gradio/js/app/test/input_output.spec.ts

19 lines
562 B
TypeScript
Raw Normal View History

2022-03-24 18:59:09 +08:00
import { test, expect, Page } from "@playwright/test";
2023-05-12 23:22:25 +08:00
import { mock_theme, wait_for_page, mock_api, mock_demo } from "./utils";
2022-03-24 18:59:09 +08:00
test("a component acts as both input and output", async ({ page }) => {
await mock_demo(page, "input_output");
await mock_api(page, [["tset"]]);
await mock_theme(page);
await wait_for_page(page);
2022-03-24 18:59:09 +08:00
const textbox = await page.getByLabel("Input-Output");
2022-03-24 18:59:09 +08:00
await textbox.fill("test");
await Promise.all([
page.click("button"),
page.waitForResponse("**/run/predict")
]);
await expect(await textbox).toHaveValue("tset");
2022-03-24 18:59:09 +08:00
});