summaryrefslogtreecommitdiff
path: root/cypress/support
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2023-03-01 07:32:53 +0100
committerGitHub <noreply@github.com>2023-03-01 15:32:53 +0900
commit44058f8b855ddffb1451241f0c28fb0cf3d9845c (patch)
treee7a4a919216a11392118eb83e9db204ef70b2da3 /cypress/support
parentfix(frontend): read KeyboardEvent.key instead of which/code (#10083) (diff)
downloadmisskey-44058f8b855ddffb1451241f0c28fb0cf3d9845c.tar.gz
misskey-44058f8b855ddffb1451241f0c28fb0cf3d9845c.tar.bz2
misskey-44058f8b855ddffb1451241f0c28fb0cf3d9845c.zip
enhance(e2e): more resilient version of `visit('/')` (#10128)
Diffstat (limited to 'cypress/support')
-rw-r--r--cypress/support/commands.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/cypress/support/commands.js b/cypress/support/commands.js
index 04a6d98b01..91a4d7abe6 100644
--- a/cypress/support/commands.js
+++ b/cypress/support/commands.js
@@ -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');