Skip to content

Commit

Permalink
Fix feedback tests concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
RioKnightleyNHS committed Feb 22, 2024
1 parent 524e02c commit 0c8fdae
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/cypress/e2e/0-ndr-core-tests/feedback_page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ describe('Feedback Page', () => {
'should display a confirmation screen after user has filled in and submitted the feedback form',
{ tags: 'regression' },
() => {
cy.intercept('POST', '/Feedback*', {
statusCode: 200,
}).as('feedback');
const mockInputData = {
feedbackContent: 'Some awesome feedback',
howSatisfied: 'Very satisfied',
Expand All @@ -80,10 +83,7 @@ describe('Feedback Page', () => {
fillInForm(mockInputData);

cy.get('#submit-feedback').click();
cy.intercept('POST', '/Feedback*', {
statusCode: 200,
}).as('feedback');

cy.wait('@feedback');
cy.get('.app-homepage-content h1', { timeout: 5000 }).should(
'have.text',
'We’ve received your feedback',
Expand All @@ -95,6 +95,9 @@ describe('Feedback Page', () => {
'should allow user submit the form without filling in the name and email',
{ tags: 'regression' },
() => {
cy.intercept('POST', '/Feedback*', {
statusCode: 200,
}).as('feedback');
const mockInputData = {
feedbackContent: 'Some awesome feedback',
howSatisfied: 'Satisfied',
Expand All @@ -104,9 +107,7 @@ describe('Feedback Page', () => {
fillInForm(mockInputData);

cy.get('#submit-feedback').click();
cy.intercept('POST', '/Feedback*', {
statusCode: 200,
}).as('feedback');
cy.wait('@feedback');
cy.get('.app-homepage-content h1', { timeout: 5000 }).should(
'have.text',
'We’ve received your feedback',
Expand Down

0 comments on commit 0c8fdae

Please sign in to comment.