Skip to content

Commit

Permalink
[CI] Increase playwright retries, remove waits for networkidle state (
Browse files Browse the repository at this point in the history
#1027)

* [CI] Increase number of retries for playwright tests in CI environment

Signed-off-by: Michael Edgar <[email protected]>

* fix: remove use of `page.waitForLoadState("networkidle")` in UI tests

Signed-off-by: Michael Edgar <[email protected]>

---------

Signed-off-by: Michael Edgar <[email protected]>
  • Loading branch information
MikeEdgar authored Sep 6, 2024
1 parent 3145b46 commit ba87225
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion ui/tests/playwright/BrokerPropertyPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test("Brokers property page", async ({page}) => {
await page.waitForSelector('text="Clear all filters"',{ timeout: 500000 });
})
await test.step("Brokers page should display properties", async () => {
await page.waitForLoadState("networkidle");
const dataRows = await page.locator('table[aria-label="Node configuration"] tbody tr').count();
expect(dataRows).toBeGreaterThan(0);
const dataCells = await page.locator('table[aria-label="Node configuration"] tbody tr td').evaluateAll((tds) =>
Expand Down
1 change: 0 additions & 1 deletion ui/tests/playwright/BrokersPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ test("Brokers page", async ({page}) => {
await page.waitForSelector('text="Rack"', { timeout: 500000 });
})
await test.step("Brokers page should display table", async () => {
await page.waitForLoadState("networkidle");
expect(await page.innerText("body")).toContain("Brokers");
expect(await page.innerText("body")).toContain(
"Partitions distribution (% of total)",
Expand Down
4 changes: 3 additions & 1 deletion ui/tests/playwright/ConsumerGroupsPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ test("Consumer groups page", async ({ page }) => {
});
});
await test.step("Consumer groups page should display table", async () => {
await page.waitForLoadState("networkidle");
await page.waitForFunction(() => {
return document.querySelectorAll('table[aria-label="Consumer groups"] tbody tr').length > 0;
});
expect(await page.innerText("body")).toContain("Consumer group name");
expect(await page.innerText("body")).toContain("State");
expect(await page.innerText("body")).toContain("Overall lag");
Expand Down
1 change: 0 additions & 1 deletion ui/tests/playwright/ConsumerPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ test("Consumer page", async ({page}) => {
await page.waitForSelector('text="Member ID"', { timeout: 500000 });
})
await test.step("Consumer page should display table", async () => {
await page.waitForLoadState("networkidle");
expect(await page.innerText("body")).toContain("Member ID");
expect(await page.innerText("body")).toContain("Overall lag");
expect(await page.innerText("body")).toContain("Assigned partitions");
Expand Down
1 change: 0 additions & 1 deletion ui/tests/playwright/MessagesPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test("Messages page", async ({page}) => {
await expect(page.getByText("Last updated").or(page.getByText("No messages data"))).toBeVisible();
})
await test.step("Messages page should display table", async () => {
await page.waitForLoadState("networkidle");
if (await page.getByText("No messages data").isVisible()) {
expect(await page.innerText("body")).toContain("Data will appear shortly after we receive produced messages.");
return;
Expand Down
1 change: 0 additions & 1 deletion ui/tests/playwright/PartitionsPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test("Partitions page", async ({page}) => {

})
await test.step("Partitions page should display table", async () => {
await page.waitForLoadState("networkidle");
expect(await page.innerText("body")).toContain("Partition ID");
expect(await page.innerText("body")).toContain("Status");
expect(await page.innerText("body")).toContain("Replicas");
Expand Down
1 change: 0 additions & 1 deletion ui/tests/playwright/TopicConsumers.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ test("Topics consumers", async ({page}) => {
await expect(page.getByText("Consumer group name").or(page.getByText("No consumer groups"))).toBeVisible();
})
await test.step("Topics consumers page should display table", async () => {
await page.waitForLoadState("networkidle");
expect(await page.innerText("body")).toContain("Consumer group name");
expect(await page.innerText("body")).toContain("Overall lag");
expect(await page.innerText("body")).toContain("State");
Expand Down
2 changes: 1 addition & 1 deletion ui/tests/playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig, devices } from "playwright/test";

export default defineConfig({
// Retry on CI only.
retries: process.env.CI_CLUSTER ? 2 : 0,
retries: process.env.CI_CLUSTER ? 5 : 0,

// Opt out of parallel tests on CI.
workers: process.env.CI_CLUSTER ? 1 : undefined,
Expand Down

0 comments on commit ba87225

Please sign in to comment.