1 declare namespace Cypress {
3 selectDropdownOptionByText : typeof selectDropdownOptionByText;
4 checkIsOptionSelected : typeof checkIsOptionSelected;
8 /************************************************
9 select option with some text with select tag id
10 ************************************************/
11 function selectDropdownOptionByText(selectId : string, optionText : string) : void {
12 cy.getElementByDataTestsId(selectId)
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)
24 Cypress.Commands.add('selectDropdownOptionByText', selectDropdownOptionByText);
25 Cypress.Commands.add('checkIsOptionSelected', checkIsOptionSelected);