Playwright test for dehydrated devices with MAS (#34095)

* Device dehydration tests: use common util for recovery setup

We have a utility method for setting up the recovery key, so let's use it.

* Factor out shared method for creating encrypted rooms

* Playwright test for device dehydration

Add a playwright test to check that this stuff actually works.

* Factor out `verifyAfterLogin` as a separate function

* Playwright test for dehydrated devices with MAS
This commit is contained in:
Richard van der Hoff
2026-07-02 13:07:57 +00:00
committed by GitHub
parent f93f68056a
commit 1b9aff2fb1
5 changed files with 98 additions and 13 deletions
+5 -5
View File
@@ -216,14 +216,14 @@ export async function logIntoElement(page: Page, credentials: Credentials) {
}
/**
* Fill in the login form in Element with the given creds, and then complete the `CompleteSecurity` step, using the
* given recovery key. (Normally this will verify the new device using the secrets from 4S.)
* Complete the `CompleteSecurity` step that happens after login, using the given recovery key.
* (Normally this will verify the new device using the secrets from 4S.)
*
* Afterwards, waits for the application to redirect to the home page.
*
* This is normally useful after a call to {@link logIntoElement} or {@link logInAccountMas}.
*/
export async function logIntoElementAndVerify(page: Page, credentials: Credentials, recoveryKey: string) {
await logIntoElement(page, credentials);
export async function verifyAfterLogin(page: Page, recoveryKey: string) {
await page.locator(".mx_AuthPage").getByRole("button", { name: "Use recovery key" }).click();
const useSecurityKey = page.locator(".mx_Dialog").getByRole("button", { name: "Use recovery key" });