Skip to content

Commit 9f5f178

Browse files
authored
cypress capture xhr put by uuid (#584)
1 parent feb7d5b commit 9f5f178

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cypress/integration/1_new_engagement_spec.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ describe('new engagement', () => {
77
const id = uuid();
88
const testEngagementName = `cypressio_${id}`;
99
const customerName = 'Ldstr E2E';
10-
const reqUrl = `engagements/customers/` + encodeURIComponent(customerName) + `/projects/${testEngagementName}`;
10+
const reqUrl = 'engagements/**';
1111

1212
beforeEach('Login', () => {
1313
cy.login();
1414
cy.fixture('users.json').as('users');
15+
1516
cy.intercept('PUT', reqUrl ).as('saveEngagement');
1617
});
1718

@@ -37,7 +38,10 @@ describe('new engagement', () => {
3738
cy.get('[data-cy=new_engagement_region]').select('DEV').should('have.value', 'dev');
3839
cy.get('[data-cy=createNewEngagement]').click();
3940

40-
cy.wait('@createEngagement').its('response.statusCode').should('eq', 201);
41+
cy.wait('@createEngagement').should((xhr) => {
42+
expect(xhr.response.statusCode, 'expecting successful POST').to.equal(201)
43+
expect(xhr.response.body.engagement_uuid, 'expecting engagement uuid to be set').to.not.be.null
44+
})
4145

4246
cy.get('li > .pf-c-alert').contains(
4347
'Your engagement has been successfully created'

0 commit comments

Comments
 (0)