Last active
January 30, 2023 00:35
-
-
Save ArCiGo/6817db70c4455175fee6f42d124b0073 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 withdraw money successfully from an existing account', () => { | |
cy.fixture('requests/withdrawalsPostRequest').then((bodyRequest) => { | |
cy.request('POST', '/withdrawals', { bodyRequest }).then((response) => { | |
expect(response.isOkStatusCode).to.be.true; | |
expect(response.status).to.be.eq(200); | |
cy.fixture('responses/withdrawalsPostResponse').should('deep.equal', response.body); | |
}); | |
}); | |
}); | |
it('should get a balance of an existing account', function() { | |
cy.request('GET', '/balance/' + this.account).then((response) => { | |
expect(response.isOkStatusCode).to.be.true; | |
expect(response.status).to.be.eq(200); | |
cy.fixture('responses/balanceGetResponse').should('deep.equal', response.body); | |
}); | |
}); | |
it('should transfer money successfully to an existing account', () => { | |
cy.fixture('requests/transfersPostRequest').then((bodyRequest) => { | |
cy.request('POST', '/transfers', { bodyRequest }).then((response) => { | |
expect(response.isOkStatusCode).to.be.true; | |
expect(response.status).to.be.eq(200); | |
cy.fixture('responses/transfersPostResponse').should('deep.equal', response.body) | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment