chore: fix the "Add contact to group" integrationt test

This commit is contained in:
Audric Ackermann 2023-05-16 14:26:03 +10:00
parent a7e8c4a31d
commit 37639077a1
3 changed files with 7 additions and 5 deletions

View File

@ -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,
};

View File

@ -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]) => {

View File

@ -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}"`);
}
}