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 6d433c324..e7de8b96e 100644 --- a/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js +++ b/cypress/integration/Moderation.ReportContent/somebody_reported_the_following_posts.js @@ -2,6 +2,12 @@ import { Given } from "cypress-cucumber-preprocessor/steps"; import 'cypress-network-idle'; Given('somebody reported the following posts:', table => { + cy.intercept({ + method: 'POST', + url: '/', + hostname: 'localhost', + }).as('postToLocalhoast') + table.hashes().forEach(({ submitterEmail, resourceId, reasonCategory, reasonDescription }) => { const submitter = { email: submitterEmail, @@ -19,6 +25,19 @@ Given('somebody reported the following posts:', table => { reasonCategory, reasonDescription }) + cy.wait(['@postToLocalhoast']).then((interception) => { + cy.wrap(interception.response.statusCode).should('eq', 200) + }) + cy.wait(['@postToLocalhoast']).then((interception) => { + cy.wrap(interception.response.statusCode).should('eq', 200) + }) + cy.wait(['@postToLocalhoast']).then((interception) => { + console.log('Cypress interception:', interception) + cy.wrap(interception.response.statusCode).should('eq', 200) + cy.wrap(interception.response.body) + .should('have.nested.property', 'data.fileReport.reportId') + }) + console.log('Cypress waited for fileReport request') cy.waitForNetworkIdle(2000) }) }) \ No newline at end of file