cleanup notifications toast on start
This commit is contained in:
@@ -81,6 +81,7 @@ export class TestHelpers {
|
|||||||
await page.goto(host);
|
await page.goto(host);
|
||||||
await page.getByRole("link", { name: "Create Account" }).click();
|
await page.getByRole("link", { name: "Create Account" }).click();
|
||||||
await page.getByRole("textbox", { name: "Username" }).fill(username);
|
await page.getByRole("textbox", { name: "Username" }).fill(username);
|
||||||
|
await page.getByRole("textbox", { name: "Password", exact: true }).click();
|
||||||
await page
|
await page
|
||||||
.getByRole("textbox", { name: "Password", exact: true })
|
.getByRole("textbox", { name: "Password", exact: true })
|
||||||
.fill(PASSWORD);
|
.fill(PASSWORD);
|
||||||
@@ -97,21 +98,10 @@ export class TestHelpers {
|
|||||||
timeout: 15_000,
|
timeout: 15_000,
|
||||||
});
|
});
|
||||||
|
|
||||||
const browserUnsupportedToast = page
|
// Clean up any toasts that may block the screen
|
||||||
.getByText("Element does not support this browser")
|
await TestHelpers.closeNotificationToast(page);
|
||||||
.locator("..")
|
// focus the user menu to avoid having hover decoration
|
||||||
.locator("..");
|
await page.getByRole("button", { name: "User menu" }).focus();
|
||||||
|
|
||||||
// Dismiss incompatible browser toast
|
|
||||||
const dismissButton = browserUnsupportedToast.getByRole("button", {
|
|
||||||
name: "Dismiss",
|
|
||||||
});
|
|
||||||
try {
|
|
||||||
await expect(dismissButton).toBeVisible({ timeout: 700 });
|
|
||||||
await dismissButton.click();
|
|
||||||
} catch {
|
|
||||||
// dismissButton not visible, continue as normal
|
|
||||||
}
|
|
||||||
|
|
||||||
await TestHelpers.setDevToolElementCallDevUrl(page);
|
await TestHelpers.setDevToolElementCallDevUrl(page);
|
||||||
|
|
||||||
@@ -126,6 +116,17 @@ export class TestHelpers {
|
|||||||
return { page, clientHandle, mxId };
|
return { page, clientHandle, mxId };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the notification toast
|
||||||
|
*/
|
||||||
|
public static async closeNotificationToast(page: Page): Promise<void> {
|
||||||
|
// Dismiss "Notification" toast
|
||||||
|
return page
|
||||||
|
.locator(".mx_Toast_toast", { hasText: "Notifications" })
|
||||||
|
.getByRole("button", { name: "Dismiss" })
|
||||||
|
.click();
|
||||||
|
}
|
||||||
|
|
||||||
public static async createRoom(
|
public static async createRoom(
|
||||||
name: string,
|
name: string,
|
||||||
page: Page,
|
page: Page,
|
||||||
|
|||||||
Reference in New Issue
Block a user