diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-12-26 10:30:01 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-12-26 10:30:01 +0000 |
commit | 3795519f98415037e9d567af85f8eafd2948971d (patch) | |
tree | 8e46c09d2de99b01c68918e3541fc9cd4fdb6e46 /vid-webpack-master/cypress/support | |
parent | f3174649f08795cdb04bf8e8e2735408dd91578a (diff) | |
parent | 035cbb909b5b39bf735fb215dd6fa79d1342c39b (diff) |
Merge "Use popup-sized viewport on Cypress tests where relevant"
Diffstat (limited to 'vid-webpack-master/cypress/support')
-rw-r--r-- | vid-webpack-master/cypress/support/index.js | 2 | ||||
-rw-r--r-- | vid-webpack-master/cypress/support/steps/genericForm/popupViewport.step.ts | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/vid-webpack-master/cypress/support/index.js b/vid-webpack-master/cypress/support/index.js index ae125c469..5062f5100 100644 --- a/vid-webpack-master/cypress/support/index.js +++ b/vid-webpack-master/cypress/support/index.js @@ -31,11 +31,11 @@ import './jsonBuilders/mocks/aai.mock'; import './jsonBuilders/mocks/vid.mock'; import './jsonBuilders/mocks/permission.mock'; - import './steps/general/compareDeepObjects.step'; import './steps/drawingBoard/drawingBoardModel.steps'; import './steps/drawingBoard/drawingBoardTree.steps'; import './steps/genericForm/genericFormAction.steps'; +import './steps/genericForm/popupViewport.step'; import './steps/drawingBoard/drawingBoardHeader.steps'; import './steps/drawingBoard/general.steps'; import './steps/general/clickOutside.step'; diff --git a/vid-webpack-master/cypress/support/steps/genericForm/popupViewport.step.ts b/vid-webpack-master/cypress/support/steps/genericForm/popupViewport.step.ts new file mode 100644 index 000000000..2fbcf406f --- /dev/null +++ b/vid-webpack-master/cypress/support/steps/genericForm/popupViewport.step.ts @@ -0,0 +1,24 @@ +declare namespace Cypress { + interface Chainable { + setViewportToDefault: typeof setViewportToDefault, + setViewportToSmallPopup: typeof setViewportToSmallPopup, + openPopupIframe: typeof openPopupIframe, + } +} + +function setViewportToDefault() { + cy.viewport(Cypress.config('viewportWidth'), Cypress.config('viewportHeight')); +} + +function setViewportToSmallPopup() { + cy.viewport(1103, 691); // the iframe.popup property on common.css +} + +function openPopupIframe(iframeUrl : string): Chainable<Window> { + cy.setViewportToSmallPopup(); + return cy.visit(iframeUrl); +} + +Cypress.Commands.add('setViewportToDefault', setViewportToDefault); +Cypress.Commands.add('setViewportToSmallPopup', setViewportToSmallPopup); +Cypress.Commands.add('openPopupIframe', openPopupIframe); |