Complete the code to start a new Postman collection run.
pm.collection.run({ [1]: '{{collectionId}}' });The collectionId is required to specify which collection to run in Postman.
Complete the code to add a test script that checks response status is 200.
pm.test('Status code is 200', function () { pm.response.to.have.status([1]); });
The test checks if the response status code is 200, which means success.
Fix the error in the test script to correctly check if response body contains 'success'.
pm.test('Body contains success', function () { pm.expect(pm.response.text()).to.[1]('success'); });
The correct Chai assertion method is include to check substring presence.
Fill both blanks to create a visual workflow that runs tests only if response status is 200.
if (pm.response.status === [1]) { pm.test('Run tests', function () { pm.expect(pm.response.[2]).to.be.ok; }); }
The workflow checks if status is 200 and then tests if the JSON response is okay.
Fill all three blanks to create a test that checks if response JSON has a key 'status' with value 'success'.
pm.test('Status key is success', function () { const jsonData = pm.response.[1](); pm.expect(jsonData.[2]).to.eql([3]); });
This test parses the response as JSON, then checks if the 'status' key equals the string 'success'.