Skip to content

Commit

Permalink
fix(screenshot): handle if there is no Page fixture available (micros…
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Dec 6, 2020
1 parent c461074 commit fb5a303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ from pathlib import Path

def pytest_runtest_makereport(item, call) -> None:
if call.when == "call":
if call.excinfo is not None:
if call.excinfo is not None and "page" in item.funcargs:
page = item.funcargs["page"]
screenshot_dir = Path(".playwright-screenshots")
screenshot_dir.mkdir(exist_ok=True)
Expand Down

0 comments on commit fb5a303

Please sign in to comment.