Fix some flaky playwright tests (#28855)
* Fix some flaky playwright tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix more flaky tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Reuse existing assertion Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -125,7 +125,7 @@ test.describe("Spotlight", () => {
|
||||
await expect(resultLocator).toHaveCount(1);
|
||||
await expect(resultLocator.first()).toContainText(room1Name);
|
||||
await resultLocator.first().click();
|
||||
expect(page.url()).toContain(room1Id);
|
||||
await expect(page).toHaveURL(new RegExp(`#/room/${room1Id}`));
|
||||
await expect(roomHeaderName(page)).toContainText(room1Name);
|
||||
});
|
||||
|
||||
@@ -139,7 +139,7 @@ test.describe("Spotlight", () => {
|
||||
await expect(resultLocator.first()).toContainText(room1Name);
|
||||
await expect(resultLocator.first()).toContainText("View");
|
||||
await resultLocator.first().click();
|
||||
expect(page.url()).toContain(room1Id);
|
||||
await expect(page).toHaveURL(new RegExp(`#/room/${room1Id}`));
|
||||
await expect(roomHeaderName(page)).toContainText(room1Name);
|
||||
});
|
||||
|
||||
@@ -153,7 +153,7 @@ test.describe("Spotlight", () => {
|
||||
await expect(resultLocator.first()).toContainText(room2Name);
|
||||
await expect(resultLocator.first()).toContainText("Join");
|
||||
await resultLocator.first().click();
|
||||
expect(page.url()).toContain(room2Id);
|
||||
await expect(page).toHaveURL(new RegExp(`#/room/${room2Id}`));
|
||||
await expect(page.locator(".mx_RoomView_MessageList")).toHaveCount(1);
|
||||
await expect(roomHeaderName(page)).toContainText(room2Name);
|
||||
});
|
||||
@@ -168,7 +168,7 @@ test.describe("Spotlight", () => {
|
||||
await expect(resultLocator.first()).toContainText(room3Name);
|
||||
await expect(resultLocator.first()).toContainText("View");
|
||||
await resultLocator.first().click();
|
||||
expect(page.url()).toContain(room3Id);
|
||||
await expect(page).toHaveURL(new RegExp(`#/room/${room3Id}`));
|
||||
await page.getByRole("button", { name: "Join the discussion" }).click();
|
||||
await expect(roomHeaderName(page)).toHaveText(room3Name);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user