Skip to content

Commit

Permalink
Merge pull request #2413 from seleniumbase/welcome-to-2024
Browse files Browse the repository at this point in the history
Welcome to 2024
  • Loading branch information
mdmintz committed Jan 4, 2024
2 parents 36d410b + bf86281 commit 31020e4
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2023 Michael Mintz
Copyright (c) 2014-2024 Michael Mintz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions examples/shadow_root_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def test_shadow_root(self):
message = "Skipping test in Recorder Mode."
print(message)
self.skip(message)
elif self.browser == "safari":
elif not self.is_chromium():
self.open_if_not_url("about:blank")
message = "Skipping test for using Safari."
message = "This test is only for Chromium browsers!"
print(message)
self.skip(message)
self.open("https://seleniumbase.io/other/shadow_dom")
Expand Down
10 changes: 6 additions & 4 deletions examples/test_cdp_ad_blocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

class CDPNetworkBlockingTests(BaseCase):
def test_cdp_network_blocking(self):
if not self.is_chromium:
self.skip("This test is only for Chromium browsers!")
self.open("about:blank")
if not self.is_chromium():
message = "This test is only for Chromium browsers!"
print(message)
self.skip(message)
self.execute_cdp_cmd(
'Network.setBlockedURLs', {"urls": [
"*googlesyndication.com*",
Expand All @@ -24,5 +27,4 @@ def test_cdp_network_blocking(self):
source = self.get_page_source()
self.assert_true("doubleclick.net" not in source)
self.assert_true("google-analytics.com" not in source)
if self.demo_mode:
self.post_message("Blocking was successful!")
self.post_message("Blocking was successful!")
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.22.4"
__version__ = "4.22.5"
2 changes: 1 addition & 1 deletion seleniumbase/console_scripts/sb_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
DRIVER_DIR = os.path.dirname(os.path.realpath(drivers.__file__))
LOCAL_PATH = "/usr/local/bin/" # On Mac and Linux systems
DEFAULT_CHROMEDRIVER_VERSION = "114.0.5735.90" # (If can't find LATEST_STABLE)
DEFAULT_GECKODRIVER_VERSION = "v0.33.0"
DEFAULT_GECKODRIVER_VERSION = "v0.34.0"
DEFAULT_EDGEDRIVER_VERSION = "115.0.1901.183" # (If can't find LATEST_STABLE)


Expand Down
9 changes: 9 additions & 0 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,9 @@ def get_remote_driver(
platform_name = desired_caps[key]
elif re.match("[a-zA-Z0-9]*:[a-zA-Z0-9]*", key):
extension_capabilities[key] = desired_caps[key]
cap_str = str(desired_caps).lower()
if "browserstack" in cap_str or "bstack" in cap_str:
chrome_options.set_capability("bstack:options", desired_caps)
chrome_options.set_capability("cloud:options", capabilities)
if selenoid:
snops = selenoid_options
Expand Down Expand Up @@ -1876,6 +1879,9 @@ def get_remote_driver(
platform_name = desired_caps[key]
elif re.match("[a-zA-Z0-9]*:[a-zA-Z0-9]*", key):
extension_capabilities[key] = desired_caps[key]
cap_str = str(desired_caps).lower()
if "browserstack" in cap_str or "bstack" in cap_str:
firefox_options.set_capability("bstack:options", desired_caps)
firefox_options.set_capability("cloud:options", capabilities)
if selenoid:
snops = selenoid_options
Expand Down Expand Up @@ -2016,6 +2022,9 @@ def get_remote_driver(
remote_options = ArgOptions()
for cap_name, cap_value in desired_caps.items():
remote_options.set_capability(cap_name, cap_value)
cap_str = str(desired_caps).lower()
if "browserstack" in cap_str or "bstack" in cap_str:
remote_options.set_capability("bstack:options", desired_caps)
driver = webdriver.Remote(
command_executor=address,
options=remote_options,
Expand Down
5 changes: 3 additions & 2 deletions seleniumbase/fixtures/base_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -6918,13 +6918,14 @@ def save_element_as_image_file(
image = Image.open(image_file_path)
draw = ImageDraw.Draw(image)
draw.rectangle(
(0, 0, (max_width * 6) + 6, 16 * len_text_rows),
(0, 0, int(max_width * 8.32) + 10, 23 * len_text_rows + 2),
fill=(236, 236, 28),
)
draw.text(
(4, 2), # Coordinates
overlay_text, # Text
(8, 38, 176), # Color
fill=(8, 38, 176), # Color
font_size=18, # Font Size
)
image.save(image_file_path, "PNG", quality=100, optimize=True)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
# (An optional library for image-processing.)
"pillow": [
'Pillow==9.5.0;python_version<"3.8"',
'Pillow==10.1.0;python_version>="3.8"',
'Pillow==10.2.0;python_version>="3.8"',
],
# pip install -e .[psutil]
"psutil": [
Expand Down

0 comments on commit 31020e4

Please sign in to comment.