diff --git a/cypress/cypress.config.js b/cypress/cypress.config.js index 9885eb7a2..2d2cefc47 100644 --- a/cypress/cypress.config.js +++ b/cypress/cypress.config.js @@ -37,8 +37,7 @@ const { parsed } = dotenv.config({ path: '../backend/.env' }) module.exports = defineConfig({ e2e: { projectId: "qa7fe2", - defaultCommandTimeout: 60000, - pageLoadTimeout: 180000, + defaultCommandTimeout: 10000, chromeWebSecurity: false, baseUrl: "http://localhost:3000", specPattern: "cypress/e2e/**/*.feature", diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 2c3826f78..88836b4f1 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -49,8 +49,9 @@ Cypress.Commands.add( 'mutate', { prevSubject: true }, (graphQLClient, mutation, variables, response) => { - return new Cypress.Promise((resolve, reject) => { + return new Cypress.Promise(async (resolve, reject) => { graphQLClient.request(mutation, variables).then(() => resolve(graphQLClient)) + }) }) diff --git a/cypress/support/step_definitions/Notification.Mention/mention_{string}_in_the_text.js b/cypress/support/step_definitions/Notification.Mention/mention_{string}_in_the_text.js index d404356f9..e1bd19da0 100644 --- a/cypress/support/step_definitions/Notification.Mention/mention_{string}_in_the_text.js +++ b/cypress/support/step_definitions/Notification.Mention/mention_{string}_in_the_text.js @@ -3,6 +3,7 @@ import { When } from "@badeball/cypress-cucumber-preprocessor"; When("mention {string} in the text", mention => { cy.get(".ProseMirror") .type(" @"); - cy.contains(".suggestion-list__item", mention) + cy.get(".suggestion-list__item") + .contains(mention) .click(); });