Skip to content

Instantly share code, notes, and snippets.

@ArCiGo
Last active January 29, 2023 23:51
Show Gist options
  • Save ArCiGo/95e4ab16846d0bf4c1f2f646da85df35 to your computer and use it in GitHub Desktop.
Save ArCiGo/95e4ab16846d0bf4c1f2f646da85df35 to your computer and use it in GitHub Desktop.
describe('Banking mock server API tests', () => {
it('should deposit money successfully to an existing account', () => {
cy.fixture('requests/depositsPostRequest').then((bodyRequest) => {
cy.request('POST', '/deposits', { bodyRequest }).then((response) => {
expect(response.isOkStatusCode).to.be.true;
expect(response.status).to.be.eq(200);
cy.fixture('responses/depositsPostResponse').should('deep.equal', response.body);
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment