mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
tests: functional: Set default screenshots dir as ./screenshots
Tests: - Fail a functional test using assert False. Notice that the screenshot is taken in ./screenshots directory. - Pass --splinter-screenshot-dir=foo and notice that the screenshot is taken in ./foo directory. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
98cfa321cb
commit
81814e487f
11
conftest.py
11
conftest.py
@ -168,6 +168,17 @@ def fixture_call_action(request, capsys, actions_module):
|
||||
return _call_action
|
||||
|
||||
|
||||
@pytest.fixture(name='splinter_screenshot_dir', scope='session')
|
||||
def fixture_splinter_screenshot_dir(request):
|
||||
"""Set default screenshot directory to ./screenshots.
|
||||
|
||||
This can be overridden using --splinter-screenshot-dir=foo as the option.
|
||||
"""
|
||||
option = request.config.getoption('--splinter-screenshot-dir')
|
||||
screenshots_dir = option if option != '.' else './screenshots'
|
||||
return os.path.abspath(screenshots_dir)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def fixture_fix_session_browser_screenshots(request):
|
||||
"""Fix a bug in pytest-splinter for screenshots.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user