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

Fix E2E tests (#2520)

#skip-bb <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2520" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end -->
上级 3cbcc6f0
......@@ -32,6 +32,6 @@ testSkipIfWindows(
await po.sendPrompt("[dump] hi");
await po.snapshotServerDump("all-messages");
// Snapshot the messages to capture the compaction summary + second response
await po.snapshotMessages();
await po.snapshotMessages({ replaceDumpPath: true });
},
);
......@@ -592,11 +592,9 @@ export class PageObject {
replaceDumpPath = false,
timeout,
}: { replaceDumpPath?: boolean; timeout?: number } = {}) {
// Always scrub compaction backup paths — they contain system-specific
// temp directories and timestamps that change between runs.
// Also conditionally scrub dyad-dump-path placeholders.
await this.page.evaluate(
({ replaceDumpPath }) => {
// NOTE: once you have called this, you can NOT manipulate the UI anymore or React will break.
if (replaceDumpPath) {
await this.page.evaluate(() => {
const messagesList = document.querySelector(
"[data-testid=messages-list]",
);
......@@ -609,15 +607,13 @@ export class PageObject {
/\.dyad\/chats\/\d+\/compaction-[^\s<"]+\.md/g,
"[[compaction-backup-path]]",
);
if (replaceDumpPath) {
messagesList.innerHTML = messagesList.innerHTML.replace(
/\[\[dyad-dump-path=([^\]]+)\]\]/g,
"[[dyad-dump-path=*]]",
);
}
},
{ replaceDumpPath },
);
messagesList.innerHTML = messagesList.innerHTML.replace(
/\[\[dyad-dump-path=([^\]]+)\]\]/g,
"[[dyad-dump-path=*]]",
);
});
}
await expect(this.page.getByTestId("messages-list")).toMatchAriaSnapshot({
timeout,
});
......
......@@ -2,11 +2,17 @@
- paragraph: OK, I'm going to do some writing now...
- img
- text: Index.tsx
- button "Edit":
- img
- img
- text: "src/pages/Index.tsx Summary: write-description"
- paragraph: And it's done!
- button "Copy":
- img
- img
- text: test-model
- img
- text: Approved
- text: less than a minute ago
- button "Undo":
- img
- button "Retry":
......
......@@ -56,7 +56,7 @@
- button "Copy Request ID":
- img
- paragraph: "[dump] hi"
- paragraph: /\[\[dyad-dump-path=\/Users\/will\/Documents\/GitHub\/dyad-zero\/testing\/fake-llm-server\/dist\/generated\/\d+\.json\]\]/
- paragraph: "[[dyad-dump-path=*]]"
- button "Copy":
- img
- img
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论