Skip to content

Commit

Permalink
Add playwright test for key backup by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dbkr committed Dec 13, 2024
1 parent 3f740a2 commit 9c3041d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions playwright/e2e/crypto/backups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Please see LICENSE files in the repository root for full details.
import { type Page } from "@playwright/test";

import { test, expect } from "../../element-web-test";
import { test as masTest } from "../oidc";

Check failure on line 12 in playwright/e2e/crypto/backups.spec.ts

View workflow job for this annotation

GitHub Actions / ESLint

'../oidc' imported multiple times
import { registerAccountMas } from "../oidc";

Check failure on line 13 in playwright/e2e/crypto/backups.spec.ts

View workflow job for this annotation

GitHub Actions / ESLint

'../oidc' imported multiple times
import { isDendrite } from "../../plugins/homeserver/dendrite";

async function expectBackupVersionToBe(page: Page, version: string) {
await expect(page.locator(".mx_SecureBackupPanel_statusList tr:nth-child(5) td")).toHaveText(
Expand All @@ -18,6 +21,19 @@ async function expectBackupVersionToBe(page: Page, version: string) {
await expect(page.locator(".mx_SecureBackupPanel_statusList tr:nth-child(6) td")).toHaveText(version);
}

masTest.describe("Key backup is enabled by default after registration", () => {
masTest.skip(isDendrite, "does not yet support MAS");

masTest("Key backup is enabled by default after registration", async ({ page, mailhog, app }) => {
await page.goto("/#/login");
await page.getByRole("button", { name: "Continue" }).click();
await registerAccountMas(page, mailhog.api, "alice", "[email protected]", "Pa$sW0rD!");

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

test.describe("Backups", () => {
test.use({
displayName: "Hanako",
Expand Down

0 comments on commit 9c3041d

Please sign in to comment.