Hi All,
As we know, Automation is key for any agile project whereas Continuous testing play major role.
I cam across situation whereas I feel need to follow continuous testing process, Any help will be helpful.
Scenario: So lets suppose I need to verify next 2 lines within one test case and If there is case when 1st steps got failed then 2nd steps should also share the result.
Script:
pm.test("Buffer", function (){
var frontlineClientsCount=pm.environment.get("frontlineClientsCount");
var newGen0ClientsCount=pm.environment.get("newGen0ClientsCount");
pm.expect(pm.response.json().clients.frontlineClientsCount).to.eql(frontlineClientsCount); //1st step
pm.expect(pm.response.json().clients.newGen0ClientsCount).to.eql(newGen0ClientsCount); //2nd step
});
Now lets assume 1st step got failed, then Test result will show about failure reason but it will not show result about second steps
In that case I can assure about 1st step but not about 2nd step. Is there any chance How I can see all result means 2nd step should run and will not depend on 1st step.
P.S. Yes we can do through separate/new test and there I can give separate steps but lets assume I have more then 15 steps so not feasible to create 15 different test cases.
The function I wrote makes this easier because it’s just one line for each test case. It could get even easier if you prefixed all your variables for this scenario with something.
Imagine you had 15 environment variables you wanted to test and they were all prefixed with buffer-. i.e. buffer-frontlineClientsCount.
You could write a script that will automatically test the response for every one of those variables. When you need to test more fields, just add them as environment variables and they will automatically be tested.