Skip to content

Commit 7405283

Browse files
committed
Remove hardcoded timeout and addressed review comments
Signed-off-by: mrrajan <86094767+mrrajan@users.noreply.github.com.>
1 parent 40ab765 commit 7405283

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

e2e/tests/ui/features/@sbom-groups/sbom-groups.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ Feature: SBOM Groups - Manage SBOM groups
116116
And A group "Searchable Group" exists
117117
When User searches for group "Searchable"
118118
Then The SBOM Groups table contains "Searchable Group"
119-
When User clears all filters
120-
Then The SBOM Groups table shows all groups
121119

122120
Scenario: Clear filter shows all groups
123121
Given User navigates to SBOM Groups page

e2e/tests/ui/features/@sbom-groups/sbom-groups.step.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,13 @@ Then("The SBOM Groups table is visible", async ({ page }) => {
3535
});
3636

3737
Then("The SBOM Groups table shows group data", async ({ page }) => {
38-
// Tree table doesn't have visible column headers
39-
// Verify table structure by checking it's not showing empty state
38+
// Verify the tree table is rendered
4039
const table = page.getByRole("treegrid", { name: "sbom-groups-table" });
4140
await expect(table).toBeVisible();
4241

43-
// Verify it's not showing empty state (which would mean no data structure)
44-
// Table is valid if either it has rows OR it's empty (both are valid states)
45-
// We're just verifying the table structure exists
46-
expect(await table.isVisible()).toBe(true);
42+
// Verify that at least one data row is present (not showing empty state)
43+
const rows = table.getByRole("row");
44+
await expect(rows.first()).toBeVisible();
4745
});
4846

4947
// Create group
@@ -351,15 +349,19 @@ Then(
351349

352350
// Filtering
353351
When("User clears all filters", async ({ page }) => {
354-
await page.getByRole("button", { name: "Clear all filters" }).click();
352+
const listPage = await SbomGroupListPage.fromCurrentPage(page);
353+
const toolbar = await listPage.getToolbar();
354+
await toolbar.clearAllFilters(); // This waits for filter chips to be removed
355355
});
356356

357357
Then("The SBOM Groups table shows all groups", async ({ page }) => {
358-
// Verify table has content
359-
await page.waitForTimeout(1000);
360-
const rows = page.getByRole("row");
361-
const count = await rows.count();
362-
expect(count).toBeGreaterThan(1); // At least header + 1 data row
358+
// Verify table has content after clearing filters
359+
const table = page.getByRole("treegrid", { name: "sbom-groups-table" });
360+
await expect(table).toBeVisible();
361+
362+
// Wait for at least one row to be visible (indicating data has loaded)
363+
const rows = table.getByRole("row");
364+
await expect(rows.first()).toBeVisible();
363365
});
364366

365367
When(

0 commit comments

Comments
 (0)