Unverified 提交 4997a8f2 authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

switch versions e2e (#312)

上级 0a8e40c7
......@@ -10,7 +10,7 @@ class PageObject {
private userDataDir: string;
constructor(
private page: Page,
public page: Page,
{ userDataDir }: { userDataDir: string },
) {
this.userDataDir = userDataDir;
......
- region "Notifications (F8)":
- list
- region "Notifications alt+T"
- text: Testing:write-index!
\ No newline at end of file
- 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
- 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
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();
});
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论