From fc3f55c2c29da34980ab1b7f6b33940ce0c41a39 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 3 Jun 2024 13:34:59 -0400 Subject: [PATCH 1/4] Update `sb.open_new_window()` for UC Mode --- seleniumbase/fixtures/base_case.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index 9ae0e7f02df..8a7df9bc917 100644 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -3728,7 +3728,15 @@ def open_new_window(self, switch_to=True): """Opens a new browser tab/window and switches to it by default.""" self.wait_for_ready_state_complete() if switch_to: - self.driver.switch_to.new_window("tab") + if self.undetectable: + self.driver.execute_script("window.open('data:,');") + self.switch_to_newest_window() + else: + try: + self.driver.switch_to.new_window("tab") + except Exception: + self.driver.execute_script("window.open('');") + self.switch_to_newest_window() else: self.driver.execute_script("window.open('');") time.sleep(0.01) From e25ddb737e68b6d8567fe7d1834e6861ae5d508b Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 3 Jun 2024 13:37:26 -0400 Subject: [PATCH 2/4] Refresh Python dependencies --- mkdocs_build/requirements.txt | 6 +++--- requirements.txt | 10 +++++----- setup.py | 14 +++++++------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mkdocs_build/requirements.txt b/mkdocs_build/requirements.txt index c0f42779273..1e6f6780dc7 100644 --- a/mkdocs_build/requirements.txt +++ b/mkdocs_build/requirements.txt @@ -3,7 +3,7 @@ regex>=2024.5.15 pymdown-extensions>=10.8.1 -pipdeptree>=2.20.0 +pipdeptree>=2.22.0 python-dateutil>=2.8.2 Markdown==3.6 markdown2==2.4.13 @@ -11,7 +11,7 @@ MarkupSafe==2.1.5 Jinja2==3.1.4 click==8.1.7 ghp-import==2.1.0 -watchdog==4.0.0 +watchdog==4.0.1 cairocffi==1.7.0 pathspec==0.12.1 Babel==2.15.0 @@ -20,7 +20,7 @@ lxml==5.2.2 pyquery==2.0.0 readtime==3.0.0 mkdocs==1.6.0 -mkdocs-material==9.5.23 +mkdocs-material==9.5.25 mkdocs-exclude-search==0.6.6 mkdocs-simple-hooks==0.1.5 mkdocs-material-extensions==1.3.1 diff --git a/requirements.txt b/requirements.txt index cafec698bcf..c0381a56a12 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,17 @@ pip>=24.0 packaging>=24.0 setuptools>=68.0.0;python_version<"3.8" -setuptools>=69.5.1;python_version>="3.8" +setuptools>=70.0.0;python_version>="3.8" wheel>=0.42.0;python_version<"3.8" wheel>=0.43.0;python_version>="3.8" attrs>=23.2.0 -certifi>=2024.2.2 +certifi>=2024.6.2 exceptiongroup>=1.2.1 filelock>=3.12.2;python_version<"3.8" filelock>=3.14.0;python_version>="3.8" platformdirs>=4.0.0;python_version<"3.8" platformdirs>=4.2.2;python_version>="3.8" -typing-extensions>=4.11.0;python_version>="3.8" +typing-extensions>=4.12.1;python_version>="3.8" parse>=1.20.1 parse-type>=0.6.2 pyyaml>=6.0.1 @@ -42,7 +42,7 @@ pluggy==1.2.0;python_version<"3.8" pluggy==1.5.0;python_version>="3.8" py==1.11.0 pytest==7.4.4;python_version<"3.8" -pytest==8.2.0;python_version>="3.8" +pytest==8.2.1;python_version>="3.8" pytest-html==2.0.1 pytest-metadata==3.0.0;python_version<"3.8" pytest-metadata==3.1.1;python_version>="3.8" @@ -73,7 +73,7 @@ rich==13.7.1 # ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.) coverage==7.2.7;python_version<"3.8" -coverage>=7.5.1;python_version>="3.8" +coverage>=7.5.3;python_version>="3.8" pytest-cov==4.1.0;python_version<"3.8" pytest-cov>=5.0.0;python_version>="3.8" flake8==5.0.4;python_version<"3.9" diff --git a/setup.py b/setup.py index 7c549e61cb5..559f09ecb57 100755 --- a/setup.py +++ b/setup.py @@ -149,17 +149,17 @@ 'pip>=24.0', 'packaging>=24.0', 'setuptools>=68.0.0;python_version<"3.8"', - 'setuptools>=69.5.1;python_version>="3.8"', + 'setuptools>=70.0.0;python_version>="3.8"', 'wheel>=0.42.0;python_version<"3.8"', 'wheel>=0.43.0;python_version>="3.8"', 'attrs>=23.2.0', - "certifi>=2024.2.2", + "certifi>=2024.6.2", "exceptiongroup>=1.2.1", 'filelock>=3.12.2;python_version<"3.8"', 'filelock>=3.14.0;python_version>="3.8"', 'platformdirs>=4.0.0;python_version<"3.8"', 'platformdirs>=4.2.2;python_version>="3.8"', - 'typing-extensions>=4.11.0;python_version>="3.8"', + 'typing-extensions>=4.12.1;python_version>="3.8"', 'parse>=1.20.1', 'parse-type>=0.6.2', 'pyyaml>=6.0.1', @@ -188,9 +188,9 @@ 'iniconfig==2.0.0', 'pluggy==1.2.0;python_version<"3.8"', 'pluggy==1.5.0;python_version>="3.8"', - "py==1.11.0", + "py==1.11.0", # Needed by pytest-html 'pytest==7.4.4;python_version<"3.8"', - 'pytest==8.2.0;python_version>="3.8"', + 'pytest==8.2.1;python_version>="3.8"', "pytest-html==2.0.1", # Newer ones had issues 'pytest-metadata==3.0.0;python_version<"3.8"', 'pytest-metadata==3.1.1;python_version>="3.8"', @@ -230,7 +230,7 @@ # Usage: coverage run -m pytest; coverage html; coverage report "coverage": [ 'coverage==7.2.7;python_version<"3.8"', - 'coverage>=7.5.1;python_version>="3.8"', + 'coverage>=7.5.3;python_version>="3.8"', 'pytest-cov==4.1.0;python_version<"3.8"', 'pytest-cov>=5.0.0;python_version>="3.8"', ], @@ -292,7 +292,7 @@ "selenium-wire": [ 'selenium-wire==5.1.0', 'Brotli==1.1.0', - 'blinker==1.7.0', + 'blinker==1.7.0', # Newer ones had issues 'h2==4.1.0', 'hpack==4.0.0', 'hyperframe==6.0.1', From ce6a8d65f7e7c8e422281e0f80a0871693d9b6cb Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 3 Jun 2024 13:39:29 -0400 Subject: [PATCH 3/4] Update examples --- examples/hack_the_planet.py | 4 ++-- examples/raw_order_tickets.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/hack_the_planet.py b/examples/hack_the_planet.py index 86732647293..1ae11b2655e 100644 --- a/examples/hack_the_planet.py +++ b/examples/hack_the_planet.py @@ -106,6 +106,7 @@ def test_all_your_base_are_belong_to_us(self): self.set_text_content('nav a[data-text="Month"]', "BELONG") self.set_text_content('nav a[data-text="Year"]', "TO") self.set_text_content('nav a[data-text="Infinity"]', "US") + self.click_if_visible('button[id*="sponsorship-close-trigger"]') self.set_text_content('aside a[class*="tful"]', aybabtu) self.set_text_content('aside a[aria-label="Create new account"]', ayb) self.set_text_content('aside a[aria-label="Log in"]', abtu) @@ -117,8 +118,6 @@ def test_all_your_base_are_belong_to_us(self): self.set_text_content(".profile-preview-card button", "SeleniumBase") if self.is_element_visible('h2 a[href*="simonh"]'): self.set_text_content('h2 a[href*="simonh"]', aybabtu) - self.type('input[name="q"]', aybabtu) - self.highlight('input[name="q"]', loops=4, scroll=False) self.highlight('[aria-label="Primary sidebar"] div div', scroll=False) self.highlight('nav a[data-text="Relevant"]', loops=1, scroll=False) self.highlight('nav a[data-text="Latest"]', loops=1, scroll=False) @@ -129,6 +128,7 @@ def test_all_your_base_are_belong_to_us(self): self.highlight('nav a[data-text="Infinity"]', loops=3, scroll=False) if self.is_element_visible('h2 a[href*="simonh"]'): self.highlight('h2 a[href*="simonh"]', loops=7, scroll=False) + self.highlight("section.crayons-card", loops=7, scroll=False) self.open("https://azure.microsoft.com/en-us/services/playfab/") self.remove_elements('div[role="dialog"]') diff --git a/examples/raw_order_tickets.py b/examples/raw_order_tickets.py index 1f53bde42fb..9dd64776309 100644 --- a/examples/raw_order_tickets.py +++ b/examples/raw_order_tickets.py @@ -2,8 +2,8 @@ with SB(uc=True, test=True, ad_block_on=True) as sb: url = "https://www.thaiticketmajor.com/concert/" - sb.driver.uc_open_with_reconnect(url, 5.5) - sb.driver.uc_click("button.btn-signin", 4) + sb.driver.uc_open_with_reconnect(url, 6.111) + sb.driver.uc_click("button.btn-signin", 4.1) sb.switch_to_frame('iframe[title*="Cloudflare"]') sb.assert_element("div#success svg#success-icon") sb.switch_to_default_content() From 087f30368288ba43b529dea3fb5110986e46abb0 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 3 Jun 2024 13:42:13 -0400 Subject: [PATCH 4/4] Version 4.27.1 --- seleniumbase/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seleniumbase/__version__.py b/seleniumbase/__version__.py index c74a820f3df..f0f3b86dd32 100755 --- a/seleniumbase/__version__.py +++ b/seleniumbase/__version__.py @@ -1,2 +1,2 @@ # seleniumbase package -__version__ = "4.27.0" +__version__ = "4.27.1"