Add tests for dependency view
here to track that the integration tests about dependency view should be added into this repo. related feature PR: #887
Hi @CsCherrYY, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Suggestions for Adding Integration Tests to the Dependency View
-
Leverage the
vscode-testlibrary to launch VS Code and run integration tests programmatically:- Repository & docs: https://github.com/microsoft/vscode-test
- Define a test runner in
package.jsonthat callsrunTests({ extensionDevelopmentPath, extensionTestsPath, launchArgs: [...] }).
-
In your test suite (e.g. under
test/integration):- Use
await vscode.commands.executeCommand('java.dependency.view.refresh')(or the correct view ID) to open/refresh the Dependency View. - Query the tree via the extension API (e.g.
vscode.window.createTreeView) or UI automation to verify expected nodes. - Clean up by closing editors/views between tests to ensure isolation.
- Use
-
Mirror patterns from existing integration tests in other VS Code extensions:
- Ensure your CI workflow installs dependencies, builds the extension, and then runs
npm testto execute integration specs.
- Ensure your CI workflow installs dependencies, builds the extension, and then runs
Other references with low confidence
-
Support additional Gradle configurations: discusses enabling IntelliSense for an
integrationTestsource set in Gradle projects. May offer ideas on configuring test project layouts.
URL: https://github.com/redhat-developer/vscode-java/issues/1809 -
[Engineer] Setup new QA process for releasing: includes a checkbox for adding integration tests by installing the Java Extension Pack.
URL: https://github.com/microsoft/vscode-java-pack/issues/289
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!