Skip to content

Instantly share code, notes, and snippets.

View ArCiGo's full-sized avatar
🎯
Learning

Armando Cifuentes ArCiGo

🎯
Learning
View GitHub Profile
config:
# the URL that is going to be tested
target: "<yourMockServerURL>"
plugins:
expect: {}
phases:
# the time that the phase will last, in seconds
- duration: 1
# number of petitions per second during the defined duration
arrivalRate: 1
{
"info": { "_postman_id": "1b1158ee-92b0-47b2-a55c-98fed5fcac10",
"name": "ExBanking",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "10028222"
{
"status": "Successful",
"account": "6391083442041505",
"ammount": 45.00,
"destination": "5434804060114097",
"concept": "Doing an amazing transfer!",
"newBalance": 484.55,
"dateTime": "6/18/2022T17:35"
}
{
"account": "6391083442041505",
"ammount": 45.00,
"destination": "5434804060114097",
"concept": "Doing an amazing transfer!"
}
{
"account": "6391083442041505",
"balance": 529.55
}
{
"status": "Successful",
"account": "6391083442041505",
"withdraw": 30.45,
"newBalance": 529.55,
"dateTime": "6/18/2022T17:35"
}
{
"account": "6391083442041505",
"ammount": 30.45
}
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);
});
});
{
"status": "Successful",
"account": "6391083442041505",
"ammount": 560.00,
"dateTime": "6/18/2022T17:35"
}
{
"account": "6391083442041505",
"ammount": 560.00
}