-
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.
Add test cases for selection behaviour (#6048)
* Add changes from PR review --------- Co-authored-by: Domenico Gemoli <dgemoli@redcross.nl>
- Loading branch information
Showing
4 changed files
with
168 additions
and
1 deletion.
There are no files selected for viewing
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
55 changes: 55 additions & 0 deletions
55
e2e/portalicious/tests/SendMessage/CorrectSelectionCountForMultiplePas.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,55 @@ | ||
import { test } from '@playwright/test'; | ||
|
||
import { SeedScript } from '@121-service/src/scripts/seed-script.enum'; | ||
import { seedIncludedRegistrations } from '@121-service/test/helpers/registration.helper'; | ||
import { resetDB } from '@121-service/test/helpers/utility.helper'; | ||
import { getAccessToken } from '@121-service/test/helpers/utility.helper'; | ||
import { registrationsPV } from '@121-service/test/registrations/pagination/pagination-data'; | ||
|
||
import BasePage from '@121-e2e/portalicious/pages/BasePage'; | ||
import LoginPage from '@121-e2e/portalicious/pages/LoginPage'; | ||
import RegistrationsPage from '@121-e2e/portalicious/pages/RegistrationsPage'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await resetDB(SeedScript.nlrcMultiple); | ||
const programIdPV = 2; | ||
const pvProgramId = programIdPV; | ||
|
||
const accessToken = await getAccessToken(); | ||
await seedIncludedRegistrations(registrationsPV, pvProgramId, 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('[31197] Selection should show correct PA count for bulk action (Multiple PAs)', async ({ | ||
page, | ||
}) => { | ||
const basePage = new BasePage(page); | ||
const registrations = new RegistrationsPage(page); | ||
|
||
const projectTitle = 'NLRC Direct Digital Aid Program (PV)'; | ||
|
||
await test.step('Select program', async () => { | ||
await basePage.selectProgram(projectTitle); | ||
}); | ||
|
||
await test.step('Apply bulk action on multiple PAs', async () => { | ||
// Select on to trigger the first count of bulk action | ||
await registrations.performActionOnRegistrationByName({ | ||
registrationName: 'Gemma Houtenbos', | ||
action: 'Message', | ||
}); | ||
await registrations.validateSendMessagePaCount(1); | ||
await registrations.cancelSendMessageBulkAction(); | ||
// Select couple of PAs to trigger the second count of bulk action | ||
await registrations.selectMultipleRegistrations(2); | ||
await registrations.performActionWithRightClick('Message'); | ||
await registrations.validateSendMessagePaCount(2); | ||
}); | ||
}); |
49 changes: 49 additions & 0 deletions
49
e2e/portalicious/tests/SendMessage/CorrectSelectionCountForSinglePa.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,49 @@ | ||
import { test } from '@playwright/test'; | ||
|
||
import { SeedScript } from '@121-service/src/scripts/seed-script.enum'; | ||
import { seedIncludedRegistrations } from '@121-service/test/helpers/registration.helper'; | ||
import { resetDB } from '@121-service/test/helpers/utility.helper'; | ||
import { getAccessToken } from '@121-service/test/helpers/utility.helper'; | ||
import { registrationsPV } from '@121-service/test/registrations/pagination/pagination-data'; | ||
|
||
import BasePage from '@121-e2e/portalicious/pages/BasePage'; | ||
import LoginPage from '@121-e2e/portalicious/pages/LoginPage'; | ||
import RegistrationsPage from '@121-e2e/portalicious/pages/RegistrationsPage'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await resetDB(SeedScript.nlrcMultiple); | ||
const programIdPV = 2; | ||
const pvProgramId = programIdPV; | ||
|
||
const accessToken = await getAccessToken(); | ||
await seedIncludedRegistrations(registrationsPV, pvProgramId, 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('[31196] Selection should show correct PA count for bulk action (Single PA)', async ({ | ||
page, | ||
}) => { | ||
const basePage = new BasePage(page); | ||
const registrations = new RegistrationsPage(page); | ||
|
||
const projectTitle = 'NLRC Direct Digital Aid Program (PV)'; | ||
|
||
await test.step('Select program', async () => { | ||
await basePage.selectProgram(projectTitle); | ||
}); | ||
|
||
await test.step('Apply bulk action on one PA', async () => { | ||
await registrations.performActionOnRegistrationByName({ | ||
registrationName: 'Gemma Houtenbos', | ||
action: 'Message', | ||
}); | ||
await registrations.validateSendMessagePaCount(1); | ||
}); | ||
}); |
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