Playwright test for device rehydration (#34091)

* 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.
This commit is contained in:
Richard van der Hoff
2026-07-02 09:51:22 +00:00
committed by GitHub
parent 20dad858c5
commit f354453cab
4 changed files with 83 additions and 82 deletions
+27
View File
@@ -406,6 +406,7 @@ export async function copyAndContinue(page: Page) {
* @param opts - other options for the createRoom call
*
* @returns a promise which resolves to the room ID
* @see createSharedEncryptedRoomWithUser
*/
export async function createSharedRoomWithUser(
app: ElementAppPage,
@@ -423,6 +424,32 @@ export async function createSharedRoomWithUser(
return roomId;
}
/**
* Create a shared, encrypted room with the given user, and wait for them to join
*
* @param other - UserID of the other user
* @param opts - other options for the createRoom call
*
* @returns a promise which resolves to the room ID
* @see createSharedRoomWithUser
*/
export async function createSharedEncryptedRoomWithUser(
app: ElementAppPage,
other: string,
opts: Omit<ICreateRoomOpts, "invite"> = { name: "TestRoom" },
): Promise<string> {
opts = structuredClone(opts);
opts.initial_state ??= [];
opts.initial_state.push({
type: "m.room.encryption",
state_key: "",
content: {
algorithm: "m.megolm.v1.aes-sha2",
},
});
return createSharedRoomWithUser(app, other, opts);
}
/**
* Send a message in the current room
* @param page