Skip to content

Commit 2e09eae

Browse files
authored
[PEPPER-1145] [Playwright] New test for Status filter (#2261)
* new playwright test status information
1 parent 3f2c644 commit 2e09eae

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

playwright-e2e/tests/dsm/miscellaneous/participant-withdrawal.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import { assertTableHeaders } from 'utils/assertion-helper';
1212
import { logParticipantWithdrew } from 'utils/log-utils';
1313
import * as user from 'data/fake-user.json';
1414

15-
// Enable after bug fix https://broadworkbench.atlassian.net/browse/PEPPER-1112
16-
test.describe.skip('Participants Withdrawal', () => {
15+
test.describe('Participants Withdrawal', () => {
1716
const studies = [StudyEnum.LMS];
1817

1918
for (const study of studies) {

playwright-e2e/tests/dsm/participant-list/rgp-default-filter.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { expect } from '@playwright/test';
22
import { test } from 'fixtures/dsm-fixture';
33
import { StudyEnum } from 'dsm/component/navigation/enums/selectStudyNav-enum';
44
import ParticipantListPage from 'dsm/pages/participant-list-page';
5+
import { CustomViewColumns } from 'dsm/component/filters/sections/search/search-enums';
56

67
test.describe('Participants list', () => {
78
test('RGP default filters @dsm @rgp', async ({ page, request }) => {
@@ -70,4 +71,17 @@ test.describe('Participants list', () => {
7071

7172
expect(test.info().errors).toHaveLength(0);
7273
});
74+
75+
test('Open Status filter @dsm @rgp', async ({ page, request }) => {
76+
// Status column must be added. It's not part of default filters.
77+
const participantListPage = await ParticipantListPage.goto(page, StudyEnum.RGP, request);
78+
const customizeViewPanel = participantListPage.filters.customizeViewPanel;
79+
await customizeViewPanel.open();
80+
await customizeViewPanel.selectColumns(CustomViewColumns.PARTICIPANT, ['Status']);
81+
await customizeViewPanel.close();
82+
83+
const searchPanel = participantListPage.filters.searchPanel;
84+
await searchPanel.open();
85+
expect(await searchPanel.checkboxExists('Status', 'Registered')).toBe(true);
86+
});
7387
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { expect } from '@playwright/test';
2+
import { test } from 'fixtures/dsm-fixture';
3+
import { StudyEnum } from 'dsm/component/navigation/enums/selectStudyNav-enum';
4+
import ParticipantListPage from 'dsm/pages/participant-list-page';
5+
6+
test.describe('Display of Participants List Filter', () => {
7+
const cmiClinicalStudies = [StudyEnum.LMS, StudyEnum.OSTEO2];
8+
const cmiResearchStudies = [StudyEnum.BRAIN, StudyEnum.PANCAN];
9+
const cmiResearchStudies2 = [StudyEnum.ANGIO, StudyEnum.ESC, StudyEnum.MBC, StudyEnum.PROSTATE];
10+
11+
for (const study of cmiClinicalStudies.concat(cmiResearchStudies).concat(cmiResearchStudies2)) {
12+
test(`Status is displayed for every participant @${study} @dsm`, async ({ page, request }) => {
13+
const participantListPage = await ParticipantListPage.goto(page, study, request);
14+
const searchPanel = participantListPage.filters.searchPanel;
15+
await searchPanel.open();
16+
17+
expect.soft(await searchPanel.checkboxExists('Status', 'Registered')).toBe(true);
18+
expect.soft(await searchPanel.checkboxExists('Status', 'Exited before Enrollment')).toBe(true);
19+
expect.soft(await searchPanel.checkboxExists('Status', 'Exited after Enrollment')).toBe(true);
20+
expect.soft(await searchPanel.checkboxExists('Status', 'Enrolled')).toBe(true);
21+
if (!cmiResearchStudies2.includes(study)) {
22+
// Some CMI Research studies do not have this status
23+
expect.soft(await searchPanel.checkboxExists('Status', 'Lost to Followup')).toBe(true);
24+
}
25+
expect(test.info().errors).toHaveLength(0);
26+
});
27+
}
28+
});

0 commit comments

Comments
 (0)