From 8fa7cca158e5da1e1ab353c34b189a410e30f3a7 Mon Sep 17 00:00:00 2001 From: Miguel de Barros Date: Thu, 10 Mar 2022 19:00:08 +0200 Subject: [PATCH] chore(mojaloop/#2650): run 3ppi ttk tests with 3ppi services enabled (#67) chore(mojaloop/#2650): Run 3PPI TTK tests with 3PPI services enabled - https://github.com/mojaloop/project/issues/2650 - added provisioning_thirdparty/dfspb_parties.json to load party information into DFSPB's backend simulator - updated minor test asserts --- .../dfspb_parties.json | 55 +++++++++++++++++++ .../hub/provisioning_thirdparty/master.json | 4 ++ collections/hub/thirdparty/collection.json | 44 +++++++++++++-- 3 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 collections/hub/provisioning_thirdparty/dfspb_parties.json diff --git a/collections/hub/provisioning_thirdparty/dfspb_parties.json b/collections/hub/provisioning_thirdparty/dfspb_parties.json new file mode 100644 index 00000000..9f56d6d3 --- /dev/null +++ b/collections/hub/provisioning_thirdparty/dfspb_parties.json @@ -0,0 +1,55 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "dfspb parties upload into sim backend", + "meta": { + "info": "pisp account" + }, + "fileInfo": { + "path": "hub/provisioning_thirdparty/dfspb_parties.json" + }, + "requests": [ + { + "id": 8, + "description": "Load 329294234 into DFSPB Backend Simulator", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 0, + "type": "mojaloop_simulator" + }, + "operationPath": "/repository/parties", + "path": "/repository/parties", + "method": "post", + "body": { + "displayName": "Bob Babirusa", + "firstName": "Bob", + "middleName": "O", + "lastName": "Babirusa", + "dateOfBirth": "1970-01-01", + "idType": "MSISDN", + "idValue": "329294234" + }, + "url": "{$inputs.DFSPB_BACKEND_TESTAPI_URL}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status to be 204", + "exec": [ + "if (response.status === 500) {", + " expect(response.body.message).to.equal(\"ID is already registered\")", + "} else {", + " expect(response.status).to.equal(204)", + "}" + ] + } + ] + }, + "scriptingEngine": "javascript" + } + ] + } + ] +} \ No newline at end of file diff --git a/collections/hub/provisioning_thirdparty/master.json b/collections/hub/provisioning_thirdparty/master.json index 54547053..fecd76a5 100644 --- a/collections/hub/provisioning_thirdparty/master.json +++ b/collections/hub/provisioning_thirdparty/master.json @@ -12,6 +12,10 @@ "name": "dfspb.json", "type": "file" }, + { + "name": "dfspb_parties.json", + "type": "file" + }, { "name": "pisp.json", "type": "file" diff --git a/collections/hub/thirdparty/collection.json b/collections/hub/thirdparty/collection.json index 9fb0582d..17e8c8bc 100644 --- a/collections/hub/thirdparty/collection.json +++ b/collections/hub/thirdparty/collection.json @@ -4,6 +4,9 @@ { "id": 1, "name": "Account Linking: Prelinking", + "fileInfo": { + "path": "hub/thirdparty/collection.json" + }, "requests": [ { "id": 1, @@ -38,6 +41,9 @@ { "id": 2, "name": "Account Linking: Discovery", + "fileInfo": { + "path": "hub/thirdparty/collection.json" + }, "requests": [ { "id": 1, @@ -88,6 +94,9 @@ { "id": 3, "name": "Account Linking - Happy Path WEB", + "fileInfo": { + "path": "hub/thirdparty/collection.json" + }, "requests": [ { "id": 1, @@ -242,6 +251,9 @@ { "id": 4, "name": "Account Linking - Happy Path OTP", + "fileInfo": { + "path": "hub/thirdparty/collection.json" + }, "requests": [ { "id": 1, @@ -395,6 +407,9 @@ { "id": 5, "name": "Account Linking - Error @ consent request stage", + "fileInfo": { + "path": "hub/thirdparty/collection.json" + }, "requests": [ { "id": 1, @@ -453,6 +468,9 @@ { "id": 6, "name": "Account Linking - Error @ consent request authenticate stage", + "fileInfo": { + "path": "hub/thirdparty/collection.json" + }, "requests": [ { "id": 1, @@ -560,6 +578,9 @@ { "id": 7, "name": "Account Linking - Error @ consent request register credential stage", + "fileInfo": { + "path": "hub/thirdparty/collection.json" + }, "requests": [ { "id": 1, @@ -715,6 +736,9 @@ { "id": 8, "name": "Third Party Transaction Request - Happy Path", + "fileInfo": { + "path": "hub/thirdparty/collection.json" + }, "requests": [ { "id": 1, @@ -814,21 +838,33 @@ " consentId: \"2acf1dfa-ce45-486e-b19e-ae4ad9804a63\",", " consentRequestId: 'b5d6206c-4f06-497d-af15-ed866ea6958f',", " scopes: [", - " { actions: ['accounts.getBalance', 'accounts.transfer'], accountId: '244431e2-7a56-40c6-814c-932631760fa9' },", - " { actions: ['accounts.getBalance', 'accounts.transfer'], accountId: '6b6e6d77-dbf4-423f-abd5-bc5854e4ab1c' }", + " { accountId: '244431e2-7a56-40c6-814c-932631760fa9', actions: ['accounts.getBalance', 'accounts.transfer'] },", + " { accountId: '6b6e6d77-dbf4-423f-abd5-bc5854e4ab1c', actions: ['accounts.getBalance', 'accounts.transfer'] }", " ]", "", " },", " challenge: \"fc315dc625bb0bb00029e706de7f38eed98dc370cd386281de46a438b8080e57\",", " currentState: 'consentReceivedAwaitingCredential'", "}", + "expect(response.body).to.deep.equal(expected)", + "// expect(response.body.consent.scopes).to.deep.equal(expected.consent.scopes) && ", + "// expect(response.body.consent.currentState).to.equal(expected.consent.currentState) && ", + "// expect(response.body.consent.consentRequestId).to.equal(expected.consent.consentRequestId)", "", - "expect(response.body).to.deep.equal(expected)" + "" ] } ] }, - "url": "{$inputs.PISP_THIRDPARTY_SDK_OUTBOUND_URL}" + "url": "{$inputs.PISP_THIRDPARTY_SDK_OUTBOUND_URL}", + "scriptingEngine": "javascript", + "scripts": { + "postRequest": { + "exec": [ + "" + ] + } + } }, { "id": 3,