Go to file
Craig Moir 4fc178d172 Updated to add another bdd Scenario
Also updated pages
Run all tests against latest version of playwright 1.32.1
2023-04-09 23:42:14 +12:00
Workflows Updated to add another bdd Scenario 2023-04-09 23:41:00 +12:00
pages Updated to add another bdd Scenario 2023-04-09 23:41:00 +12:00
tests Updated to add another bdd Scenario 2023-04-09 23:42:14 +12:00
.gitignore renamed tests. 2021-08-23 09:10:14 +12:00
conftest.py Updated to add another bdd Scenario 2023-04-09 23:41:00 +12:00
pytest.ini removed pytest-xdist dependency to simplify 2023-01-28 12:27:56 +13:00
readme.md Updated to add another bdd Scenario 2023-04-09 23:41:00 +12:00
requirements.txt removed pytest-xdist dependency to simplify 2023-01-28 12:27:56 +13:00

readme.md

Playwright Python pytest_bdd example

  • Depends on pytest-playwright
  • pip install pytest-playwright
  • pip install pytest-bdd
  • playwright install

Command Line Example

Use "pytest" to run all the tests

Other examples Use "pytest tests/test_with_bdd.py" to run all the tests in the test_without_bdd module Use "pytest tests/without_bdd/test_without_bdd.py::test_select_numbers_link" to run the test_select_numbers_link test

Playwright Documentation

https://playwright.dev/python/docs/intro

pytest-bdd Documentation

See https://pypi.org/project/pytest-bdd/ for reporting options.

Page Object example

This test is using a standard page object model, where the selectors and functions are group inside a class.

Example is given with and without the bdd layer

Alternative format that uses files instead of objects to group the pages can be found here

pytest-xdist - used to run multiple tests at the same time pytest-html - for nice simple html report