Skip to content

Update the Recorder, "sbase print FILE.md", and dependencies #2554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions examples/uc_cdp_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ def add_cdp_listener(self):
lambda data: pprint(data)
)

def verify_success(self):
self.assert_text("OH YEAH, you passed!", "h1", timeout=6.25)
self.sleep(1)
def click_turnstile_and_verify(sb):
sb.driver.uc_switch_to_frame("iframe")
sb.driver.uc_click("span.mark")
sb.assert_element("img#captcha-success", timeout=3.33)
sb.highlight("img#captcha-success", loops=8)

def test_display_cdp_events(self):
if not (self.undetectable and self.uc_cdp_events):
self.get_new_driver(undetectable=True, uc_cdp_events=True)
self.driver.uc_open_with_tab("https://nowsecure.nl/#relax")
self.verify_success()
self.driver.uc_open("https://seleniumbase.io/apps/turnstile")
self.add_cdp_listener()
self.refresh()
self.click_turnstile_and_verify()
self.sleep(1)
self.refresh()
self.sleep(0.5)
8 changes: 4 additions & 4 deletions help_docs/uc_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ driver.default_get(url) # Faster, but Selenium can be detected
👤 Here are some examples of using those special UC Mode methods: (Use `self.driver` for `BaseCase` formats. Use `sb.driver` for `SB()` formats):

```python
driver.uc_open_with_reconnect("https://nowsecure.nl/#relax", reconnect_time=5)
driver.uc_open_with_reconnect("https://nowsecure.nl/#relax", 5)
driver.uc_open_with_reconnect("https://top.gg/", reconnect_time=5)
driver.uc_open_with_reconnect("https://top.gg/", 5)

driver.reconnect(5)
driver.reconnect(timeout=5)
Expand All @@ -127,8 +127,8 @@ driver.reconnect(timeout=5)
👤 You can also set the `reconnect_time` / `timeout` to `"breakpoint"` as a valid option. This allows the user to perform manual actions (until typing `c` and pressing ENTER to continue from the breakpoint):

```python
driver.uc_open_with_reconnect("https://nowsecure.nl/#relax", reconnect_time="breakpoint")
driver.uc_open_with_reconnect("https://nowsecure.nl/#relax", "breakpoint")
driver.uc_open_with_reconnect("https://top.gg/", reconnect_time="breakpoint")
driver.uc_open_with_reconnect("https://top.gg/", "breakpoint")

driver.reconnect(timeout="breakpoint")
driver.reconnect("breakpoint")
Expand Down
2 changes: 1 addition & 1 deletion mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ lxml==5.1.0
pyquery==2.0.0
readtime==3.0.0
mkdocs==1.5.3
mkdocs-material==9.5.11
mkdocs-material==9.5.12
mkdocs-exclude-search==0.6.6
mkdocs-simple-hooks==0.1.5
mkdocs-material-extensions==1.3.1
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pyotp==2.9.0
markdown-it-py==2.2.0;python_version<"3.8"
markdown-it-py==3.0.0;python_version>="3.8"
mdurl==0.1.2
rich==13.7.0
rich==13.7.1

# --- Testing Requirements --- #
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)
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.24.2"
__version__ = "4.24.3"
1 change: 1 addition & 0 deletions seleniumbase/console_scripts/sb_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ def main():
all_code = all_code.replace("</b>", "**")
if "<code>`" not in all_code and "`<code>" not in all_code:
if "</code>`" not in all_code and "`</code>" not in all_code:
all_code = all_code.replace('<code translate="no">', "``")
all_code = all_code.replace("<code>", "``")
all_code = all_code.replace("</code>", "``")
# Display ALL <h> tags as an <h1> because the font size is fixed
Expand Down
Binary file modified seleniumbase/extensions/recorder.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions seleniumbase/js_code/active_css_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@
non_id_attributes.push('href');
non_id_attributes.push('label');
non_id_attributes.push('data-content');
non_id_attributes.push('data-tip');
non_id_attributes.push('data-for');
non_id_attributes.push('class');
non_id_attributes.push('for');
non_id_attributes.push('placeholder');
Expand Down
2 changes: 2 additions & 0 deletions seleniumbase/js_code/recorder_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@
non_id_attributes.push('href');
non_id_attributes.push('label');
non_id_attributes.push('data-content');
non_id_attributes.push('data-tip');
non_id_attributes.push('data-for');
non_id_attributes.push('class');
non_id_attributes.push('for');
non_id_attributes.push('placeholder');
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
'markdown-it-py==2.2.0;python_version<"3.8"',
'markdown-it-py==3.0.0;python_version>="3.8"',
'mdurl==0.1.2',
'rich==13.7.0',
'rich==13.7.1',
],
extras_require={
# pip install -e .[allure]
Expand Down