Restart e2e test (#306)

This commit is contained in:
Will Chen authored and GitHub committed 2025-06-02 15:20:35 -07:00
1 parent ada1542e34
commit 46d398b4e9
3 files changed
+29 -1

No files matched your search

+7 -1
View File
@@ -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({
+15
View File
@@ -0,0 +1,15 @@
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();
});
@@ -0,0 +1,7 @@
- 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/