Skip to content

Commit a7a3f4f

Browse files
authored
ci(postman): Modify confirm call to use client-secret instead of relying on API calls (#2127)
1 parent bed8326 commit a7a3f4f

File tree

4,803 files changed

+73786
-50659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,803 files changed

+73786
-50659
lines changed
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"eventOrder": [
3-
"event.prerequest.js",
4-
"event.test.js"
5-
]
2+
"eventOrder": ["event.prerequest.js", "event.test.js"]
63
}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"childrenOrder": [
3-
"Health check",
4-
"Flow Testcases"
5-
]
2+
"childrenOrder": ["Health check", "Flow Testcases"]
63
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"childrenOrder": [
3-
"QuickStart",
4-
"Happy Cases",
5-
"Variation Cases"
6-
]
2+
"childrenOrder": ["QuickStart", "Happy Cases", "Variation Cases"]
73
}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"childrenOrder": [
3-
"Payments - Create",
4-
"Payments - Retrieve"
5-
]
2+
"childrenOrder": ["Payments - Create", "Payments - Retrieve"]
63
}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"eventOrder": [
3-
"event.test.js"
4-
]
2+
"eventOrder": ["event.test.js"]
53
}
Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,71 @@
1-
// Validate status 2xx
1+
// Validate status 2xx
22
pm.test("[POST]::/payments - Status code is 2xx", function () {
3-
pm.response.to.be.success;
3+
pm.response.to.be.success;
44
});
55

66
// Validate if response header has matching content-type
77
pm.test("[POST]::/payments - Content-Type is application/json", function () {
8-
pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
8+
pm.expect(pm.response.headers.get("Content-Type")).to.include(
9+
"application/json",
10+
);
911
});
1012

11-
// Validate if response has JSON Body
13+
// Validate if response has JSON Body
1214
pm.test("[POST]::/payments - Response has JSON Body", function () {
13-
pm.response.to.have.jsonBody();
15+
pm.response.to.have.jsonBody();
1416
});
1517

1618
// Set response object as internal variable
1719
let jsonData = {};
18-
try {jsonData = pm.response.json();}catch(e){}
20+
try {
21+
jsonData = pm.response.json();
22+
} catch (e) {}
1923

2024
// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id
2125
if (jsonData?.payment_id) {
22-
pm.collectionVariables.set("payment_id", jsonData.payment_id);
23-
console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id);
26+
pm.collectionVariables.set("payment_id", jsonData.payment_id);
27+
console.log(
28+
"- use {{payment_id}} as collection variable for value",
29+
jsonData.payment_id,
30+
);
2431
} else {
25-
console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');
26-
};
27-
32+
console.log(
33+
"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.",
34+
);
35+
}
2836

2937
// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id
3038
if (jsonData?.mandate_id) {
31-
pm.collectionVariables.set("mandate_id", jsonData.mandate_id);
32-
console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id);
39+
pm.collectionVariables.set("mandate_id", jsonData.mandate_id);
40+
console.log(
41+
"- use {{mandate_id}} as collection variable for value",
42+
jsonData.mandate_id,
43+
);
3344
} else {
34-
console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.');
35-
};
45+
console.log(
46+
"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.",
47+
);
48+
}
3649

3750
// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret
3851
if (jsonData?.client_secret) {
39-
pm.collectionVariables.set("client_secret", jsonData.client_secret);
40-
console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret);
52+
pm.collectionVariables.set("client_secret", jsonData.client_secret);
53+
console.log(
54+
"- use {{client_secret}} as collection variable for value",
55+
jsonData.client_secret,
56+
);
4157
} else {
42-
console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');
43-
};
58+
console.log(
59+
"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.",
60+
);
61+
}
4462

4563
// Response body should have value "succeeded" for "status"
4664
if (jsonData?.status) {
47-
pm.test("[POST]::/payments - Content check if value for 'status' matches 'succeeded'", function() {
48-
pm.expect(jsonData.status).to.eql("succeeded");
49-
})};
65+
pm.test(
66+
"[POST]::/payments - Content check if value for 'status' matches 'succeeded'",
67+
function () {
68+
pm.expect(jsonData.status).to.eql("succeeded");
69+
},
70+
);
71+
}

postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,8 @@
7777
},
7878
"url": {
7979
"raw": "{{baseUrl}}/payments",
80-
"host": [
81-
"{{baseUrl}}"
82-
],
83-
"path": [
84-
"payments"
85-
]
80+
"host": ["{{baseUrl}}"],
81+
"path": ["payments"]
8682
},
8783
"description": "To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture"
8884
}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"eventOrder": [
3-
"event.test.js"
4-
]
2+
"eventOrder": ["event.test.js"]
53
}
Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,71 @@
1-
// Validate status 2xx
1+
// Validate status 2xx
22
pm.test("[GET]::/payments/:id - Status code is 2xx", function () {
3-
pm.response.to.be.success;
3+
pm.response.to.be.success;
44
});
55

66
// Validate if response header has matching content-type
77
pm.test("[GET]::/payments/:id - Content-Type is application/json", function () {
8-
pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
8+
pm.expect(pm.response.headers.get("Content-Type")).to.include(
9+
"application/json",
10+
);
911
});
1012

11-
// Validate if response has JSON Body
13+
// Validate if response has JSON Body
1214
pm.test("[GET]::/payments/:id - Response has JSON Body", function () {
13-
pm.response.to.have.jsonBody();
15+
pm.response.to.have.jsonBody();
1416
});
1517

1618
// Set response object as internal variable
1719
let jsonData = {};
18-
try {jsonData = pm.response.json();}catch(e){}
20+
try {
21+
jsonData = pm.response.json();
22+
} catch (e) {}
1923

2024
// pm.collectionVariables - Set payment_id as variable for jsonData.payment_id
2125
if (jsonData?.payment_id) {
22-
pm.collectionVariables.set("payment_id", jsonData.payment_id);
23-
console.log("- use {{payment_id}} as collection variable for value",jsonData.payment_id);
26+
pm.collectionVariables.set("payment_id", jsonData.payment_id);
27+
console.log(
28+
"- use {{payment_id}} as collection variable for value",
29+
jsonData.payment_id,
30+
);
2431
} else {
25-
console.log('INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.');
26-
};
27-
32+
console.log(
33+
"INFO - Unable to assign variable {{payment_id}}, as jsonData.payment_id is undefined.",
34+
);
35+
}
2836

2937
// pm.collectionVariables - Set mandate_id as variable for jsonData.mandate_id
3038
if (jsonData?.mandate_id) {
31-
pm.collectionVariables.set("mandate_id", jsonData.mandate_id);
32-
console.log("- use {{mandate_id}} as collection variable for value",jsonData.mandate_id);
39+
pm.collectionVariables.set("mandate_id", jsonData.mandate_id);
40+
console.log(
41+
"- use {{mandate_id}} as collection variable for value",
42+
jsonData.mandate_id,
43+
);
3344
} else {
34-
console.log('INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.');
35-
};
45+
console.log(
46+
"INFO - Unable to assign variable {{mandate_id}}, as jsonData.mandate_id is undefined.",
47+
);
48+
}
3649

3750
// pm.collectionVariables - Set client_secret as variable for jsonData.client_secret
3851
if (jsonData?.client_secret) {
39-
pm.collectionVariables.set("client_secret", jsonData.client_secret);
40-
console.log("- use {{client_secret}} as collection variable for value",jsonData.client_secret);
52+
pm.collectionVariables.set("client_secret", jsonData.client_secret);
53+
console.log(
54+
"- use {{client_secret}} as collection variable for value",
55+
jsonData.client_secret,
56+
);
4157
} else {
42-
console.log('INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.');
43-
44-
};
45-
58+
console.log(
59+
"INFO - Unable to assign variable {{client_secret}}, as jsonData.client_secret is undefined.",
60+
);
61+
}
4662

4763
// Response body should have value "Succeeded" for "status"
4864
if (jsonData?.status) {
49-
pm.test("[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'", function() {
50-
pm.expect(jsonData.status).to.eql("succeeded");
51-
})};
65+
pm.test(
66+
"[POST]::/payments/:id - Content check if value for 'status' matches 'succeeded'",
67+
function () {
68+
pm.expect(jsonData.status).to.eql("succeeded");
69+
},
70+
);
71+
}

postman/collection-dir/aci/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Retrieve/request.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@
88
],
99
"url": {
1010
"raw": "{{baseUrl}}/payments/:id?force_sync=true",
11-
"host": [
12-
"{{baseUrl}}"
13-
],
14-
"path": [
15-
"payments",
16-
":id"
17-
],
11+
"host": ["{{baseUrl}}"],
12+
"path": ["payments", ":id"],
1813
"query": [
1914
{
2015
"key": "force_sync",

0 commit comments

Comments
 (0)