E2E Web and API Automation Using Playwright and Typescript
[By Moxe Tibane and Ronald Ncube]
Welcome to the All-In-One next generation of UI Automation
The benefits of this framework include
🏆 In-built Cucumber Integration
🏆 In-built Azure Test Plans Integration
🏆 In-built Azure Pipelines
🏆In-built Azure Test Coverage and Execution Dashboard
🏆 In-built Cucumber Report
Table of contents
Pre-requisites to running playwright
Before you can run with Playwright, you will need the following installed in your machine
Most Engineers use VS Code VS Code
To check if node is install run the command: node -v
If node is installed in your machine, your will get the following:
Else install Node from the following link NodeJs
Setup
Generate a PAT file in Azure. Steps to generate a PAT File
Update your .env.secrets with your PAT file as follows
PAT=[Your base 64 PAT token here]
TEST_GENERIC_USERNAME=[Your username here]
TEST_GENERIC_PASSWORD=[Your password here]
Executing your test scripts
Since the test are written in Cucumber, we need a test runneer that can interpret the tests.
The test runner that is used in this framework is CucummberJs which is fairly easy to use>
To run the tests, you simply need to:
- Open your code editor's terminal from the root of your project
- Run the command: npm install and wait for the installation
- Now it is time to run the tests. Simply run the command: npm run test:chrome:stg "@SampleTests"
Additional Info
If you have any issues following this guide, please reach out to Moxe Tibane or Ronald Ncube on Teams; they will definitely sort you out.
Happy Testing 😄
Copyright reserved © 2023