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

Migrate knock/* from Cypress to Playwright (#12030)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2023-12-12 14:08:36 +00:00
committed by GitHub
parent a806d71d45
commit e92ca4fcd2
11 changed files with 721 additions and 601 deletions

View File

@ -81,19 +81,25 @@ export const test = base.extend<
uut?: Locator; // Unit Under Test, useful place to refer a prepared locator
botCreateOpts: CreateBotOpts;
bot: Bot;
labsFlags: string[];
webserver: Webserver;
}
>({
cryptoBackend: ["legacy", { option: true }],
config: CONFIG_JSON,
page: async ({ context, page, config, cryptoBackend }, use) => {
page: async ({ context, page, config, cryptoBackend, labsFlags }, use) => {
await context.route(`http://localhost:8080/config.json*`, async (route) => {
const json = { ...CONFIG_JSON, ...config };
json["features"] = {
...json["features"],
// Enable the lab features
...labsFlags.reduce((obj, flag) => {
obj[flag] = true;
return obj;
}, {}),
};
if (cryptoBackend === "rust") {
json["features"] = {
...json["features"],
feature_rust_crypto: true,
};
json.features.feature_rust_crypto = true;
}
await route.fulfill({ json });
});
@ -145,6 +151,7 @@ export const test = base.extend<
displayName,
});
},
labsFlags: [],
user: async ({ page, homeserver, credentials }, use) => {
await page.addInitScript(
({ baseUrl, credentials }) => {