Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions e2e-tests/local_agent_code_search.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { expect } from "@playwright/test";
import { testSkipIfWindows } from "./helpers/test_helper";

/**
Expand All @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/package_manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function createSupportedPnpmShim(userDataDir: string) {
}

function warmSocketFirewallCache() {
const maxAttempts = 5;
const maxAttempts = process.env.CI ? 8 : 5;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the project's general rules, we should prioritize explicit if/else blocks over ternary operators for clarity when handling different execution paths (such as CI vs. local builds), even if it results in minor code duplication. Readability is favored over conciseness in these scenarios.

  let maxAttempts = 5;
  if (process.env.CI) {
    maxAttempts = 8;
  }
References
  1. Prioritize explicit if/else blocks over ternary operators for clarity when handling different execution paths (e.g., test vs. production builds), even if it results in minor code duplication. Readability is favored over conciseness in these scenarios.

const warmupEnv = {
...process.env,
npm_config_store_dir: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions e2e-tests/supabase_migrations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions rules/e2e-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/codebase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]);
Expand Down
Loading