An open API service indexing awesome lists of open source software.

https://github.com/lynix28/web-playwright-example

WebUI automation test example project with Playwright
https://github.com/lynix28/web-playwright-example

automated-testing bdd-tests playwright-python web-testing

Last synced: 3 months ago
JSON representation

WebUI automation test example project with Playwright

Awesome Lists containing this project

README

        

# WEB-PLAYWRIGHT-EXAMPLE

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/lynix28/web-playwright-example/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/lynix28/web-playwright-example/tree/master)

How to Setup:

- Clone this repo and go to the project directory
- Install & create Virtual ENV

- `pip install virtualenv`
- `python -m venv ./venv`

- Use the Virtual ENV

- `source ./venv/bin/activate`

- Install PIP Packages

- `pip install -r requirements.txt`

- Download required browser

- `playwright install`

Inspect an element:

- `playwright cr "URL_to_website"`
- use: cr = chromium | ff = firefox | wk = webkit

Running the tests:

- `pytest ./[your_test_script].py`
- to run it on HEADLESS, update the `.env` file, the default is 'False'
- to use different browser like 'firefox' or 'webkit', update the `.env` file, the default is 'chromium'

Running the tests (with: run_test.sh):

- `./run_test.sh` | to run all tests
- `./run_test.sh [your_test_script_alias]` | to run a specific scenario
- Make sure to give "execute" permission to `run_test.sh`
- Make sure to add your test to `test_list.sh` if there is any new test scenario

- `./run_test.sh --help` | for more example how to run the test

Running the tests (BDD):

- `pytest` | to run all tests
- `pytest -k "tag_or_alias"` | to run a specific scenario (ex: login)