diff --git a/LICENSE b/LICENSE index fb3fdf25437..a7133a96b68 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/examples/shadow_root_test.py b/examples/shadow_root_test.py index 05a273e26b1..99f838c04f9 100644 --- a/examples/shadow_root_test.py +++ b/examples/shadow_root_test.py @@ -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") diff --git a/examples/test_cdp_ad_blocking.py b/examples/test_cdp_ad_blocking.py index 285781c66d4..94ffd80808b 100644 --- a/examples/test_cdp_ad_blocking.py +++ b/examples/test_cdp_ad_blocking.py @@ -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*", @@ -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!") diff --git a/seleniumbase/__version__.py b/seleniumbase/__version__.py index 7354291cd07..d825fe11b03 100755 --- a/seleniumbase/__version__.py +++ b/seleniumbase/__version__.py @@ -1,2 +1,2 @@ # seleniumbase package -__version__ = "4.22.4" +__version__ = "4.22.5" diff --git a/seleniumbase/console_scripts/sb_install.py b/seleniumbase/console_scripts/sb_install.py index 4891fa62e6e..7cc890d6fb9 100644 --- a/seleniumbase/console_scripts/sb_install.py +++ b/seleniumbase/console_scripts/sb_install.py @@ -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) diff --git a/seleniumbase/core/browser_launcher.py b/seleniumbase/core/browser_launcher.py index f7c7b12a400..5ae567b3559 100644 --- a/seleniumbase/core/browser_launcher.py +++ b/seleniumbase/core/browser_launcher.py @@ -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 @@ -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 @@ -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, diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index 1c89db100e3..408625d5ae8 100644 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -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) diff --git a/setup.py b/setup.py index 1d734c2e784..1dc8932cd4b 100755 --- a/setup.py +++ b/setup.py @@ -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": [