enhance(e2e): more resilient version of visit('/')
(#10128)
This commit is contained in:
parent
6d82371449
commit
44058f8b85
2 changed files with 13 additions and 8 deletions
|
@ -24,6 +24,11 @@
|
|||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
|
||||
Cypress.Commands.add('visitHome', () => {
|
||||
cy.visit('/');
|
||||
cy.get('button', { timeout: 30000 }).should('be.visible');
|
||||
})
|
||||
|
||||
Cypress.Commands.add('resetState', () => {
|
||||
cy.window(win => {
|
||||
win.indexedDB.deleteDatabase('keyval-store');
|
||||
|
@ -43,7 +48,7 @@ Cypress.Commands.add('registerUser', (username, password, isAdmin = false) => {
|
|||
});
|
||||
|
||||
Cypress.Commands.add('login', (username, password) => {
|
||||
cy.visit('/');
|
||||
cy.visitHome();
|
||||
|
||||
cy.intercept('POST', '/api/signin').as('signin');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue