From 37639077a11eba66f9b5a2d57e0ad3f6cc338d70 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 16 May 2023 14:26:03 +1000 Subject: [PATCH] chore: fix the "Add contact to group" integrationt test --- playwright.config.ts | 6 ++++-- ts/test/automation/group_testing.spec.ts | 4 ++-- ts/test/automation/utilities/utils.ts | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index aa9e8c8c6..dd2a231dd 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -9,8 +9,10 @@ const config: PlaywrightTestConfig = { testDir: './ts/test/automation', testIgnore: '*.js', outputDir: './ts/test/automation/test-results', - retries: 1, - repeatEach: 1, + retries: process.env.PLAYWRIGHT_RETRIES_COUNT + ? toNumber(process.env.PLAYWRIGHT_RETRIES_COUNT) + : 1, + workers: toNumber(process.env.PLAYWRIGHT_WORKER_COUNT) || 1, reportSlowTests: null, }; diff --git a/ts/test/automation/group_testing.spec.ts b/ts/test/automation/group_testing.spec.ts index eddd48194..b10fda3da 100644 --- a/ts/test/automation/group_testing.spec.ts +++ b/ts/test/automation/group_testing.spec.ts @@ -5,7 +5,6 @@ import { clickOnElement, clickOnMatchingText, clickOnTestIdWithText, - doesTextIncludeString, typeIntoInput, waitForControlMessageWithText, waitForMatchingText, @@ -70,7 +69,8 @@ sessionTestFourWindows('Add contact to group', async ([windowA, windowB, windowC 'module-conversation__user__profile-name', testGroup.userName ); - await doesTextIncludeString(windowD, 'control-message', 'You joined the group.'); + const emptyStateGroupText = `You have no messages from ${testGroup.userName}. Send a message to start the conversation!`; + await waitForTestIdWithText(windowD, 'empty-conversation-notification', emptyStateGroupText); }); sessionTestThreeWindows('Change group name', async ([windowA, windowB, windowC]) => { diff --git a/ts/test/automation/utilities/utils.ts b/ts/test/automation/utilities/utils.ts index 93c3ae00c..39ed571bd 100644 --- a/ts/test/automation/utilities/utils.ts +++ b/ts/test/automation/utilities/utils.ts @@ -161,7 +161,7 @@ export async function doesTextIncludeString(window: Page, dataTestId: string, te if (builtSelector) { console.info('Text found:', text); } else { - throw new Error(`Text not found: , ${text}`); + throw new Error(`Text not found: "${text}"`); } }