Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix screenshot section #7

Merged
merged 1 commit into from Sep 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -122,8 +122,11 @@ To pause the Pytest test execution and interact with the browser (if its launche

On the CI it's useful to have screenshots if a test is failing, this can be implemented by adding the following in your `conftest.py` which will store the screenshots in the `.playwright-screenshots` directory which can be uploaded e.g. in your CI as an artifact.

This snippet requires `slugify` to convert test names to file paths, which can be installed with `pip install python-slugify`.

```py
from slugify import slugify
from pathlib import Path

def pytest_runtest_makereport(item, call) -> None:
if call.when == "call":
Expand Down