Skip to content

Commit 68070b2

Browse files
dididyclaude
andauthored
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>
1 parent ee5d260 commit 68070b2

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

apps/web/playwright/e2e/crypto/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ export async function disableKeyBackup(app: ElementAppPage): Promise<void> {
337337
if (await keyStorageToggle.isChecked()) {
338338
await encryptionTab.getByRole("switch", { name: "Allow key storage" }).click();
339339
await encryptionTab.getByRole("button", { name: "Delete key storage" }).click();
340-
await encryptionTab.getByRole("switch", { name: "Allow key storage" }).isVisible();
340+
await expect(encryptionTab.getByRole("switch", { name: "Allow key storage" })).toBeVisible();
341341

342342
// Wait for the update to account data to stick
343343
await new Promise((resolve) => setTimeout(resolve, 2000));

apps/web/playwright/e2e/devtools/devtools.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ test.describe("Devtools", () => {
3535
await input.fill("https://example.com");
3636
await input.press("Enter");
3737
// expect EW NOT to reload
38-
await page.getByText("Saved").isVisible();
38+
await expect(page.getByText("Saved")).toBeVisible();
3939
});
4040
});

apps/web/playwright/e2e/spotlight/spotlight.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ test.describe("Spotlight", () => {
203203
.locator("..")
204204
.locator("[role=menuitemradio]")
205205
.click();
206-
await page.waitForTimeout(3_600_000);
207-
208206
await page.waitForTimeout(500); // wait for the dialog to settle
209207

210208
const resultLocator = spotlight.results;

apps/web/playwright/e2e/threads/threads.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ test.describe("Threads", () => {
441441
textbox = locator.getByRole("textbox", { name: "Send an unencrypted message…" });
442442
await textbox.fill("Hello Mr. User");
443443
await textbox.press("Enter");
444-
await expect(locator.locator(".mx_EventTile_last").getByText("Hello Mr. User")).toBeAttached();
444+
await expect(locator.locator(".mx_EventTile_last").getByText("Hello Mr. User")).toBeVisible();
445445
// Close thread
446446
await locator.getByTestId("base-card-close-button").click();
447447

@@ -454,8 +454,8 @@ test.describe("Threads", () => {
454454
await expect(page.locator(".mx_ThreadView_timelinePanelWrapper")).toHaveCount(1);
455455

456456
locator = page.locator(".mx_BaseCard");
457-
await expect(locator.locator(".mx_EventTile").first().getByText("Hello Mr. Bot")).toBeAttached();
458-
await expect(locator.locator(".mx_EventTile").last().getByText("Hello Mr. User")).toBeAttached();
457+
await expect(locator.locator(".mx_EventTile").first().getByText("Hello Mr. Bot")).toBeVisible();
458+
await expect(locator.locator(".mx_EventTile").last().getByText("Hello Mr. User")).toBeVisible();
459459
});
460460

461461
test("navigate through right panel", { tag: "@screenshot" }, async ({ page, app, user }) => {

0 commit comments

Comments
 (0)