Context window e2e (#324)

This commit is contained in:
Will Chen authored and GitHub committed 2025-06-03 21:30:36 -07:00
1 parent b8f7490288
commit 7994b01aa8
15 files changed
+5360 -4

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import { test } from "./helpers/test_helper";
test("context window", async ({ po }) => {
await po.setUp();
await po.sendPrompt("tc=1");
await po.sendPrompt("tc=2");
await po.sendPrompt("[dump] tc=3");
await po.snapshotServerDump();
await po.sendPrompt("[dump] tc=4");
await po.snapshotServerDump();
await po.sendPrompt("[dump] tc=5");
await po.snapshotServerDump();
await po.goToSettingsTab();
await po.page
.getByRole("combobox", { name: "Maximum number of chat turns" })
.click();
await po.page.getByRole("option", { name: "Plus (5)" }).click();
// close combobox
// await po.page.keyboard.press("Escape");
await po.snapshotSettings();
await po.page.getByText("Go Back").click();
await po.sendPrompt("[dump] tc=6");
await po.snapshotServerDump();
});
+1
View File
@@ -0,0 +1 @@
1
+1
View File
@@ -0,0 +1 @@
2
+1
View File
@@ -0,0 +1 @@
3
+1
View File
@@ -0,0 +1 @@
4
+1
View File
@@ -0,0 +1 @@
5
+1
View File
@@ -0,0 +1 @@
6
+4 -3
View File
@@ -151,7 +151,7 @@ class PageObject {
// Find the dump path using regex
const dumpPathMatch = messagesListText?.match(
/\[\[dyad-dump-path=([^\]]+)\]\]/,
/.*\[\[dyad-dump-path=([^\]]+)\]\]/,
);
if (!dumpPathMatch) {
@@ -161,8 +161,9 @@ class PageObject {
const dumpFilePath = dumpPathMatch[1];
// Read the JSON file
const dumpContent = fs.readFileSync(dumpFilePath, "utf-8");
const dumpContent: string = (
fs.readFileSync(dumpFilePath, "utf-8") as any
).replaceAll(/\[\[dyad-dump-path=([^\]]+)\]\]/g, "[[dyad-dump-path=*]]");
// Perform snapshot comparison
const parsedDump = JSON.parse(dumpContent);
if (type === "request") {
@@ -0,0 +1,12 @@
- paragraph: tc=1
- paragraph: "1"
- paragraph: tc=2
- paragraph: "2"
- paragraph: "[dump] tc=3"
- paragraph: /\[\[dyad-dump-path=\/Users\/will\/Documents\/GitHub\/dyad-zero\/testing\/fake-llm-server\/dist\/generated\/\d+\.json\]\]/
- paragraph: "[dump] tc=4"
- paragraph: /\[\[dyad-dump-path=\/Users\/will\/Documents\/GitHub\/dyad-zero\/testing\/fake-llm-server\/dist\/generated\/\d+\.json\]\]/
- paragraph: "[dump] tc=5"
- paragraph: /\[\[dyad-dump-path=\/Users\/will\/Documents\/GitHub\/dyad-zero\/testing\/fake-llm-server\/dist\/generated\/\d+\.json\]\]/
- button "Retry":
- img
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,17 @@
{
"selectedModel": {
"name": "test-model",
"provider": "custom::testing",
"customModelId": 1
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "0.8.0",
"maxChatTurnsInContext": 5,
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"isTestMode": true
}
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -27,5 +27,6 @@
"@/*": ["./src/*"]
}
},
"include": ["src"]
"include": ["src", "e2e-tests"],
"exclude": ["e2e-tests/fixtures"]
}