- 1 year ago
gitlab-runner for testing windows application with GUI
To use GitLab Runner for testing a Windows application with a GUI, you can configure the runner to run in an interactive session and set up a virtual display for GUI interaction. Here's an overview of the steps involved:
Set up a GitLab Runner on a Windows machine:
- Install GitLab Runner on the Windows machine following the official documentation: https://docs.gitlab.com/runner/install/windows.html
- Register the runner with your GitLab instance, linking it to your project.
Configure the runner to run in an interactive session:
- Open the GitLab Runner's configuration file located at
C:\GitLab-Runner\config.toml
(or the path specified during installation). - Set the
runners.session
option to"gui"
, which runs the GitLab Runner in an interactive session.
- Open the GitLab Runner's configuration file located at
Set up a virtual display for GUI interaction:
- Install a virtual display utility like Xvfb or Xming.
- Start the virtual display before running the GUI tests. For example, with Xvfb:arduino
Xvfb :99 -screen 0 1024x768x24 &
export DISPLAY=:99
Adapt your test scripts and configurations:
- Make sure your test scripts are configured to use the virtual display environment variable (
DISPLAY=:99
) to interact with the GUI. - Adjust any other necessary configurations or environment variables for your specific testing framework or application.
- Make sure your test scripts are configured to use the virtual display environment variable (
Update your GitLab CI/CD configuration:
- Update your
.gitlab-ci.yml
file to include the necessary steps for running GUI tests. - For example, you might have a
test
job that executes the test script and interacts with the GUI.
- Update your
Commit and push your changes:
- Commit and push your updated
.gitlab-ci.yml
file to trigger a pipeline and run the GUI tests.
- Commit and push your updated
By configuring GitLab Runner to run in an interactive session and setting up a virtual display for GUI interaction, you can perform GUI testing of your Windows application using GitLab CI/CD. Adapt the steps according to your specific testing framework, tools, and application requirements.