diff options
Diffstat (limited to 'vid-webpack-master/cypress/support/steps/general/clickOutside.step.ts')
-rw-r--r-- | vid-webpack-master/cypress/support/steps/general/clickOutside.step.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vid-webpack-master/cypress/support/steps/general/clickOutside.step.ts b/vid-webpack-master/cypress/support/steps/general/clickOutside.step.ts new file mode 100644 index 000000000..e3323a125 --- /dev/null +++ b/vid-webpack-master/cypress/support/steps/general/clickOutside.step.ts @@ -0,0 +1,14 @@ +declare namespace Cypress { + interface Chainable { + clickOutside: typeof clickOutside, + } +} + +function clickOutside(testByIdClickElement : string, testBeforeClickOutside : Function, testAfterClickOutside : Function) { + testBeforeClickOutside(); + cy.getElementByDataTestsId(testByIdClickElement).click({force: true}).then(()=>{ + testAfterClickOutside(); + }); +} + +Cypress.Commands.add('clickOutside', clickOutside); |