Skip to content

Several updates #2500

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 10 commits into from
Feb 16, 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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
pytest my_first_test.py
```

<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py"><img src="https://seleniumbase.github.io/cdn/gif/fast_swag.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py"><img src="https://seleniumbase.github.io/cdn/gif/fast_swag_2.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>

> ``pytest`` uses ``--chrome`` by default unless set differently.

Expand Down Expand Up @@ -361,10 +361,10 @@ COMMANDS:
<summary> ▶️ Here's sample output from a chromedriver download. (<b>click to expand</b>)</summary>

```bash
*** chromedriver to download = 116.0.5845.96 (Latest Stable)
*** chromedriver to download = 121.0.6167.85 (Latest Stable)

Downloading chromedriver-mac-arm64.zip from:
https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/mac-arm64/chromedriver-mac-arm64.zip ...
https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.85/mac-arm64/chromedriver-mac-arm64.zip ...
Download Complete!

Extracting ['chromedriver'] from chromedriver-mac-arm64.zip ...
Expand All @@ -373,8 +373,8 @@ Unzip Complete!
The file [chromedriver] was saved to:
/Users/michael/github/SeleniumBase/seleniumbase/drivers/chromedriver

Making [chromedriver 116.0.5845.96] executable ...
[chromedriver 116.0.5845.96] is now ready for use!
Making [chromedriver 121.0.6167.85] executable ...
[chromedriver 121.0.6167.85] is now ready for use!
```

</details>
Expand All @@ -392,7 +392,7 @@ cd examples/
pytest my_first_test.py
```

<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py"><img src="https://seleniumbase.github.io/cdn/gif/fast_swag.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py"><img src="https://seleniumbase.github.io/cdn/gif/fast_swag_2.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>

<p align="left"><b>Here's the code for <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py">my_first_test.py</a>:</b></p>

Expand Down
5 changes: 4 additions & 1 deletion examples/dialog_boxes/dialog_box_tour.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ def test_dialog_boxes(self):

self.open("https://seleniumbase.io/help_docs/ReadMe/")
self.highlight("h1")
self.highlight_click('a:contains("Running Example Tests")')
self.slow_scroll_to('article p a[href*="/examples/ReadMe/"]')
zoom_in = 'article p a[href*="/examples/ReadMe/"]{zoom: 1.8;}'
self.add_css_style(zoom_in)
self.highlight_click('article p a[href*="/examples/ReadMe/"]')
self.highlight("h1")

self.set_jqc_theme("bootstrap", color="green", width="52%")
Expand Down
4 changes: 2 additions & 2 deletions examples/migration/raw_selenium/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ With raw Selenium, that requires more code:<br />

<p>💡 SeleniumBase has its own <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">Recorder / Test Generator</a> for creating tests from manual browser actions.</p>

<p>💡 SeleniumBase comes with <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md">test case management software, ("CasePlans")</a>, for organizing tests and step descriptions.</p>
<p>💡 SeleniumBase comes with <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md">test case management software, ("Case Plans")</a>, for organizing tests and step descriptions.</p>

<p>💡 SeleniumBase includes tools for <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/ReadMe.md">building data apps, ("ChartMaker")</a>, which can generate JavaScript from Python.</p>
<p>💡 SeleniumBase includes tools for <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/ReadMe.md">building data apps, ("Chart Maker")</a>, which can generate JavaScript from Python.</p>

</div>

Expand Down
16 changes: 10 additions & 6 deletions help_docs/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- SeleniumBase Docs -->

<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_word_cloud.png" alt="SeleniumBase" title="SeleniumBase" width="450" /></a></p>
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_word_cloud.png" alt="SeleniumBase" title="SeleniumBase" width="330" /></a></p>

## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Help Docs

Expand Down Expand Up @@ -33,10 +33,13 @@
<a href="https://seleniumbase.io/examples/dialog_boxes/ReadMe/">🛂 Dialog Boxes</a>
<br />
<a href="https://seleniumbase.io/help_docs/recorder_mode/">🔴 Recorder</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/migration/raw_selenium">🚝 Migrate</a>
<a href="https://seleniumbase.io/devices/?url=seleniumbase.io">💻 Device Farm</a>
<br />
<a href="https://seleniumbase.io/examples/presenter/ReadMe/">🎞️ Slides</a> |
<a href="https://seleniumbase.io/examples/chart_maker/ReadMe/">📶 Charts</a>
<a href="https://seleniumbase.io/examples/chart_maker/ReadMe/">📶 Chart Maker</a>
<br / >
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/commander.md">🎖️ GUI</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md">👤 UC Mode</a>
</p>

