diff --git a/cypress/cypress.json b/cypress/cypress.json index 498d73bdc..52e1c1038 100644 --- a/cypress/cypress.json +++ b/cypress/cypress.json @@ -1,6 +1,6 @@ { "projectId": "qa7fe2", - "defaultCommandTimeout": 180000, + "defaultCommandTimeout": 5000, "pageLoadTimeout": 180000, "ignoreTestFiles": "*.js", "chromeWebSecurity": false, 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 e7de8b96e..c119845e2 100644 --- a/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js +++ b/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js @@ -2,10 +2,12 @@ import { Given } from "cypress-cucumber-preprocessor/steps"; import 'cypress-network-idle'; Given('somebody reported the following posts:', table => { + const reportIdRegex = /^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/ cy.intercept({ method: 'POST', url: '/', hostname: 'localhost', + port: 4000, }).as('postToLocalhoast') table.hashes().forEach(({ submitterEmail, resourceId, reasonCategory, reasonDescription }) => { @@ -36,6 +38,7 @@ Given('somebody reported the following posts:', table => { cy.wrap(interception.response.statusCode).should('eq', 200) cy.wrap(interception.response.body) .should('have.nested.property', 'data.fileReport.reportId') + .and('match', reportIdRegex) }) console.log('Cypress waited for fileReport request') cy.waitForNetworkIdle(2000)