Testing Setup and Execution - zowe/zowe-explorer-vscode GitHub Wiki
Testing Setup and Execution
Use this page for detailed testing setup and test execution workflows.
If you are looking for unit test information, start with Unit Tests.
For development setup and contribution expectations that also reference unit test coverage, see Developer Setup and Contributor Guidance.
Contents
End-to-end tests (v3)
Set up and execute end-to-end tests for Zowe Explorer. Note: We recommend using Node v22.x for the tests until an issue is resolved with Node v24.x around Chromedriver access.
Test profile data
To run end-to-end tests, define a .env file in packages/zowe-explorer/__tests__/__e2e__ with environment variables for profile information, credentials, and test targets. Refer to .env.example for the complete list.
# ----------------------------------------------
# Variables for Zowe Explorer end-to-end testing
# ----------------------------------------------
# Path to the Zowe home folder where configurations are stored (relative to current directory)
ZOWE_TEST_DIR=".zowe"
# VS Code version to run tests with - can be "stable", "insiders", or a specific version e.g. "1.80.0"
ZE_TEST_VSCODE_VER="stable"
# Profile variables
ZE_TEST_PROFILE_NAME="<profileName>" # The name of the profile in your Zowe config to use for testing
ZE_TEST_TSO_PROFILE_NAME="<tsoProfileName>" # The name of the TSO profile in your Zowe config to use for testing
ZE_TEST_SSH_PROFILE_NAME="<sshProfileName>" # The name of the SSH profile in your Zowe config to use for testing
ZE_TEST_PROFILE_USER="testUser" # The user to leverage during the e2e tests
# USS variables
ZE_TEST_USS_FILTER="/u/users/testUser" # The filter to apply when searching on a USS profile
ZE_TEST_USS_DIR="test" # The USS directory to use for edit and list testing - should be relative to USS filter
ZE_TEST_USS_FILE="testFile.txt" # The USS file to edit and save with, relative to USS dir
# Data Set variables
ZE_TEST_DS_FILTER="TESTUSER.*" # The filter to apply when searching on a Data Sets profile
ZE_TEST_PDS="TESTUSER.C" # The PDS to use for edit and list testing - must be matched by the defined filter
ZE_TEST_PDS_MEMBER="TESTC" # The PDS member to use for edit and list testing - relative to the defined PDS
ZE_TEST_PS="TESTUSER.TESTPS" # The PS to use for editing - must be matched by the defined filter
# JCL Data Set variables for Jobs submission
ZE_TEST_JCL_PDS="TESTUSER.JCL" # The PDS containing JCL to submit as job - must be matched by the defined filter
ZE_TEST_JCL_MEMBER="JOB1" # The PDS member used to store and submit the generated JCL sample
All resources must already exist on the system unless specified otherwise.
Once configured:
- Change directory to
packages/zowe-explorer. - Build with
pnpm build. - Run tests with
pnpm test:e2e.
[!IMPORTANT] On macOS:
- Additional setup is required: Native context menus are not Webdriver-controlled, so AppleScript is used. Grant Accessibility permission to VS Code in macOS Settings (
Privacy & Security->Accessibility).- ChromeDriver fails to launch: If
chromedriverfails to launch (seen in test logs) or the VS Code window never opens, ensure that your Zowe Explorer repo folder is not in a protected location. Apple's TCC protects user locations such as the Desktop, Documents, and Downloads folders. If the repository is located in one of these protected folders, try re-locating it and then re-run the tests from the new path.
Execute from VS Code
- Build the extension.
- Open Run and Debug.
- Select End-to-end Tests.
- Start with the play button.
Output appears in the VS Code debug console. JUnit reports are written to packages/zowe-explorer/results.
Behavior-driven integration tests (v3)
Use integration tests to validate UI and command behavior across profile and tree interactions.
Test profile requirements
- At least 3 profiles must exist in your Zowe config.
- Profiles do not need valid credentials up front, but hostnames must be valid/reachable for validation paths.
- A default profile must be set for the
zosmfprofile type.
Execute from VS Code
- Build the extension.
- Open Run and Debug.
- Select Behavior-driven Integration Tests.
- Start with the play button.
Output appears in the VS Code debug console. JUnit reports are written to packages/zowe-explorer/results.
Theia regression tests (v2 and below)
Run regression tests to verify compatibility with Theia.
Set up Theia workspace
- Install required components:
- Mozilla Firefox
- Google Chrome
- Mozilla Geckodriver (add to PATH)
- ChromeDriver (add to PATH)
- Selenium WebDriver (global install)
- Build a VSIX that contains your changes.
- Build and run the Theia browser example using Setting up your Theia workspace.
- Ensure your latest VSIX is in the
pluginsfolder. - Ensure Theia is running while tests execute.
Optional verification: open http://localhost:3000 and confirm Zowe Explorer is deployed.
Run regression tests
- Compile with:
yarn run compile
- Run tests with:
yarn run test:theia
Output appears in the VS Code debug console.
Run tests with Firefox UI visibility
Tests run in headless mode by default. To run with visible Firefox:
- Open
__tests__/__theia__/. - Comment out
firefoxOptions.headless();. - Compile the extension.
- Run Theia regression tests.
Firefox launches with a visible UI while tests run.