Skip to content

fix(e2e): collapse JAVA PROJECTS tree before second click-project-node#1009

Merged
wenytang-ms merged 1 commit intomainfrom
fix/file-operations-collapse-java-projects-tree
May 7, 2026
Merged

fix(e2e): collapse JAVA PROJECTS tree before second click-project-node#1009
wenytang-ms merged 1 commit intomainfrom
fix/file-operations-collapse-java-projects-tree

Conversation

@wenytang-ms
Copy link
Copy Markdown
Contributor

Why

CI run #25422861436 failed on the merge of #1003 with Java Dependency — File Operations at 35/39:

❌ [click-project-node-2] click my-app tree item
   <h3 class="title">Java Projects</h3> from <div class="pane-header"...>
   intercepts pointer events

#1003 had already added closeAuxiliaryBar, collapseSidebarSection OUTLINE/TIMELINE, collapseWorkspaceRoot, and focus-java-projects before the first click-project-node, which fixed the initial click. But the second click failed for a different reason.

Root cause

Between Test 1 and Test 2 of the file-operations plan:

  1. enter-class-name App2 opens App2.java in an editor.
  2. Link-with-editor (default ON) auto-expands the JAVA PROJECTS tree all the way to my-app → src/main/java → com.mycompany.app → App2.java to reveal the newly-created file.
  3. Test 2 starts: close-editors-before-pkg, collapse-workspace-root-2, focus-java-projects-2.
  4. collapseWorkspaceRoot only collapses the Explorer view's workspace folder — it does not collapse the JAVA PROJECTS view itself.
  5. Result: when click-project-node-2 runs, my-app is no longer at row 0 of the JAVA PROJECTS view; it's been pushed deeper, gets scrolled, and ends up directly underneath the sticky .pane-header .title "Java Projects". The pane-header intercepts the click — CI log shows the actual hit target was the codicon-collapse-all view-title button.

Fix

Add a clickViewTitleAction "Java Projects" "Collapse All" step before click-project-node-2 to reset the JAVA PROJECTS tree to its initial collapsed state, putting my-app back at row 0 (clearly below the sticky pane-header).

Test 3 (rename) and Test 4 (delete) don't need this guard — they click leaf nodes (AppToRename, AppToDelete) that link-with-editor freshly reveals at the bottom of the viewport, where the sticky pane-header isn't a concern. CI confirmed both passed (✅ select-rename-target, ✅ delete-context-menu).

Verification

Ran the full plan locally on Windows with @vscjava/vscode-autotest@0.6.6 against a freshly-built vscode-java-dependency.vsix:

✅ [collapse-java-projects-tree-2] clickViewTitleAction "Java Projects" "Collapse All" (2319ms)
✅ [click-project-node-2] click my-app tree item (2003ms)
...
📊 Results: 40/40 passed

Compatibility

clickViewTitleAction was introduced in autotest 0.6.6, which is published on npm and what the workflow installs via npm install -g @vscjava/vscode-autotest.

The Test 1 `enter-class-name App2` step opens App2.java in the editor.
With link-with-editor on (default), this auto-expands the JAVA PROJECTS
tree to my-app → src/main/java → com.mycompany.app → App2.java to
reveal the newly created file.

When Test 2 then closes editors and tries to click the my-app root node
again, the tree is still expanded so my-app is no longer at row 0. Even
after `focus-java-projects`, the row gets scrolled, and the sticky JAVA
PROJECTS pane-header (.pane-header .title) intercepts the click. CI logs
show the click hit the codicon-collapse-all button on the view title bar
instead of the my-app row, causing `click-project-node-2` to fail.

`collapseWorkspaceRoot` only collapses the Explorer view's workspace
root, not the JAVA PROJECTS view. Use the view's own `Collapse All`
title-bar action via clickViewTitleAction (autotest 0.6.6+) to reset
the tree state, putting my-app back at row 0 below the pane-header.

Verified locally: 40/40 steps pass with the new collapse step.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wenytang-ms wenytang-ms merged commit acb0ded into main May 7, 2026
6 checks passed
@wenytang-ms wenytang-ms deleted the fix/file-operations-collapse-java-projects-tree branch May 7, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants