From 9ae4e2981511d4b458e61130ec75a74ceadd5718 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Wed, 28 Aug 2024 15:38:23 -0300 Subject: [PATCH] tests: improve delete rows from table message test (#3598) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🐛 (generalBugs-shard-1.spec.ts): Fix timing issues in end-to-end test by adding explicit waits for elements to be visible before interacting with them --- .../generalBugs-shard-1.spec.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts index 83923b65ec3..46b68a5c7f2 100644 --- a/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts +++ b/src/frontend/tests/scheduled-end-to-end/generalBugs-shard-1.spec.ts @@ -73,14 +73,28 @@ test("should delete rows from table message", async ({ page }) => { await page.waitForTimeout(2000); await page.getByTestId("user-profile-settings").last().click(); + await page.waitForSelector( + '[data-testid="user-profile-settings"]:last-child', + ); + + await page.waitForTimeout(500); + + await page.waitForSelector('text="Settings"'); await page.getByText("Settings").last().click(); + + await page.waitForSelector('text="Messages"'); await page.getByText("Messages").last().click(); - const label = "Press Space to toggle all rows selection (unchecked)"; - await page.getByLabel(label).first().click(); + await page.waitForSelector(".ag-checkbox-input"); + await page.locator(".ag-checkbox-input").first().click(); + + await page.waitForTimeout(500); + await page.waitForSelector('[data-testid="icon-Trash2"]:first-child'); await page.getByTestId("icon-Trash2").first().click(); + await page.waitForTimeout(500); + await page.waitForSelector("text=No Data Available", { timeout: 30000 }); await page.getByText("No Data Available").isVisible(); });