Skip to content

Commit

Permalink
[PAGOPA-959] fix full feature test
Browse files Browse the repository at this point in the history
  • Loading branch information
cap-ang committed Aug 22, 2023
1 parent ef945f5 commit 917c195
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@ async function assertEmptyList(response, flows) {
assert.ok((response.data.length - flows.size) === 0);
}

async function assertFlowXMLContent(response, flowId) {
console.log(` - -> the client receives the flow XML content with outcome [OK]..`);
assert.match(response.data, new RegExp(`^<FlussoRiversamento.+`, "g"));
assert.match(response.data, new RegExp(`<identificativoFlusso>${flowId}</identificativoFlusso>`, "g"));
}

async function assertNonEmptyList(response) {
console.log(` - -> the client receives a non-empty list of flows..`);
assert.ok(response.data.length > 0);
}

async function assertPaymentOptionStatus(response, status) {
console.log(` - -> the client receives the payment options with status [${status}]..`);
assert.strictEqual(response.data.status, status);
}

async function assertStatusCode(response, statusCode) {
console.log(` - -> the client receives status code [${statusCode}]..`);
assert.strictEqual(response.status, statusCode);
Expand All @@ -19,4 +30,6 @@ module.exports = {
assertEmptyList,
assertNonEmptyList,
assertStatusCode,
assertFlowXMLContent,
assertPaymentOptionStatus
}
7 changes: 5 additions & 2 deletions integration-test/src/step_definitions/support/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ const { Before, BeforeStep, Given, setDefaultTimeout, Then, When } = require('@c
const {
assertEmptyList,
assertNonEmptyList,
assertStatusCode
assertStatusCode,
assertFlowXMLContent,
assertPaymentOptionStatus
} = require('./logic/common_logic');
const {
generateAndPayDebtPosition,
generateDebtPosition,
retrievePaymentOptionDetail
} = require('./logic/gpd_logic');
const {
const {
executeHealthCheckForAPIConfig,
executeHealthCheckForGPD,
executeHealthCheckForGPDPayments,
Expand Down

0 comments on commit 917c195

Please sign in to comment.