pm.test("Driver:Password Rest: Reset driver password with proper data", function () {
var jsonData = pm.response.json();
pm.expect(jsonData.message).eq("Password rest successfully done!");
});
//Now we need to try if the changed password work
pm.test("Driver:Password Rest: re-login and check if the password reset been successful", function () {
var jsonData = pm.response.json();
pm.sendRequest({
method: 'POST',
url: pm.environment.get('url') + '/driver/login?',
header: {
'Authorization': 'Basic ' + btoa(pm.variables.get('driver_email') + ":" + pm.variables.get('newPassword')),
}
},function(err,res){
pm.expect(parseInt(res.code)).eq(400);
});
});
I have the above code, but on the last test case, the response says 200. This fails with βAssertionError: expected 200 to equal 400β. cause to fail everything even if the report is not get generated. But if the expected values match, then it shows a pass test case in the report too. how can I fix this