Skip to content

Commit

Permalink
Playwright: fix (hopefully) flaky shields test
Browse files Browse the repository at this point in the history
Wait for our user to fetch the bot's identity before running the test, to work
around a race in the shield logic.

Hopefully, fixes #28061
  • Loading branch information
richvdh committed Dec 4, 2024
1 parent 33c69c3 commit 4607325
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions playwright/e2e/crypto/event-shields.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@ test.describe("Cryptography", function () {
bot: bob,
homeserver,
}) => {
// Workaround for https://github.com/element-hq/element-web/issues/28640:
// make sure that Alice has seen Bob's identity before she goes offline. We do this by opening
// his user info.
await app.toggleRoomInfoPanel();
const rightPanel = page.locator(".mx_RightPanel");
await rightPanel.getByRole("menuitem", { name: "People" }).click();
await rightPanel.getByRole("button", { name: bob.credentials!.userId }).click();
await expect(rightPanel.locator(".mx_UserInfo_devices")).toContainText("1 session");

// Our app is blocked from syncing while Bob sends his messages.
await app.client.network.goOffline();

Expand Down

0 comments on commit 4607325

Please sign in to comment.