Merge branch 't3chguy/flaky-playwright-13jan' of https://github.com/vector-im/element-web into t3chguy/flaky-tests-10jan

# Conflicts:
#	playwright/services.ts
#	playwright/stale-screenshot-reporter.ts
#	playwright/testcontainers/mas.ts
#	playwright/testcontainers/synapse.ts
This commit is contained in:
Michael Telatynski
2025-01-13 12:06:49 +00:00
6 changed files with 16 additions and 14 deletions

View File

@@ -47,6 +47,7 @@ test.describe("RightPanel", () => {
// Set a local room address
const localAddresses = page.locator(".mx_SettingsFieldset", { hasText: "Local Addresses" });
await localAddresses.getByRole("textbox").fill(ROOM_ADDRESS_LONG);
await expect(page.getByText("This address is available to use")).toBeVisible();
await localAddresses.getByRole("button", { name: "Add" }).click();
await expect(localAddresses.getByText(`#${ROOM_ADDRESS_LONG}:localhost`)).toHaveClass(
"mx_EditableItem_item",

View File

@@ -30,6 +30,7 @@ test.describe("Room Directory", () => {
// First add a local address `gaming`
const localAddresses = page.locator(".mx_SettingsFieldset", { hasText: "Local Addresses" });
await localAddresses.getByRole("textbox").fill("gaming");
await expect(page.getByText("This address is available to use")).toBeVisible();
await localAddresses.getByRole("button", { name: "Add" }).click();
await expect(localAddresses.getByText("#gaming:localhost")).toHaveClass("mx_EditableItem_item");

View File

@@ -41,6 +41,7 @@ test.describe("General room settings tab", () => {
// 1. Set the room-address to be a really long string
const longString = "abcasdhjasjhdaj1jh1asdhasjdhajsdhjavhjksd".repeat(4);
await settings.locator("#roomAliases input[label='Room address']").fill(longString);
await expect(page.getByText("This address is available to use")).toBeVisible();
await settings.locator("#roomAliases").getByText("Add", { exact: true }).click();
// 2. wait for the new setting to apply ...

View File

@@ -179,18 +179,17 @@ export class Client {
public async createRoom(options: ICreateRoomOpts): Promise<string> {
const client = await this.prepareClient();
return await client.evaluate(async (cli, options) => {
const roomPromise = new Promise<void>((resolve) => {
const onRoom = (room: Room) => {
if (room.roomId === roomId) {
cli.off(window.matrixcs.ClientEvent.Room, onRoom);
resolve();
}
};
cli.on(window.matrixcs.ClientEvent.Room, onRoom);
});
const { room_id: roomId } = await cli.createRoom(options);
if (!cli.getRoom(roomId)) {
await roomPromise;
await new Promise<void>((resolve) => {
const onRoom = (room: Room) => {
if (room.roomId === roomId) {
cli.off(window.matrixcs.ClientEvent.Room, onRoom);
resolve();
}
};
cli.on(window.matrixcs.ClientEvent.Room, onRoom);
});
}
return roomId;
}, options);

View File

@@ -44,7 +44,6 @@ class StaleScreenshotReporter implements Reporter {
public async onExit(): Promise<void> {
if (this.failing) return;
const screenshotFiles = new Set(await glob(`**/*.png`, { cwd: snapshotRoot }));
for (const screenshot of screenshotFiles) {
if (screenshot.split("-").at(-1) !== "linux.png") {

View File

@@ -23,7 +23,6 @@ const DEFAULT_CONFIG = {
{ name: "human" },
{ name: "oauth" },
{ name: "compat" },
{ name: "adminapi" },
{
name: "graphql",
playground: true,
@@ -164,10 +163,12 @@ const DEFAULT_CONFIG = {
},
rate_limiting: {
login: {
burst: 1000,
burst: 10,
per_second: 1,
},
registration: {
burst: 1000,
burst: 10,
per_second: 1,
},
},
};