--------
Expand All @@ -57,19 +60,20 @@
<div><a href="https://seleniumbase.io/examples/example_logs/ReadMe/"><b>The Dashboard</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/recorder_mode/"><b>Recorder Mode</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/commander/"><b>pytest Commander</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/method_summary/"><b>Method Summary</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/syntax_formats/"><b>Syntax Formats</b></a></div>
<div><a href="https://seleniumbase.io/examples/behave_bdd/ReadMe/"><b>Behave BDD</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/behave_gui/"><b>Behave Commander</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/mobile_testing/"><b>Mobile Device Testing</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/method_summary/"><b>Method Summary (API Ref)</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/case_plans/"><b>Case Plans</b></a></div>
<div><a href="https://seleniumbase.io/examples/chart_maker/ReadMe/"><b>Chart Maker</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/translations/"><b>Language Translations</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/locale_codes/"><b>Language Locale Codes</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/js_package_manager/"><b>JS Package Manager</b></a></div>
<div><a href="https://seleniumbase.io/examples/tour_examples/ReadMe/"><b>Tour Examples</b></a></div>
<div><a href="https://seleniumbase.io/examples/tour_examples/ReadMe/"><b>Tour Maker</b></a></div>
<div><a href="https://seleniumbase.io/examples/presenter/ReadMe/"><b>Presentation Maker</b></a></div>
<div><a href="https://seleniumbase.io/examples/chart_maker/ReadMe/"><b>Chart Maker</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/handling_iframes/"><b>Handling iframes</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/uc_mode/"><b>Undetected Mode (UC Mode)</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/mysql_installation/"><b>MySQL Installation Overview</b></a></div>
<div><a href="https://seleniumbase.io/seleniumbase/utilities/selenium_grid/ReadMe/"><b>Using the Selenium Grid</b></a></div>
<div><a href="https://seleniumbase.io/help_docs/desired_capabilities/"><b>Browser Desired Capabilities</b></a></div>
Expand Down
2 changes: 1 addition & 1 deletion mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

regex>=2023.12.25
pymdown-extensions>=10.7
pipdeptree>=2.13.2
pipdeptree>=2.14.0
python-dateutil>=2.8.2
Markdown==3.5.2
markdown2==2.4.12
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pytest==7.4.4;python_version<"3.8"
pytest==8.0.0;python_version>="3.8"
pytest-html==2.0.1
pytest-metadata==3.0.0;python_version<"3.8"
pytest-metadata==3.1.0;python_version>="3.8"
pytest-metadata==3.1.1;python_version>="3.8"
pytest-ordering==0.6
pytest-rerunfailures==13.0
pytest-xdist==3.5.0
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://seleniumbase.github.io/cdn/img/sb_word_cloud.png" alt="SeleniumBase" title="SeleniumBase" width="400" />
<img src="https://seleniumbase.github.io/cdn/img/sb_word_cloud.png" alt="SeleniumBase" title="SeleniumBase" width="330" />

