test(e2e): update mock specs for splash changes
This commit is contained in:
@@ -5,6 +5,12 @@ export const e2eEmailCredentials = {
|
||||
password: "12345678",
|
||||
};
|
||||
|
||||
export const splashStartChatButtonName = "Start Chatting";
|
||||
|
||||
export function getSplashStartChatButton(page: Page) {
|
||||
return page.getByRole("button", { name: splashStartChatButtonName });
|
||||
}
|
||||
|
||||
export async function clearBrowserState(
|
||||
context: BrowserContext,
|
||||
page: Page,
|
||||
@@ -45,12 +51,12 @@ export async function enterChatFromSplash(
|
||||
|
||||
await page.goto("/splash", { waitUntil });
|
||||
|
||||
const skipButton = page.getByRole("button", { name: "Skip" });
|
||||
await expect(skipButton).toBeVisible({ timeout });
|
||||
await expect(skipButton).toBeEnabled();
|
||||
const startChatButton = getSplashStartChatButton(page);
|
||||
await expect(startChatButton).toBeVisible({ timeout });
|
||||
await expect(startChatButton).toBeEnabled();
|
||||
|
||||
for (let attempt = 0; attempt < 3; attempt += 1) {
|
||||
await skipButton.click();
|
||||
await startChatButton.click();
|
||||
try {
|
||||
await expect(page).toHaveURL(expectedUrl, { timeout: 3_000 });
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user