-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked all tests to share common code, and handle async properly
- Loading branch information
1 parent
a7d8346
commit 755b981
Showing
16 changed files
with
267 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { expect, test } from "@playwright/test"; | ||
import { expect, test } from "./authenticated-test"; | ||
|
||
test("Partitions page", async ({page}) => { | ||
await test.step("Navigate to partitions page", async () => { | ||
await page.goto("./"); | ||
await page.click('text="Click to login anonymously"'); | ||
await page.click('text="Topics"'); | ||
await page.waitForSelector('text="Hide internal topics"', { timeout: 500000 }); | ||
await page.click('table[aria-label="Topics"] tbody tr:first-child td:first-child a'); | ||
await expect(page.getByText("Last updated").or(page.getByText("No messages data"))).toBeVisible(); | ||
await page.click('text="Partitions"'); | ||
await page.waitForSelector('text="Partition ID"', { timeout: 500000 }); | ||
test.beforeEach(async ({ authenticatedPage }) => { | ||
await authenticatedPage.goToFirstTopic(); | ||
}); | ||
|
||
}) | ||
test("Partitions page", async ({ page, authenticatedPage }) => { | ||
await test.step("Navigate to partitions page", async () => { | ||
await authenticatedPage.clickLink("Partitions"); | ||
await authenticatedPage.waitForTableLoaded(); | ||
}); | ||
await test.step("Partitions page should display table", async () => { | ||
expect(await page.innerText("body")).toContain("Partition ID"); | ||
expect(await page.innerText("body")).toContain("Status"); | ||
expect(await page.innerText("body")).toContain("Replicas"); | ||
expect(await page.innerText("body")).toContain("Size"); | ||
expect(await page.innerText("body")).toContain("Leader"); | ||
expect(await page.innerText("body")).toContain("Preferred leader"); | ||
const dataRows = await page.locator('table[aria-label="Partitions"] tbody tr').elementHandles(); | ||
const dataRows = await page | ||
.locator('table[aria-label="Partitions"] tbody tr') | ||
.elementHandles(); | ||
expect(dataRows.length).toBeGreaterThan(0); | ||
const dataCells = await page.locator('table[aria-label="Partitions"] tbody tr td').evaluateAll((tds) => | ||
tds.map((td) => td.textContent?.trim() ?? "")); | ||
const dataCells = await page | ||
.locator('table[aria-label="Partitions"] tbody tr td') | ||
.evaluateAll((tds) => tds.map((td) => td.textContent?.trim() ?? "")); | ||
expect(dataCells.length).toBeGreaterThan(0); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import { expect, test } from "@playwright/test"; | ||
import { expect, test } from "./authenticated-test"; | ||
|
||
test("Topics configuration", async ({page}) => { | ||
test.beforeEach(async ({ authenticatedPage }) => { | ||
await authenticatedPage.goToFirstTopic(); | ||
}); | ||
|
||
test("Topics configuration", async ({ page, authenticatedPage }) => { | ||
await test.step("Navigate to topics configuration page", async () => { | ||
await page.goto("./"); | ||
await page.click('text="Click to login anonymously"'); | ||
await page.click('text="Topics"'); | ||
await page.waitForSelector('text="Hide internal topics"', { timeout: 500000 }); | ||
await page.click('table[aria-label="Topics"] tbody tr:first-child td:first-child a'); | ||
await expect(page.getByText("Last updated").or(page.getByText("No messages data"))).toBeVisible(); | ||
await page.click('text="Configuration"'); | ||
await page.waitForSelector('text="Clear all filters"', { timeout: 500000 }); | ||
}) | ||
await authenticatedPage.clickLink("Configuration"); | ||
}); | ||
await test.step("Topics configuration page should display table", async () => { | ||
const dataRows = await page.locator('table[aria-label="Node configuration"] tbody tr').elementHandles(); | ||
await authenticatedPage.waitForTableLoaded(); | ||
const dataRows = await page | ||
.locator('table[aria-label="Node configuration"] tbody tr') | ||
.elementHandles(); | ||
expect(dataRows.length).toBeGreaterThan(0); | ||
const dataCells = await page.locator('table[aria-label="Node configuration"] tbody tr td').evaluateAll((tds) => | ||
tds.map((td) => td.textContent?.trim() ?? "") | ||
); | ||
const dataCells = await page | ||
.locator('table[aria-label="Node configuration"] tbody tr td') | ||
.evaluateAll((tds) => tds.map((td) => td.textContent?.trim() ?? "")); | ||
expect(dataCells.length).toBeGreaterThan(0); | ||
}); | ||
}); |
Oops, something went wrong.