Skip to content

Instantly share code, notes, and snippets.

@vitoo
Created February 6, 2019 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitoo/42c39ea430bf580d53341000dc0d14a6 to your computer and use it in GitHub Desktop.
Save vitoo/42c39ea430bf580d53341000dc0d14a6 to your computer and use it in GitHub Desktop.
Feature('Api feature');
require('chai').should();
Scenario('test a GET request', async (I) => {
response = await I.sendGetRequest('/api');
//output : console.log(response.data);
response.status.should.eql(200);
//check json object
response.data.should.be.an('object');
//check property present
response.data.should.have.property('operationId');
//check property value
response.data.operationId.should.eql('1123231');
//check partial json
response.data.should.deep.include({
"operationId": "1123231",
"calculationId": "2"
});
//check full json
response.data.should.eql({
"operationId": "1123231",
"calculationId": "2",
"applicationDate": "2017-05-23",
"typeCode": "SU"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment