Steps to it:
Create a room in Google chat (Addin the member's list).
Room is setup:
Select “Manage webhooks” as displayed below:
Type any name as per your need and click save:
Copy the link to the Clipboard. Open your collection/folders, just add this as a new POST request to the existing ones.
Click on “Send”:
In this BOT you can add some Test Scripts based on the previous requests execution status to showcase the Test Report.
Sample is below:
var resp = JSON.parse(responseBody);
console.log(resp);
//Checking the Response Status Code
pm.test("Response is Successful with Status Code 200", function ()
{
pm.response.to.have.status(200);
console.log("Response is Successful with Status Code 200");
});
// this counter is from previous step (in your script need to define it)
to check the completion of run
const counter_check = pm.environment.get("counter");
if(counter_check == 10)
{
pm.test("Execution Passed" , function ()
{
console.log("Execution Passed");
});
}
else
{
pm.test("Execution Failed" , function ()
{
pm.expect.fail('Execution failed, please check test results of previous steps');
});
}
Happy Learning 😇
No comments:
Post a Comment