diff --git a/cypress/integration/Moderation.ReportContent/I_click_on_the_avatar_menu_in_the_top_right_corner.js b/cypress/integration/Moderation.ReportContent/I_click_on_the_avatar_menu_in_the_top_right_corner.js index 27830b239..f6df925f5 100644 --- a/cypress/integration/Moderation.ReportContent/I_click_on_the_avatar_menu_in_the_top_right_corner.js +++ b/cypress/integration/Moderation.ReportContent/I_click_on_the_avatar_menu_in_the_top_right_corner.js @@ -1,5 +1,7 @@ import { When } from "cypress-cucumber-preprocessor/steps"; +import 'cypress-network-idle'; When("I click on the avatar menu in the top right corner", () => { cy.get(".avatar-menu").click(); + cy.waitForNetworkIdle(2000); }); \ No newline at end of file diff --git a/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js b/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js index 87c28022e..577f3edce 100644 --- a/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js +++ b/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js @@ -7,7 +7,6 @@ Given('somebody reported the following posts:', table => { method: 'POST', url: '/', hostname: 'localhost', - port: 4000, }).as('postToLocalhost') table.hashes().forEach(({ submitterEmail, resourceId, reasonCategory, reasonDescription }) => { @@ -30,9 +29,6 @@ Given('somebody reported the following posts:', table => { cy.wait(['@postToLocalhost']).then((interception) => { cy.wrap(interception.response.statusCode).should('eq', 200) }) - cy.wait(['@postToLocalhost']).then((interception) => { - cy.wrap(interception.response.statusCode).should('eq', 200) - }) cy.wait(['@postToLocalhost']).then((interception) => { console.log('Cypress interception:', interception) cy.wrap(interception.response.statusCode).should('eq', 200) @@ -40,7 +36,6 @@ Given('somebody reported the following posts:', table => { .should('have.nested.property', 'data.fileReport.reportId') .and('match', reportIdRegex) }) - console.log('Cypress waited for fileReport request') cy.waitForNetworkIdle(2000) }) }) \ No newline at end of file diff --git a/cypress/integration/common/I_click_on_{string}.js b/cypress/integration/common/I_click_on_{string}.js index 5f43eb912..fa79ef384 100644 --- a/cypress/integration/common/I_click_on_{string}.js +++ b/cypress/integration/common/I_click_on_{string}.js @@ -1,4 +1,5 @@ import { When } from "cypress-cucumber-preprocessor/steps"; +import 'cypress-network-idle'; When("I click on {string}", element => { const elementSelectors = { @@ -16,4 +17,5 @@ When("I click on {string}", element => { cy.get(elementSelectors[element]) .click() .wait(750); + cy.waitForNetworkIdle(2000); }); \ No newline at end of file diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 5327a018e..7e706c970 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -50,8 +50,6 @@ Cypress.Commands.add( { prevSubject: true }, (graphQLClient, mutation, variables, response) => { return new Cypress.Promise(async (resolve, reject) => { - const response = await graphQLClient.request(mutation, variables) - console.log('Cypress command mutate:', response) graphQLClient.request(mutation, variables).then(() => resolve(graphQLClient)) })