Last active
January 29, 2023 23:51
-
-
Save ArCiGo/51bae3e3d8d946e3ba35d1af199a8307 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Banking mock server API tests', () => { | |
it('should post a user successfully', () => { | |
cy.fixture('requests/usersPostRequest').then((bodyRequest) => { | |
cy.request('POST', '/users', { bodyRequest }).then((response) => { | |
expect(response.isOkStatusCode).to.be.true; | |
expect(response.status).to.be.eq(200); | |
cy.fixture('responses/usersPostResponse').should('deep.equal', response.body); | |
/** | |
* In my sample, once the user is created, the system | |
* automatically assigns him/her an account. | |
*/ | |
cy.wrap(response.body.account).as('account'); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment