I have been using Playwrights node docker image, defined here: https://playwright.dev/docs/docker
This includes all the browser dependencies/etc.. for the node version of docker. This has worked fine however i'm going to be integrating the testrail CLI to help upload playwright report results to testrail.
Unfortunately this requires python which is not installed (from what I can tell) on the playwright default docker file.
What's my best/easiest course of action here? Obviously I am not going to switch all my test cases, would it make more sense to use a self-created docker file? Is there some way I can install python in the docker file in gitlab? (Which is the ci system we are using now).
I'm not super familiar with docker outside of the basics. But I imagine installing python after the fact makes more sense?
What is the best game plan here? Thanks!
The gitlab pipeline is defined in the .gitlab-ci.yml
file in the root of your repository. If you open that file in a text editor, you'll see the various jobs the pipeline runs.
It will look something like this:
<some_job_name>:
image: mcr.microsoft.com/playwright:v1.45.1-jammy
script:
- <some command>
What that means is that the job will run on the image provided.
In the script
section you can add a call to install python ( apt-get install python3
for example)
More info here: https://docs.gitlab.com/ee/ci/jobs/
This will install python3 every time the job runs, so a better approach might be to build your own custom image. This way python will be installed once and available in the image thus speeding up your pipeline. The downside is it takes some setting up.
More info on running CI/CD in containers: https://docs.gitlab.com/ee/ci/docker/using_docker_images.html
The general steps are as follows:
FROM mcr.microsoft.com/playwright:v1.45.1-jammy
RUN apt-get install python3
docker build
and create the imageI hope this helps.