aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/steps/general/clickOutside.step.ts
blob: e3323a1251f36bc53980cec80e14c24ba2639c4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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);