Skip to content

Commit

Permalink
[PPANTT-131] feat: Updated int. tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-cialini committed Oct 1, 2024
1 parent 65d654d commit 8f2bcce
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions integration-test/src/config/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ INVALID_NOTICE_NUMBER=111111111111111111
DISABLED_STATION_NOTICE_NUMBER=313111111111111111
DISABLED_STATION_ODP_NOTICE_NUMBER=312111111111111111
MISSING_STATION_NOTICE_NUMBER=399111111111111111
ERROR_STATION_NOTICE_NUMBER=311111111119999999
WRONG_STATION_NOTICE_NUMBER=311111111119999902
UNAUTHORIZED_PSP=AAAAAAAAA
VALID_PSP=99999000001

Expand Down
2 changes: 2 additions & 0 deletions integration-test/src/config/.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ INVALID_NOTICE_NUMBER=111111111111111111
DISABLED_STATION_NOTICE_NUMBER=313111111111111111
DISABLED_STATION_ODP_NOTICE_NUMBER=312111111111111111
MISSING_STATION_NOTICE_NUMBER=399111111111111111
ERROR_STATION_NOTICE_NUMBER=311111111119999999
WRONG_STATION_NOTICE_NUMBER=311111111119999902
UNAUTHORIZED_PSP=AAAAAAAAA
VALID_PSP=99999000001

Expand Down
2 changes: 2 additions & 0 deletions integration-test/src/config/.env.uat
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ INVALID_NOTICE_NUMBER=111111111111111111
DISABLED_STATION_NOTICE_NUMBER=313111111111111111
DISABLED_STATION_ODP_NOTICE_NUMBER=312111111111111111
MISSING_STATION_NOTICE_NUMBER=399111111111111111
ERROR_STATION_NOTICE_NUMBER=311111111119999999
WRONG_STATION_NOTICE_NUMBER=311111111119999902
UNAUTHORIZED_PSP=AAAAAAAAA
VALID_PSP=99999000001

Expand Down
10 changes: 10 additions & 0 deletions integration-test/src/features/get_payment_options.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ Feature: Get Payment Options
And payments options has size 2
And payments option n 0 has 1 installments
And payments option n 1 has 1 installments

Scenario: PAA Wrong System Error
When an Http GET request is sent to recover payment options for taxCode "valid" with noticeNumber "wrong" and idPsp "valid"
Then response has a 400 Http status
And has error code "PAA_STAZIONE_INT_ERRATA"

Scenario: PAA System Error
When an Http GET request is sent to recover payment options for taxCode "valid" with noticeNumber "error" and idPsp "valid"
Then response has a 400 Http status
And has error code "PAA_SYSTEM_ERROR"
8 changes: 8 additions & 0 deletions integration-test/src/step_definitions/payment_options_step.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const invalidStationNoticeNumber = process.env.INVALID_NOTICE_NUMBER;
const disabledStationNoticeNumber = process.env.DISABLED_STATION_NOTICE_NUMBER;
const disabledOdpStationNoticeNumber = process.env.DISABLED_STATION_ODP_NOTICE_NUMBER;
const missingStationNoticeNumber = process.env.MISSING_STATION_NOTICE_NUMBER;
const errorNoticeNumber = process.env.ERROR_STATION_NOTICE_NUMBER;
const wrongNoticeNumber = process.env.WRONG_STATION_NOTICE_NUMBER;
const invalidPsp = process.env.UNAUTHORIZED_PSP;
const validPsp = process.env.VALID_PSP;

Expand Down Expand Up @@ -70,6 +72,12 @@ When('an Http GET request is sent to recover payment options for taxCode {string
case "co-oblidged":
selectedNoticeNumber = coOptNoticeNumber;
break;
case "wrong":
selectedNoticeNumber = wrongNoticeNumber;
break;
case "error":
selectedNoticeNumber = errorNoticeNumber;
break;
}

switch (idPsp) {
Expand Down

0 comments on commit 8f2bcce

Please sign in to comment.