Show a progress bar while migrating from legacy crypto (#12104)

* Show a progress bar during migration of crypto data

* playwright: add new `pageWithCredentials` fixture

* Add a playwright test for migration progress

* Add documentation for `idbSave`
This commit is contained in:
Richard van der Hoff 2024-01-17 07:14:49 +00:00 committed by GitHub
parent 2d3351bb33
commit 993a7029b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 72194 additions and 5 deletions

View file

@ -73,6 +73,16 @@ export const test = base.extend<
homeserver: HomeserverInstance;
oAuthServer: { port: number };
credentials: CredentialsWithDisplayName;
/**
* The same as {@link https://playwright.dev/docs/api/class-fixtures#fixtures-page|`page`},
* but adds an initScript which will populate localStorage with the user's details from
* {@link #credentials} and {@link #homeserver}.
*
* Similar to {@link #user}, but doesn't load the app.
*/
pageWithCredentials: Page;
user: CredentialsWithDisplayName;
displayName?: string;
app: ElementAppPage;
@ -163,7 +173,8 @@ export const test = base.extend<
});
},
labsFlags: [],
user: async ({ page, homeserver, credentials }, use) => {
pageWithCredentials: async ({ page, homeserver, credentials }, use) => {
await page.addInitScript(
({ baseUrl, credentials }) => {
// Seed the localStorage with the required credentials
@ -180,9 +191,12 @@ export const test = base.extend<
},
{ baseUrl: homeserver.config.baseUrl, credentials },
);
await use(page);
},
user: async ({ pageWithCredentials: page, credentials }, use) => {
await page.goto("/");
await page.waitForSelector(".mx_MatrixChat", { timeout: 30000 });
await use(credentials);
},