fix: enhance waitForElement command to ensure element exists and is visible
gitea/salix-front/pipeline/pr-master This commit is unstable
Details
gitea/salix-front/pipeline/pr-master This commit is unstable
Details
This commit is contained in:
parent
34892316d7
commit
a55c03f945
|
@ -72,7 +72,11 @@ Cypress.Commands.overwrite('visit', (originalFn, url, options, waitRequest = tru
|
|||
});
|
||||
|
||||
Cypress.Commands.add('waitForElement', (element) => {
|
||||
cy.get(element).should('be.visible').and('not.be.disabled');
|
||||
cy.get(element)
|
||||
.should('exist')
|
||||
.scrollIntoView()
|
||||
.should('be.visible')
|
||||
.and('not.be.disabled');
|
||||
});
|
||||
|
||||
Cypress.Commands.add('getValue', (selector) => {
|
||||
|
@ -113,7 +117,7 @@ Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
|
|||
cy.waitForElement(selector, timeout);
|
||||
|
||||
cy.get(selector, { timeout })
|
||||
.should('exist')
|
||||
|
||||
.should('be.visible')
|
||||
.click()
|
||||
.then(($el) => {
|
||||
|
|
Loading…
Reference in New Issue