Skip to content

Commit

Permalink
feat: full page screenshots (microsoft#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
CGBassPlayer committed Jun 19, 2023
1 parent 901fd82 commit 3a10ce7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pytest_playwright/pytest_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,11 @@ def context(
pytestconfig, request, f"test-{human_readable_status}-{index+1}.png"
)
try:
page.screenshot(timeout=5000, path=screenshot_path)
page.screenshot(
timeout=5000,
path=screenshot_path,
full_page=pytestconfig.getoption("--full-page-screenshot"),
)
except Error:
pass

Expand Down Expand Up @@ -392,3 +396,9 @@ def pytest_addoption(parser: Any) -> None:
choices=["on", "off", "only-on-failure"],
help="Whether to automatically capture a screenshot after each test.",
)
group.addoption(
"--full-page-screenshot",
action="store_true",
default=False,
help="Whether to take a full page screenshot",
)

0 comments on commit 3a10ce7

Please sign in to comment.