Skip to content

Commit

Permalink
NEW: prepare Selene to work with wdm > 3.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
yashaka committed Jul 27, 2023
1 parent bce7077 commit 1652fc8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ TODOs:
- can we force order of how `selene.*` is rendered on autocomplete? via `__all__`...
- deprecate `have.js_returned` in favour of `have.script_returned`

## 2.0.0rc3post1 (released on 21.07.2023)
## 2.0.0rc3post2 (released on 27.07.2023)

### Prepare Selene to work with wdm > 3.8.6

Hence, 4.0.0 should be kind of supported now... But Selene's tests, if executed on macOS arm64 – are very unstable with chromedriver downloaded by wdm 4.0.0 :(. That's why we still freeze wdm to 3.8.6, but on your own risk you can try 4.0.0.

## 2.0.0rc3post1 (released on 27.07.2023)

### Fixes patch from rc3 to download latest chromedriver if google did not publish matched chromedriver for latest Chrome version.

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "selene"
version = "2.0.0rc3post1"
version = "2.0.0rc3post2"
description = "User-oriented browser tests in Python (Selenide port)"
authors = ["Iakiv Kramarenko <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -107,6 +107,7 @@ skip-string-normalization = 1
import-outside-toplevel,
too-many-locals,
too-many-lines,
too-many-branches,
invalid-name,
not-callable,
unused-argument,
Expand Down
2 changes: 1 addition & 1 deletion selene/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,4 @@
# """
from selene.core.entity import Element, Collection # noqa

__version__ = '2.0.0rc3post1'
__version__ = '2.0.0rc3post2'
8 changes: 7 additions & 1 deletion selene/support/_extensions/webdriver_manager/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from . import patch
from webdriver_manager.core.utils import ChromeType as _ChromeType

import webdriver_manager

if webdriver_manager.__version__ == '3.8.6':
from webdriver_manager.core.utils import ChromeType as _ChromeType
else:
from webdriver_manager.core.os_manager import ChromeType as _ChromeType

ChromeType = _ChromeType
9 changes: 8 additions & 1 deletion selene/support/_extensions/webdriver_manager/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@

def _to_find_chromedrivers_from_115(driver_manager: ChromeDriverManager):
"""
Fixes webdriver_manager issue with latest chrome versions (>= 115.0.5763.0)
Fixes webdriver_manager 3.8.6 issue with latest chrome versions (>= 115.0.5763.0)
See https://github.com/SergeyPirogov/webdriver_manager/issues/536
Will work for any version of webdriver_manager >= 3.8.6,
but actually, only 3.8.6 is affected by patching.
Fix is based on simple ideas from:
* https://github.com/SergeyPirogov/webdriver_manager/issues/536#issuecomment-1641266654
* https://github.com/SergeyPirogov/webdriver_manager/issues/536#issuecomment-1641396604
Expand All @@ -41,6 +44,10 @@ def _to_find_chromedrivers_from_115(driver_manager: ChromeDriverManager):
not just the object passed to this function.
Let's keep fingers crossed;p
"""
import webdriver_manager

if webdriver_manager.__version__ != '3.8.6':
return driver_manager

from webdriver_manager.core import logger as wdm_logger
from packaging import version
Expand Down

0 comments on commit 1652fc8

Please sign in to comment.