Files
gradio-app--gradio/js/spa/test/function_values.spec.ts
wehub-resource-sync adf0d17497
publish / version_or_publish (push) Has been cancelled
storybook-build / changes (push) Has been cancelled
storybook-build / :storybook-build (push) Has been cancelled
Sync Gradio Skills to Hugging Face / sync-skills (push) Has been cancelled
functional / changes (push) Has been cancelled
functional / build-frontend (push) Has been cancelled
functional / functional-test-SSR=false (push) Has been cancelled
functional / functional-reload (push) Has been cancelled
js / changes (push) Has been cancelled
js / js-test (push) Has been cancelled
docs-build / changes (push) Has been cancelled
docs-build / docs-build (push) Has been cancelled
docs-build / website-build (push) Has been cancelled
functional / functional-test-SSR=true (push) Has been cancelled
hygiene / hygiene-test (push) Has been cancelled
python / changes (push) Has been cancelled
python / build (push) Has been cancelled
python / test-ubuntu-latest-flaky (push) Has been cancelled
python / test-ubuntu-latest-not-flaky (push) Has been cancelled
python / test-windows-latest-flaky (push) Has been cancelled
python / test-windows-latest-not-flaky (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:17:32 +08:00

44 lines
1.8 KiB
TypeScript

import { test, expect } from "@self/tootils";
test("Test Country Filter", async ({ page }) => {
const countries_list = page.getByTestId("json");
await expect(countries_list).toContainText("Algeria");
await expect(countries_list).not.toContainText("Argentina");
await page.getByLabel("range slider for Country Count").fill("3");
await expect(countries_list).toContainText("Algeria");
await expect(countries_list).toContainText("Argentina");
await page.getByLabel("Alphabetical Order").uncheck();
await expect(countries_list).not.toContainText("Algeria");
await expect(countries_list).toContainText("Sudan");
});
test("Test Random Country List", async ({ page }) => {
const random_country_box = page.getByLabel("Random Country");
const random_countries_box = page.getByLabel("Random Countries");
await expect(random_country_box).not.toBeEmpty();
await expect(random_countries_box).not.toBeEmpty();
const first_country_value = await random_country_box.inputValue();
const first_countries_value = await random_countries_box.inputValue();
await expect(random_country_box).not.toHaveValue(
first_country_value as string
);
await expect(random_countries_box).not.toHaveValue(
first_countries_value as string
);
await page.getByRole("button", { name: "Stop" }).click();
await page.waitForTimeout(2000);
const current_country_value = await random_country_box.inputValue();
const current_countries_value = await random_countries_box.inputValue();
await expect(random_country_box).toHaveValue(current_country_value as string);
await expect(random_countries_box).toHaveValue(
current_countries_value as string
);
await page.getByRole("button", { name: "Start" }).click();
await expect(random_country_box).not.toHaveValue(
current_country_value as string
);
await expect(random_countries_box).not.toHaveValue(
current_countries_value as string
);
});