Automation Testing with CI/CD - Playwright Tests with Bitbucket and GitLab
In this blog post, I have taken Playwright tests to integrate with CI process using Bitbucket and GitLab. A typical diagram of CI/CD from a QA stand point below
When we say Continuous Integration, It means an Automated process which easily manages frequent releases. It is a process which kicks off the pipeline by detecting, pulling, building the changed source code and automation testing on the fly for the changed source code of a product.
From the above diagram I have taken a typical monolithic project where automation testing is performed here on both Localhost/Dev environment and staging environment.
In some projects we directly target the Staging/Pre-Prod environment only as the developers perform unit testing on their DEV environments. The idea here is to create an automation test framework and create a repository for the test code. Run these tests on headless mode on your CI tool like Jenkins, GitLab, Bitbucket etc.. as a part of continuous integration.
When it comes to Continuous Delivery, It is a set of automatic processes which will get the source code changes and runs them through different operations like build, packaging and related operations to deploy the software automatically without any human interference.
You will need the help of your DevOps and SRE team to manage these complex pipelines and releases.
Coming back to our CI, I have taken Playwright tests to show the tests run on CI with Bitbucket and GitLab.
You can also run tests with Cypress, WebdriverIO or Test Cafe according to your choice.
The automation tests are usually environment agnostic meaning you have to just change the Env url or handle the url's with ENV Variables. The tests will be same across all the environments DEV, Staging and Prod.
Integrate Playwright Tests with Bitbucket
You need to install "Microsoft" or "Google" Authenticator on your phone for 2FA (2 Factor Authentication) to run the pipeline in Bitbucket for the very first time. Just scan the QR code and you are ready.
For the first time click on "Pipelines" on the left side nav menu and click on the "Run pipeline" button on the top right.
Awesome diagram bro. Like the approach
ReplyDeleteThank you Akshay :)
Delete