vscode-gradle icon indicating copy to clipboard operation
vscode-gradle copied to clipboard

Add tests for dependency view

Open CsCherrYY opened this issue 4 years ago • 1 comments

here to track that the integration tests about dependency view should be added into this repo. related feature PR: #887

CsCherrYY avatar Aug 13 '21 07:08 CsCherrYY

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-test library to launch VS Code and run integration tests programmatically:

    • Repository & docs: https://github.com/microsoft/vscode-test
    • Define a test runner in package.json that calls runTests({ 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.
  • Mirror patterns from existing integration tests in other VS Code extensions:

    • Ensure your CI workflow installs dependencies, builds the extension, and then runs npm test to execute integration specs.
Other references with low confidence
  • Support additional Gradle configurations: discusses enabling IntelliSense for an integrationTest source 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!

github-actions[bot] avatar Nov 06 '25 08:11 github-actions[bot]