Skip to content

Commit 54ab001

Browse files
authored
Merge pull request #1050 from seleniumbase/windows-and-edge-updates
Windows and EdgeDriver updates
2 parents 22f526f + f2cc10f commit 54ab001

File tree

8 files changed

+47
-52
lines changed

8 files changed

+47
-52
lines changed

help_docs/features_list.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
[<img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" title="SeleniumBase" width="240">](https://github.com/seleniumbase/SeleniumBase/)
1+
<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>
22

33
<!-- 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>
44
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw">Watch the tutorial on YouTube</a></b>)</p>
55

66
<a id="feature_list"></a>
7-
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Features: 🗂️</h2>
7+
<h2><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Features: 🏰</h2>
88

99
* A complete test automation framework for web and mobile E2E UI testing.
10+
* Has [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for generating scripts from recorded actions. (``--rec``)
1011
* Supports multiple browsers, tabs, iFrames, and proxies in the same test.
1112
* Automatic smart-waiting improves reliability and prevents flaky tests.
1213
* 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 @@
2021
* Can run tests through an authenticated proxy server. (``--proxy=USER:PASS@HOST:PORT``)
2122
* Can run tests with a customized browser user agent. (``--agent=USER_AGENT_STRING``)
2223
* Can set a Chromium User Data Directory/Profile to load. (``--user_data_dir=DIR``)
23-
* Has [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for generating scripts from recorded actions. (``--recorder``)
2424
* Can load Chrome Extension ZIP files. (``--extension_zip=ZIP``)
2525
* Can load Chrome Extension folders. (``--extension_dir=DIR``)
2626
* Powerful [console scripts](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md). (Type **``seleniumbase``** or **``sbase``** to use.)
@@ -38,12 +38,14 @@
3838
* Can execute JavaScript code from Python calls. (Use: ``self.execute_script()``)
3939
* Can pierce through Shadow DOM selectors. (Add ``::shadow`` to CSS fragments.)
4040
* Includes a hybrid-automation solution, [MasterQA](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/masterqa/ReadMe.md), for speeding up manual testing.
41-
* Includes a tool to [convert Katalon & Selenium IDE recordings](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/katalon/ReadMe.md) into SeleniumBase scripts.
41+
* Includes a tool to [convert Katalon & SeleniumIDE recordings](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/katalon/ReadMe.md) into SeleniumBase format.
4242
* Includes useful [Python decorators and password obfuscation methods](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common/ReadMe.md).
4343

4444
--------
4545

4646
<!-- 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>
4747
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0">Have fun with test automation!</a></b>)</p>
4848

49-
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="285">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
49+
<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>
50+
51+
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="200">](https://seleniumbase.io/)

mkdocs_build/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
regex>=2021.11.1
1+
regex>=2021.11.2
22
tqdm>=4.62.3
33
docutils==0.18
44
python-dateutil==2.8.2

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ packaging>=21.2;python_version>="3.6"
55
typing-extensions>=3.10.0.2
66
setuptools>=44.1.1;python_version<"3.5"
77
setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"
8-
setuptools>=58.4.0;python_version>="3.6"
8+
setuptools>=58.5.2;python_version>="3.6"
99
setuptools-scm==5.0.2;python_version<"3.6"
1010
setuptools-scm>=6.3.2;python_version>="3.6"
1111
tomli>=1.2.2;python_version>="3.6"
@@ -70,7 +70,7 @@ parameterized==0.8.1
7070
sbvirtualdisplay==1.0.0
7171
soupsieve==1.9.6;python_version<"3.5"
7272
soupsieve==2.1;python_version>="3.5" and python_version<"3.6"
73-
soupsieve==2.2.1;python_version>="3.6"
73+
soupsieve==2.3;python_version>="3.6"
7474
beautifulsoup4==4.9.3;python_version<"3.5"
7575
beautifulsoup4==4.10.0;python_version>="3.5"
7676
cryptography==2.9.2;python_version<"3.5"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "2.1.1"
2+
__version__ = "2.1.2"

seleniumbase/console_scripts/sb_install.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def main(override=None):
298298
name = "edgedriver"
299299
last = (
300300
"https://msedgewebdriverstorage.blob.core.windows.net"
301-
"/edgewebdriver/LATEST_BETA"
301+
"/edgewebdriver/LATEST_STABLE"
302302
)
303303
get_latest = False
304304
if num_args == 3:
@@ -324,18 +324,29 @@ def main(override=None):
324324
use_version = url_request.text.split("\r")[0].split("\n")[0]
325325
else:
326326
use_version = DEFAULT_EDGEDRIVER_VERSION
327+
suffix = None
327328
if "win64" in sys_plat or "x64" in sys_plat:
328329
file_name = "edgedriver_win64.zip"
330+
suffix = "WINDOWS"
329331
elif "win32" in sys_plat or "x86" in sys_plat:
330332
file_name = "edgedriver_win32.zip"
333+
suffix = "WINDOWS"
331334
elif "darwin" in sys_plat:
332335
file_name = "edgedriver_mac64.zip"
336+
suffix = "MACOS"
333337
elif "linux" in sys_plat:
334338
file_name = "edgedriver_linux64.zip"
339+
suffix = "LINUX"
335340
else:
336341
raise Exception(
337342
"Cannot determine which version of EdgeDriver to download!"
338343
)
344+
if use_version.isdigit():
345+
edgedriver_st = "https://msedgedriver.azureedge.net/LATEST_RELEASE"
346+
use_version = "%s_%s_%s" % (edgedriver_st, use_version, suffix)
347+
url_request = requests.get(use_version)
348+
if url_request.ok:
349+
use_version = url_request.text.split("\r")[0].split("\n")[0]
339350
download_url = "https://msedgedriver.azureedge.net/%s/%s" % (
340351
use_version,
341352
file_name,

seleniumbase/console_scripts/sb_print.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def main():
128128
used_width = None # code_width and few spaces on right for padding
129129
magic_syntax = None # the syntax generated by rich.syntax.Syntax()
130130
try:
131-
console_width = os.popen("stty size", "r").read().split()[1]
131+
console_width = os.get_terminal_size()[0]
132132
if console_width:
133133
console_width = int(console_width)
134134
except Exception:
@@ -570,11 +570,15 @@ def main():
570570
used_width = code_width + extra_r_spaces
571571

572572
the_code = rich_helper.fix_emoji_spacing(the_code)
573+
the_theme = "monokai"
574+
platform = sys.platform
575+
if "win32" in platform or "win64" in platform or "x64" in platform:
576+
the_theme = "abap"
573577

574578
magic_syntax = rich_helper.process_syntax(
575579
the_code,
576580
code_lang,
577-
theme="monokai",
581+
theme=the_theme,
578582
line_numbers=line_numbers,
579583
code_width=used_width,
580584
word_wrap=word_wrap,

seleniumbase/core/browser_launcher.py

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,40 +1240,6 @@ def get_local_driver(
12401240
"profile.managed_default_content_settings.popups": 0,
12411241
"profile.default_content_setting_values.automatic_downloads": 1,
12421242
}
1243-
chrome_options = _set_chrome_options(
1244-
browser_name,
1245-
downloads_path,
1246-
headless,
1247-
locale_code,
1248-
proxy_string,
1249-
proxy_auth,
1250-
proxy_user,
1251-
proxy_pass,
1252-
user_agent,
1253-
recorder_ext,
1254-
disable_csp,
1255-
enable_ws,
1256-
enable_sync,
1257-
use_auto_ext,
1258-
no_sandbox,
1259-
disable_gpu,
1260-
incognito,
1261-
guest_mode,
1262-
devtools,
1263-
remote_debug,
1264-
swiftshader,
1265-
ad_block_on,
1266-
block_images,
1267-
chromium_arg,
1268-
user_data_dir,
1269-
extension_zip,
1270-
extension_dir,
1271-
servername,
1272-
mobile_emulator,
1273-
device_width,
1274-
device_height,
1275-
device_pixel_ratio,
1276-
)
12771243
if LOCAL_EDGEDRIVER and os.path.exists(LOCAL_EDGEDRIVER):
12781244
try:
12791245
make_driver_executable_if_not(LOCAL_EDGEDRIVER)
@@ -1325,6 +1291,8 @@ def get_local_driver(
13251291
edge_options.add_experimental_option(
13261292
"excludeSwitches", ["enable-automation", "enable-logging"]
13271293
)
1294+
if not enable_sync:
1295+
edge_options.add_argument("--disable-sync")
13281296
if guest_mode:
13291297
edge_options.add_argument("--guest")
13301298
if headless:
@@ -1435,15 +1403,20 @@ def get_local_driver(
14351403
driver = Edge(service=service, options=edge_options)
14361404
except Exception as e:
14371405
auto_upgrade_edgedriver = False
1406+
edge_version = None
14381407
if "This version of MSEdgeDriver only supports" in e.msg:
14391408
if "Current browser version is " in e.msg:
14401409
auto_upgrade_edgedriver = True
1410+
edge_version = e.msg.split(
1411+
"Current browser version is ")[1].split(' ')[0]
1412+
elif "only supports MSEdge version " in e.msg:
1413+
auto_upgrade_edgedriver = True
1414+
edge_version = e.msg.split(
1415+
"only supports MSEdge version ")[1].split(' ')[0]
14411416
if not auto_upgrade_edgedriver:
14421417
raise Exception(e.msg) # Not an obvious fix. Raise.
14431418
else:
14441419
pass # Try upgrading EdgeDriver to match Edge.
1445-
edge_version = e.msg.split(
1446-
"Current browser version is ")[1].split(' ')[0]
14471420
args = " ".join(sys.argv)
14481421
if ("-n" in sys.argv or " -n=" in args or args == "-c"):
14491422
import fasteners
@@ -1472,15 +1445,20 @@ def get_local_driver(
14721445
)
14731446
except Exception as e:
14741447
auto_upgrade_edgedriver = False
1448+
edge_version = None
14751449
if "This version of MSEdgeDriver only supports" in e.msg:
14761450
if "Current browser version is " in e.msg:
14771451
auto_upgrade_edgedriver = True
1452+
edge_version = e.msg.split(
1453+
"Current browser version is ")[1].split(' ')[0]
1454+
elif "only supports MSEdge version " in e.msg:
1455+
auto_upgrade_edgedriver = True
1456+
edge_version = e.msg.split(
1457+
"only supports MSEdge version ")[1].split(' ')[0]
14781458
if not auto_upgrade_edgedriver:
14791459
raise Exception(e.msg) # Not an obvious fix. Raise.
14801460
else:
14811461
pass # Try upgrading EdgeDriver to match Edge.
1482-
edge_version = e.msg.split(
1483-
"Current browser version is ")[1].split(' ')[0]
14841462
args = " ".join(sys.argv)
14851463
if ("-n" in sys.argv or " -n=" in args or args == "-c"):
14861464
import fasteners

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"typing-extensions>=3.10.0.2",
122122
'setuptools>=44.1.1;python_version<"3.5"',
123123
'setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"',
124-
'setuptools>=58.4.0;python_version>="3.6"',
124+
'setuptools>=58.5.2;python_version>="3.6"',
125125
'setuptools-scm==5.0.2;python_version<"3.6"',
126126
'setuptools-scm>=6.3.2;python_version>="3.6"',
127127
'tomli>=1.2.2;python_version>="3.6"',
@@ -186,7 +186,7 @@
186186
"sbvirtualdisplay==1.0.0",
187187
'soupsieve==1.9.6;python_version<"3.5"',
188188
'soupsieve==2.1;python_version>="3.5" and python_version<"3.6"',
189-
'soupsieve==2.2.1;python_version>="3.6"',
189+
'soupsieve==2.3;python_version>="3.6"',
190190
'beautifulsoup4==4.9.3;python_version<"3.5"',
191191
'beautifulsoup4==4.10.0;python_version>="3.5"',
192192
'cryptography==2.9.2;python_version<"3.5"',

0 commit comments

Comments
 (0)