Unverified 提交 46d398b4 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Restart e2e test (#306)

上级 ada1542e
......@@ -54,13 +54,19 @@ class PageObject {
await this.page.getByRole("button", { name: "Restart" }).click();
}
locateLoadingAppPreview() {
return this.page.getByText("Loading app preview...");
}
getPreviewIframeElement() {
return this.page.getByTestId("preview-iframe-element");
}
async snapshotPreview() {
const iframe = this.getPreviewIframeElement();
await expect(iframe.contentFrame().locator("body")).toMatchAriaSnapshot();
await expect(iframe.contentFrame().locator("body")).toMatchAriaSnapshot({
timeout: 15_000,
});
}
async snapshotServerDump({
......
import { test } from "./helpers/test_helper";
import { expect } from "@playwright/test";
test("restart app", async ({ po }) => {
await po.setUp({ autoApprove: true });
await po.sendPrompt("hi");
await po.clickRestart();
await expect(po.locateLoadingAppPreview()).toBeVisible();
await expect(po.locateLoadingAppPreview()).not.toBeVisible({
timeout: 15_000,
});
await po.snapshotPreview();
});
- region "Notifications (F8)":
- list
- region "Notifications alt+T"
- heading "Welcome to Your Blank App" [level=1]
- paragraph: Start building your amazing project here!
- link "Made with Dyad":
- /url: https://www.dyad.sh/
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论