Skip to content

Unclear how to set "splinter-screenshot-dir" to send failure screenshots to a particular directory #178

Open
@jzohrab

Description

@jzohrab

Hello, thank you for the great project!

I'm trying to get failures to go to a specified ignored folder so they don't clutter up my project root, but I can't get it to work.

In my .pytest.ini, I've tried things like this:

-splinter-screenshot-dir = tests/acceptance/failure_screenshots

but this gives the error

.venv/lib/python3.11/site-packages/_pytest/config/__init__.py:1373: PytestConfigWarning: Unknown config option: -splinter-screenshot-dir
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

I've also tried passing it in command-line args, e.g:

pytest -splinter-screenshot-dir blah my_test.py
pytest -splinter-screenshot-dir=blah my_test.py
pytest splinter-screenshot-dir=blah my_test.py
pytest tests/acceptance -splinter-screenshot-dir=tests/acceptance/failure_screenshots

But still get

===========================
pytest-splinter screenshots
===========================
png:  /Users/jeff/Documents/Projects/lute_v3/tests.acceptance.test_smoke/test_hit_main_page-browser.png
html: /Users/jeff/Documents/Projects/lute_v3/tests.acceptance.test_smoke/test_hit_main_page-browser.html

The folder I'm using exists.

I've read the docs and searched, but can't see how to do it correctly. Advice appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions