pytest spinter and selenium integration for anyone interested in browser interaction in tests
ScopeMismatch: You tried to access the 'function' scoped fixture 'splinter_driver_kwargs' with a 'session' scoped request object, involved factories
@ajinkyapande but the screenshots are made automatically for you: --splinter-make-screenshot-on-failure
pytest-splinter should take browser screenshots on test failure. Choices are 'true' or 'false' (default: 'true').
--splinter-screenshot-dir
pytest-splinter browser screenshot directory. Defaults to the current directory.
if request.node.splinter_failure.longrepr:
reprtraceback = request.node.splinter_failure.longrepr.reprtraceback
reprtraceback.extraline = _screenshot_extraline(
screenshot_png_path, screenshot_html_path
)
<splinter-screenshot-dir>/my.dotted.name.test.package/test_name-browser.png
<splinter-screenshot-dir>/my.dotted.name.test.package/test_name-browser.html