Fix E2E test quality issues: always-passing assertions, unawaited checks, and dead code (#32801)

* Fix E2E test quality issues: always-passing assertions, unawaited checks, and dead code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* apply review

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
YONGJAE LEE(이용재)
2026-03-16 18:00:22 +00:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent ee5d2609df
commit 68070b2e97
4 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -337,7 +337,7 @@ export async function disableKeyBackup(app: ElementAppPage): Promise<void> {
if (await keyStorageToggle.isChecked()) {
await encryptionTab.getByRole("switch", { name: "Allow key storage" }).click();
await encryptionTab.getByRole("button", { name: "Delete key storage" }).click();
await encryptionTab.getByRole("switch", { name: "Allow key storage" }).isVisible();
await expect(encryptionTab.getByRole("switch", { name: "Allow key storage" })).toBeVisible();
// Wait for the update to account data to stick
await new Promise((resolve) => setTimeout(resolve, 2000));
@@ -35,6 +35,6 @@ test.describe("Devtools", () => {
await input.fill("https://example.com");
await input.press("Enter");
// expect EW NOT to reload
await page.getByText("Saved").isVisible();
await expect(page.getByText("Saved")).toBeVisible();
});
});
@@ -203,8 +203,6 @@ test.describe("Spotlight", () => {
.locator("..")
.locator("[role=menuitemradio]")
.click();
await page.waitForTimeout(3_600_000);
await page.waitForTimeout(500); // wait for the dialog to settle
const resultLocator = spotlight.results;
@@ -441,7 +441,7 @@ test.describe("Threads", () => {
textbox = locator.getByRole("textbox", { name: "Send an unencrypted message…" });
await textbox.fill("Hello Mr. User");
await textbox.press("Enter");
await expect(locator.locator(".mx_EventTile_last").getByText("Hello Mr. User")).toBeAttached();
await expect(locator.locator(".mx_EventTile_last").getByText("Hello Mr. User")).toBeVisible();
// Close thread
await locator.getByTestId("base-card-close-button").click();
@@ -454,8 +454,8 @@ test.describe("Threads", () => {
await expect(page.locator(".mx_ThreadView_timelinePanelWrapper")).toHaveCount(1);
locator = page.locator(".mx_BaseCard");
await expect(locator.locator(".mx_EventTile").first().getByText("Hello Mr. Bot")).toBeAttached();
await expect(locator.locator(".mx_EventTile").last().getByText("Hello Mr. User")).toBeAttached();
await expect(locator.locator(".mx_EventTile").first().getByText("Hello Mr. Bot")).toBeVisible();
await expect(locator.locator(".mx_EventTile").last().getByText("Hello Mr. User")).toBeVisible();
});
test("navigate through right panel", { tag: "@screenshot" }, async ({ page, app, user }) => {