refactor: refs #8484 improve search input behavior and enhance visit command with DOM content load
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
f6439ed356
commit
98363c2197
|
@ -9,7 +9,7 @@ describe('InvoiceInList', () => {
|
|||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/invoice-in/list`);
|
||||
cy.get('#searchbar input').should('be.visible').type('{enter}');
|
||||
cy.get('#searchbar input').type('{enter}');
|
||||
});
|
||||
|
||||
it('should redirect on clicking a invoice', () => {
|
||||
|
|
|
@ -54,9 +54,18 @@ Cypress.Commands.add('login', (user) => {
|
|||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('domContentLoad', (element, timeout = 5000) => {
|
||||
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
|
||||
Cypress.Commands.add('domContentLoad', (timeout = 5000) => {
|
||||
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'), {
|
||||
timeout,
|
||||
interval: 5000,
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.overwrite('visit', (originalFn, url, options) => {
|
||||
originalFn(url, options);
|
||||
cy.domContentLoad();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('waitForElement', (element, timeout = 5000) => {
|
||||
cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue