tests: improve delete rows from table message test (#3598)

🐛 (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
This commit is contained in:
Cristhian Zanforlin Lousa 2024-08-28 15:38:23 -03:00 committed by GitHub
commit 9ae4e29815
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();
});