diff --git a/playwright/e2e/crypto/backups-mas.spec.ts b/playwright/e2e/crypto/backups-mas.spec.ts index 84707eb49dc..6519a484e9f 100644 --- a/playwright/e2e/crypto/backups-mas.spec.ts +++ b/playwright/e2e/crypto/backups-mas.spec.ts @@ -11,6 +11,7 @@ import { registerAccountMas } from "../oidc"; import { isDendrite } from "../../plugins/homeserver/dendrite"; import { TestClientServerAPI } from "../csAPI"; import { masHomeserver } from "../../plugins/homeserver/synapse/masHomeserver.ts"; +import { checkDeviceIsConnectedKeyBackup } from "./utils"; // These tests register an account with MAS because then we go through the "normal" registration flow // and crypto gets set up. Using the 'user' fixture create a user and synthesizes an existing login, @@ -24,8 +25,11 @@ test.describe("Encryption state after registration", () => { await page.getByRole("button", { name: "Continue" }).click(); await registerAccountMas(page, mailpitClient, `alice_${testInfo.testId}`, "alice@email.com", "Pa$sW0rD!"); - await app.settings.openUserSettings("Security & Privacy"); - await expect(page.getByText("This session is backing up your keys.")).toBeVisible(); + // Wait for the ui to load + await expect(page.locator(".mx_MatrixChat")).toBeVisible(); + + // Recovery is not set up yet + await checkDeviceIsConnectedKeyBackup(app, "1", true, false); }); test("user is prompted to set up recovery", async ({ page, mailpitClient, app }, testInfo) => { diff --git a/playwright/e2e/crypto/utils.ts b/playwright/e2e/crypto/utils.ts index a9fa14a277d..58086e46f48 100644 --- a/playwright/e2e/crypto/utils.ts +++ b/playwright/e2e/crypto/utils.ts @@ -145,11 +145,13 @@ export async function checkDeviceIsCrossSigned(app: ElementAppPage): Promise { // Sanity check the given backup version: if it's null, something went wrong earlier in the test. if (!expectedBackupVersion) { @@ -192,7 +194,7 @@ export async function checkDeviceIsConnectedKeyBackup( // The active backup version is as expected expect(activeBackupVersion).toBe(expectedBackupVersion); // The backup key is stored in 4S - expect(backupKeyIn4S).toBe(true); + if (checkBackupKeyIn4S) expect(backupKeyIn4S).toBe(true); if (checkBackupPrivateKeyInCache) { // The backup key is available locally