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

Cleaner settings snapshot (#2093)

<!-- This is an auto-generated description by cubic. --> ## Summary by cubic Refactored e2e settings snapshots to record and snapshot only deltas, with redaction for volatile fields. This makes snapshots smaller, deterministic, and easier to read. - **Refactors** - Replaced snapshotSettings with recordSettings and snapshotSettingsDelta (git diff-style output). - Renamed captureSettings to recordSettings. - Redacted telemetryUserId and lastShownReleaseNotesVersion for stable snapshots. - Updated tests to capture pre-change settings and assert the delta. - Removed full JSON snapshots; added minimal diff snapshots for changed values. - **Migration** - In tests, call po.recordSettings() before a settings change, then po.snapshotSettingsDelta(beforeSettings). - Remove any remaining uses of snapshotSettings. <sup>Written for commit 5837d759687cd72ed635137a6fe19049bebe18bc. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Replaces full `user-settings.json` snapshots with concise, deterministic diffs in e2e tests. > > - Adds `recordSettings()` and `snapshotSettingsDelta()` in `test_helper.ts` to compare before/after settings and output git-style diffs > - Redacts volatile keys (e.g., `telemetryUserId`, `lastShownReleaseNotesVersion`) for stable snapshots > - Refactors settings-related tests (`telemetry`, `auto_update`, `release_channel`, `smart_context_options`, `turbo_edits_options`, `thinking_budget`, `context_window`, `template-*`) to use the new APIs > - Updates snapshot files to contain only the changed keys/values (adds/removes/changes) > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5837d759687cd72ed635137a6fe19049bebe18bc. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
上级 3646afbe
...@@ -4,12 +4,14 @@ import { test } from "./helpers/test_helper"; ...@@ -4,12 +4,14 @@ import { test } from "./helpers/test_helper";
test("auto update - disable and enable", async ({ po }) => { test("auto update - disable and enable", async ({ po }) => {
await po.goToSettingsTab(); await po.goToSettingsTab();
const beforeSettings = po.recordSettings();
await po.toggleAutoUpdate(); await po.toggleAutoUpdate();
await expect( await expect(
po.page.getByRole("button", { name: "Restart Dyad" }), po.page.getByRole("button", { name: "Restart Dyad" }),
).toBeVisible(); ).toBeVisible();
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings);
const beforeSettings2 = po.recordSettings();
await po.toggleAutoUpdate(); await po.toggleAutoUpdate();
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings2);
}); });
...@@ -12,6 +12,7 @@ testSkipIfWindows("context window", async ({ po }) => { ...@@ -12,6 +12,7 @@ testSkipIfWindows("context window", async ({ po }) => {
await po.snapshotServerDump(); await po.snapshotServerDump();
await po.goToSettingsTab(); await po.goToSettingsTab();
const beforeSettings = po.recordSettings();
await po.page await po.page
.getByRole("combobox", { name: "Maximum number of chat turns" }) .getByRole("combobox", { name: "Maximum number of chat turns" })
.click(); .click();
...@@ -19,7 +20,7 @@ testSkipIfWindows("context window", async ({ po }) => { ...@@ -19,7 +20,7 @@ testSkipIfWindows("context window", async ({ po }) => {
// close combobox // close combobox
// await po.page.keyboard.press("Escape"); // await po.page.keyboard.press("Escape");
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings);
await po.page.getByText("Go Back").click(); await po.page.getByText("Go Back").click();
await po.sendPrompt("[dump] tc=6"); await po.sendPrompt("[dump] tc=6");
......
...@@ -157,7 +157,7 @@ test("github clear integration settings", async ({ po }) => { ...@@ -157,7 +157,7 @@ test("github clear integration settings", async ({ po }) => {
await po.clickOpenInChatButton(); await po.clickOpenInChatButton();
// Make sure we are committing so that githubUser.email is getting set. // Make sure we are committing so that githubUser.email is getting set.
await po.sendPrompt("tc=write-index"); await po.sendPrompt("tc=write-index");
const beforeSettings = po.captureSettings(); const beforeSettings = po.recordSettings();
// Navigate to settings // Navigate to settings
await po.goToSettingsTab(); await po.goToSettingsTab();
......
...@@ -1019,37 +1019,22 @@ export class PageObject { ...@@ -1019,37 +1019,22 @@ export class PageObject {
await this.page.getByRole("switch", { name: "Auto-fix problems" }).click(); await this.page.getByRole("switch", { name: "Auto-fix problems" }).click();
} }
async snapshotSettings() {
const settings = path.join(this.userDataDir, "user-settings.json");
const settingsContent = fs.readFileSync(settings, "utf-8");
// Sanitize the "telemetryUserId" since it's a UUID
const sanitizedSettingsContent = settingsContent
.replace(/"telemetryUserId": "[^"]*"/g, '"telemetryUserId": "[UUID]"')
// Don't snapshot this otherwise it'll diff with every release.
.replace(
/"lastShownReleaseNotesVersion": "[^"]*"/g,
'"lastShownReleaseNotesVersion": "[scrubbed]"',
);
expect(sanitizedSettingsContent).toMatchSnapshot();
}
/** /**
* Captures the current settings state for later comparison. * Records the current settings state for later comparison.
* Use with `snapshotSettingsDelta()` to snapshot only what changed. * Use with `snapshotSettingsDelta()` to snapshot only what changed.
*/ */
captureSettings(): Record<string, unknown> { recordSettings(): Record<string, unknown> {
const settingsPath = path.join(this.userDataDir, "user-settings.json"); const settingsPath = path.join(this.userDataDir, "user-settings.json");
const settingsContent = fs.readFileSync(settingsPath, "utf-8"); const settingsContent = fs.readFileSync(settingsPath, "utf-8");
return JSON.parse(settingsContent); return JSON.parse(settingsContent);
} }
/** /**
* Snapshots only the differences between the current settings and a previously captured state. * Snapshots only the differences between the current settings and a previously recorded state.
* Output is in git diff style for easy reading. * Output is in git diff style for easy reading.
*/ */
snapshotSettingsDelta(beforeSettings: Record<string, unknown>) { snapshotSettingsDelta(beforeSettings: Record<string, unknown>) {
const afterSettings = this.captureSettings(); const afterSettings = this.recordSettings();
const diffLines: string[] = []; const diffLines: string[] = [];
...@@ -1061,6 +1046,12 @@ export class PageObject { ...@@ -1061,6 +1046,12 @@ export class PageObject {
// Sort keys for deterministic output // Sort keys for deterministic output
const sortedKeys = Array.from(allKeys).sort(); const sortedKeys = Array.from(allKeys).sort();
// Keys whose values should be redacted for deterministic snapshots
const redactedKeys: Record<string, string> = {
telemetryUserId: "[UUID]",
lastShownReleaseNotesVersion: "[scrubbed]",
};
for (const key of sortedKeys) { for (const key of sortedKeys) {
const beforeValue = beforeSettings[key]; const beforeValue = beforeSettings[key];
const afterValue = afterSettings[key]; const afterValue = afterSettings[key];
...@@ -1068,8 +1059,10 @@ export class PageObject { ...@@ -1068,8 +1059,10 @@ export class PageObject {
const afterExists = key in afterSettings; const afterExists = key in afterSettings;
// Format value with diff marker on each line for multiline values // Format value with diff marker on each line for multiline values
// Redact certain keys for deterministic snapshots
const formatValue = (val: unknown, marker: "+" | "-") => { const formatValue = (val: unknown, marker: "+" | "-") => {
const lines = JSON.stringify(val, null, 2).split("\n"); const displayVal = key in redactedKeys ? redactedKeys[key] : val;
const lines = JSON.stringify(displayVal, null, 2).split("\n");
return lines return lines
.map((line, i) => (i === 0 ? line : `${marker} ${line}`)) .map((line, i) => (i === 0 ? line : `${marker} ${line}`))
.join("\n"); .join("\n");
......
...@@ -7,16 +7,18 @@ test("release channel - change from stable to beta and back", async ({ ...@@ -7,16 +7,18 @@ test("release channel - change from stable to beta and back", async ({
await po.goToSettingsTab(); await po.goToSettingsTab();
// Change to beta channel // Change to beta channel
const beforeSettings1 = po.recordSettings();
await po.changeReleaseChannel("beta"); await po.changeReleaseChannel("beta");
await expect( await expect(
po.page.getByRole("button", { name: "Restart Dyad" }), po.page.getByRole("button", { name: "Restart Dyad" }),
).toBeVisible(); ).toBeVisible();
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings1);
// Change back to stable channel // Change back to stable channel
const beforeSettings2 = po.recordSettings();
await po.changeReleaseChannel("stable"); await po.changeReleaseChannel("stable");
await expect( await expect(
po.page.getByRole("button", { name: "Download Stable" }), po.page.getByRole("button", { name: "Download Stable" }),
).toBeVisible(); ).toBeVisible();
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings2);
}); });
...@@ -5,11 +5,16 @@ test("switching smart context mode saves the right setting", async ({ po }) => { ...@@ -5,11 +5,16 @@ test("switching smart context mode saves the right setting", async ({ po }) => {
const proModesDialog = await po.openProModesDialog({ const proModesDialog = await po.openProModesDialog({
location: "home-chat-input-container", location: "home-chat-input-container",
}); });
await po.snapshotSettings();
const beforeSettings1 = po.recordSettings();
await proModesDialog.setSmartContextMode("balanced"); await proModesDialog.setSmartContextMode("balanced");
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings1);
const beforeSettings2 = po.recordSettings();
await proModesDialog.setSmartContextMode("off"); await proModesDialog.setSmartContextMode("off");
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings2);
const beforeSettings3 = po.recordSettings();
await proModesDialog.setSmartContextMode("deep"); await proModesDialog.setSmartContextMode("deep");
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings3);
}); });
{ - "enableAutoUpdate": true
"selectedModel": { + "enableAutoUpdate": false
"name": "auto", \ No newline at end of file
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": false,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "enableAutoUpdate": false
"selectedModel": { + "enableAutoUpdate": true
"name": "auto", \ No newline at end of file
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ + "maxChatTurnsInContext": 5
"selectedModel": { \ No newline at end of file
"name": "test-model",
"provider": "custom::testing",
"customModelId": 1
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"maxChatTurnsInContext": 5,
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "releaseChannel": "stable"
"selectedModel": { + "releaseChannel": "beta"
"name": "auto", \ No newline at end of file
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "beta",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "releaseChannel": "beta"
"selectedModel": { + "releaseChannel": "stable"
"name": "auto", \ No newline at end of file
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ + "proSmartContextOption": "balanced"
"selectedModel": { \ No newline at end of file
"name": "auto",
"provider": "auto"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "enableProSmartFilesContextMode": true
"selectedModel": { + "enableProSmartFilesContextMode": false
"name": "auto", - "proSmartContextOption": "balanced"
"provider": "auto" \ No newline at end of file
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"proSmartContextOption": "balanced",
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "enableProSmartFilesContextMode": false
"selectedModel": { + "enableProSmartFilesContextMode": true
"name": "auto", + "proSmartContextOption": "deep"
"provider": "auto" \ No newline at end of file
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": false,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"proSmartContextOption": "deep",
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ + "lastShownReleaseNotesVersion": "[scrubbed]"
"selectedModel": { - "telemetryConsent": "unset"
"name": "auto", + "telemetryConsent": "opted_in"
"provider": "auto" \ No newline at end of file
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "opted_in",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ + "lastShownReleaseNotesVersion": "[scrubbed]"
"selectedModel": { \ No newline at end of file
"name": "auto",
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ + "lastShownReleaseNotesVersion": "[scrubbed]"
"selectedModel": { - "telemetryConsent": "unset"
"name": "auto", + "telemetryConsent": "opted_out"
"provider": "auto" \ No newline at end of file
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "opted_out",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ + "acceptedCommunityCode": true
"selectedModel": { - "selectedTemplateId": "react"
"name": "auto", + "selectedTemplateId": "jeff-kazzee/dyad-template-angular"
"provider": "auto" \ No newline at end of file
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "jeff-kazzee/dyad-template-angular",
"selectedChatMode": "build",
"acceptedCommunityCode": true,
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "selectedTemplateId": "react"
"selectedModel": { + "selectedTemplateId": "next"
"name": "test-model", \ No newline at end of file
"provider": "custom::testing",
"customModelId": 1
},
"providerSettings": {},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "next",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ + "thinkingBudget": "low"
"selectedModel": { \ No newline at end of file
"name": "gemini-2.5-pro",
"provider": "google"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"thinkingBudget": "low",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "thinkingBudget": "low"
"selectedModel": { + "thinkingBudget": "medium"
"name": "gemini-2.5-pro", \ No newline at end of file
"provider": "google"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"thinkingBudget": "medium",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "thinkingBudget": "medium"
"selectedModel": { + "thinkingBudget": "high"
"name": "gemini-2.5-pro", \ No newline at end of file
"provider": "google"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"thinkingBudget": "high",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ + "proLazyEditsMode": "v1"
"selectedModel": { \ No newline at end of file
"name": "auto",
"provider": "auto"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "proLazyEditsMode": "v1"
"selectedModel": { + "proLazyEditsMode": "v2"
"name": "auto", \ No newline at end of file
"provider": "auto"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"proLazyEditsMode": "v1",
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{ - "enableProLazyEditsMode": true
"selectedModel": { + "enableProLazyEditsMode": false
"name": "auto", - "proLazyEditsMode": "v2"
"provider": "auto" + "proLazyEditsMode": "off"
}, \ No newline at end of file
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": true,
"proLazyEditsMode": "v2",
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
{
"selectedModel": {
"name": "auto",
"provider": "auto"
},
"providerSettings": {
"auto": {
"apiKey": {
"value": "testdyadkey",
"encryptionType": "plaintext"
}
}
},
"telemetryConsent": "unset",
"telemetryUserId": "[UUID]",
"hasRunBefore": true,
"enableDyadPro": true,
"experiments": {},
"lastShownReleaseNotesVersion": "[scrubbed]",
"enableProLazyEditsMode": false,
"proLazyEditsMode": "off",
"enableProSmartFilesContextMode": true,
"selectedTemplateId": "react",
"selectedChatMode": "build",
"enableAutoFixProblems": false,
"enableAutoUpdate": true,
"releaseChannel": "stable",
"isRunning": true,
"isTestMode": true
}
\ No newline at end of file
import { test } from "./helpers/test_helper"; import { test } from "./helpers/test_helper";
test("telemetry - accept", async ({ po }) => { test("telemetry - accept", async ({ po }) => {
// Expect NO telemetry settings to be set const beforeSettings = po.recordSettings();
await po.snapshotSettings();
await po.clickTelemetryAccept(); await po.clickTelemetryAccept();
// Expect telemetry settings to be set // Expect telemetry settings to be set
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings);
}); });
test("telemetry - reject", async ({ po }) => { test("telemetry - reject", async ({ po }) => {
// Expect NO telemetry settings to be set const beforeSettings = po.recordSettings();
await po.snapshotSettings();
await po.clickTelemetryReject(); await po.clickTelemetryReject();
// Expect telemetry settings to still NOT be set // Expect telemetry settings to still NOT be set
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings);
}); });
test("telemetry - later", async ({ po }) => { test("telemetry - later", async ({ po }) => {
// Expect NO telemetry settings to be set const beforeSettings = po.recordSettings();
await po.snapshotSettings();
await po.clickTelemetryLater(); await po.clickTelemetryLater();
// Expect telemetry settings to still NOT be set // Expect telemetry settings to still NOT be set
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings);
}); });
...@@ -3,10 +3,12 @@ import { test } from "./helpers/test_helper"; ...@@ -3,10 +3,12 @@ import { test } from "./helpers/test_helper";
test("template - community", async ({ po }) => { test("template - community", async ({ po }) => {
await po.goToHubTab(); await po.goToHubTab();
// This is a community template, so we should see the consent dialog // This is a community template, so we should see the consent dialog
const beforeSettings1 = po.recordSettings();
await po.selectTemplate("Angular"); await po.selectTemplate("Angular");
await po.page.getByRole("button", { name: "Cancel" }).click(); await po.page.getByRole("button", { name: "Cancel" }).click();
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings1);
const beforeSettings2 = po.recordSettings();
await po.selectTemplate("Angular"); await po.selectTemplate("Angular");
await po.page.getByRole("button", { name: "Accept" }).click(); await po.page.getByRole("button", { name: "Accept" }).click();
await po.page await po.page
...@@ -15,5 +17,5 @@ test("template - community", async ({ po }) => { ...@@ -15,5 +17,5 @@ test("template - community", async ({ po }) => {
.locator("div") .locator("div")
.first() .first()
.click(); .click();
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings2);
}); });
...@@ -3,8 +3,9 @@ import { expect } from "@playwright/test"; ...@@ -3,8 +3,9 @@ import { expect } from "@playwright/test";
test("create next.js app", async ({ po }) => { test("create next.js app", async ({ po }) => {
await po.setUp(); await po.setUp();
const beforeSettings = po.recordSettings();
await po.goToHubAndSelectTemplate("Next.js Template"); await po.goToHubAndSelectTemplate("Next.js Template");
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings);
// Create an app // Create an app
await po.sendPrompt("tc=edit-made-with-dyad"); await po.sendPrompt("tc=edit-made-with-dyad");
......
...@@ -7,27 +7,30 @@ testSkipIfWindows("thinking budget", async ({ po }) => { ...@@ -7,27 +7,30 @@ testSkipIfWindows("thinking budget", async ({ po }) => {
// Low // Low
await po.goToSettingsTab(); await po.goToSettingsTab();
const beforeSettings1 = po.recordSettings();
await po.page.getByRole("combobox", { name: "Thinking Budget" }).click(); await po.page.getByRole("combobox", { name: "Thinking Budget" }).click();
await po.page.getByRole("option", { name: "Low" }).click(); await po.page.getByRole("option", { name: "Low" }).click();
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings1);
await po.page.getByText("Go Back").click(); await po.page.getByText("Go Back").click();
await po.sendPrompt("[dump] hi"); await po.sendPrompt("[dump] hi");
await po.snapshotServerDump("request"); await po.snapshotServerDump("request");
// Medium // Medium
await po.goToSettingsTab(); await po.goToSettingsTab();
const beforeSettings2 = po.recordSettings();
await po.page.getByRole("combobox", { name: "Thinking Budget" }).click(); await po.page.getByRole("combobox", { name: "Thinking Budget" }).click();
await po.page.getByRole("option", { name: "Medium (default)" }).click(); await po.page.getByRole("option", { name: "Medium (default)" }).click();
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings2);
await po.page.getByText("Go Back").click(); await po.page.getByText("Go Back").click();
await po.sendPrompt("[dump] hi"); await po.sendPrompt("[dump] hi");
await po.snapshotServerDump("request"); await po.snapshotServerDump("request");
// High // High
await po.goToSettingsTab(); await po.goToSettingsTab();
const beforeSettings3 = po.recordSettings();
await po.page.getByRole("combobox", { name: "Thinking Budget" }).click(); await po.page.getByRole("combobox", { name: "Thinking Budget" }).click();
await po.page.getByRole("option", { name: "High" }).click(); await po.page.getByRole("option", { name: "High" }).click();
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings3);
await po.page.getByText("Go Back").click(); await po.page.getByText("Go Back").click();
await po.sendPrompt("[dump] hi"); await po.sendPrompt("[dump] hi");
await po.snapshotServerDump("request"); await po.snapshotServerDump("request");
......
...@@ -5,11 +5,16 @@ test("switching turbo edits saves the right setting", async ({ po }) => { ...@@ -5,11 +5,16 @@ test("switching turbo edits saves the right setting", async ({ po }) => {
const proModesDialog = await po.openProModesDialog({ const proModesDialog = await po.openProModesDialog({
location: "home-chat-input-container", location: "home-chat-input-container",
}); });
await po.snapshotSettings();
const beforeSettings1 = po.recordSettings();
await proModesDialog.setTurboEditsMode("classic"); await proModesDialog.setTurboEditsMode("classic");
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings1);
const beforeSettings2 = po.recordSettings();
await proModesDialog.setTurboEditsMode("search-replace"); await proModesDialog.setTurboEditsMode("search-replace");
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings2);
const beforeSettings3 = po.recordSettings();
await proModesDialog.setTurboEditsMode("off"); await proModesDialog.setTurboEditsMode("off");
await po.snapshotSettings(); po.snapshotSettingsDelta(beforeSettings3);
}); });
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论