Playwright is an end-to-end testing and automation framework developed by Microsoft. Starting from the Testkube Helm chart version 1.9.5, it is possible to use Testkube to manage your Playwright tests inside your Kubernetes cluster.
Check out our blog post to learn how to harness the power of Playwright Testing in your cloud-native apps.
Running Playwright Tests
The Playwright Testkube runner pulls the test code from Git directories. When creating a new test, this needs to be configured via the
$ testkube create test --git-branch lilla/feat/playwright-executor --git-uri https://github.com/vLia/testkube-tests.git --git-path "playwright" --name playwright-test-demo --type playwright/test
Test created testkube / playwright-test-demo 🥇
$ testkube run test playwright-test-demo
Execution ID: 63eb5948d2588841ffa577a0
Execution name: playwright-test-demo-1
Execution number: 1
Start time: 2023-02-14 09:50:00.924165379 +0000 UTC
End time: 0001-01-01 00:00:00 +0000 UTC
Test execution started
Watch test execution until complete:
$ kubectl testkube watch execution playwright-test-demo-1
Use following command to get test execution details:
$ kubectl testkube get execution playwright-test-demo-1
To follow up with the results of the execution, you can either
watch the execution while it is running or
get the results of it after it is done, as seen in the commands printed out by the cli.
To get a list of the created artifacts, use the following command:
$ testkube get artifact playwright-test-demo-1
EXECUTION | NAME | SIZE (KB)
| playwright-report.zip | 180527
These files were created and uploaded to the previously configured object storage. To download them, use the
testkube download artifact command.
$ testkube download artifact playwright-test-demo-1 playwright-report.zip data
File data/playwright-report.zip downloaded.
Running tests in a containerized environment is convenient: it's simple, portable and increases the speed of development. There is a need to be aware of the limitations of this environment.
Similarly to many other testing tools, Playwright provides the option to open a browser window for reports. It is important to make sure reporters are not opening additional windows.
The following environment variables are set on a Dockerfile-level, but it is still important to be mindful of these differences.
Using Different Playwright Versions
The Testkube Playwright executor supports only one version for now: 1.30.0. In case this does not suffice, the container executor docs contains instructions on how to set up your own executor with a different version of Playwright.