refresh e2e (#307)
This commit is contained in:
@@ -54,6 +54,22 @@ class PageObject {
|
||||
await this.page.getByRole("button", { name: "Restart" }).click();
|
||||
}
|
||||
|
||||
async clickPreviewRefresh() {
|
||||
await this.page.getByTestId("preview-refresh-button").click();
|
||||
}
|
||||
|
||||
async clickPreviewNavigateBack() {
|
||||
await this.page.getByTestId("preview-navigate-back-button").click();
|
||||
}
|
||||
|
||||
async clickPreviewNavigateForward() {
|
||||
await this.page.getByTestId("preview-navigate-forward-button").click();
|
||||
}
|
||||
|
||||
async clickPreviewOpenBrowser() {
|
||||
await this.page.getByTestId("preview-open-browser-button").click();
|
||||
}
|
||||
|
||||
locateLoadingAppPreview() {
|
||||
return this.page.getByText("Loading app preview...");
|
||||
}
|
||||
|
||||
19
e2e-tests/refresh.spec.ts
Normal file
19
e2e-tests/refresh.spec.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { test } from "./helpers/test_helper";
|
||||
|
||||
test("refresh app", async ({ po }) => {
|
||||
await po.setUp({ autoApprove: true });
|
||||
await po.sendPrompt("hi");
|
||||
|
||||
// Drop the document.body inside the contentFrame to make
|
||||
// sure refresh works.
|
||||
await po
|
||||
.getPreviewIframeElement()
|
||||
.contentFrame()
|
||||
.locator("body")
|
||||
.evaluate((body) => {
|
||||
body.remove();
|
||||
});
|
||||
|
||||
await po.clickPreviewRefresh();
|
||||
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/
|
||||
Reference in New Issue
Block a user