Localazy Download (#32808)

* [create-pull-request] automated change

* test: update SC tests

* test: update SC screenshots

* test: update EW snapshots

* test: update EW tests

* test: update EW e2e tests

---------

Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
This commit is contained in:
ElementRobot
2026-03-18 16:53:28 +01:00
committed by GitHub
parent 2128c1884c
commit 8a38a2fe4a
105 changed files with 535 additions and 836 deletions
@@ -57,7 +57,7 @@ test.describe("Encryption state after registration", () => {
await page.getByRole("textbox", { name: "Name" }).fill("test room");
await page.getByRole("button", { name: "Create room" }).click();
await expect(page.getByRole("heading", { name: "Set up recovery" })).toBeVisible();
await expect(page.getByRole("heading", { name: "Back up your chats" })).toBeVisible();
});
});
@@ -22,7 +22,7 @@ test.describe("Complete security", () => {
async ({ page, credentials, homeserver }) => {
await createBot(page, homeserver, credentials, true);
await logIntoElement(page, credentials);
await expect(page.getByRole("heading", { name: "Confirm your identity" })).toBeVisible();
await expect(page.getByRole("heading", { name: "Confirm your digital identity" })).toBeVisible();
await expect(page.getByRole("main")).toMatchScreenshot("complete-security.png");
},
);
@@ -45,6 +45,8 @@ test.describe("Cryptography", function () {
// Log in again, and see how the message looks.
await logIntoElement(page, credentials);
// Dismiss the "Back up your chats" toast, otherwise it gets in the way of clicking the room list
await page.getByRole("button", { name: "Dismiss" }).click();
await app.viewRoomByName("Test room");
const lastTile = page.locator(".mx_EventTile").last();
await expect(lastTile).toContainText("Historical messages are not available on this device");
@@ -42,7 +42,7 @@ test.describe("Dehydration", () => {
await page.getByRole("button", { name: "Continue" }).click();
// Set up recovery
await page.getByRole("button", { name: "Set up recovery" }).click();
await page.getByRole("button", { name: "Get recovery key" }).click();
await page.getByRole("button", { name: "Continue" }).click();
const recoveryKey = await page.getByTestId("recoveryKey").innerText();
await page.getByRole("button", { name: "Continue" }).click();
@@ -59,14 +59,14 @@ test.describe("Dehydration", () => {
await expect(sessionsTab.getByText("Dehydrated device")).not.toBeVisible();
});
test("'Set up recovery' creates dehydrated device", async ({ app, credentials, page }) => {
test("'Get recovery key' creates dehydrated device", async ({ app, credentials, page }) => {
await logIntoElement(page, credentials);
const settingsDialogLocator = await app.settings.openUserSettings("Encryption");
await settingsDialogLocator.getByRole("button", { name: "Set up recovery" }).click();
await settingsDialogLocator.getByRole("button", { name: "Get recovery key" }).click();
// First it displays an informative panel about the recovery key
await expect(settingsDialogLocator.getByRole("heading", { name: "Set up recovery" })).toBeVisible();
await expect(settingsDialogLocator.getByRole("heading", { name: "Get recovery key" })).toBeVisible();
await settingsDialogLocator.getByRole("button", { name: "Continue" }).click();
// Next, it displays the new recovery key. We click on the copy button.
@@ -86,7 +86,7 @@ test.describe("Dehydration", () => {
await expectDehydratedDeviceEnabled(app);
});
test("Reset identity during login and set up recovery re-creates dehydrated device", async ({
test("Reset identity during login and back up your chats re-creates dehydrated device", async ({
page,
homeserver,
app,
@@ -108,7 +108,7 @@ test.describe("Dehydration", () => {
// Oh no, we forgot our recovery key - reset our identity
await page.locator(".mx_AuthPage").getByRole("button", { name: "Can't confirm" }).click();
await expect(
page.getByRole("heading", { name: "Are you sure you want to reset your identity?" }),
page.getByRole("heading", { name: "Are you sure you want to reset your digital identity?" }),
).toBeVisible();
await page.getByRole("button", { name: "Continue", exact: true }).click();
await page.getByPlaceholder("Password").fill(credentials.password);
@@ -116,7 +116,7 @@ test.describe("Dehydration", () => {
// And set up recovery
const settings = await app.settings.openUserSettings("Encryption");
await settings.getByRole("button", { name: "Set up recovery" }).click();
await settings.getByRole("button", { name: "Get recovery key" }).click();
await settings.getByRole("button", { name: "Continue" }).click();
const recoveryKey = await settings.getByTestId("recoveryKey").innerText();
await settings.getByRole("button", { name: "Continue" }).click();
@@ -133,10 +133,10 @@ test.describe("Dehydration", () => {
// Create a dehydrated device by setting up recovery (see "'Set up
// recovery' creates dehydrated device" test above)
const settingsDialogLocator = await app.settings.openUserSettings("Encryption");
await settingsDialogLocator.getByRole("button", { name: "Set up recovery" }).click();
await settingsDialogLocator.getByRole("button", { name: "Get recovery key" }).click();
// First it displays an informative panel about the recovery key
await expect(settingsDialogLocator.getByRole("heading", { name: "Set up recovery" })).toBeVisible();
await expect(settingsDialogLocator.getByRole("heading", { name: "Get recovery key" })).toBeVisible();
await settingsDialogLocator.getByRole("button", { name: "Continue" }).click();
// Next, it displays the new recovery key. We click on the copy button.
@@ -302,7 +302,7 @@ test.describe("Cryptography", function () {
const last = page.locator(".mx_EventTile_last");
await expect(last).toContainText("test encrypted from user that was previously verified");
const lastE2eIcon = last.locator(".mx_EventTile_e2eIcon");
await expect(lastE2eIcon).toHaveAccessibleName("Sender's verified identity was reset");
await expect(lastE2eIcon).toHaveAccessibleName("Sender's verified digital identity was reset");
await expect(lastE2eIcon).toMatchScreenshot("event-shield-identity-reset.png");
},
);
@@ -52,6 +52,6 @@ test.describe("Invisible cryptography", () => {
/* should show an error for a message from a previously verified device */
await bobSecondDevice.sendMessage(testRoomId, "test encrypted from user that was previously verified");
const lastTile = page.locator(".mx_EventTile_last");
await expect(lastTile).toContainText("Sender's verified identity was reset");
await expect(lastTile).toContainText("Sender's verified digital identity was reset");
});
});
@@ -23,7 +23,7 @@ test.describe("Logout tests", () => {
await sendMessageInCurrentRoom(page, "Hello secret world");
const locator = await app.settings.openUserMenu();
await locator.getByRole("menuitem", { name: "Sign out", exact: true }).click();
await locator.getByRole("menuitem", { name: "Remove this device", exact: true }).click();
const currentDialogLocator = page.locator(".mx_Dialog");
@@ -41,11 +41,11 @@ test.describe("Logout tests", () => {
await sendMessageInCurrentRoom(page, "Hello secret world");
const locator = await app.settings.openUserMenu();
await locator.getByRole("menuitem", { name: "Sign out", exact: true }).click();
await locator.getByRole("menuitem", { name: "Remove this device", exact: true }).click();
const currentDialogLocator = page.locator(".mx_Dialog");
await expect(currentDialogLocator.getByText("Are you sure you want to sign out?")).toBeVisible();
await expect(currentDialogLocator.getByText("Are you sure you want to Remove this device?")).toBeVisible();
});
test("Logout directly if the user has no room keys", async ({ page, app }) => {
@@ -54,7 +54,7 @@ test.describe("Logout tests", () => {
await sendMessageInCurrentRoom(page, "Hello public world!");
const locator = await app.settings.openUserMenu();
await locator.getByRole("menuitem", { name: "Sign out", exact: true }).click();
await locator.getByRole("menuitem", { name: "Remove this device", exact: true }).click();
// Should have logged out directly
await expect(page.getByRole("heading", { name: "Sign in" })).toBeVisible();
@@ -61,7 +61,9 @@ test.describe("Key storage out of sync toast", () => {
await page.getByRole("button", { name: "Forgot recovery key?" }).click();
await expect(
page.getByRole("heading", { name: "Forgot your recovery key? Youll need to reset your identity." }),
page.getByRole("heading", {
name: "Forgot your recovery key? Youll need to reset your digital identity.",
}),
).toBeVisible();
});
});
+3 -3
View File
@@ -252,11 +252,11 @@ export async function logIntoElementAndVerify(page: Page, credentials: Credentia
*/
export async function logOutOfElement(page: Page, discardKeys: boolean = false) {
await page.getByRole("button", { name: "User menu" }).click();
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Sign out" }).click();
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Remove this device" }).click();
if (discardKeys) {
await page.getByRole("button", { name: "I don't want my encrypted messages" }).click();
} else {
await page.locator(".mx_Dialog .mx_QuestionDialog").getByRole("button", { name: "Sign out" }).click();
await page.locator(".mx_Dialog .mx_QuestionDialog").getByRole("button", { name: "Remove this device" }).click();
}
// Wait for the login page to load
@@ -315,7 +315,7 @@ export async function enableKeyBackup(app: ElementAppPage): Promise<string> {
await encryptionTab.getByRole("switch", { name: "Allow key storage" }).click();
}
await encryptionTab.getByRole("button", { name: "Set up recovery" }).click();
await encryptionTab.getByRole("button", { name: "Get recovery key" }).click();
await encryptionTab.getByRole("button", { name: "Continue" }).click();
const recoveryKey = await encryptionTab.getByTestId("recoveryKey").innerText();
@@ -185,7 +185,9 @@ test.describe("Login", () => {
await page.goto("/");
await login(page, homeserver, credentials);
await expect(page.getByRole("heading", { name: "Confirm your identity", level: 2 })).toBeVisible();
await expect(
page.getByRole("heading", { name: "Confirm your digital identity", level: 2 }),
).toBeVisible();
await expect(page.getByRole("button", { name: "Skip verification for now" })).toBeVisible();
});
@@ -218,7 +220,9 @@ test.describe("Login", () => {
await page.goto("/");
await login(page, homeserver, credentials);
await expect(page.getByRole("heading", { name: "Confirm your identity", level: 2 })).toBeVisible();
await expect(
page.getByRole("heading", { name: "Confirm your digital identity", level: 2 }),
).toBeVisible();
await expect(page.getByRole("button", { name: "Skip verification for now" })).toBeVisible();
});
@@ -253,7 +257,7 @@ test.describe("Login", () => {
await page.goto("/");
await login(page, homeserver, credentials);
const h2 = page.getByRole("heading", { name: "Confirm your identity", level: 2 });
const h2 = page.getByRole("heading", { name: "Confirm your digital identity", level: 2 });
await expect(h2).toBeVisible();
await expect(h2.locator(".mx_CompleteSecurity_skip")).toHaveCount(0);
@@ -273,7 +277,7 @@ test.describe("Login", () => {
// Load the page and see that we are asked to verify
await page.goto("/#/welcome");
await login(page, homeserver, credentials);
let h2 = page.getByRole("heading", { name: "Confirm your identity", level: 2 });
let h2 = page.getByRole("heading", { name: "Confirm your digital identity", level: 2 });
await expect(h2).toBeVisible();
// Click "Use another device"
@@ -283,7 +287,7 @@ test.describe("Login", () => {
await page.getByRole("button", { name: "Close dialog" }).click();
// Check that we are still being asked to verify
h2 = page.getByRole("heading", { name: "Confirm your identity", level: 2 });
h2 = page.getByRole("heading", { name: "Confirm your digital identity", level: 2 });
await expect(h2).toBeVisible();
});
});
@@ -302,7 +306,9 @@ test.describe("Login", () => {
await page.goto("/");
await login(page, homeserver, credentials);
await expect(page.getByRole("heading", { name: "Confirm your identity", level: 2 })).toBeVisible();
await expect(
page.getByRole("heading", { name: "Confirm your digital identity", level: 2 }),
).toBeVisible();
// Start the reset process
await page.getByRole("button", { name: "Can't confirm?" }).click();
@@ -335,7 +341,10 @@ test.describe("Login", () => {
// Allow the outstanding requests queue to settle before logging out
await page.waitForTimeout(2000);
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Sign out" }).click();
await page
.locator(".mx_UserMenu_contextMenu")
.getByRole("menuitem", { name: "Remove this device" })
.click();
await expect(page).toHaveURL(/\/#\/login$/);
});
});
@@ -29,7 +29,7 @@ test.describe("logout with logout_redirect_url", () => {
// give a change for the outstanding requests queue to settle before logging out
await page.waitForTimeout(2000);
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Sign out" }).click();
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Remove this device" }).click();
await expect(page).toHaveURL(/\/decoder-ring\/$/);
});
});
@@ -74,7 +74,7 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
(request) => request.url() === revokeUri && request.postDataJSON()["token_type_hint"] === "refresh_token",
);
const locator = await app.settings.openUserMenu();
await locator.getByRole("menuitem", { name: "Sign out", exact: true }).click();
await locator.getByRole("menuitem", { name: "Remove this device", exact: true }).click();
await revokeAccessTokenPromise;
await revokeRefreshTokenPromise;
});
@@ -98,7 +98,7 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
await page.goto("http://localhost:8080");
await expect(
page.getByText("For security, this session has been signed out. Please sign in again."),
page.getByText("For security, this session has been removed. Please sign in again."),
).toBeVisible();
//await expect(page).toMatchScreenshot("token-expired.png", { includeDialogBackground: true });
@@ -122,7 +122,7 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
// Allow the outstanding requests queue to settle before logging out
await page.waitForTimeout(2000);
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Sign out" }).click();
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Remove this device" }).click();
await expect(page).toHaveURL(/\/#\/login$/);
// Log in again
@@ -131,7 +131,7 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
await page.getByRole("button", { name: "Continue" }).click();
// We should be in
await expect(page.getByText("Confirm your identity")).toBeVisible();
await expect(page.getByText("Confirm your digital identity")).toBeVisible();
});
test.describe("with force_verification on", () => {
@@ -154,7 +154,10 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
await page.getByRole("button", { name: "User menu" }).click();
await expect(page.getByText(userId, { exact: true })).toBeVisible();
await page.waitForTimeout(2000);
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Sign out" }).click();
await page
.locator(".mx_UserMenu_contextMenu")
.getByRole("menuitem", { name: "Remove this device" })
.click();
await expect(page).toHaveURL(/\/#\/login$/);
// Log in again
@@ -163,7 +166,7 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
await page.getByRole("button", { name: "Continue" }).click();
// We should be being warned that we need to verify (but we can't)
await expect(page.getByText("Confirm your identity")).toBeVisible();
await expect(page.getByText("Confirm your digital identity")).toBeVisible();
// And there should be no way to close this prompt
await expect(page.getByRole("button", { name: "Skip verification for now" })).not.toBeVisible();
@@ -198,7 +201,10 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
await page.getByRole("button", { name: "User menu" }).click();
await expect(page.getByText(userId, { exact: true })).toBeVisible();
await page.waitForTimeout(2000);
await page.locator(".mx_UserMenu_contextMenu").getByRole("menuitem", { name: "Sign out" }).click();
await page
.locator(".mx_UserMenu_contextMenu")
.getByRole("menuitem", { name: "Remove this device" })
.click();
await expect(page).toHaveURL(/\/#\/login$/);
// Log in again
@@ -59,7 +59,7 @@ test.describe("Device manager", () => {
await filteredDeviceListItems.last().click({ force: true });
// sign out from list selection action buttons
await tab.getByRole("button", { name: "Sign out", exact: true }).click();
await tab.getByRole("button", { name: "Remove this device", exact: true }).click();
await page.getByRole("dialog").getByTestId("dialog-primary-button").click();
// list updated after sign out
@@ -88,7 +88,7 @@ test.describe("Device manager", () => {
await expect(firstSession.locator(".mx_DeviceTile h4").getByText(sessionName)).toBeVisible();
// sign out using the device details sign out
await firstSession.getByRole("button", { name: "Sign out of this session" }).click();
await firstSession.getByRole("button", { name: "Remove this session" }).click();
// confirm the signout
await page.getByRole("dialog").getByTestId("dialog-primary-button").click();
@@ -64,7 +64,7 @@ test.describe("Advanced section in Encryption tab", () => {
// After resetting the identity, the user should set up a new recovery key
await expect(
util.getEncryptionRecoverySection().getByRole("button", { name: "Set up recovery" }),
util.getEncryptionRecoverySection().getByRole("button", { name: "Get recovery key" }),
).toBeVisible();
await checkDeviceIsCrossSigned(app);
@@ -111,7 +111,7 @@ test.describe("Encryption tab", () => {
// The user is prompted to reset their identity
await expect(
dialog.getByText("Forgot your recovery key? Youll need to reset your identity."),
dialog.getByText("Forgot your recovery key? Youll need to reset your digital identity."),
).toBeVisible();
});
@@ -59,13 +59,13 @@ test.describe("Recovery section in Encryption tab", () => {
// The key backup is deleted and the user needs to set it up
const dialog = await util.openEncryptionTab();
const setupButton = dialog.getByRole("button", { name: "Set up recovery" });
const setupButton = dialog.getByRole("button", { name: "Get recovery key" });
await expect(setupButton).toBeVisible();
await expect(util.getEncryptionRecoverySection()).toMatchScreenshot("set-up-recovery.png");
await setupButton.click();
// Display an informative panel about the recovery key
await expect(dialog.getByRole("heading", { name: "Set up recovery" })).toBeVisible();
await expect(dialog.getByRole("heading", { name: "Get recovery key" })).toBeVisible();
await expect(util.getEncryptionTabContent()).toMatchScreenshot("set-up-key-1-encryption-tab.png");
await dialog.getByRole("button", { name: "Continue" }).click();