Skip to content

Commit

Permalink
Patch UC Mode examples to use the updated turnstile selector
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmintz committed May 10, 2024
1 parent 419cedc commit e693775
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/raw_cdp_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
url = "seleniumbase.io/apps/turnstile"
driver.uc_open_with_reconnect(url, 2)
driver.switch_to_frame("iframe")
driver.uc_click("span.mark")
driver.uc_click("span")
driver.sleep(3)
pprint(driver.get_log("performance"))
finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/raw_form_turnstile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
sb.highlight_click('input[value="AR"] + span')
sb.click('input[value="cc"] + span')
sb.switch_to_frame("iframe")
sb.driver.uc_click("span.mark")
sb.driver.uc_click("span")
sb.highlight("img#captcha-success", timeout=3)
sb.highlight_click('button:contains("Request & Pay")')
sb.highlight("img#submit-success")
Expand Down
4 changes: 2 additions & 2 deletions examples/raw_nopecha.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
if sb.is_element_visible("#example-container0 iframe"):
sb.switch_to_frame("#example-container0 iframe")
if not sb.is_element_visible("circle.success-circle"):
sb.driver.uc_click("span.mark", reconnect_time=3)
sb.driver.uc_click("span", reconnect_time=3)
sb.switch_to_frame("#example-container0 iframe")
sb.switch_to_default_content()

sb.switch_to_frame("#example-container5 iframe")
sb.driver.uc_click("span.mark", reconnect_time=2.5)
sb.driver.uc_click("span", reconnect_time=2.5)
sb.switch_to_frame("#example-container5 iframe")
sb.assert_element("svg#success-icon", timeout=3)
sb.switch_to_parent_frame()
Expand Down
2 changes: 1 addition & 1 deletion examples/raw_turnstile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def open_the_turnstile_page(sb):

def click_turnstile_and_verify(sb):
sb.driver.switch_to_frame("iframe")
sb.driver.uc_click("span.mark")
sb.driver.uc_click("span")
sb.assert_element("img#captcha-success", timeout=3)


Expand Down
2 changes: 1 addition & 1 deletion examples/uc_cdp_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def add_cdp_listener(self):

def click_turnstile_and_verify(sb):
sb.switch_to_frame("iframe")
sb.driver.uc_click("span.mark")
sb.driver.uc_click("span")
sb.assert_element("img#captcha-success", timeout=3)
sb.highlight("img#captcha-success", loops=8)

Expand Down
6 changes: 3 additions & 3 deletions help_docs/uc_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def open_the_turnstile_page(sb):

def click_turnstile_and_verify(sb):
sb.switch_to_frame("iframe")
sb.driver.uc_click("span.mark")
sb.driver.uc_click("span")
sb.assert_element("img#captcha-success", timeout=3)

with SB(uc=True, test=True) as sb:
Expand Down Expand Up @@ -268,12 +268,12 @@ with SB(uc=True, test=True) as sb:
if sb.is_element_visible("#example-container0 iframe"):
sb.switch_to_frame("#example-container0 iframe")
if not sb.is_element_visible("circle.success-circle"):
sb.driver.uc_click("span.mark", reconnect_time=3)
sb.driver.uc_click("span", reconnect_time=3)
sb.switch_to_frame("#example-container0 iframe")
sb.switch_to_default_content()

sb.switch_to_frame("#example-container5 iframe")
sb.driver.uc_click("span.mark", reconnect_time=2.5)
sb.driver.uc_click("span", reconnect_time=2.5)
sb.switch_to_frame("#example-container5 iframe")
sb.assert_element("svg#success-icon", timeout=3)
sb.switch_to_parent_frame()
Expand Down

0 comments on commit e693775

Please sign in to comment.