aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/steps/genericForm/checkPopover.step.ts
blob: 085410ecee5b785be3ed72d394c67f8f399c57b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
declare namespace Cypress {
  interface Chainable {
    checkPopoverContentOnMouseEvent: typeof checkPopoverContentOnMouseEvent
  }
}

function checkPopoverContentOnMouseEvent(dataTestId: string, klass: string, mouseEvent: string, index: number) : Chainable<any> {
  index = index || 0;
  let element = cy.getElementByDataTestsId(dataTestId).eq(index);
  element.trigger(mouseEvent).click().get(klass);
  return element;
}

Cypress.Commands.add('checkPopoverContentOnMouseEvent', checkPopoverContentOnMouseEvent);