mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-12 10:34:32 +08:00
3539787ebb
* add line numbers and collapse + expand logic * add story test and style tweaks * add changeset * allow expanding via preview * story tweaks * remove mobile/desktop story tests * remove unused thing * add open param * amend test * * add cm-like theme colors * prevent copy + pasting line numbers and toggle * a11y tweaks * update lines on rerender * fix test * fix test --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
26 lines
927 B
TypeScript
26 lines
927 B
TypeScript
import { test, expect } from "@gradio/tootils";
|
|
|
|
test("renders the correct elements", async ({ page }) => {
|
|
const description = await page.getByTestId("markdown");
|
|
await expect(description).toContainText("Detect Disease From Scan");
|
|
|
|
const checkboxes = await page.getByTestId("checkbox-group");
|
|
await expect(checkboxes).toContainText("Covid Malaria Lung Cancer");
|
|
|
|
const tabs = await page.locator("button", { hasText: /X-ray|CT Scan/ });
|
|
await expect(tabs).toHaveCount(2);
|
|
});
|
|
|
|
test("can run an api request and display the data", async ({ page }) => {
|
|
await page.getByTitle("Covid").check();
|
|
await page.getByTitle("Lung Cancer").check();
|
|
|
|
const run_button = await page.locator("button", { hasText: /Run/ }).first();
|
|
await run_button.click();
|
|
|
|
const json = await page.getByTestId("json").first();
|
|
await expect(json).toHaveText(
|
|
` [ \"0\": { \"Covid\": 0.25 , \"Lung Cancer\": 0.5 } ] `
|
|
);
|
|
});
|