If you want to add the CLI arguments automatically without specifying them, you can use the [pytest.ini](https://docs.pytest.org/en/stable/reference.html#ini-options-ref) file:
This plugin configures Playwright-specific [fixtures for pytest](https://docs.pytest.org/en/latest/fixture.html). To use these fixtures, use the fixture name as an argument to the test function.
```py
def test_my_app_is_working(fixture_name):
# Test using fixture_name
# ...
```
**Function scope**: These fixtures are created when requested in a test function and destroyed when the test ends.
-`context`: New [browser context](https://playwright.dev/#path=docs%2Fcore-concepts.md&q=browser-contexts) for a test.
-`page`: New [browser page](https://playwright.dev/#path=docs%2Fcore-concepts.md&q=pages-and-frames) for a test.
**Session scope**: These fixtures are created when requested in a test function and destroyed when all tests end.
-`browser`: Browser instance launched by Playwright.
-`browser_name`: Browser name as string.
-`is_chromium`, `is_webkit`, `is_firefox`: Booleans for the respective browser types.
**Customizing fixture options**: For `browser` and `context` fixtures, use the the following fixtures to define custom launch options.
Use the `breakpoint()` statement in your test code to pause execution and get a [pdb](https://docs.python.org/3/library/pdb.html) REPL.
```py
def test_bing_is_working(page):
page.goto("https://bing.com")
breakpoint()
# ...
```
### Screenshot on test failure
You can capture screenshots for failed tests with a [pytest runtest hook](https://docs.pytest.org/en/6.1.0/reference.html?highlight=pytest_runtest_makereport#test-running-runtest-hooks). Add this to your `conftest.py` file.
Note that this snippet uses `slugify` to convert test names to file paths, which can be installed with `pip install python-slugify`.
Use the [Playwright GitHub Action](https://github.com/microsoft/playwright-github-action) or [guides for other CI providers](https://playwright.dev/#path=docs%2Fci.md&q=) to deploy your tests to CI/CD