Skip to content

Commit

Permalink
tests: improve delete rows from table message test (#3598)
Browse files Browse the repository at this point in the history
🐛 (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
  • Loading branch information
Cristhianzl authored Aug 28, 2024
1 parent b1f79a5 commit 9ae4e29
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

0 comments on commit 9ae4e29

Please sign in to comment.