Skip to content

Commit

Permalink
Merge pull request #2385 from seleniumbase/add-breakpoint-option-in-u…
Browse files Browse the repository at this point in the history
…c-mode

Add a `"breakpoint"` option for reconnecting in UC Mode
  • Loading branch information
mdmintz authored Dec 23, 2023
2 parents 77c0ccd + 4c1c2bd commit 9f8ce98
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,13 @@ class CoffeeCartTest(BaseCase):
def test_coffee_cart(self):
self.open("https://seleniumbase.io/coffee/")
self.assert_title("Coffee Cart")
self.assert_element('button:contains("Total: $0.00")')
self.click('div[data-sb="Cappuccino"]')
self.assert_exact_text("cart (1)", 'a[aria-label="Cart page"]')
self.click('div[data-sb="Flat-White"]')
self.assert_exact_text("cart (2)", 'a[aria-label="Cart page"]')
self.click('div[data-sb="Cafe-Latte"]')
self.assert_exact_text("cart (3)", 'a[aria-label="Cart page"]')
self.click('a[aria-label="Cart page"]')
self.assert_exact_text("Total: $53.00", "button.pay")
self.click("button.pay")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ rich==13.7.0

coverage==6.2;python_version<"3.7"
coverage==7.2.7;python_version>="3.7" and python_version<"3.8"
coverage==7.3.3;python_version>="3.8"
coverage==7.3.4;python_version>="3.8"
pytest-cov==4.0.0;python_version<"3.7"
pytest-cov==4.1.0;python_version>="3.7"
flake8==5.0.4;python_version<"3.9"
Expand Down
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.1"
__version__ = "4.22.2"
1 change: 1 addition & 0 deletions seleniumbase/fixtures/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ class ValidBinaries:
"google-chrome-unstable",
"brave-browser",
"brave-browser-stable",
"brave",
"opera",
"opera-stable",
"chrome.exe", # WSL (Windows Subsystem for Linux)
Expand Down
7 changes: 6 additions & 1 deletion seleniumbase/undetected/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,12 @@ def reconnect(self, timeout=0.1):
self.service.stop()
except Exception:
pass
time.sleep(timeout)
if isinstance(timeout, str):
if timeout.lower() == "breakpoint":
breakpoint() # To continue:
pass # Type "c" & press ENTER!
else:
time.sleep(timeout)
try:
self.service.start()
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
# Usage: coverage run -m pytest; coverage html; coverage report
"coverage": [
'coverage==7.2.7;python_version<"3.8"',
'coverage==7.3.3;python_version>="3.8"',
'coverage==7.3.4;python_version>="3.8"',
'pytest-cov==4.1.0',
],
# pip install -e .[flake8]
Expand Down

0 comments on commit 9f8ce98

Please sign in to comment.