Skip to content

Commit 7028fdd

Browse files
test(e2e): fix race condition and locator iteration in number filter test
Replace textContent()+toBe() with toHaveText() locator assertion so the paging status check retries until the filter is applied. Fix row loop to use expected.length and .nth(i) — rows.length on a Playwright Locator is undefined, so the loop was silently never executing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c09697a commit 7028fdd

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

packages/pluggableWidgets/datagrid-number-filter-web/e2e/DataGridNumberFilter.spec.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ test.describe("datagrid-number-filter-web", () => {
3838
await page.goto("/p/filter_init_condition");
3939
await waitForMendixApp(page);
4040

41-
const rows = await page.locator(".mx-name-dataGrid21 [role=row]");
42-
for (let i = 0; i < rows.length; i++) {
43-
await expect(rows[i]).toHaveText(expected[i]);
44-
}
41+
const pagingStatus = page.locator(".mx-name-dataGrid21 .paging-status");
42+
await expect(pagingStatus).toHaveText("1 to 2 of 2");
4543

46-
const pagingStatus = await page.textContent(".mx-name-dataGrid21 .paging-status");
47-
await expect(pagingStatus).toBe("1 to 2 of 2");
44+
const rows = page.locator(".mx-name-dataGrid21 [role=row]");
45+
await expect(rows).toHaveCount(expected.length);
46+
for (let i = 0; i < expected.length; i++) {
47+
await expect(rows.nth(i)).toHaveText(expected[i]);
48+
}
4849
});
4950
});
5051

0 commit comments

Comments
 (0)