Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky playwright tests #28957

Draft
wants to merge 13 commits into
base: develop
Choose a base branch
from
3 changes: 3 additions & 0 deletions docs/playwright.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ test.use({
```

The appropriate homeserver will be launched by the Playwright worker and reused for all tests which match the worker configuration.
Due to homeservers being reused between tests, please use unique names for any rooms put into the room directory as
they may be visible from other tests, the suggested approach is to use `testInfo.testId` within the name or lodash's uniqueId.
We remove public rooms from the directory between tests but deleting users doesn't have a homeserver agnostic solution.
The logs from testcontainers will be attached to any reports output from Playwright.

## Writing Tests
Expand Down
20 changes: 12 additions & 8 deletions playwright/e2e/crypto/backups-mas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ test.use(masHomeserver);
test.describe("Encryption state after registration", () => {
test.skip(isDendrite, "does not yet support MAS");

test("Key backup is enabled by default", async ({ page, mailhogClient, app }) => {
test("Key backup is enabled by default", async ({ page, mailhogClient, app }, testInfo) => {
await page.goto("/#/login");
await page.getByRole("button", { name: "Continue" }).click();
await registerAccountMas(page, mailhogClient, "alice", "[email protected]", "Pa$sW0rD!");
await registerAccountMas(page, mailhogClient, `alice_${testInfo.testId}`, "[email protected]", "Pa$sW0rD!");

await app.settings.openUserSettings("Security & Privacy");
await expect(page.getByText("This session is backing up your keys.")).toBeVisible();
});

test("user is prompted to set up recovery", async ({ page, mailhogClient, app }) => {
test("user is prompted to set up recovery", async ({ page, mailhogClient, app }, testInfo) => {
await page.goto("/#/login");
await page.getByRole("button", { name: "Continue" }).click();
await registerAccountMas(page, mailhogClient, "alice", "[email protected]", "Pa$sW0rD!");
await registerAccountMas(page, mailhogClient, `alice_${testInfo.testId}`, "[email protected]", "Pa$sW0rD!");

await page.getByRole("button", { name: "Add room" }).click();
await page.getByRole("menuitem", { name: "New room" }).click();
Expand All @@ -45,8 +45,13 @@ test.describe("Encryption state after registration", () => {
test.describe("Key backup reset from elsewhere", () => {
test.skip(isDendrite, "does not yet support MAS");

test("Key backup is disabled when reset from elsewhere", async ({ page, mailhogClient, request, homeserver }) => {
const testUsername = "alice";
test("Key backup is disabled when reset from elsewhere", async ({
page,
mailhogClient,
request,
homeserver,
}, testInfo) => {
const testUsername = `alice_${testInfo.testId}`;
const testPassword = "Pa$sW0rD!";

// there's a delay before keys are uploaded so the error doesn't appear immediately: use a fake
Expand All @@ -62,8 +67,7 @@ test.describe("Key backup reset from elsewhere", () => {
await page.getByRole("textbox", { name: "Name" }).fill("test room");
await page.getByRole("button", { name: "Create room" }).click();

// @ts-ignore - this runs in the browser scope where mxMatrixClientPeg is a thing. Here, it is not.
const accessToken = await page.evaluate(() => mxMatrixClientPeg.get().getAccessToken());
const accessToken = await page.evaluate(() => window.mxMatrixClientPeg.get().getAccessToken());

const csAPI = new TestClientServerAPI(request, homeserver, accessToken);

Expand Down
29 changes: 10 additions & 19 deletions playwright/e2e/csAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,31 @@ import { APIRequestContext } from "playwright-core";
import { KeyBackupInfo } from "matrix-js-sdk/src/crypto-api";

import { HomeserverInstance } from "../plugins/homeserver";
import { ClientServerApi } from "../testcontainers/utils.ts";

/**
* A small subset of the Client-Server API used to manipulate the state of the
* account on the homeserver independently of the client under test.
*/
export class TestClientServerAPI {
export class TestClientServerAPI extends ClientServerApi {
public constructor(
private request: APIRequestContext,
private homeserver: HomeserverInstance,
request: APIRequestContext,
homeserver: HomeserverInstance,
private accessToken: string,
) {}
) {
super(homeserver.baseUrl);
this.setRequest(request);
}

public async getCurrentBackupInfo(): Promise<KeyBackupInfo | null> {
const res = await this.request.get(`${this.homeserver.baseUrl}/_matrix/client/v3/room_keys/version`, {
headers: { Authorization: `Bearer ${this.accessToken}` },
});

return await res.json();
return this.request("GET", `/v3/room_keys/version`, this.accessToken);
}

/**
* Calls the API directly to delete the given backup version
* @param version The version to delete
*/
public async deleteBackupVersion(version: string): Promise<void> {
const res = await this.request.delete(
`${this.homeserver.baseUrl}/_matrix/client/v3/room_keys/version/${version}`,
{
headers: { Authorization: `Bearer ${this.accessToken}` },
},
);

if (!res.ok) {
throw new Error(`Failed to delete backup version: ${res.status}`);
}
await this.request("DELETE", `/v3/room_keys/version/${version}`, this.accessToken);
}
}
53 changes: 33 additions & 20 deletions playwright/e2e/forgot-password/forgot-password.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/

import { expect, test } from "../../element-web-test";
import { expect, test as base } from "../../element-web-test";
import { selectHomeserver } from "../utils";
import { emailHomeserver } from "../../plugins/homeserver/synapse/emailHomeserver.ts";
import { isDendrite } from "../../plugins/homeserver/dendrite";
import { Credentials } from "../../plugins/homeserver";

const username = "user1234";
// this has to be password-like enough to please zxcvbn. Needless to say it's just from pwgen.
const password = "oETo7MPf0o";
const email = "[email protected]";

const test = base.extend<{ credentials: Pick<Credentials, "username" | "password"> }>({
// eslint-disable-next-line no-empty-pattern
credentials: async ({}, use, testInfo) => {
await use({
username: `user_${testInfo.testId}`,
// this has to be password-like enough to please zxcvbn. Needless to say it's just from pwgen.
password: "oETo7MPf0o",
});
},
});

test.use(emailHomeserver);
test.use({
config: {
Expand Down Expand Up @@ -45,31 +54,35 @@ test.describe("Forgot Password", () => {
await expect(page.getByRole("main")).toMatchScreenshot("forgot-password.png");
});

test("renders email verification dialog properly", { tag: "@screenshot" }, async ({ page, homeserver }) => {
const user = await homeserver.registerUser(username, password);
test(
"renders email verification dialog properly",
{ tag: "@screenshot" },
async ({ page, homeserver, credentials }) => {
const user = await homeserver.registerUser(credentials.username, credentials.password);

await homeserver.setThreepid(user.userId, "email", email);
await homeserver.setThreepid(user.userId, "email", email);

await page.goto("/");
await page.goto("/");

await page.getByRole("link", { name: "Sign in" }).click();
await selectHomeserver(page, homeserver.baseUrl);
await page.getByRole("link", { name: "Sign in" }).click();
await selectHomeserver(page, homeserver.baseUrl);

await page.getByRole("button", { name: "Forgot password?" }).click();
await page.getByRole("button", { name: "Forgot password?" }).click();

await page.getByRole("textbox", { name: "Email address" }).fill(email);
await page.getByRole("textbox", { name: "Email address" }).fill(email);

await page.getByRole("button", { name: "Send email" }).click();
await page.getByRole("button", { name: "Send email" }).click();

await page.getByRole("button", { name: "Next" }).click();
await page.getByRole("button", { name: "Next" }).click();

await page.getByRole("textbox", { name: "New Password", exact: true }).fill(password);
await page.getByRole("textbox", { name: "Confirm new password", exact: true }).fill(password);
await page.getByRole("textbox", { name: "New Password", exact: true }).fill(credentials.password);
await page.getByRole("textbox", { name: "Confirm new password", exact: true }).fill(credentials.password);

await page.getByRole("button", { name: "Reset password" }).click();
await page.getByRole("button", { name: "Reset password" }).click();

await expect(page.getByRole("button", { name: "Resend" })).toBeInViewport();
await expect(page.getByRole("button", { name: "Resend" })).toBeInViewport();

await expect(page.locator(".mx_Dialog")).toMatchScreenshot("forgot-password-verify-email.png");
});
await expect(page.locator(".mx_Dialog")).toMatchScreenshot("forgot-password-verify-email.png");
},
);
});
6 changes: 6 additions & 0 deletions playwright/e2e/login/login-consent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ async function login(page: Page, homeserver: HomeserverInstance, credentials: Cr
await page.getByRole("button", { name: "Sign in" }).click();
}

// This test suite uses the same userId for all tests in the suite
// due to DEVICE_SIGNING_KEYS_BODY being specific to that userId,
// so we restart the Synapse container to make it forget everything.
test.use(consentHomeserver);
test.use({
config: {
Expand All @@ -97,6 +100,9 @@ test.use({
...credentials,
displayName,
});

// Restart the homeserver to wipe its in-memory db so we can reuse the same user ID without cross-signing prompts
await homeserver.restart();
},
});

Expand Down
4 changes: 2 additions & 2 deletions playwright/e2e/login/login-sso.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ test.use(legacyOAuthHomeserver);
test.describe("SSO login", () => {
test.skip(isDendrite, "does not yet support SSO");

test("logs in with SSO and lands on the home screen", async ({ page, homeserver }) => {
test("logs in with SSO and lands on the home screen", async ({ page, homeserver }, testInfo) => {
// If this test fails with a screen showing "Timeout connecting to remote server", it is most likely due to
// your firewall settings: Synapse is unable to reach the OIDC server.
//
// If you are using ufw, try something like:
// sudo ufw allow in on docker0
//
await doTokenRegistration(page, homeserver);
await doTokenRegistration(page, homeserver, testInfo);
});
});
4 changes: 2 additions & 2 deletions playwright/e2e/login/soft_logout_oauth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ test.use({
test.use(legacyOAuthHomeserver);
test.describe("Soft logout with SSO user", () => {
test.use({
user: async ({ page, homeserver }, use) => {
const user = await doTokenRegistration(page, homeserver);
user: async ({ page, homeserver }, use, testInfo) => {
const user = await doTokenRegistration(page, homeserver, testInfo);

// Eventually, we should end up at the home screen.
await expect(page).toHaveURL(/\/#\/home$/);
Expand Down
5 changes: 3 additions & 2 deletions playwright/e2e/login/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Please see LICENSE files in the repository root for full details.
*/

import { Page, expect } from "@playwright/test";
import { Page, expect, TestInfo } from "@playwright/test";

import { Credentials, HomeserverInstance } from "../../plugins/homeserver";

Expand All @@ -15,6 +15,7 @@
export async function doTokenRegistration(
page: Page,
homeserver: HomeserverInstance,
testInfo: TestInfo,
): Promise<Credentials & { displayName: string }> {
await page.goto("/#/login");

Expand All @@ -34,8 +35,8 @@
await page.getByRole("button", { name: "Submit" }).click();

// Synapse prompts us to pick a user ID
await expect(page.getByRole("heading", { name: "Create your account" })).toBeVisible();

Check failure on line 38 in playwright/e2e/login/utils.ts

View workflow job for this annotation

GitHub Actions / Run Tests [Chrome] 6/6

[Chrome] › login/soft_logout_oauth.spec.ts:40:9 › Soft logout with SSO user › shows the soft-logout page when a request fails

1) [Chrome] › login/soft_logout_oauth.spec.ts:40:9 › Soft logout with SSO user › shows the soft-logout page when a request fails, and allows a re-login Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByRole('heading', { name: 'Create your account' }) Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByRole('heading', { name: 'Create your account' }) at login/utils.ts:38 36 | 37 | // Synapse prompts us to pick a user ID > 38 | await expect(page.getByRole("heading", { name: "Create your account" })).toBeVisible(); | ^ 39 | await page.getByRole("textbox", { name: "Username (required)" }).fill(`alice_${testInfo.testId}`); 40 | 41 | // wait for username validation to start, and complete at doTokenRegistration (/home/runner/work/element-web/element-web/playwright/e2e/login/utils.ts:38:78) at Object.user (/home/runner/work/element-web/element-web/playwright/e2e/login/soft_logout_oauth.spec.ts:30:26)
await page.getByRole("textbox", { name: "Username (required)" }).fill("alice");
await page.getByRole("textbox", { name: "Username (required)" }).fill(`alice_${testInfo.testId}`);

// wait for username validation to start, and complete
await expect(page.locator("#field-username-output")).toHaveText("");
Expand Down
2 changes: 1 addition & 1 deletion playwright/e2e/oidc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
await expect(async () => {
messages = await mailhog.messages();
expect(messages.items).toHaveLength(1);
}).toPass();

Check failure on line 34 in playwright/e2e/oidc/index.ts

View workflow job for this annotation

GitHub Actions / Run Tests [Chrome] 6/6

[Chrome] › oidc/oidc-native.spec.ts:20:9 › OIDC Native › can register the oauth2 client and an account @no-firefox @no-webkit

2) [Chrome] › oidc/oidc-native.spec.ts:20:9 › OIDC Native › can register the oauth2 client and an account @no-firefox @no-webkit Error: expect(received).toHaveLength(expected) Expected length: 1 Received length: 0 Received array: [] Call Log: - Test timeout of 90000ms exceeded at oidc/index.ts:34 32 | messages = await mailhog.messages(); 33 | expect(messages.items).toHaveLength(1); > 34 | }).toPass(); | ^ 35 | expect(messages.items[0].to).toEqual(`${username} <${email}>`); 36 | const [, code] = messages.items[0].text.match(/Your verification code to confirm this email address is: (\d{6})/); 37 | at registerAccountMas (/home/runner/work/element-web/element-web/playwright/e2e/oidc/index.ts:34:8) at /home/runner/work/element-web/element-web/playwright/e2e/oidc/oidc-native.spec.ts:38:9
expect(messages.items[0].to).toEqual(`${username} <${email}>`);
const [code] = messages.items[0].text.match(/(\d{6})/);
const [, code] = messages.items[0].text.match(/Your verification code to confirm this email address is: (\d{6})/);

await page.getByRole("textbox", { name: "6-digit code" }).fill(code);
await page.getByRole("button", { name: "Continue" }).click();
Expand Down
17 changes: 14 additions & 3 deletions playwright/e2e/oidc/oidc-native.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,30 @@
test.skip(isDendrite, "does not yet support MAS");
test.slow(); // trace recording takes a while here

test("can register the oauth2 client and an account", async ({ context, page, homeserver, mailhogClient, mas }) => {
test("can register the oauth2 client and an account", async ({
context,
page,
homeserver,
mailhogClient,
mas,
}, testInfo) => {
await page.clock.install();

const tokenUri = `${mas.baseUrl}/oauth2/token`;
const tokenApiPromise = page.waitForRequest(

Check failure on line 30 in playwright/e2e/oidc/oidc-native.spec.ts

View workflow job for this annotation

GitHub Actions / Run Tests [Chrome] 6/6

[Chrome] › oidc/oidc-native.spec.ts:20:9 › OIDC Native › can register the oauth2 client and an account @no-firefox @no-webkit

2) [Chrome] › oidc/oidc-native.spec.ts:20:9 › OIDC Native › can register the oauth2 client and an account @no-firefox @no-webkit Error: page.waitForRequest: Test ended. 28 | 29 | const tokenUri = `${mas.baseUrl}/oauth2/token`; > 30 | const tokenApiPromise = page.waitForRequest( | ^ 31 | (request) => request.url() === tokenUri && request.postDataJSON()["grant_type"] === "authorization_code", 32 | ); 33 | at /home/runner/work/element-web/element-web/playwright/e2e/oidc/oidc-native.spec.ts:30:38
(request) => request.url() === tokenUri && request.postDataJSON()["grant_type"] === "authorization_code",
);

await page.goto("/#/login");
await page.getByRole("button", { name: "Continue" }).click();
await registerAccountMas(page, mailhogClient, "alice", "[email protected]", "Pa$sW0rD!");

const userId = `alice_${testInfo.testId}`;
await registerAccountMas(page, mailhogClient, userId, "[email protected]", "Pa$sW0rD!");

// Eventually, we should end up at the home screen.
await expect(page).toHaveURL(/\/#\/home$/, { timeout: 10000 });
await expect(page.getByRole("heading", { name: "Welcome alice", exact: true })).toBeVisible();
await expect(page.getByRole("heading", { name: `Welcome ${userId}`, exact: true })).toBeVisible();
await page.clock.runFor(20000); // run the timer so we see the token request

const tokenApiRequest = await tokenApiPromise;
expect(tokenApiRequest.postDataJSON()["grant_type"]).toBe("authorization_code");
Expand Down
4 changes: 2 additions & 2 deletions playwright/e2e/one-to-one-chat/one-to-one-chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const test = base.extend<{
test.describe("1:1 chat room", () => {
test.use({
displayName: "Jeff",
user2: async ({ homeserver }, use) => {
const credentials = await homeserver.registerUser("user1234", "p4s5W0rD", "Timmy");
user2: async ({ homeserver }, use, testInfo) => {
const credentials = await homeserver.registerUser(`user2_${testInfo.testId}`, "p4s5W0rD", "Timmy");
await use(credentials);
},
});
Expand Down
6 changes: 3 additions & 3 deletions playwright/e2e/share-dialog/share-dialog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

const dialog = page.getByRole("dialog", { name: "Share room" });
await expect(dialog.getByText(`https://matrix.to/#/${room.roomId}`)).toBeVisible();
expect(dialog).toMatchScreenshot("share-dialog-room.png", {
await expect(dialog).toMatchScreenshot("share-dialog-room.png", {
// QRCode and url changes at every run
mask: [page.locator(".mx_QRCode"), page.locator(".mx_ShareDialog_top > span")],
});
Expand All @@ -40,7 +40,7 @@

const dialog = page.getByRole("dialog", { name: "Share User" });
await expect(dialog.getByText(`https://matrix.to/#/${user.userId}`)).toBeVisible();
expect(dialog).toMatchScreenshot("share-dialog-user.png", {
await expect(dialog).toMatchScreenshot("share-dialog-user.png", {
// QRCode changes at every run
mask: [page.locator(".mx_QRCode")],
});
Expand All @@ -57,7 +57,7 @@

const dialog = page.getByRole("dialog", { name: "Share Room Message" });
await expect(dialog.getByRole("checkbox", { name: "Link to selected message" })).toBeChecked();
expect(dialog).toMatchScreenshot("share-dialog-event.png", {
await expect(dialog).toMatchScreenshot("share-dialog-event.png", {

Check failure on line 60 in playwright/e2e/share-dialog/share-dialog.spec.ts

View workflow job for this annotation

GitHub Actions / Run Tests [Chrome] 4/6

[Chrome] › share-dialog/share-dialog.spec.ts:49:9 › Share dialog › should share an event @screenshot

2) [Chrome] › share-dialog/share-dialog.spec.ts:49:9 › Share dialog › should share an event @screenshot Error: expect(locator).toHaveScreenshot(expected) 265 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/element-web/element-web/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-event-linux.png Received: /home/runner/work/element-web/element-web/playwright/test-results/share-dialog-share-dialog-Share-dialog-should-share-an-event-Chrome/share-dialog-event-actual.png Diff: /home/runner/work/element-web/element-web/playwright/test-results/share-dialog-share-dialog-Share-dialog-should-share-an-event-Chrome/share-dialog-event-diff.png Call log: - expect.toHaveScreenshot(share-dialog-event.png) with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog', { name: 'Share Room Message' }) - locator resolved to <div role="dialog" class="mx_ShareDialog" data-focus-lock-disabled="false" aria-describedby="mx_Dialog_content" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 265 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog', { name: 'Share Room Message' }) - locator resolved to <div role="dialog" class="mx_ShareDialog" data-focus-lock-disabled="false" aria-describedby="mx_Dialog_content" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 265 pixels (ratio 0.01 of all image pixels) are different. 58 | const dialog = page.getByRole("dialog", { name: "Share Room Message" }); 59 | await expect(dialog.getByRole("checkbox", { name: "Link to selected message" })).toBeChecked(); > 60 | await expect(dialog).toMatchScreenshot("share-dialog-event.png", { | ^ 61 | // QRCode and url changes at every run 62 | mask: [page.locator(".mx_QRCode"), page.locator(".mx_ShareDialog_top > span")], 63 | }); at /home/runner/work/element-web/element-web/playwright/e2e/share-dialog/share-dialog.spec.ts:60:30

Check failure on line 60 in playwright/e2e/share-dialog/share-dialog.spec.ts

View workflow job for this annotation

GitHub Actions / Run Tests [Chrome] 4/6

[Chrome] › share-dialog/share-dialog.spec.ts:49:9 › Share dialog › should share an event @screenshot

2) [Chrome] › share-dialog/share-dialog.spec.ts:49:9 › Share dialog › should share an event @screenshot Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) 265 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/element-web/element-web/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-event-linux.png Received: /home/runner/work/element-web/element-web/playwright/test-results/share-dialog-share-dialog-Share-dialog-should-share-an-event-Chrome-retry1/share-dialog-event-actual.png Diff: /home/runner/work/element-web/element-web/playwright/test-results/share-dialog-share-dialog-Share-dialog-should-share-an-event-Chrome-retry1/share-dialog-event-diff.png Call log: - expect.toHaveScreenshot(share-dialog-event.png) with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog', { name: 'Share Room Message' }) - locator resolved to <div role="dialog" class="mx_ShareDialog" data-focus-lock-disabled="false" aria-describedby="mx_Dialog_content" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 265 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog', { name: 'Share Room Message' }) - locator resolved to <div role="dialog" class="mx_ShareDialog" data-focus-lock-disabled="false" aria-describedby="mx_Dialog_content" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 265 pixels (ratio 0.01 of all image pixels) are different. 58 | const dialog = page.getByRole("dialog", { name: "Share Room Message" }); 59 | await expect(dialog.getByRole("checkbox", { name: "Link to selected message" })).toBeChecked(); > 60 | await expect(dialog).toMatchScreenshot("share-dialog-event.png", { | ^ 61 | // QRCode and url changes at every run 62 | mask: [page.locator(".mx_QRCode"), page.locator(".mx_ShareDialog_top > span")], 63 | }); at /home/runner/work/element-web/element-web/playwright/e2e/share-dialog/share-dialog.spec.ts:60:30

Check failure on line 60 in playwright/e2e/share-dialog/share-dialog.spec.ts

View workflow job for this annotation

GitHub Actions / Run Tests [Chrome] 4/6

[Chrome] › share-dialog/share-dialog.spec.ts:49:9 › Share dialog › should share an event @screenshot

2) [Chrome] › share-dialog/share-dialog.spec.ts:49:9 › Share dialog › should share an event @screenshot Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) 265 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/element-web/element-web/playwright/snapshots/share-dialog/share-dialog.spec.ts/share-dialog-event-linux.png Received: /home/runner/work/element-web/element-web/playwright/test-results/share-dialog-share-dialog-Share-dialog-should-share-an-event-Chrome-retry2/share-dialog-event-actual.png Diff: /home/runner/work/element-web/element-web/playwright/test-results/share-dialog-share-dialog-Share-dialog-should-share-an-event-Chrome-retry2/share-dialog-event-diff.png Call log: - expect.toHaveScreenshot(share-dialog-event.png) with timeout 5000ms - verifying given screenshot expectation - waiting for getByRole('dialog', { name: 'Share Room Message' }) - locator resolved to <div role="dialog" class="mx_ShareDialog" data-focus-lock-disabled="false" aria-describedby="mx_Dialog_content" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 265 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for getByRole('dialog', { name: 'Share Room Message' }) - locator resolved to <div role="dialog" class="mx_ShareDialog" data-focus-lock-disabled="false" aria-describedby="mx_Dialog_content" aria-labelledby="mx_BaseDialog_title">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 265 pixels (ratio 0.01 of all image pixels) are different. 58 | const dialog = page.getByRole("dialog", { name: "Share Room Message" }); 59 | await expect(dialog.getByRole("checkbox", { name: "Link to selected message" })).toBeChecked(); > 60 | await expect(dialog).toMatchScreenshot("share-dialog-event.png", { | ^ 61 | // QRCode and url changes at every run 62 | mask: [page.locator(".mx_QRCode"), page.locator(".mx_ShareDialog_top > span")], 63 | }); at /home/runner/work/element-web/element-web/playwright/e2e/share-dialog/share-dialog.spec.ts:60:30
// QRCode and url changes at every run
mask: [page.locator(".mx_QRCode"), page.locator(".mx_ShareDialog_top > span")],
});
Expand Down
1 change: 0 additions & 1 deletion playwright/e2e/sliding-sync/sliding-sync.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
};

// Load the user fixture for all tests
test.beforeEach(({ user }) => {});

Check failure on line 86 in playwright/e2e/sliding-sync/sliding-sync.spec.ts

View workflow job for this annotation

GitHub Actions / Run Tests [Chrome] 4/6

[Chrome] › sliding-sync/sliding-sync.spec.ts:191:5 › Sliding Sync › should not show unread indicators

5) [Chrome] › sliding-sync/sliding-sync.spec.ts:191:5 › Sliding Sync › should not show unread indicators Test timeout of 30000ms exceeded while running "beforeEach" hook. 84 | 85 | // Load the user fixture for all tests > 86 | test.beforeEach(({ user }) => {}); | ^ 87 | 88 | test("should render the Rooms list in reverse chronological order by default and allowing sorting A-Z", async ({ 89 | page, at /home/runner/work/element-web/element-web/playwright/e2e/sliding-sync/sliding-sync.spec.ts:86:10

test("should render the Rooms list in reverse chronological order by default and allowing sorting A-Z", async ({
page,
Expand All @@ -108,7 +108,6 @@
await page.getByRole("menuitemradio", { name: "A-Z" }).dispatchEvent("click");
await expect(page.locator(".mx_StyledRadioButton_checked").getByText("A-Z")).toBeVisible();

await page.pause();
await checkOrder(["Apple", "Orange", "Pineapple", "Test Room"], page);
});

Expand Down
Loading
Loading