Replies: 1 comment
-
I think It would be nice if there was support for these postman scripts in Hoppscotch... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
I am new to hoppscotch moving from postman. I had some post request scripts in postman, seems like with the api differences pm object vs pw object scripts would not work in hoppscotch. I am checking in the documentation and not finding many examples on how to write post-scripts. Can I get some example references for the same? Specifically need to check the offer id and offer name in my response
{
"offers": [
{
"id": "plus-offer-V0002",
"name": "plusoffer",
"offerBy": "game+",
"type": "advertisement",
"redirectURLLink": "",
"category": "shopping",
"webComponents": [
{
"id": "plus-offer-V0002",
"heroImage": "",
"tileImage": "",
"description": "",
"learnMoreLink": "",
"learnMoreTest": "",
"title": "",
"heroImageAltText": "",
"titleImageAltText": "",
"category": "shopping",
"position": "1"
}
.......
}
}
and i am trying with this script and its failing
pw.test("Check offer name", () => {
const jsonData = pw.response.body.data;
pw.expect(jsonData.offers[0].id).toBe("plus-offer-V0002");
});
Please help?
Beta Was this translation helpful? Give feedback.
All reactions