Created
February 6, 2019 11:02
-
-
Save vitoo/42c39ea430bf580d53341000dc0d14a6 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
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