Skip to content

Commit

Permalink
Fix splinter_screenshot_encoding not being passed properly
Browse files Browse the repository at this point in the history
  • Loading branch information
youtux authored and olegpidsadnyi committed May 29, 2018
1 parent a83cb59 commit 32e6ba9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGES.rst
@@ -1,6 +1,11 @@
Changelog
=========

1.8.6
-----

- Fix screenshots not being taken when used with xdist (youtux)

1.8.5
-----

Expand All @@ -15,7 +20,7 @@ Changelog
1.8.2
-----

- Fixed missing `switch_to` method (some selenium `expected_conditions` are broken without
- Fixed missing `switch_to` method (some selenium `expected_conditions` are broken without
it, see `#93 <https://github.com/pytest-dev/pytest-splinter/pull/93>`_)

1.8.1
Expand Down
2 changes: 1 addition & 1 deletion pytest_splinter/__init__.py
@@ -1,2 +1,2 @@
"""pytest-splinter package."""
__version__ = '1.8.5'
__version__ = '1.8.6'
10 changes: 7 additions & 3 deletions pytest_splinter/plugin.py
Expand Up @@ -350,7 +350,8 @@ def _take_screenshot(
session_tmpdir,
splinter_screenshot_dir,
splinter_screenshot_getter_html,
splinter_screenshot_getter_png
splinter_screenshot_getter_png,
splinter_screenshot_encoding,
):
"""Capture a screenshot as .png and .html.
Expand Down Expand Up @@ -397,7 +398,7 @@ def _take_screenshot(
{
'file_name': screenshot_html_file_name,
'content': html_fd.read(),
'encoding': splinter_screenshot_encoding
'encoding': splinter_screenshot_encoding,
}]
})
except Exception as e: # NOQA
Expand All @@ -412,7 +413,8 @@ def _browser_screenshot_session(
splinter_screenshot_dir,
splinter_make_screenshot_on_failure,
splinter_screenshot_getter_html,
splinter_screenshot_getter_png
splinter_screenshot_getter_png,
splinter_screenshot_encoding,
):
"""Make browser screenshot on test failure."""
yield
Expand Down Expand Up @@ -444,6 +446,7 @@ def _browser_screenshot_session(
splinter_screenshot_dir=splinter_screenshot_dir,
splinter_screenshot_getter_html=splinter_screenshot_getter_html,
splinter_screenshot_getter_png=splinter_screenshot_getter_png,
splinter_screenshot_encoding=splinter_screenshot_encoding,
)


Expand Down Expand Up @@ -524,6 +527,7 @@ def _take_screenshot_on_failure():
splinter_screenshot_dir=splinter_screenshot_dir,
splinter_screenshot_getter_html=splinter_screenshot_getter_html,
splinter_screenshot_getter_png=splinter_screenshot_getter_png,
splinter_screenshot_encoding=splinter_screenshot_encoding,
)
request.addfinalizer(_take_screenshot_on_failure)

Expand Down
3 changes: 2 additions & 1 deletion requirements-testing.txt
Expand Up @@ -4,4 +4,5 @@ pytest-localserver
pylama
pylama_pylint
astroid>=1.4.5
selenium<3
selenium<3
splinter<=0.7.5

0 comments on commit 32e6ba9

Please sign in to comment.