From cdcde247da61f1fb54c1dc5f2009472ff4899b3f Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 3 Jan 2024 22:12:26 -0500 Subject: [PATCH 1/7] Welcome to 2024 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 2de1ad3456bd4c42f037ab64333d73406fd17f6a Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 3 Jan 2024 22:13:22 -0500 Subject: [PATCH 2/7] Upgrade the default geckodriver version to v0.34.0 --- seleniumbase/console_scripts/sb_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 6519f87f34da0a0fdc70a6f08f4a784e5290a4d5 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 3 Jan 2024 22:14:33 -0500 Subject: [PATCH 3/7] Improve the method for saving overlay text on images --- seleniumbase/fixtures/base_case.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) From 50f8a0330eaec87893556e5c58c070c5ce53ea91 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 3 Jan 2024 22:15:36 -0500 Subject: [PATCH 4/7] Fix the Browserstack integration --- seleniumbase/core/browser_launcher.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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, From 8dc0b5996c84d840afbd92954a898e22ecd2ff63 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 3 Jan 2024 22:16:06 -0500 Subject: [PATCH 5/7] Update example tests --- examples/shadow_root_test.py | 4 ++-- examples/test_cdp_ad_blocking.py | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) 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!") From 7d9334f9201c7b5fc06b1fe25855b3144f961803 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 3 Jan 2024 22:16:38 -0500 Subject: [PATCH 6/7] Refresh optional Python dependencies --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": [ From bf862816ad607e4d1c2b47412265adbf46370353 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 3 Jan 2024 22:17:04 -0500 Subject: [PATCH 7/7] Version 4.22.5 --- seleniumbase/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"