<h2><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Framework Folders</h2>

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.23.3"
__version__ = "4.23.4"
4 changes: 2 additions & 2 deletions seleniumbase/behave/behave_sb.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def get_configured_sb(context):
# Handle: -D variables="{'KEY':'VALUE','KEY2':'VALUE2'}"
if low_key == "variables":
variables = userdata[key]
if variables and type(variables) is str and len(variables) > 0:
if variables and isinstance(variables, str) and len(variables) > 0:
bad_input = False
if (
not variables.startswith("{")
Expand All @@ -377,7 +377,7 @@ def get_configured_sb(context):
else:
try:
variables = ast.literal_eval(variables)
if not type(variables) is dict:
if not isinstance(variables, dict):
bad_input = True
except Exception:
bad_input = True
Expand Down
6 changes: 6 additions & 0 deletions seleniumbase/console_scripts/sb_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,12 @@ def main(override=None, intel_for_uc=None, force_uc=None):
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/"
"%s/%s/%s" % (use_version, platform_code, file_name)
)
major_ch_ver = use_version.split(".")[0]
if major_ch_ver.isnumeric() and int(major_ch_ver) >= 121:
download_url = (
"https://storage.googleapis.com/chrome-for-testing-public/"
"%s/%s/%s" % (use_version, platform_code, file_name)
)
url_request = None
if not found_chromedriver:
url_req = requests_get(last)
Expand Down
12 changes: 6 additions & 6 deletions seleniumbase/console_scripts/sb_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def main():
first_paren = line.find("(")
line1 = line[:first_paren + 1]
line2 = new_ws + line[first_paren + 1:]
if not ("):") in line2:
if ("):") not in line2:
new_sb_lines.append(line1)
if get_width(line2) + w > console_width:
if line2.count('", "') == 1:
Expand Down Expand Up @@ -353,7 +353,7 @@ def main():
new_ws = line[0:whitespace] + " "
line1 = line.split('("')[0] + "("
line2 = new_ws + '"' + line.split('("')[1]
if not ("):") in line2:
if ("):") not in line2:
new_sb_lines.append(line1)
if get_width(line2) + w > console_width:
if line2.count('" in self.') == 1:
Expand Down Expand Up @@ -382,7 +382,7 @@ def main():
new_ws = line[0:whitespace] + " "
line1 = line.split("('")[0] + "("
line2 = new_ws + "'" + line.split("('")[1]
if not ("):") in line2:
if ("):") not in line2:
new_sb_lines.append(line1)
if get_width(line2) + w > console_width:
if line2.count("' in self.") == 1:
Expand Down Expand Up @@ -444,7 +444,7 @@ def main():
continue
new_sb_lines.append(line2)
continue
if line.count("(self.") == 1 and not ("):") in line:
if line.count("(self.") == 1 and ("):") not in line:
whitespace = line_length2 - len(line.lstrip())
new_ws = line[0:whitespace] + " "
line1 = line.split("(self.")[0] + "("
Expand Down Expand Up @@ -500,7 +500,7 @@ def main():
else:
new_sb_lines.append(line2)
continue
if line.count(" % ") == 1 and not ("):") in line:
if line.count(" % ") == 1 and ("):") not in line:
whitespace = line_length2 - len(line.lstrip())
new_ws = line[0:whitespace] + " "
line1 = line.split(" % ")[0] + " \\"
Expand All @@ -509,7 +509,7 @@ def main():
new_sb_lines.append(line1)
new_sb_lines.append(line2)
continue
if line.count(" = ") == 1 and not (" # ") in line:
if line.count(" = ") == 1 and (" # ") not in line:
whitespace = line_length2 - len(line.lstrip())
new_ws = line[0:whitespace] + " "
line1 = line.split(" = ")[0] + " = ("
Expand Down
26 changes: 13 additions & 13 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ def uc_special_open_if_cf(
driver.switch_to.window(driver.window_handles[-1])
uc_metrics = {}
if (
type(device_width) is int
and type(device_height) is int
and type(device_pixel_ratio) is int
isinstance(device_width, int)
and isinstance(device_height, int)
and isinstance(device_pixel_ratio, int)
):
uc_metrics["width"] = device_width
uc_metrics["height"] = device_height
Expand Down Expand Up @@ -847,9 +847,9 @@ def _set_chrome_options(
emulator_settings = {}
device_metrics = {}
if (
type(device_width) is int
and type(device_height) is int
and type(device_pixel_ratio) is int
isinstance(device_width, int)
and isinstance(device_height, int)
and isinstance(device_pixel_ratio, int)
):
device_metrics["width"] = device_width
device_metrics["height"] = device_height
Expand Down Expand Up @@ -1389,7 +1389,7 @@ def get_driver(
headless = True
if (
binary_location
and type(binary_location) is str
and isinstance(binary_location, str)
and (
browser_name == constants.Browser.GOOGLE_CHROME
or browser_name == constants.Browser.EDGE
Expand Down Expand Up @@ -2553,9 +2553,9 @@ def get_local_driver(
emulator_settings = {}
device_metrics = {}
if (
type(device_width) is int
and type(device_height) is int
and type(device_pixel_ratio) is int
isinstance(device_width, int)
and isinstance(device_height, int)
and isinstance(device_pixel_ratio, int)
):
device_metrics["width"] = device_width
device_metrics["height"] = device_height
Expand Down Expand Up @@ -3703,9 +3703,9 @@ def get_local_driver(
if mobile_emulator:
uc_metrics = {}
if (
type(device_width) is int
and type(device_height) is int
and type(device_pixel_ratio) is int
isinstance(device_width, int)
and isinstance(device_height, int)
and isinstance(device_pixel_ratio, int)
):
uc_metrics["width"] = device_width
uc_metrics["height"] = device_height
Expand Down
4 changes: 1 addition & 3 deletions seleniumbase/core/jqc_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ def jquery_confirm_text_dialog(driver, message, button=None, options=None):
if not message:
message = ""
if button:
if not type(button) is list and not type(button) is tuple:
raise Exception('"button" should be a (text, color) tuple!')
if len(button) != 2:
if not isinstance(button, (list, tuple)) or len(button) != 2:
raise Exception('"button" should be a (text, color) tuple!')
else:
button = ("Submit", "blue")
Expand Down
Binary file modified seleniumbase/extensions/recorder.zip
Binary file not shown.
Loading