Updated workflow with TestDriver integration
This workflow builds the application, uploads the build as an artifact, and then uses TestDriver to download the artifact via the runner artifact URL and run tests.Workflow file
.github/workflows/testdriver-integration.yaml
Using lifecycle files for Electron apps
To ensure your Electron app is downloaded and run in the correct environment, use TestDriver’s lifecycle files:- lifecycle/provision.yaml: Download and extract the Electron app artifact here.
- lifecycle/prerun.yaml: Start your Electron app here before the test begins.
Example:
testdriver/lifecycle/provision.yaml
testdriver/lifecycle/prerun.yaml
Key changes and explanation
1. Artifact URL Retrieval
TheGet Artifact URL
step constructs the artifact URL dynamically using the GitHub repository and server URL. This value is passed to the lifecycle files as an environment variable.
2. Downloading and running the app in lifecycle files
- Download and extract the Electron app in
lifecycle/provision.yaml
. - Start the Electron app in
lifecycle/prerun.yaml
. - The TestDriver CLI will then execute your tests against the running app.
Secrets configuration
Add the following secrets to your GitHub repository:TD_API_KEY
: Your TestDriver API key.GITHUB_TOKEN
: Automatically provided by GitHub Actions for authentication.
Benefits of this workflow
- Dynamic Artifact Access: Ensures TestDriver can download artifacts directly from the runner.
- Automated Testing: Integrates TestDriver to validate the application after the build.
- Secure Authentication: Uses the GitHub token for secure artifact access.
- Cross-Platform Support: Can be adapted for different operating systems and environments.
By integrating TestDriver with the runner artifact URL and GitHub token, and using lifecycle files, this workflow ensures seamless and secure testing of your Electron application builds.