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
- Host: GitHub
- URL: https://github.com/lynix28/web-playwright-example
- Owner: lynix28
- Created: 2023-07-02T19:18:36.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T09:38:51.000Z (almost 2 years ago)
- Last Synced: 2025-02-08T14:13:20.233Z (4 months ago)
- Topics: automated-testing, bdd-tests, playwright-python, web-testing
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WEB-PLAYWRIGHT-EXAMPLE
[](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 = webkitRunning 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)