blob: 1f8eea02445376e2d2146f6a4c7af806a8e14936 [file] [log] [blame]
declare namespace Cypress {
interface Chainable {
selectDropdownOptionByText : typeof selectDropdownOptionByText;
checkIsOptionSelected : typeof checkIsOptionSelected;
}
}
/************************************************
select option with some text with select tag id
************************************************/
function selectDropdownOptionByText(selectId : string, optionText : string) : void {
cy.getElementByDataTestsId(selectId)
.select(optionText);
}
/************************************************
check if option is selected
************************************************/
function checkIsOptionSelected(selectId : string, optionText : string) : void {
cy.getElementByDataTestsId(selectId)
.should('have.value', optionText)
}
Cypress.Commands.add('selectDropdownOptionByText', selectDropdownOptionByText);
Cypress.Commands.add('checkIsOptionSelected', checkIsOptionSelected);