2022-05-27 16:53:50 +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-05-27 16:53:50 +08:00
|
|
|
|
|
|
|
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"]]);
|
2023-03-27 22:52:07 +08:00
|
|
|
await mock_theme(page);
|
|
|
|
await wait_for_page(page);
|
2022-05-27 16:53:50 +08:00
|
|
|
|
2022-10-13 00:30:42 +08:00
|
|
|
const textbox = await page.getByLabel("Name");
|
2022-05-27 16:53:50 +08:00
|
|
|
|
|
|
|
await textbox.fill("Frank");
|
2022-10-13 00:30:42 +08:00
|
|
|
await expect(await textbox).toHaveValue("Frank");
|
|
|
|
await expect(await page.getByLabel("Output")).toHaveValue(
|
2022-05-27 16:53:50 +08:00
|
|
|
"Welcome! This page has loaded for Frank"
|
|
|
|
);
|
|
|
|
});
|