-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
e2e/tests/121-Portal/MakeNewPayment/PV/ViewVisaCardsPV.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import HomePage from '@121-e2e/pages/Home/HomePage'; | ||
import LoginPage from '@121-e2e/pages/Login/LoginPage'; | ||
import NavigationModule from '@121-e2e/pages/Navigation/NavigationModule'; | ||
import PhysicalCardOverview from '@121-e2e/pages/PhysicalCardOverview/PhysicalCardOverview'; | ||
import TableModule from '@121-e2e/pages/Table/TableModule'; | ||
import { WalletCardStatus121 } from '@121-service/src/payments/fsp-integration/intersolve-visa/enum/wallet-status-121.enum'; | ||
import { SeedScript } from '@121-service/src/scripts/seed-script.enum'; | ||
import NLRCProgramPV from '@121-service/src/seed-data/program/program-nlrc-pv.json'; | ||
import { seedPaidRegistrations } from '@121-service/test/helpers/registration.helper'; | ||
import { resetDB } from '@121-service/test/helpers/utility.helper'; | ||
import { registrationsPV } from '@121-service/test/registrations/pagination/pagination-data'; | ||
import { test } from '@playwright/test'; | ||
import englishTranslations from '../../../../../interfaces/Portal/src/assets/i18n/en.json'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await resetDB(SeedScript.nlrcMultiple); | ||
const programIdPV = 2; | ||
const pvProgramId = programIdPV; | ||
|
||
await seedPaidRegistrations(registrationsPV, pvProgramId); | ||
|
||
// Login | ||
const loginPage = new LoginPage(page); | ||
await page.goto('/login'); | ||
await loginPage.login( | ||
process.env.USERCONFIG_121_SERVICE_EMAIL_ADMIN, | ||
process.env.USERCONFIG_121_SERVICE_PASSWORD_ADMIN, | ||
); | ||
}); | ||
|
||
test('[28479] Re-issue Visa debit cards', async ({ page }) => { | ||
const table = new TableModule(page); | ||
const navigationModule = new NavigationModule(page); | ||
const physicalCard = new PhysicalCardOverview(page); | ||
const homePage = new HomePage(page); | ||
|
||
await test.step('Should navigate to PA profile page in Payment table', async () => { | ||
await homePage.navigateToProgramme(NLRCProgramPV.titlePortal.en); | ||
await navigationModule.navigateToProgramTab( | ||
englishTranslations.page.program.tab.payment.label, | ||
); | ||
await table.clickOnPaNumber(3); | ||
}); | ||
|
||
await test.step('Should validate all possible card statuses at once: Paused, Active, Blocked/Substitued', async () => { | ||
await physicalCard.validateDebitCardStatus( | ||
englishTranslations['registration-details']['physical-cards-overview'] | ||
.title, | ||
WalletCardStatus121.Active, | ||
); | ||
await physicalCard.issueNewVisaDebitCard(); | ||
// FOR NOW STATUS SHOULD BE BLOCKED BUT AFTER NEW CHANGES ARE APPLIED THIS SHOULD BE CHANGED INTO "SUBSTITUTED" | ||
await physicalCard.validateDebitCardStatus( | ||
englishTranslations['registration-details']['physical-cards-overview'] | ||
.title, | ||
WalletCardStatus121.Blocked, | ||
); | ||
await physicalCard.pauseVisaDebitCard(); | ||
await physicalCard.validateDebitCardStatus( | ||
englishTranslations['registration-details']['physical-cards-overview'] | ||
.title, | ||
WalletCardStatus121.Paused, | ||
); | ||
}); | ||
}); |