switch versions e2e (#312)
This commit is contained in:
@@ -10,7 +10,7 @@ class PageObject {
|
||||
private userDataDir: string;
|
||||
|
||||
constructor(
|
||||
private page: Page,
|
||||
public page: Page,
|
||||
{ userDataDir }: { userDataDir: string },
|
||||
) {
|
||||
this.userDataDir = userDataDir;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
- region "Notifications (F8)":
|
||||
- list
|
||||
- region "Notifications alt+T"
|
||||
- text: Testing:write-index!
|
||||
@@ -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/
|
||||
@@ -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/
|
||||
22
e2e-tests/switch_versions.spec.ts
Normal file
22
e2e-tests/switch_versions.spec.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { test } from "./helpers/test_helper";
|
||||
import { expect } from "@playwright/test";
|
||||
|
||||
test("switch versions", async ({ po }) => {
|
||||
await po.setUp({ autoApprove: true });
|
||||
await po.sendPrompt("tc=write-index");
|
||||
|
||||
await po.snapshotPreview();
|
||||
|
||||
expect(
|
||||
await po.page.getByRole("button", { name: "Version" }).textContent(),
|
||||
).toBe("Version 2");
|
||||
await po.page.getByRole("button", { name: "Version" }).click();
|
||||
await po.page.getByText("Init Dyad app Undo").click();
|
||||
await po.snapshotPreview();
|
||||
|
||||
await po.page.getByRole("button", { name: "Undo to latest version" }).click();
|
||||
// Should be same as the previous snapshot, but just to be sure.
|
||||
await po.snapshotPreview();
|
||||
|
||||
await expect(po.page.getByText("Version 3")).toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user