Skip to content

Commit

Permalink
#225: final fix:); kind of tested manually and now should work
Browse files Browse the repository at this point in the history
  • Loading branch information
yashaka committed Sep 10, 2020
1 parent d2eeee6 commit fa4a08d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@
- repeat fix of #225 to other options in shared config, refactor it...
- should we make original config (not shared) mutable?

## 2.0.0a32 (released on 10.09.2020)
## 2.0.0a33 (released on 10.09.2020)
- fixed [#225](https://github.com/yashaka/selene/issues/225): Failed to get last_screenshot from shared browser if element with custom config failed

## 2.0.0a32 (released on 10.09.2020)
- broken release:)

## 2.0.0a31 (released on 31.07.2020)
- fixed type hints in `*.should(here)`
- latest PyCharm 2020.2 revealed the hidden issue with typing
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Tests with Selene can be built either in a simple straightforward "selenide' sty

## Versions

* Latest recommended version to use is [2.0.0a32](https://pypi.org/project/selene/2.0.0a32/)
* Latest recommended version to use is [2.0.0a33](https://pypi.org/project/selene/2.0.0a33/)
* it's a completely new version of selene, with improved API and speed
* supports python >= 3.7
* it's incompatible with [1.x](https://github.com/yashaka/selene/tree/1.x)
Expand Down
2 changes: 1 addition & 1 deletion selene/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
# """
# todo: add here some type imports like Element, Collection, etc.

__version__ = '2.0.0a32'
__version__ = '2.0.0a33'

# --- DEPRECATED, and will be removed soon --- #

Expand Down
14 changes: 9 additions & 5 deletions selene/support/shared/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import time
import warnings
from functools import lru_cache
from typing import Optional, TypeVar, Generic, Callable
from typing import Optional, TypeVar, Generic, Callable, Union

from selenium.common.exceptions import WebDriverException
from selenium.webdriver import ChromeOptions, Chrome, Firefox, Remote
Expand Down Expand Up @@ -159,8 +159,8 @@ def __init__(self,
poll_during_waits: int = 100,
counter=None, # default is set below
reports_folder: Optional[str] = None, # default is set below
last_screenshot: Optional[str] = None,
last_page_source: Optional[str] = None,
last_screenshot: Union[Optional[str], Source[str]] = None,
last_page_source: Union[Optional[str], Source[str]] = None,
):

self._browser_name = browser_name
Expand Down Expand Up @@ -213,8 +213,12 @@ def set_firefox():
'.selene',
'screenshots',
str(next(self._counter)))
self._last_screenshot = Source(last_screenshot)
self._last_page_source = Source(last_page_source)
self._last_screenshot = \
last_screenshot if isinstance(last_screenshot, Source) \
else Source(last_screenshot)
self._last_page_source = \
last_page_source if isinstance(last_page_source, Source) \
else Source(last_page_source)
super().__init__(driver=driver,
timeout=timeout,
base_url=base_url,
Expand Down

0 comments on commit fa4a08d

Please sign in to comment.