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

18 lines
599 B
TypeScript
Raw Normal View History

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";
test("renders the correct elements", async ({ page }) => {
await mock_demo(page, "blocks_page_load");
await mock_api(page, [["Welcome! This page has loaded for Frank"]]);
await mock_theme(page);
await wait_for_page(page);
const textbox = await page.getByLabel("Name");
await textbox.fill("Frank");
await expect(await textbox).toHaveValue("Frank");
await expect(await page.getByLabel("Output")).toHaveValue(
"Welcome! This page has loaded for Frank"
);
});