test(e2e): add Tier 1 plan — copy file / relative path#1032
Merged
Conversation
Adds an E2E plan covering the two clipboard commands contributed against the Java Projects view: - java.view.package.copyFilePath (Copy Path) - java.view.package.copyRelativeFilePath (Copy Relative Path) Both handlers (dependencyExplorer.ts:159 and :165) are thin wrappers that forward the selected DataNode's URI to VS Code's built-in copyFilePath / copyRelativeFilePath. They have no on-screen side effect whatsoever — the only observable consequence is what lands on the OS clipboard. Verifying them therefore requires the new clipboard primitives (writeClipboard / verifyClipboard) added in autotest 0.7.16. Plan shape - Setup: wait for LS, free sidebar space, collapse workspace root, focus Java Projects. - Reveal App.java via Quick Open (link-with-editor auto-expands the tree path), then click the tree row with the new `exact` modifier to disambiguate the leaf label "App" from the project node "my-app" (which would otherwise be matched first by case-insensitive substring and silently selected, producing the workspace folder URI instead of the file URI). - For each command: seed the clipboard with a sentinel, invoke the command by id, assert the clipboard contains "App.java", matches the expected path-suffix shape (cross-OS regex tolerating both `\` and `/` separators), and no longer equals the sentinel. Cross-OS note - VS Code's built-in `copyRelativeFilePath` computes `path.relative(workspaceFolderUri, fileUri)` and falls back to the absolute path when membership fails. On Windows the URI we pass (`Uri.parse(cmdNode.uri)` from JDT.LS) can differ in drive-letter case or percent-encoding from VS Code's registered workspace folder URI, so the membership test fails and the absolute path comes back. On POSIX the URIs match and the relative form is produced. The assertions tolerate both — they prove the command fired and overwrote the sentinel with a well-formed path ending in the expected layout, but do not require the leading-`src` shape that only POSIX produces. Coverage moves from ~33 → 35 of the ~39 user-facing Java Manager commands. Tier 2 (file-menu / file-explorer wrappers) and Tier 3 (gradle lifecycle, multi-module navigation) remain deferred. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new E2E plan to validate the Java Projects view clipboard wrapper commands (java.view.package.copyFilePath and java.view.package.copyRelativeFilePath) by asserting OS clipboard contents (seed sentinel → invoke command → verify clipboard text and path shape across OSes).
Changes:
- Added a new E2E plan that selects
Appin the Java Projects tree deterministically and invokes both copy-path commands by id. - Verifies clipboard output using sentinel overwrite checks plus cross-OS regex matching for expected path suffixes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
chagong
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an E2E plan covering the two clipboard commands contributed against the Java Projects view:
java.view.package.copyFilePath(Copy Path)java.view.package.copyRelativeFilePath(Copy Relative Path)Both handlers (
dependencyExplorer.ts:159and:165) are thin wrappers that forward the selectedDataNode's URI to VS Code's built-incopyFilePath/copyRelativeFilePath. They have no on-screen side effect whatsoever — the only observable consequence is what lands on the OS clipboard. Verifying them therefore requires the new clipboard primitives (writeClipboard/verifyClipboard) added in autotest 0.7.16 (wenytang-ms/javaext-autotest#6).Plan shape
App.javavia Quick Open (link-with-editor auto-expands the tree path), then click the tree row with the newexactmodifier to disambiguate the leaf labelAppfrom the project nodemy-app(which would otherwise be matched first by case-insensitive substring and silently selected, producing the workspace folder URI instead of the file URI).App.java, matches the expected path-suffix shape (cross-OS regex tolerating both\and/separators), and no longer equals the sentinel.Cross-OS note
VS Code's built-in
copyRelativeFilePathcomputespath.relative(workspaceFolderUri, fileUri)and falls back to the absolute path when membership fails. On Windows the URI we pass (Uri.parse(cmdNode.uri)from JDT.LS) can differ in drive-letter case or percent-encoding from VS Code's registered workspace folder URI, so the membership test fails and the absolute path comes back. On POSIX the URIs match and the relative form is produced. The assertions tolerate both — they prove the command fired and overwrote the sentinel with a well-formed path ending in the expected layout, but do not require the leading-srcshape that only POSIX produces.Coverage
Moves from ~33 → ~35 of the ~39 user-facing Java Manager commands. Tier 2 (file-menu / file-explorer wrappers) and Tier 3 (gradle lifecycle, multi-module navigation) remain deferred.
Test plan
Full local e2e suite on Windows: 12/12 plans pass (325 steps total) including the new
java-dep-copy-paths.yamlat 17/17.Dependency
CI installs autotest globally via
npm install -g @vscjava/vscode-autotest(unpinned). Requires autotest ≥ 0.7.16 on the npm registry — gated on wenytang-ms/javaext-autotest#6 being merged + published.