diff --git a/e2e-tests/local_agent_code_search.spec.ts b/e2e-tests/local_agent_code_search.spec.ts index cfb0577c9..6ca99fab2 100644 --- a/e2e-tests/local_agent_code_search.spec.ts +++ b/e2e-tests/local_agent_code_search.spec.ts @@ -1,3 +1,4 @@ +import { expect } from "@playwright/test"; import { testSkipIfWindows } from "./helpers/test_helper"; /** @@ -9,6 +10,14 @@ testSkipIfWindows("local-agent - code search", async ({ po }) => { await po.setUpDyadPro({ localAgent: true }); await po.importApp("minimal"); await po.chatActions.selectLocalAgentMode(); + await po.page.evaluate(async () => { + await (window as any).electron.ipcRenderer.invoke("set-user-settings", { + enableCodeExplorer: false, + }); + }); + await expect + .poll(() => po.settings.recordSettings().enableCodeExplorer) + .toBe(false); await po.sendPrompt("tc=local-agent/code-search"); diff --git a/e2e-tests/package_manager.spec.ts b/e2e-tests/package_manager.spec.ts index f79c5d0d0..8fc9bfaad 100644 --- a/e2e-tests/package_manager.spec.ts +++ b/e2e-tests/package_manager.spec.ts @@ -101,7 +101,7 @@ async function createSupportedPnpmShim(userDataDir: string) { } function warmSocketFirewallCache() { - const maxAttempts = 5; + const maxAttempts = process.env.CI ? 8 : 5; const warmupEnv = { ...process.env, npm_config_store_dir: undefined, diff --git a/e2e-tests/snapshots/local_agent_code_search.spec.ts_local-agent---code-search-1.aria.yml b/e2e-tests/snapshots/local_agent_code_search.spec.ts_local-agent---code-search-1.aria.yml index c5461afe0..474bdcbf6 100644 --- a/e2e-tests/snapshots/local_agent_code_search.spec.ts_local-agent---code-search-1.aria.yml +++ b/e2e-tests/snapshots/local_agent_code_search.spec.ts_local-agent---code-search-1.aria.yml @@ -5,7 +5,9 @@ - text: "[[Version 2: files changed]]" - button "Copy Request ID" - paragraph: tc=local-agent/code-search -- paragraph: I'll search for files related to React components in the codebase.I found the relevant files! The main React component is in src/App.tsx which handles the app rendering. +- paragraph: I'll search for files related to React components in the codebase. +- button "Code Search React component rendering" +- paragraph: I found the relevant files! The main React component is in src/App.tsx which handles the app rendering. - button "Copy" - button "Copy Request ID" - button "Undo" diff --git a/e2e-tests/supabase_migrations.spec.ts b/e2e-tests/supabase_migrations.spec.ts index acf8454b6..df4b79592 100644 --- a/e2e-tests/supabase_migrations.spec.ts +++ b/e2e-tests/supabase_migrations.spec.ts @@ -53,6 +53,7 @@ testSkipIfWindows("supabase migrations", async ({ po }) => { // Send a prompt that triggers a migration await po.sendPrompt("tc=execute-sql-no-description"); await po.chatActions.waitForChatCompletion(); + await po.approveProposal(); await expect(async () => { // Check that one migration file was created @@ -126,6 +127,7 @@ testSkipIfWindows("supabase migrations with native git", async ({ po }) => { // Send a prompt that triggers a migration await po.sendPrompt("tc=execute-sql-no-description"); await po.chatActions.waitForChatCompletion(); + await po.approveProposal(); await expect(async () => { // Check that one migration file was created diff --git a/rules/e2e-testing.md b/rules/e2e-testing.md index 8fa9cd73f..1ed51e05a 100644 --- a/rules/e2e-testing.md +++ b/rules/e2e-testing.md @@ -195,6 +195,8 @@ If `npm run build` / Electron Forge packaging fails with `Failed to locate modul - **Click timeouts with "subtree intercepts pointer events" across many specs**: When several unrelated specs all time out clicking the same button and the call log says another element's "subtree intercepts pointer events", it's a CSS layout overlap (often a flex item shrinking below its `flex-shrink-0` content — see rules/ui-styling.md), not a flaky test. Look at the failure screenshot first and fix the app layout instead of retrying clicks. - **Filesystem-heavy IPC assertions**: Operations that delete or copy whole app directories (e.g. bulk app delete) can exceed the 5s default expect timeout on CI runners. Give the post-operation assertion an explicit `{ timeout: 30_000 }`. - **Fake Anthropic engine routes**: When app code uses Anthropic direct passthrough, the fake LLM server must handle `/v1/messages` (and provider-prefixed variants like `/engine/v1/messages`), not just `/chat/completions`. Anthropic tool results come back as user messages with `tool_result` content blocks, so fixture turn counting must skip those as user prompts. +- **Legacy local-agent `code_search` coverage**: `code_search` is hidden when code explorer is enabled and ready, so specs that explicitly test `code_search` should set `enableCodeExplorer: false` and poll persisted settings before sending the fixture prompt. Otherwise local and CI can render different snapshots depending on code-explorer readiness. +- **Supabase destructive SQL migration proposals**: Auto-approve does not apply destructive SQL changes. If an E2E prompt returns a destructive SQL proposal (for example `DROP TABLE`), call `po.approveProposal()` before asserting that a migration file or app-file change exists. ## Triaging failures from a CI run's html-report diff --git a/src/__tests__/codebase.test.ts b/src/__tests__/codebase.test.ts index 9e5174018..1acf38454 100644 --- a/src/__tests__/codebase.test.ts +++ b/src/__tests__/codebase.test.ts @@ -101,7 +101,7 @@ describe("extractCodebase", () => { }, }); - expect(result.files.map((file) => file.path)).toEqual([ + expect(result.files.map((file) => file.path).sort()).toEqual([ ".gitignore", "src.ts", ]);