Skip to content

[Playwright] Fix atcp-recieve-kit.spec test #2227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

aweng98
Copy link
Contributor

@aweng98 aweng98 commented Sep 20, 2023

Created new function findParticipantFor() to search for a participant without a Genome Study Kit Barcode.

CircleCI run.

atcp-receive-kit.spec.ts:41:9 Receive genome sample kit for AT @dsm @AT @functional
[dsm] › tests/dsm/atcp/atcp-receive-kit.spec.ts:41:9 › Receive Genome Study Kit › Receive genome sample kit for AT @dsm @AT @functional › Verify participant detail on Participant page 

    Error: shortId cannot be null

       at dsm/pages/participant-list-page.ts:158

      156 |   public async filterListByShortId(shortId: string, opts: { resultsCount?: number } = {}): Promise<void> {
      157 |     if (!shortId) {
    > 158 |       throw new Error('shortId cannot be null');
          |             ^
      159 |     }
      160 |     const { resultsCount = 1 } = opts;
      161 |     const participantsTable = this.participantListTable;

        at ParticipantListPage.filterListByShortId (/home/circleci/repo/playwright-e2e/dsm/pages/participant-list-page.ts:158:13)
        at /home/circleci/repo/playwright-e2e/tests/dsm/atcp/atcp-receive-kit.spec.ts:114:35
        at /home/circleci/repo/playwright-e2e/tests/dsm/atcp/atcp-receive-kit.spec.ts:104:7

test.beforeEach(async ({page, request}) => {
navigation = new Navigation(page, request);
const welcomePage = new WelcomePage(page);
await welcomePage.selectStudy(study);
});

test(`Receive genome sample kit for ${study} @dsm @${study} @functional`, async ({page}) => {
// Instead using UI table filter and search, it is much quicker and more accurate to intercept DSM API request to find the right participant to use.
// Find a Playwright test user that does not have GENOME_STUDY_SPIT_KIT_BARCODE.
await page.route('**/*', async (route, request): Promise<void> => {
Copy link
Contributor Author

@aweng98 aweng98 Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await page.route('**/*', async (route, request) is not working because response only contains participants on 1 page at a time, not all paricipants from database.

@aweng98
Copy link
Contributor Author

aweng98 commented Sep 20, 2023

test failure participant-withdrawal.spec.ts is unrelated.

@aweng98 aweng98 merged commit d5ac523 into develop Sep 20, 2023
@aweng98 aweng98 deleted the playwright-test-atcp-receive-kit branch September 20, 2023 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants