Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
2 changes: 0 additions & 2 deletions e2e-tests/ai_e2e_testing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ testSkipIfWindows(
await po.navigation.goToTemplatesAndSelectTemplate("Next.js Template");
await po.chatActions.selectChatMode("build");
await po.sendPrompt("tc=basic", { timeout: Timeout.EXTRA_LONG });
await po.sendPrompt("tc=add-neon");

// Connect a Neon project so runs get an isolated branch copy.
await po.appManagement.startDatabaseIntegrationSetup("neon");
await po.appManagement.clickConnectNeonButton();
Expand Down
8 changes: 2 additions & 6 deletions e2e-tests/approve.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { testSkipIfWindows, Timeout } from "./helpers/test_helper";
import { expect } from "@playwright/test";

testSkipIfWindows("write to index, approve, check preview", async ({ po }) => {
await po.setUp();
testSkipIfWindows("write to index and check preview", async ({ po }) => {
await po.setUp({ autoApprove: true });

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

Legacy proposal approve/reject path loses all remaining test coverage

src/ipc/handlers/__tests__/reject.integration.test.ts is deleted, PageObject.approveProposal/rejectProposal are removed, and every remaining E2E call site (approve, debugging_logs, logs_server, visual_editing, package_manager) now opts into auto-approval instead. The approve/reject code path is still live, though: ChatInputActions renders whenever getProposal returns non-null, and proposal_handlers deliberately keeps returning legacy proposals for assistant messages without aiMessagesJson — i.e. exactly the pre-upgrade chats this compatibility path exists to serve. That path now ships with no automated coverage at any level, and ChatInput.tsx simultaneously relaxes its render guard by dropping the selectedMode !== "ask" && selectedMode !== "local-agent" condition.

💡 Suggestion: Keep one integration test that seeds an assistant message with legacy XML content and a null aiMessagesJson, then drives the real Approve and Reject buttons, so the stored-response compatibility path stays verified.

await po.sendPrompt("tc=write-index");
await po.snapshotMessages();
await po.approveProposal();

// Should be slightly different from above, because it will say "approved"
await po.snapshotMessages();

// This can be pretty slow because it's waiting for the app to build.
await expect(po.previewPanel.getPreviewIframeElement()).toBeVisible({
Expand Down
10 changes: 6 additions & 4 deletions e2e-tests/attach_image.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ test("attach image - chat - upload to codebase", async ({ po }) => {
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles("e2e-tests/fixtures/images/logo.png");

await po.sendPrompt("[[UPLOAD_IMAGE_TO_CODEBASE]]", {
timeout: Timeout.EXTRA_LONG,
});
await po.sendPrompt(
"tc=local-agent/upload-image-to-codebase [[UPLOAD_IMAGE_TO_CODEBASE]]",
{
timeout: Timeout.EXTRA_LONG,
},
);

// Wait for the uploaded file card to render before snapshotting. Use .first()
// because the modified-files card at the bottom of the chat now also lists
Expand All @@ -113,7 +116,6 @@ test("attach image - chat - upload to codebase", async ({ po }) => {
po.page.getByText("file.png", { exact: true }).first(),
).toBeVisible();

await po.snapshotServerDump("last-message", { name: "upload-to-codebase" });
await po.snapshotMessages({ replaceDumpPath: true });

// new/image/file.png
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/auto_approve.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { testSkipIfWindows, Timeout } from "./helpers/test_helper";
import { expect } from "@playwright/test";

testSkipIfWindows("auto-approve", async ({ po }) => {
testSkipIfWindows("agentic Build applies changes", async ({ po }) => {
await po.setUp({ autoApprove: true });
await po.sendPrompt("tc=write-index");
await po.snapshotMessages();
Expand Down
21 changes: 11 additions & 10 deletions e2e-tests/concurrent_chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ import { expect } from "@playwright/test";

test("concurrent chat", async ({ po }) => {
await po.setUp();
await po.sendPrompt("tc=chat1 [sleep=medium]", {
await po.sendPrompt("tc=chat1 [sleep=long]", {
skipWaitForCompletion: true,
});
await expect
.poll(() => new URL(po.page.url()).searchParams.get("id"))
.not.toBeNull();
const chat1Id = new URL(po.page.url()).searchParams.get("id");
expect(chat1Id).not.toBeNull();

await po.chatActions.clickNewChat();
await po.sendPrompt("tc=chat2");
await po.snapshotMessages();

// Chat #1 tab should be visible in the chat tabs with an "in progress" indicator
// Find the tab that contains the "Chat in progress" indicator and click it
const chat1TabContainer = po.page
.locator('[aria-label="Chat in progress"]')
.locator("xpath=ancestor::div[@draggable][1]");
await expect(chat1TabContainer).toBeVisible();

// Click the button inside the tab to select it
await chat1TabContainer.locator("button").first().click();
// The background turn may complete before the foreground chat settles, but
// both chat tabs must remain independently selectable.
const chat1Tab = po.page
.getByTestId(`chat-tab-${chat1Id}`)
.locator("button")
.first();
await expect(chat1Tab).toBeVisible();
await chat1Tab.click();
await po.snapshotMessages({ timeout: 12_000 });
});
Loading
Loading