mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
19 lines
562 B
TypeScript
19 lines
562 B
TypeScript
import { test, expect, Page } from "@playwright/test";
|
|
import { mock_theme, wait_for_page, mock_api, mock_demo } from "./utils";
|
|
|
|
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);
|
|
|
|
const textbox = await page.getByLabel("Input-Output");
|
|
|
|
await textbox.fill("test");
|
|
await Promise.all([
|
|
page.click("button"),
|
|
page.waitForResponse("**/run/predict")
|
|
]);
|
|
await expect(await textbox).toHaveValue("tset");
|
|
});
|