Skip to content

Commit

Permalink
test(e2e): verify session with the encryption tab instead of the secu…
Browse files Browse the repository at this point in the history
…rity & privacy tab (#29090)
  • Loading branch information
florianduros authored Jan 24, 2025
1 parent 9b6be0f commit b36d9ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions playwright/e2e/crypto/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,19 @@ export async function logOutOfElement(page: Page, discardKeys: boolean = false)
}

/**
* Open the security settings, and verify the current session using the security key.
* Open the encryption settings, and verify the current session using the security key.
*
* @param app - `ElementAppPage` wrapper for the playwright `Page`.
* @param securityKey - The security key (i.e., 4S key), set up during a previous session.
*/
export async function verifySession(app: ElementAppPage, securityKey: string) {
const settings = await app.settings.openUserSettings("Security & Privacy");
await settings.getByRole("button", { name: "Verify this session" }).click();
const settings = await app.settings.openUserSettings("Encryption");
await settings.getByRole("button", { name: "Verify this device" }).click();
await app.page.getByRole("button", { name: "Verify with Security Key" }).click();
await app.page.locator(".mx_Dialog").locator('input[type="password"]').fill(securityKey);
await app.page.getByRole("button", { name: "Continue", disabled: false }).click();
await app.page.getByRole("button", { name: "Done" }).click();
await app.settings.closeDialog();
}

/**
Expand Down

0 comments on commit b36d9ce

Please sign in to comment.