merge from ecomp a88f0072 - Modern UI
[vid.git] / vid-webpack-master / cypress / support / elements / element.select.actions.ts
1 declare namespace Cypress {
2   interface Chainable {
3     selectDropdownOptionByText : typeof selectDropdownOptionByText;
4     checkIsOptionSelected : typeof checkIsOptionSelected;
5   }
6 }
7
8 /************************************************
9  select option with some text with select tag id
10  ************************************************/
11 function selectDropdownOptionByText(selectId : string, optionText : string) : void {
12   cy.getElementByDataTestsId(selectId)
13     .select(optionText);
14 }
15
16 /************************************************
17  check if  option is selected
18  ************************************************/
19 function checkIsOptionSelected(selectId : string, optionText : string) : void {
20   cy.getElementByDataTestsId(selectId)
21     .should('have.value', optionText)
22 }
23
24 Cypress.Commands.add('selectDropdownOptionByText', selectDropdownOptionByText);
25 Cypress.Commands.add('checkIsOptionSelected', checkIsOptionSelected);
26