diff --git a/playwright/e2e/invite/invite-dialog.spec.ts b/playwright/e2e/invite/invite-dialog.spec.ts index 197b686318..98a57c8eb1 100644 --- a/playwright/e2e/invite/invite-dialog.spec.ts +++ b/playwright/e2e/invite/invite-dialog.spec.ts @@ -48,9 +48,7 @@ test.describe("Invite dialog", function () { // Assert that the bar is rendered await expect(other.locator(".mx_InviteDialog_addressBar")).toBeVisible(); - await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-room-without-user.png", { - mask: [page.locator(".mx_InviteDialog_helpText_userId")], - }); + await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-room-without-user.png"); await expect(other.locator(".mx_InviteDialog_identityServer")).not.toBeVisible(); @@ -71,9 +69,7 @@ test.describe("Invite dialog", function () { ).toBeVisible(); // Take a snapshot of the invite dialog with a user pill - await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-room-with-user-pill.png", { - mask: [page.locator(".mx_InviteDialog_helpText_userId")], - }); + await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-room-with-user-pill.png"); // Invite the bot await other.getByRole("button", { name: "Invite" }).click(); @@ -96,9 +92,7 @@ test.describe("Invite dialog", function () { await expect(other.locator(".mx_InviteDialog_addressBar")).toBeVisible(); // Take a snapshot of the invite dialog - await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-dm-without-user.png", { - mask: [page.locator(".mx_InviteDialog_footer_link, .mx_InviteDialog_helpText a")], - }); + await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-dm-without-user.png"); await other.getByTestId("invite-dialog-input").fill(bot.credentials.userId); @@ -110,9 +104,7 @@ test.describe("Invite dialog", function () { ).toBeVisible(); // Take a snapshot of the invite dialog with a user pill - await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-dm-with-user-pill.png", { - mask: [page.locator(".mx_InviteDialog_footer_link, .mx_InviteDialog_helpText a")], - }); + await expect(page.locator(".mx_Dialog")).toMatchScreenshot("invite-dialog-dm-with-user-pill.png"); // Open a direct message UI await other.getByRole("button", { name: "Go" }).click(); diff --git a/playwright/e2e/right-panel/file-panel.spec.ts b/playwright/e2e/right-panel/file-panel.spec.ts index 0d227b016c..9d1d4abc09 100644 --- a/playwright/e2e/right-panel/file-panel.spec.ts +++ b/playwright/e2e/right-panel/file-panel.spec.ts @@ -136,8 +136,8 @@ test.describe("FilePanel", () => { // Take a snapshot of file tiles list on FilePanel await expect(filePanelMessageList).toMatchScreenshot("file-tiles-list.png", { - // Exclude timestamps, profile & flaky seek bar from snapshot - mask: [page.locator(".mx_MessageTimestamp, .mx_DisambiguatedProfile, .mx_AudioPlayer_seek")], + // Exclude timestamps & flaky seek bar from snapshot + mask: [page.locator(".mx_MessageTimestamp, .mx_AudioPlayer_seek")], }); }); diff --git a/playwright/e2e/settings/general-user-settings-tab.spec.ts b/playwright/e2e/settings/general-user-settings-tab.spec.ts index 1935af52f2..d6d138db5b 100644 --- a/playwright/e2e/settings/general-user-settings-tab.spec.ts +++ b/playwright/e2e/settings/general-user-settings-tab.spec.ts @@ -35,10 +35,7 @@ test.describe("General user settings tab", () => { }); test("should be rendered properly", async ({ uut }) => { - await expect(uut).toMatchScreenshot("general.png", { - // Exclude userId from snapshots - mask: [uut.locator(".mx_ProfileSettings_profile_controls > p")], - }); + await expect(uut).toMatchScreenshot("general.png"); // Assert that the top heading is rendered await expect(uut.getByRole("heading", { name: "General" })).toBeVisible(); diff --git a/playwright/element-web-test.ts b/playwright/element-web-test.ts index e2e1729a4b..971dd11d11 100644 --- a/playwright/element-web-test.ts +++ b/playwright/element-web-test.ts @@ -129,12 +129,11 @@ export const test = base.extend< displayName: undefined, credentials: async ({ homeserver, displayName: testDisplayName }, use) => { const names = ["Alice", "Bob", "Charlie", "Daniel", "Eve", "Frank", "Grace", "Hannah", "Isaac", "Judy"]; - const username = _.uniqueId("user_"); const password = _.uniqueId("password_"); const displayName = testDisplayName ?? _.sample(names)!; - const credentials = await homeserver.registerUser(username, password, displayName); - console.log(`Registered test user ${username} with displayname ${displayName}`); + const credentials = await homeserver.registerUser("user", password, displayName); + console.log(`Registered test user @user:localhost with displayname ${displayName}`); await use({ ...credentials, diff --git a/playwright/pages/bot.ts b/playwright/pages/bot.ts index f005880095..fd122680c4 100644 --- a/playwright/pages/bot.ts +++ b/playwright/pages/bot.ts @@ -70,7 +70,12 @@ export class Bot extends Client { private async getCredentials(): Promise { if (this.credentials) return this.credentials; - const username = uniqueId(this.opts.userIdPrefix); + // We want to pad the uniqueId but not the prefix + const username = + this.opts.userIdPrefix + + uniqueId(this.opts.userIdPrefix) + .substring(this.opts.userIdPrefix?.length ?? 0) + .padStart(4, "0"); const password = uniqueId("password_"); console.log(`getBot: Create bot user ${username} with opts ${JSON.stringify(this.opts)}`); this.credentials = await this.homeserver.registerUser(username, password, this.opts.displayName); diff --git a/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-dm-with-user-pill-linux.png b/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-dm-with-user-pill-linux.png index 291c14aba2..63b3d1ed37 100644 Binary files a/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-dm-with-user-pill-linux.png and b/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-dm-with-user-pill-linux.png differ diff --git a/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-dm-without-user-linux.png b/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-dm-without-user-linux.png index b9c770d574..663505b4c5 100644 Binary files a/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-dm-without-user-linux.png and b/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-dm-without-user-linux.png differ diff --git a/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-room-with-user-pill-linux.png b/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-room-with-user-pill-linux.png index 4cc8edbe92..a576969a41 100644 Binary files a/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-room-with-user-pill-linux.png and b/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-room-with-user-pill-linux.png differ diff --git a/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-room-without-user-linux.png b/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-room-without-user-linux.png index 3dfcb57737..d06d9e8164 100644 Binary files a/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-room-without-user-linux.png and b/playwright/snapshots/invite/invite-dialog.spec.ts/invite-dialog-room-without-user-linux.png differ diff --git a/playwright/snapshots/right-panel/file-panel.spec.ts/file-tiles-list-linux.png b/playwright/snapshots/right-panel/file-panel.spec.ts/file-tiles-list-linux.png index 602a80e5ee..ad49c25abc 100644 Binary files a/playwright/snapshots/right-panel/file-panel.spec.ts/file-tiles-list-linux.png and b/playwright/snapshots/right-panel/file-panel.spec.ts/file-tiles-list-linux.png differ diff --git a/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png b/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png index d70e3667c9..ca7b77112b 100644 Binary files a/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png and b/playwright/snapshots/settings/general-user-settings-tab.spec.ts/general-linux.png differ