1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

Improvements to Playwright test infrastructure (#12260)

* Move mailhog fixture to element-web-test.ts

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Remove spurious debug log

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Lazily set up ElementAppPage subfixtures to avoid conflicting on network routing

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update playwright/e2e/crypto/utils.ts

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2024-02-19 17:26:32 +00:00
committed by GitHub
parent 300f30eca9
commit 0e22413885
4 changed files with 27 additions and 15 deletions

View File

@ -24,7 +24,7 @@ import type { IConfigOptions } from "../src/IConfigOptions";
import { Credentials, Homeserver, HomeserverInstance, StartHomeserverOpts } from "./plugins/homeserver";
import { Synapse } from "./plugins/homeserver/synapse";
import { Dendrite, Pinecone } from "./plugins/homeserver/dendrite";
import { Instance } from "./plugins/mailhog";
import { Instance, MailHogServer } from "./plugins/mailhog";
import { ElementAppPage } from "./pages/ElementAppPage";
import { OAuthServer } from "./plugins/oauth_server";
import { Crypto } from "./pages/crypto";
@ -86,7 +86,7 @@ export const test = base.extend<
user: CredentialsWithDisplayName;
displayName?: string;
app: ElementAppPage;
mailhog?: { api: mailhog.API; instance: Instance };
mailhog: { api: mailhog.API; instance: Instance };
crypto: Crypto;
room?: { roomId: string };
toasts: Toasts;
@ -234,6 +234,14 @@ export const test = base.extend<
await use(bot);
},
// eslint-disable-next-line no-empty-pattern
mailhog: async ({}, use) => {
const mailhog = new MailHogServer();
const instance = await mailhog.start();
await use(instance);
await mailhog.stop();
},
slidingSyncProxy: async ({ page, user, homeserver }, use) => {
const proxy = new SlidingSyncProxy(homeserver.config.dockerUrl);
const proxyInstance = await proxy.start();