-
Notifications
You must be signed in to change notification settings - Fork 15
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
70 additions
and
0 deletions.
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
e2e/portalicious/tests/ViewPayment/ImportReconciliationDataForExcelFsp.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,70 @@ | ||
import { test } from '@playwright/test'; | ||
import { format } from 'date-fns'; | ||
import path from 'path'; | ||
|
||
import { SeedScript } from '@121-service/src/scripts/enum/seed-script.enum'; | ||
import NLRCProgramPV from '@121-service/src/seed-data/program/program-nlrc-pv.json'; | ||
import { seedIncludedRegistrations } from '@121-service/test/helpers/registration.helper'; | ||
import { | ||
getAccessToken, | ||
resetDB, | ||
} from '@121-service/test/helpers/utility.helper'; | ||
import { | ||
programIdPV, | ||
registrationsPvExcel, | ||
} from '@121-service/test/registrations/pagination/pagination-data'; | ||
|
||
import LoginPage from '@121-e2e/portalicious/pages/LoginPage'; | ||
import PaymentsPage from '@121-e2e/portalicious/pages/PaymentsPage'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await resetDB(SeedScript.nlrcMultiple); | ||
const accessToken = await getAccessToken(); | ||
await seedIncludedRegistrations( | ||
registrationsPvExcel, | ||
programIdPV, | ||
accessToken, | ||
); | ||
|
||
// Login | ||
const loginPage = new LoginPage(page); | ||
await page.goto('/'); | ||
await loginPage.login( | ||
process.env.USERCONFIG_121_SERVICE_EMAIL_ADMIN, | ||
process.env.USERCONFIG_121_SERVICE_PASSWORD_ADMIN, | ||
); | ||
}); | ||
|
||
test('[32303] [Excel fsp]: Import reconciliation data should work similar to import registration data', async ({ | ||
page, | ||
}) => { | ||
const paymentsPage = new PaymentsPage(page); | ||
|
||
const projectTitle = NLRCProgramPV.titlePortal.en; | ||
const lastPaymentDate = `${format(new Date(), 'dd/MM/yyyy')}`; | ||
const reconciliationData = path.resolve( | ||
__dirname, | ||
'../../../test-registration-data/test-reconciliation-Excel-pv.csv', | ||
); | ||
|
||
await test.step('Navigate to Program payments', async () => { | ||
await paymentsPage.selectProgram(projectTitle); | ||
|
||
await paymentsPage.navigateToProgramPage('Payments'); | ||
}); | ||
|
||
await test.step('Start payment', async () => { | ||
await paymentsPage.createPayment(); | ||
await paymentsPage.startPayment(); | ||
// Assert redirection to payment overview page | ||
await page.waitForURL((url) => | ||
url.pathname.startsWith(`/en-GB/project/${programIdPV}/payments/1`), | ||
); | ||
// Assert payment overview page by payment date/ title | ||
await paymentsPage.validatePaymentsDetailsPageByDate(lastPaymentDate); | ||
}); | ||
|
||
await test.step('Upload payment reconciliation data via UI', async () => { | ||
await paymentsPage.importReconciliationData(reconciliationData); | ||
}); | ||
}); |