Merge pull request #1050 from seleniumbase/windows-and-edge-updates

Windows and EdgeDriver updates
This commit is contained in:
Michael Mintz 2021-11-03 22:59:26 -04:00 committed by GitHub
commit 54ab001adf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 52 deletions

View File

@ -1,12 +1,13 @@
[<img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" title="SeleniumBase" width="240">](https://github.com/seleniumbase/SeleniumBase/)
<h3 align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" alt="SeleniumBase" title="SeleniumBase" width="240"></a></h3>
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw"><img src="http://img.youtube.com/vi/Sjzq9kU5kOw/0.jpg" title="SeleniumBase on YouTube" width="285" /></a>
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw">Watch the tutorial on YouTube</a></b>)</p>
<a id="feature_list"></a>
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> ⛲ Features: 🗂️</h2>
<h2><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Features: 🏰</h2>
* A complete test automation framework for web and mobile E2E UI testing.
* Has [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for generating scripts from recorded actions. (``--rec``)
* Supports multiple browsers, tabs, iFrames, and proxies in the same test.
* Automatic smart-waiting improves reliability and prevents flaky tests.
* Supports [pytest](https://docs.pytest.org/en/latest/), [unittest](https://docs.python.org/3/library/unittest.html), and [nose](http://nose.readthedocs.io/en/latest/) for test discovery and execution.
@ -20,7 +21,6 @@
* Can run tests through an authenticated proxy server. (``--proxy=USER:PASS@HOST:PORT``)
* Can run tests with a customized browser user agent. (``--agent=USER_AGENT_STRING``)
* Can set a Chromium User Data Directory/Profile to load. (``--user_data_dir=DIR``)
* Has [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for generating scripts from recorded actions. (``--recorder``)
* Can load Chrome Extension ZIP files. (``--extension_zip=ZIP``)
* Can load Chrome Extension folders. (``--extension_dir=DIR``)
* Powerful [console scripts](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md). (Type **``seleniumbase``** or **``sbase``** to use.)
@ -38,7 +38,7 @@
* Can execute JavaScript code from Python calls. (Use: ``self.execute_script()``)
* Can pierce through Shadow DOM selectors. (Add ``::shadow`` to CSS fragments.)
* Includes a hybrid-automation solution, [MasterQA](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/masterqa/ReadMe.md), for speeding up manual testing.
* Includes a tool to [convert Katalon & Selenium IDE recordings](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/katalon/ReadMe.md) into SeleniumBase scripts.
* Includes a tool to [convert Katalon & SeleniumIDE recordings](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/katalon/ReadMe.md) into SeleniumBase format.
* Includes useful [Python decorators and password obfuscation methods](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common/ReadMe.md).
--------
@ -46,4 +46,6 @@
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0"><img src="http://img.youtube.com/vi/yEQeAU_mrg0/0.jpg" title="SeleniumBase on YouTube" width="285" /></a>
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0">Have fun with test automation!</a></b>)</p>
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="285">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/sb_logo_10.png" alt="SeleniumBase" title="SeleniumBase" width="200"></a></p>
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="200">](https://seleniumbase.io/)

View File

@ -1,4 +1,4 @@
regex>=2021.11.1
regex>=2021.11.2
tqdm>=4.62.3
docutils==0.18
python-dateutil==2.8.2

View File

@ -5,7 +5,7 @@ packaging>=21.2;python_version>="3.6"
typing-extensions>=3.10.0.2
setuptools>=44.1.1;python_version<"3.5"
setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"
setuptools>=58.4.0;python_version>="3.6"
setuptools>=58.5.2;python_version>="3.6"
setuptools-scm==5.0.2;python_version<"3.6"
setuptools-scm>=6.3.2;python_version>="3.6"
tomli>=1.2.2;python_version>="3.6"
@ -70,7 +70,7 @@ parameterized==0.8.1
sbvirtualdisplay==1.0.0
soupsieve==1.9.6;python_version<"3.5"
soupsieve==2.1;python_version>="3.5" and python_version<"3.6"
soupsieve==2.2.1;python_version>="3.6"
soupsieve==2.3;python_version>="3.6"
beautifulsoup4==4.9.3;python_version<"3.5"
beautifulsoup4==4.10.0;python_version>="3.5"
cryptography==2.9.2;python_version<"3.5"

View File

@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "2.1.1"
__version__ = "2.1.2"

View File

@ -298,7 +298,7 @@ def main(override=None):
name = "edgedriver"
last = (
"https://msedgewebdriverstorage.blob.core.windows.net"
"/edgewebdriver/LATEST_BETA"
"/edgewebdriver/LATEST_STABLE"
)
get_latest = False
if num_args == 3:
@ -324,18 +324,29 @@ def main(override=None):
use_version = url_request.text.split("\r")[0].split("\n")[0]
else:
use_version = DEFAULT_EDGEDRIVER_VERSION
suffix = None
if "win64" in sys_plat or "x64" in sys_plat:
file_name = "edgedriver_win64.zip"
suffix = "WINDOWS"
elif "win32" in sys_plat or "x86" in sys_plat:
file_name = "edgedriver_win32.zip"
suffix = "WINDOWS"
elif "darwin" in sys_plat:
file_name = "edgedriver_mac64.zip"
suffix = "MACOS"
elif "linux" in sys_plat:
file_name = "edgedriver_linux64.zip"
suffix = "LINUX"
else:
raise Exception(
"Cannot determine which version of EdgeDriver to download!"
)
if use_version.isdigit():
edgedriver_st = "https://msedgedriver.azureedge.net/LATEST_RELEASE"
use_version = "%s_%s_%s" % (edgedriver_st, use_version, suffix)
url_request = requests.get(use_version)
if url_request.ok:
use_version = url_request.text.split("\r")[0].split("\n")[0]
download_url = "https://msedgedriver.azureedge.net/%s/%s" % (
use_version,
file_name,

View File

@ -128,7 +128,7 @@ def main():
used_width = None # code_width and few spaces on right for padding
magic_syntax = None # the syntax generated by rich.syntax.Syntax()
try:
console_width = os.popen("stty size", "r").read().split()[1]
console_width = os.get_terminal_size()[0]
if console_width:
console_width = int(console_width)
except Exception:
@ -570,11 +570,15 @@ def main():
used_width = code_width + extra_r_spaces
the_code = rich_helper.fix_emoji_spacing(the_code)
the_theme = "monokai"
platform = sys.platform
if "win32" in platform or "win64" in platform or "x64" in platform:
the_theme = "abap"
magic_syntax = rich_helper.process_syntax(
the_code,
code_lang,
theme="monokai",
theme=the_theme,
line_numbers=line_numbers,
code_width=used_width,
word_wrap=word_wrap,

View File

@ -1240,40 +1240,6 @@ def get_local_driver(
"profile.managed_default_content_settings.popups": 0,
"profile.default_content_setting_values.automatic_downloads": 1,
}
chrome_options = _set_chrome_options(
browser_name,
downloads_path,
headless,
locale_code,
proxy_string,
proxy_auth,
proxy_user,
proxy_pass,
user_agent,
recorder_ext,
disable_csp,
enable_ws,
enable_sync,
use_auto_ext,
no_sandbox,
disable_gpu,
incognito,
guest_mode,
devtools,
remote_debug,
swiftshader,
ad_block_on,
block_images,
chromium_arg,
user_data_dir,
extension_zip,
extension_dir,
servername,
mobile_emulator,
device_width,
device_height,
device_pixel_ratio,
)
if LOCAL_EDGEDRIVER and os.path.exists(LOCAL_EDGEDRIVER):
try:
make_driver_executable_if_not(LOCAL_EDGEDRIVER)
@ -1325,6 +1291,8 @@ def get_local_driver(
edge_options.add_experimental_option(
"excludeSwitches", ["enable-automation", "enable-logging"]
)
if not enable_sync:
edge_options.add_argument("--disable-sync")
if guest_mode:
edge_options.add_argument("--guest")
if headless:
@ -1435,15 +1403,20 @@ def get_local_driver(
driver = Edge(service=service, options=edge_options)
except Exception as e:
auto_upgrade_edgedriver = False
edge_version = None
if "This version of MSEdgeDriver only supports" in e.msg:
if "Current browser version is " in e.msg:
auto_upgrade_edgedriver = True
edge_version = e.msg.split(
"Current browser version is ")[1].split(' ')[0]
elif "only supports MSEdge version " in e.msg:
auto_upgrade_edgedriver = True
edge_version = e.msg.split(
"only supports MSEdge version ")[1].split(' ')[0]
if not auto_upgrade_edgedriver:
raise Exception(e.msg) # Not an obvious fix. Raise.
else:
pass # Try upgrading EdgeDriver to match Edge.
edge_version = e.msg.split(
"Current browser version is ")[1].split(' ')[0]
args = " ".join(sys.argv)
if ("-n" in sys.argv or " -n=" in args or args == "-c"):
import fasteners
@ -1472,15 +1445,20 @@ def get_local_driver(
)
except Exception as e:
auto_upgrade_edgedriver = False
edge_version = None
if "This version of MSEdgeDriver only supports" in e.msg:
if "Current browser version is " in e.msg:
auto_upgrade_edgedriver = True
edge_version = e.msg.split(
"Current browser version is ")[1].split(' ')[0]
elif "only supports MSEdge version " in e.msg:
auto_upgrade_edgedriver = True
edge_version = e.msg.split(
"only supports MSEdge version ")[1].split(' ')[0]
if not auto_upgrade_edgedriver:
raise Exception(e.msg) # Not an obvious fix. Raise.
else:
pass # Try upgrading EdgeDriver to match Edge.
edge_version = e.msg.split(
"Current browser version is ")[1].split(' ')[0]
args = " ".join(sys.argv)
if ("-n" in sys.argv or " -n=" in args or args == "-c"):
import fasteners

View File

@ -121,7 +121,7 @@ setup(
"typing-extensions>=3.10.0.2",
'setuptools>=44.1.1;python_version<"3.5"',
'setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"',
'setuptools>=58.4.0;python_version>="3.6"',
'setuptools>=58.5.2;python_version>="3.6"',
'setuptools-scm==5.0.2;python_version<"3.6"',
'setuptools-scm>=6.3.2;python_version>="3.6"',
'tomli>=1.2.2;python_version>="3.6"',
@ -186,7 +186,7 @@ setup(
"sbvirtualdisplay==1.0.0",
'soupsieve==1.9.6;python_version<"3.5"',
'soupsieve==2.1;python_version>="3.5" and python_version<"3.6"',
'soupsieve==2.2.1;python_version>="3.6"',
'soupsieve==2.3;python_version>="3.6"',
'beautifulsoup4==4.9.3;python_version<"3.5"',
'beautifulsoup4==4.10.0;python_version>="3.5"',
'cryptography==2.9.2;python_version<"3.5"',