Fix flakiness in comment and reply e2e test

This commit is contained in:
Sebastian Martinez
2023-11-15 16:21:47 +01:00
committed by Rūdolfs Ošiņš
parent 84addf467d
commit 0f8bd0d1dc
3 changed files with 9 additions and 11 deletions
+5 -1
View File
@@ -167,7 +167,11 @@
}
</style>
<div class="comment-section" class:inline>
<div
class="comment-section"
aria-label="extended-textarea"
title=""
class:inline>
<Radio>
<Button
styleBorderRadius="0"
-2
View File
@@ -45,9 +45,7 @@ test("use revision selector", async ({ page }) => {
await page.getByRole("link", { name: "Changes" }).click();
// Switching to the initial revision
await page.getByText("Revision 2c2f036").click();
await expect(page.locator(".dropdown")).toBeVisible();
await page.getByRole("link", { name: "Revision 679b2c8" }).click();
await expect(page.locator(".dropdown")).toBeHidden();
await expect(
page.getByRole("cell", { name: "Had to push a new revision" }),
+4 -8
View File
@@ -57,9 +57,7 @@ export async function expectThreadCommentingToWork(page: Page) {
await page.getByRole("button", { name: "Leave your comment" }).click();
await page.getByPlaceholder("Leave your comment").fill("This is a comment");
await page.getByRole("button", { name: "Comment" }).click();
await expect(
page.getByRole("button", { name: "Comment", exact: true }),
).toBeHidden();
await expect(page.getByLabel("extended-textarea")).toBeHidden();
await page.reload();
await expect(page.getByText("This is a comment")).toBeVisible();
@@ -68,16 +66,14 @@ export async function expectThreadCommentingToWork(page: Page) {
.getByPlaceholder("Leave your comment")
.fill("This is an edited comment");
await page.getByRole("button", { name: "Save" }).click();
await expect(page.getByRole("button", { name: "Save" })).toBeHidden();
await expect(page.getByLabel("extended-textarea")).toBeHidden();
await page.reload();
await expect(page.getByText("This is an edited comment")).toBeVisible();
await page.getByRole("button", { name: "Reply to comment" }).click();
await page.getByPlaceholder("Reply to comment").fill("This is a reply");
await page.getByRole("button", { name: "Comment", exact: true }).click();
await expect(
page.getByRole("button", { name: "Comment", exact: true }),
).toBeHidden();
await expect(page.getByLabel("extended-textarea")).toBeHidden();
await page.reload();
await expect(page.getByText("This is a reply")).toBeVisible();
@@ -86,7 +82,7 @@ export async function expectThreadCommentingToWork(page: Page) {
.getByPlaceholder("Leave your comment")
.fill("This is an edited reply");
await page.getByRole("button", { name: "Save" }).click();
await expect(page.getByRole("button", { name: "Save" })).toBeHidden();
await expect(page.getByLabel("extended-textarea")).toBeHidden();
await page.reload();
await expect(page.getByText("This is an edited reply")).toBeVisible();
}