Update the docs

This commit is contained in:
Michael Mintz 2022-11-05 01:27:22 -04:00
parent 127e245766
commit c654908710
53 changed files with 316 additions and 140 deletions

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
<meta property="og:site_name" content="SeleniumBase">
<meta property="og:title" content="SeleniumBase: Python Web Automation and E2E Testing" />
<meta property="og:description" content="Fast, easy, and reliable Web/UI testing with Python." />
@ -14,7 +16,7 @@
<p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="SeleniumBase" /></a></p>
<p align="center">
<a href="#python_installation">🚀 Start</a> |
<a href="#python_installation">🏄 Start</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🏰 Features</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">📚 Examples</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">🎛️ Options</a> |
@ -202,7 +204,7 @@ Feature: SeleniumBase scenarios for the RealWorld App
**You can install ``seleniumbase`` from [GitHub](https://github.com/seleniumbase/SeleniumBase) or [PyPI](https://pypi.org/project/seleniumbase/):**
🔵 Installing ``seleniumbase`` from a GitHub clone:
🔵 **Installing ``seleniumbase`` from a GitHub clone:**
```bash
git clone https://github.com/seleniumbase/SeleniumBase.git
@ -210,14 +212,14 @@ cd SeleniumBase/
pip install -e .
```
To upgrade an existing install from a GitHub clone:
**To upgrade an existing install from a GitHub clone:**
```bash
git pull
pip install -e .
```
🔵 Installing ``seleniumbase`` from PyPI:
🔵 **Installing ``seleniumbase`` from PyPI:**
```bash
pip install seleniumbase
@ -227,7 +229,7 @@ pip install seleniumbase
* (Add ``--force-reinstall`` to upgrade indirect libraries.)
* (Use ``pip3`` if multiple versions of Python are present.)
To upgrade an existing install from PyPI:
**To upgrade an existing install from PyPI:**
```bash
pip install -U seleniumbase
@ -283,7 +285,7 @@ COMMANDS:
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Downloading web drivers:</h3>
✅ SeleniumBase automatically downloads web drivers as needed, such as ``chromedriver`` and ``geckodriver`` (Firefox).
✅ SeleniumBase automatically downloads web drivers as needed, such as ``chromedriver``, ``edgedriver``, and ``geckodriver``.
✅ To manually download a webdriver, see [Console Scripts](https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/) OR [Webdriver Installation](https://seleniumbase.io/help_docs/webdriver_installation/).

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Example Tests:
<p align="left"><a align="center" href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py"><img align="center" src="https://seleniumbase.github.io/cdn/img/sb_demo_page.png" alt="SeleniumBase Demo Page" width="420" /></a></p>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 🐝 Behave test runner for SeleniumBase 🐝
🐝 (Utilizes the [Behave BDD Python library](https://github.com/behave/behave). For more info, see the [Behave tutorial](https://behave.readthedocs.io/en/stable/tutorial.html) and read about [Behave's Gherkin model](https://behave.readthedocs.io/en/stable/gherkin.html).)

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
<img src="https://seleniumbase.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="290">
<h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Example Boilerplates:</h2>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
<h3><img src="https://seleniumbase.io/img/green_logo.png" title="SeleniumBase" width="32" /> Using Desired Capabilities</h3>
You can specify browser capabilities when running SeleniumBase tests on a remote Selenium Grid server such as <a href="https://www.browserstack.com/automate/capabilities" target="_blank">BrowserStack</a>, <a href="https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/" target="_blank">Sauce Labs</a>, or another.

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 📊 ChartMaker 📶
<p>SeleniumBase ChartMaker lets you use Python to generate HTML charts.</p>

View File

@ -1,15 +1,17 @@
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 🛂 Dialog Boxes 🛂
<!-- SeleniumBase Docs -->
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32"> 🛂 Dialog Boxes 🛂</h2>
SeleniumBase Dialog Boxes let your users provide input in the middle of automation scripts.
* This feature utilizes the [jquery-confirm](https://craftpip.github.io/jquery-confirm/) library.
* A Python API is used to call the JavaScript API.
<img src="https://seleniumbase.io/cdn/img/emoji_sports_dialog.png" alt="SeleniumBase" width="400" />
<img src="https://seleniumbase.github.io/cdn/img/emoji_sports_dialog.png" alt="SeleniumBase" width="400" />
<h4>↕️ (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/dialog_boxes/dialog_box_tour.py">Example: dialog_box_tour.py</a>) ↕️</h4>
<img src="https://seleniumbase.io/cdn/gif/sports_dialog.gif" alt="SeleniumBase" width="400" />
<img src="https://seleniumbase.github.io/cdn/gif/sports_dialog.gif" alt="SeleniumBase" width="400" />
<h4>Here's how to run that example:</h4>
@ -175,4 +177,4 @@ self.activate_jquery_confirm() # Automatic for jqc methods
--------
<h4>✅ 🛂 Automated/Manual Hybrid Mode (MasterQA)</h4>
<p><b><a href="https://seleniumbase.io/seleniumbase/masterqa/ReadMe/">MasterQA</a></b> uses <b>SeleniumBase Dialog Boxes</b> to speed up manual testing by having automation perform all the browser actions while the manual tester handles validation. See <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/master_qa">the MasterQA GitHub page</a> for examples.</p>
<p><b><a href="https://seleniumbase.github.io/seleniumbase/masterqa/ReadMe/">MasterQA</a></b> uses <b>SeleniumBase Dialog Boxes</b> to speed up manual testing by having automation perform all the browser actions while the manual tester handles validation. See <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/master_qa">the MasterQA GitHub page</a> for examples.</p>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Logs, The Dashboard, and Reports:
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=XpuJCjJhJwQ"><img src="http://img.youtube.com/vi/XpuJCjJhJwQ/0.jpg" title="SeleniumBase on YouTube" width="285" /></a>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
![](https://seleniumbase.io/cdn/img/masterqa_logo.png "MasterQA")
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> MasterQA combines automation with manual verification steps.</h3>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## ✅ Support for migrating from raw Selenium to SeleniumBase

View File

@ -1,10 +1,12 @@
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 📑 Presenter 🎞️
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 📑 Presenter 🎞️
<p>SeleniumBase Presenter (slide-maker) lets you use Python to generate HTML presentations.</p>
<b>Here's a sample presentation:</b>
<a href="https://seleniumbase.io/other/presenter.html"><img width="500" src="https://seleniumbase.io/other/presenter.gif" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/presenter.html"><img width="500" src="https://seleniumbase.io/other/presenter.gif" title="Screenshot"></a><br>
([Click on the image/GIF for the actual presentation](https://seleniumbase.io/other/presenter.html))
@ -21,7 +23,7 @@ pytest my_presentation.py
**Here's a presentation with a chart:**
<a href="https://seleniumbase.io/other/core_presentation.html"><img width="428" src="https://seleniumbase.io/other/sb_core_areas.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/core_presentation.html"><img width="428" src="https://seleniumbase.io/other/sb_core_areas.png" title="Screenshot"></a><br>
([Click on the image/GIF for the actual presentation](https://seleniumbase.io/other/core_presentation.html))
@ -35,7 +37,7 @@ pytest core_presentation.py
```
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="24" /> Creating a new presentation:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Creating a new presentation:</h3>
```python
self.create_presentation(name=None, theme="serif", transition="default")
@ -58,7 +60,7 @@ Notes are disabled by default. You can enable notes by specifying:
``show_notes=True``
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="24" /> Adding a slide to a presentation:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Adding a slide to a presentation:</h3>
```python
self.add_slide(content=None, image=None, code=None, iframe=None,
@ -81,7 +83,7 @@ self.add_slide(content=None, image=None, code=None, iframe=None,
"""
```
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="24" /> Running a presentation:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Running a presentation:</h3>
```python
self.begin_presentation(
@ -104,7 +106,7 @@ Before the presentation is run, the full HTML is saved to the ``saved_presentati
All methods have the optional ``name`` argument, which is only needed if you're creating multiple presentations at once.
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="24" /> Here's an example of using SeleniumBase Presenter:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Here's an example of using SeleniumBase Presenter:</h3>
```python
from seleniumbase import BaseCase
@ -229,7 +231,7 @@ That example is from [my_presentation.py](https://github.com/seleniumbase/Seleni
pytest my_presentation.py
```
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="24" /> Saving a presentation:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Saving a presentation:</h3>
If you want to save the presentation you created as an HTML file, use:
@ -245,4 +247,4 @@ self.begin_presentation(show_notes=True)
--------
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="240" /></h3>
<h3 align="left"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="240" /></h3>

View File

@ -1,4 +1,6 @@
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/g_maps_tour.png" alt="SeleniumBase Tour" width="340" /></h3>
<!-- SeleniumBase Docs -->
<h3 align="left"><img src="https://seleniumbase.github.io/cdn/img/g_maps_tour.png" alt="SeleniumBase Tour" width="340" /></h3>
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Interactive Product Tours 🚎
@ -10,7 +12,7 @@
<b>A tour demo: (with autoplay)</b>
<img src="https://seleniumbase.io/cdn/gif/introjs_tour.gif" title="SeleniumBase Tour of Google"><br>
<img src="https://seleniumbase.github.io/cdn/gif/introjs_tour.gif" title="SeleniumBase Tour of Google"><br>
[SeleniumBase maps_introjs_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/maps_introjs_tour.py)
@ -21,7 +23,7 @@ pytest maps_introjs_tour.py --interval=1
<b>Here's a longer version:</b>
<img src="https://seleniumbase.io/cdn/gif/google_tour_4.gif" title="SeleniumBase Tour of Google"><br>
<img src="https://seleniumbase.github.io/cdn/gif/google_tour_4.gif" title="SeleniumBase Tour of Google"><br>
[SeleniumBase google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py)
@ -142,6 +144,6 @@ OR
--------
<img src="https://seleniumbase.io/cdn/gif/driverjs_tour_2.gif" title="SeleniumBase Tour of Google"><br>
<img src="https://seleniumbase.github.io/cdn/gif/driverjs_tour_2.gif" title="SeleniumBase Tour of Google"><br>
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="320" /></h3>
<h3 align="left"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="320" /></h3>

View File

@ -1,3 +1,5 @@
### <img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="20" /> pytest-specific unit tests
<!-- SeleniumBase Docs -->
### <img src="https://seleniumbase.github.io/img/logo3.png" title="SeleniumBase" width="20" /> pytest-specific unit tests
The tests in this folder are for basic verification of the SeleniumBase framework with pytest.

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/sb_logo_f6.png" alt="SeleniumBase" width="445" /></a></p>
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Automated Visual Regression Testing

View File

@ -1,20 +1,21 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Help Docs
<p align="left">
<a href="https://seleniumbase.io/#python_installation">🚁 Start</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📊 Dashboard</a>
<a href="https://seleniumbase.io/#python_installation">🏄 Start</a> |
<a href="https://seleniumbase.io/examples/example_logs/ReadMe/">📊 Dashboard</a>
<br />
<a href="https://seleniumbase.io/help_docs/features_list/">🏰 Features</a> |
<a href="https://seleniumbase.io/help_docs/customizing_test_runs/">🎛️ Options</a>
<br />
<a href="https://seleniumbase.io/examples/ReadMe/">📖 Examples</a> |
<a href="https://seleniumbase.io/examples/ReadMe/">📚 Examples</a> |
<a href="https://seleniumbase.io/help_docs/mobile_testing/">📱 Mobile</a>
<br />
<a href="https://seleniumbase.io/help_docs/syntax_formats/">📝 Syntax Formats</a> |
<a href="https://seleniumbase.io/help_docs/syntax_formats/">🔡 Syntax Formats</a> |
<a href="https://seleniumbase.io/integrations/github/workflows/ReadMe/">🤖 CI/CD</a>
<br />
<a href="https://seleniumbase.io/help_docs/method_summary/">📙 APIs</a> |
<a href="https://seleniumbase.io/examples/example_logs/ReadMe/">📊 Reports</a> |
<a href="https://seleniumbase.io/help_docs/method_summary/">📗 Methods / APIs</a> |
<a href="https://seleniumbase.io/examples/tour_examples/ReadMe/">🚎 Tours</a>
<br />
<a href="https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/">🔮 Console Scripts</a> |
@ -29,11 +30,11 @@
<a href="https://seleniumbase.io/help_docs/recorder_mode/">🔴 Recorder</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js">🚉 Node GUI</a>
<br />
<a href="https://seleniumbase.io/help_docs/translations/">🈺 Translator</a> |
<a href="https://seleniumbase.io/help_docs/translations/">🌏 Translator</a> |
<a href="https://seleniumbase.io/examples/dialog_boxes/ReadMe/">🛂 Dialog Boxes</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/">📶 Charts</a>
</p>
--------

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) SeleniumBase Behave GUI / Commander 🐝🎖️
🐝🎖️ The <b>SeleniumBase Behave GUI</b> lets you run <code>behave</code> scripts from a Desktop GUI.<br>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) SeleniumBase Case Plans 🗂️
<img src="https://seleniumbase.io/cdn/img/cp/sb_case_plans.png" title="SeleniumBase Case Plans Summary" width="625">

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 📊 ChartMaker 📶
<p>SeleniumBase ChartMaker lets you use Python to generate HTML charts.</p>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
<meta property="og:site_name" content="SeleniumBase | Docs">
<meta property="og:title" content="SeleniumBase | Reliable Test Automation" />
<meta property="og:description" content="Simple browser automation and testing with Python." />
@ -116,20 +118,28 @@ pytest my_first_test.py --demo
from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_basics(self):
self.open("https://store.xkcd.com/search")
self.type('input[name="q"]', "xkcd book")
self.click('input[value="Search"]')
self.assert_text("xkcd: volume 0", "h3")
self.open("https://xkcd.com/353/")
self.assert_title("xkcd: Python")
self.assert_element('img[alt="Python"]')
self.click('a[rel="license"]')
self.assert_text("free to copy and reuse")
self.go_back()
self.click_link("About")
self.assert_exact_text("xkcd.com", "h2")
def test_swag_labs(self):
self.open("https://www.saucedemo.com")
self.type("#user-name", "standard_user")
self.type("#password", "secret_sauce\n")
self.assert_element("div.inventory_list")
self.assert_text("PRODUCTS", "span.title")
self.click('button[name*="backpack"]')
self.click("#shopping_cart_container a")
self.assert_text("YOUR CART", "span.title")
self.assert_text("Backpack", "div.cart_item")
self.click("button#checkout")
self.type("#first-name", "SeleniumBase")
self.type("#last-name", "Automation")
self.type("#postal-code", "77123")
self.click("input#continue")
self.assert_text("CHECKOUT: OVERVIEW")
self.assert_text("Backpack", "div.cart_item")
self.click("button#finish")
self.assert_exact_text("THANK YOU FOR YOUR ORDER", "h2")
self.assert_element('img[alt="Pony Express"]')
self.js_click("a#logout_sidebar_link")
self.assert_element("div#login_button_container")
```
* 默认情况下, **[CSS Selectors](https://www.w3schools.com/cssref/css_selectors.asp)** 用来查找页面元素.
@ -167,23 +177,23 @@ self.save_screenshot(FILE_NAME) # 保存当前页面的截图
from seleniumbase.translate.chinese import 硒测试用例
class 我的测试类(硒测试用例):
def test_例子1(self):
self.开启网址("https://xkcd.in/comic?lg=cn&id=353")
self.断言标题("Python - XKCD中文站")
self.断言元素("#content div.comic-body")
self.断言文本("上漫画")
self.单击("div.nextLink")
self.断言文本("老妈的逆袭", "#content h1")
self.单击链接文本("下一篇")
self.断言文本("敲桌子", "#content h1")
self.断言文本("有时候无聊就是最棒的乐趣")
self.回去()
self.单击链接文本("兰德尔·门罗")
self.断言文本("兰德尔·门罗", "#firstHeading")
self.更新文本("#searchInput", "程式设计")
self.开启("https://zh.wikipedia.org/wiki/")
self.断言标题("维基百科,自由的百科全书")
self.断言元素('a[title="首页"]')
self.断言文本("新闻动态", "span#新闻动态")
self.输入文本("#searchInput", "舞龍")
self.单击("#searchButton")
self.断言文本("程序设计", "#firstHeading")
self.断言文本("舞龍", "#firstHeading")
self.断言元素('img[src*="Chinese_draak.jpg"]')
self.输入文本("#searchInput", "麻婆豆腐")
self.单击("#searchButton")
self.断言文本("麻婆豆腐", "#firstHeading")
self.断言元素('div.thumb div:contains("一家中餐館的麻婆豆腐")')
self.输入文本("#searchInput", "精武英雄")
self.单击("#searchButton")
self.断言元素('img[src*="Fist_of_legend.jpg"]')
self.断言文本("李连杰", 'li a[title="李连杰"]')
```
``from seleniumbase.translate.chinese import 硒测试用例``:
@ -334,64 +344,108 @@ pytest my_first_test.py --pdb -s
下面是Pytest附带的一些有用的命令行选项:
```bash
-v # Prints the full test name for each test.
-q # Prints fewer details in the console output when running tests.
-v # Verbose mode. Prints the full name of each test run.
-q # Quiet mode. Print fewer details in the console output when running tests.
-x # Stop running the tests after the first failure is reached.
--html=report.html # Creates a detailed pytest-html report after tests finish.
--collect-only # Show what tests would get run without actually running them.
--collect-only | --co # Show what tests would get run. (Without running them)
-n=NUM # Multithread the tests using that many threads. (Speed up test runs!)
-s # See print statements. (Should be on by default with pytest.ini present.)
--junit-xml=report.xml # Creates a junit-xml report after tests finish.
--pdb # If a test fails, pause run and enter debug mode. (Don't use with CI!)
-m=MARKER # Only run tests that are marked with the specified pytest marker.
--pdb # If a test fails, enter Post Mortem Debug Mode. (Don't use with CI!)
--trace # Enter Debug Mode at the beginning of each test. (Don't use with CI!)
-m=MARKER # Run tests with the specified pytest marker.
```
SeleniumBase 为测试提供额外的Pytest命令行选项:
```bash
--browser=BROWSER # (The web browser to use.)
--browser=BROWSER # (The web browser to use. Default: "chrome".)
--chrome # (Shortcut for "--browser=chrome". On by default.)
--edge # (Shortcut for "--browser=edge".)
--firefox # (Shortcut for "--browser=firefox".)
--safari # (Shortcut for "--browser=safari".)
--cap-file=FILE # (The web browser's desired capabilities to use.)
--cap-string=STRING # (The web browser's desired capabilities to use.)
--settings-file=FILE # (Overrides SeleniumBase settings.py values.)
--env=ENV # (Set a test environment. Use "self.env" to use this in tests.)
--data=DATA # (Extra data to pass to tests. Use "self.data" in tests.)
--var1=DATA # (Extra data to pass to tests. Use "self.var1" in tests.)
--var2=DATA # (Extra data to pass to tests. Use "self.var2" in tests.)
--var3=DATA # (Extra data to pass to tests. Use "self.var3" in tests.)
--settings-file=FILE # (Override default SeleniumBase settings.)
--env=ENV # (Set the test env. Access with "self.env" in tests.)
--account=STR # (Set account. Access with "self.account" in tests.)
--data=STRING # (Extra test data. Access with "self.data" in tests.)
--var1=STRING # (Extra test data. Access with "self.var1" in tests.)
--var2=STRING # (Extra test data. Access with "self.var2" in tests.)
--var3=STRING # (Extra test data. Access with "self.var3" in tests.)
--variables=DICT # (Extra test data. Access with "self.variables".)
--user-data-dir=DIR # (Set the Chrome user data directory to use.)
--server=SERVER # (The server / IP address used by the tests.)
--port=PORT # (The port that's used by the test server.)
--proxy=SERVER:PORT # (This is the proxy server:port combo used by tests.)
--agent=STRING # (This designates the web browser's User Agent to use.)
--mobile # (The option to use the mobile emulator while running tests.)
--metrics=STRING # ("CSSWidth,Height,PixelRatio" for mobile emulator tests.)
--extension-zip=ZIP # (Load a Chrome Extension .zip file, comma-separated.)
--protocol=PROTOCOL # (The Selenium Grid protocol: http|https.)
--server=SERVER # (The Selenium Grid server/IP used for tests.)
--port=PORT # (The Selenium Grid port used by the test server.)
--proxy=SERVER:PORT # (Connect to a proxy server:port for tests.)
--proxy=USERNAME:PASSWORD@SERVER:PORT # (Use authenticated proxy server.)
--proxy-bypass-list=STRING # (";"-separated hosts to bypass, Eg "*.foo.com")
--proxy-pac-url=URL # (Connect to a proxy server using a PAC_URL.pac file.)
--proxy-pac-url=USERNAME:PASSWORD@URL # (Authenticated proxy with PAC URL.)
--agent=STRING # (Modify the web browser's User-Agent string.)
--mobile # (Use the mobile device emulator while running tests.)
--metrics=STRING # (Set mobile metrics: "CSSWidth,CSSHeight,PixelRatio".)
--chromium-arg="ARG=N,ARG2" # (Set Chromium args, ","-separated, no spaces.)
--firefox-arg="ARG=N,ARG2" # (Set Firefox args, comma-separated, no spaces.)
--firefox-pref=SET # (Set a Firefox preference:value set, comma-separated.)
--extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
--headless # (The option to run tests headlessly. The default on Linux OS.)
--headed # (The option to run tests with a GUI on Linux OS.)
--sjw # (Skip JS Waits for readyState to be "complete" or Angular to load.)
--pls=PLS # (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
--headless # (Run tests in headless mode. The default arg on Linux OS.)
--headless2 # (Use the new headless mode, which supports extensions.)
--headed # (Run tests in headed/GUI mode on Linux OS, where not default.)
--xvfb # (Run tests using the Xvfb virtual display server on Linux OS.)
--locale=LOCALE_CODE # (Set the Language Locale Code for the web browser.)
--interval=SECONDS # (The autoplay interval for presentations & tour steps)
--start-page=URL # (The starting URL for the web browser when tests begin.)
--archive-logs # (Archive old log files instead of deleting them.)
--time-limit=SECONDS # (Safely fail any test that exceeds the limit limit.)
--slow # (The option to slow down the automation.)
--demo # (The option to visually see test actions as they occur.)
--demo-sleep=SECONDS # (The option to wait longer after Demo Mode actions.)
--archive-logs # (Archive existing log files instead of deleting them.)
--archive-downloads # (Archive old downloads instead of deleting them.)
--time-limit=SECONDS # (Safely fail any test that exceeds the time limit.)
--slow # (Slow down the automation. Faster than using Demo Mode.)
--demo # (Slow down and visually see test actions as they occur.)
--demo-sleep=SECONDS # (Set the wait time after Slow & Demo Mode actions.)
--highlights=NUM # (Number of highlight animations for Demo Mode actions.)
--message-duration=SECONDS # (The time length for Messenger alerts.)
--check-js # (The option to check for JavaScript errors after page loads.)
--ad-block # (The option to block some display ads after page loads.)
--check-js # (Check for JavaScript errors after page loads.)
--ad-block # (Block some types of display ads from loading.)
--block-images # (Block images from loading during tests.)
--do-not-track # (Indicate to websites that you don't want to be tracked.)
--verify-delay=SECONDS # (The delay before MasterQA verification checks.)
--disable-csp # (This disables the Content Security Policy of websites.)
--enable-sync # (The option to enable "Chrome Sync".)
--use-auto-ext # (The option to use Chrome's automation extension.)
--incognito # (The option to enable Chrome's Incognito mode.)
--guest # (The option to enable Chrome's Guest mode.)
--devtools # (The option to open Chrome's DevTools when the browser opens.)
--reuse-session # (The option to reuse the browser session between tests.)
--crumbs # (Option to delete all cookies between tests reusing a session.)
--maximize-window # (The option to start with the web browser maximized.)
--save-screenshot # (The option to save a screenshot after each test.)
--recorder # (Enables the Recorder for turning browser actions into code.)
--rec-behave # (Same as Recorder Mode, but also generates behave-gherkin.)
--rec-sleep # (If the Recorder is enabled, also records self.sleep calls.)
--rec-print # (If the Recorder is enabled, prints output after tests end.)
--disable-js # (Disable JavaScript on websites. Pages might break!)
--disable-csp # (Disable the Content Security Policy of websites.)
--disable-ws # (Disable Web Security on Chromium-based browsers.)
--enable-ws # (Enable Web Security on Chromium-based browsers.)
--enable-sync # (Enable "Chrome Sync" on websites.)
--use-auto-ext # (Use Chrome's automation extension.)
--uc | --undetected # (Use undetected-chromedriver to evade bot-detection.)
--uc-sub | --uc-subprocess # (Use undetected-chromedriver as a subprocess.)
--remote-debug # (Enable Chrome's Remote Debugger on http://localhost:9222)
--final-debug # (Enter Debug Mode after each test ends. Don't use with CI!)
--dashboard # (Enable the SeleniumBase Dashboard. Saved at: dashboard.html)
--dash-title=STRING # (Set the title shown for the generated dashboard.)
--swiftshader # (Use Chrome's "--use-gl=swiftshader" feature.)
--incognito # (Enable Chrome's Incognito mode.)
--guest # (Enable Chrome's Guest mode.)
--devtools # (Open Chrome's DevTools when the browser opens.)
--reuse-session | --rs # (Reuse the browser session between tests.)
--crumbs # (Delete all cookies between tests reusing a session.)
--disable-beforeunload # (Disable the "beforeunload" event on Chrome.)
--window-size=WIDTH,HEIGHT # (Set the browser's starting window size.)
--maximize # (Start tests with the browser window maximized.)
--screenshot # (Save a screenshot at the end of each test.)
--no-screenshot # (No screenshots saved unless tests directly ask it.)
--visual-baseline # (Set the visual baseline for Visual/Layout tests.)
--wire # (Use selenium-wire's webdriver for replacing selenium webdriver.)
--external-pdf # (Set Chromium "plugins.always_open_pdf_externally":True.)
--timeout-multiplier=MULTIPLIER # (Multiplies the default timeout values.)
--list-fail-page # (After each failing test, list the URL of the failure.)
```
(有关详细信息,请参见命令行选项的完整列表 **[点击这里](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/pytest_plugin.py)**.)

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) SeleniumBase Commander 🎖️
🎖️ <b>SeleniumBase Commander</b> lets you run <code>pytest</code> scripts from a Desktop GUI.<br>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) pytest options for SeleniumBase
🎛️ SeleniumBase's [pytest plugin](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/pytest_plugin.py) lets you customize test runs from the CLI (Command-Line Interface), which adds options for setting/enabling the browser type, Dashboard Mode, Demo Mode, Headless Mode, Mobile Mode, Multi-threading Mode, Recorder Mode, reuse-session mode, proxy config, user agent config, browser extensions, html-report mode, and more.

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Demo Mode 🎦
<p align="left"><img src="https://seleniumbase.github.io/cdn/gif/xkcd_vid.gif" width="400" alt="SeleniumBase Example" title="SeleniumBase Example" /></p>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Using Desired Capabilities
You can specify browser capabilities when running SeleniumBase tests on a remote Selenium Grid server such as <a href="https://www.browserstack.com/automate/capabilities" target="_blank">BrowserStack</a>, <a href="https://www.lambdatest.com/capabilities-generator/" target="_blank">LambdaTest</a>, or <a href="https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/" target="_blank">Sauce Labs</a>.

View File

@ -1,9 +1,11 @@
<!-- SeleniumBase Docs -->
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw"><img src="http://img.youtube.com/vi/Sjzq9kU5kOw/0.jpg" title="SeleniumBase on YouTube" width="285" /></a>
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw">Watch the tutorial on YouTube</a></b>)</p>
<a id="feature_list"></a>
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) SeleniumBase Features: 🥂
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) SeleniumBase Features: 🏰
* A powerful Python framework for browser automation and E2E UI testing.
* Includes [Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md) for instantly generating browser tests in Python.

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="300" /></h3>
<h4> Here are some organizations that have grown their automation with SeleniumBase:</h4>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## Showing hidden files on macOS
Depending on your macOS settings, some files may be hidden from view in your Finder window, such as ``.gitignore``.

View File

@ -1,4 +1,6 @@
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) How SeleniumBase Works 👁️
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) How SeleniumBase Works 👁️
<a id="how_seleniumbase_works"></a>
@ -77,5 +79,5 @@ pytest -k agent
--------
<p><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" alt="SeleniumBase" title="SeleniumBase" width="200" /></a></p>
<p><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" alt="SeleniumBase" title="SeleniumBase" width="300" /></a></p>
<p><a href="https://www.python.org/downloads/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE&logo=python" title="Supported Python Versions" /></a></p>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) The HTML Inspector 🔎
🔎 <b>HTML Inspector</b> provides useful info about a web page.

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) SeleniumBase Installation
<h4>If installing SeleniumBase directly from <a href="https://pypi.python.org/pypi/seleniumbase">PyPI</a>, (the Python Package Index), use:</h4>
@ -6,7 +8,7 @@
pip install seleniumbase
```
To upgrade an existing ``seleniumbase`` install from PyPI:
<h4>To upgrade an existing ``seleniumbase`` install from PyPI:</h4>
```bash
pip install -U seleniumbase
@ -28,7 +30,7 @@ cd SeleniumBase/
pip install -e .
```
To upgrade an existing ``seleniumbase`` install from GitHub:
<h4>To upgrade an existing ``seleniumbase`` install from GitHub:</h4>
```bash
git pull # To pull the latest version

View File

@ -1,4 +1,6 @@
## Installation instructions for Git, Python, and Pip
<!-- SeleniumBase Docs -->
## Installation instructions for ``Git``, ``Python``, and ``pip``
### [Git](http://www.git-scm.com)
@ -12,18 +14,11 @@ You can [download Git from here](http://git-scm.com/downloads).
You can download Python from [https://www.python.org/downloads/](https://www.python.org/downloads/) if it's not already preinstalled on your machine.
### [Pip](https://en.wikipedia.org/wiki/Pip_%28package_manager%29)
### [pip](https://en.wikipedia.org/wiki/Pip_%28package_manager%29)
You probably already have pip and setuptools installed. If not:
**``pip`` already comes with Python!** (It lets you install packages, such as ``seleniumbase``.)
```bash
python -m easy_install -U pip
pip install -U setuptools
```
If that didn't work, here are some more commands you can try:
On macOS / Windows / Linux, run the following command:
⚠️ If something went wrong with your ``pip`` installation, try this:
```bash
python -m ensurepip --default-pip

View File

@ -1,10 +1,20 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) JS Package Manager and Code Generators
<h3>🕹️ SeleniumBase lets you load JavaScript packages from any CDN link into any website via Python.</h3>
<b>🎨 The following SeleniumBase solutions utilize this feature:</b>
🎦 (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/demo_mode.md">Demo Mode</a>) - 🚎 (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">Website Tours</a>) - 🎞️ (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/ReadMe.md">Presenter</a>) - 📊 (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/ReadMe.md">Chart Maker</a> / <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">Dashboard</a>) - 🛂 (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/dialog_boxes/ReadMe.md">Dialog Boxes</a> / <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">MasterQA</a>)
🎦 (<a href="../demo_mode.md">Demo Mode</a>)
🚎 (<a href="../../examples/tour_examples/ReadMe.md">Website Tours</a>)
🎞️ (<a href="../../examples/presenter/ReadMe.md">Presentation Maker</a>)
📊 (<a href="../../examples/chart_maker/ReadMe.md">Chart Maker</a> / <a href="../../examples/example_logs/ReadMe.md">Dashboard</a>)
🛂 (<a href="../../examples/dialog_boxes/ReadMe.md">Dialog Boxes</a> / <a href="../../examples/master_qa/ReadMe.md">MasterQA</a>)
--------

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Language Locale Codes
You can specify a Language Locale Code to customize web pages on supported websites. With SeleniumBase, you can change the web browser's Locale on the command line by doing this:

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) SeleniumBase Methods (API Reference)
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=_yNJlHnp2JA"><img src="https://seleniumbase.github.io/cdn/img/sb_api_youtube.png" title="SeleniumBase on YouTube" width="285" /></a>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Mobile Testing
Use ``--mobile`` to run SeleniumBase tests using Chrome's mobile device emulator with default values for Device Metrics and User-Agent.

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## MySQL Installation Instructions

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Recorder Mode 🔴
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=eKN5nq7YbdM"><img src="http://img.youtube.com/vi/eKN5nq7YbdM/0.jpg" title="SeleniumBase on YouTube" width="285" /></a>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="300" /></h3>
## Shadow DOM support / Shadow-root interaction

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
<a id="syntax_formats"></a>
## [<img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="40">](https://github.com/seleniumbase/SeleniumBase/) The 23 Syntax Formats

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="290">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
### Thank you for flying with SeleniumBase! 🛸

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
<a id="language_tests"></a>
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 🌏 Translated Tests 🈺

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## Useful grep commands
There are several useful **grep** commands for helping you find and/or replace text in multiple files. Examples:

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## Using Safari's WebDriver for running browser tests on macOS
*(NOTE: Safari's WebDriver requires macOS 10.13 "High Sierra" or later.)*

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Verifying that web drivers are installed
On newer versions of SeleniumBase, the driver is automatically downloaded to the ``seleniumbase/drivers`` folder as needed, and does not need to be on the System Path when running tests.

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## Virtual Environment Tutorial
There are multiple ways of creating a **[Python virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment)**. This tutorial covers two of those:
@ -100,4 +102,28 @@ rmvirtualenv sbase_env
--------
If the ``python`` and ``python3`` versions don't match (*while in a virtualenv on macOS or Linux*), the following command will sync the versions:
```bash
alias python=`which python3`
```
(To remove an alias, use: ``unalias NAME``)
--------
To verify the ``python`` version, use:
```bash
python --version
```
To see the PATH of your ``python`` (macOS/Linux), use:
```bash
which python
```
--------
> <i>[python-guide.org/en/latest/dev/virtualenvs](http://docs.python-guide.org/en/latest/dev/virtualenvs/) has more information about Python virtual environments. For specific details about VirtualEnv and VirtualEnvWrapper, see [http://virtualenv.readthedocs.org/en/latest/](http://virtualenv.readthedocs.org/en/latest/) and [http://virtualenvwrapper.readthedocs.org/en/latest/](http://virtualenvwrapper.readthedocs.org/en/latest/).</i>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Installing webdrivers
To run web automation, you'll need webdrivers for each browser you plan on using. With SeleniumBase, drivers are downloaded automatically as needed into the SeleniumBase ``drivers`` folder.
@ -19,9 +21,9 @@ sbase get chromedriver latest
* You can also get a specific version of chromedriver for a specific version of Chrome:
```bash
sbase get chromedriver 105.0.5195.52
sbase get chromedriver 107.0.5304.62
sbase get chromedriver 105
sbase get chromedriver 107
```
* On Linux, you can run the following two commands (once you've installed SeleniumBase) to automatically upgrade your Chromedriver to match your version of Chrome: (``wget`` downloads the file, and ``pytest`` runs it.)
@ -79,8 +81,8 @@ chmod +x /usr/local/bin/chromedriver
```
```bash
wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
tar xvfz geckodriver-v0.31.0-linux64.tar.gz
wget https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz
tar xvfz geckodriver-v0.32.0-linux64.tar.gz
mv geckodriver /usr/local/bin/
chmod +x /usr/local/bin/geckodriver
```

View File

@ -124,7 +124,7 @@ def main(*args, **kwargs):
if ' href="' in line and '.md"' in line:
changed = True
line = line.replace('.md"', '/"')
if "<!-- Hide TOC -->" in line:
if "<!-- SeleniumBase Docs -->" in line:
changed = True
new_lines = []
new_lines.append("---")

View File

@ -1,16 +1,18 @@
<!-- SeleniumBase Docs -->
## Using [seleniumbase/common](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common) methods.
### Part 1: Decorators - (from [decorators.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common/decorators.py))
#### Use these Python decorators with your test methods as needed:
* @print_runtime(description=None, limit=None)
* ``@print_runtime(description=None, limit=None)``
* @runtime_limit(limit, description=None)
* ``@runtime_limit(limit, description=None)``
* @retry_on_exception(tries=6, delay=1, backoff=2, max_delay=32)
* ``@retry_on_exception(tries=6, delay=1, backoff=2, max_delay=32)``
* @rate_limited(max_per_second)
* ``@rate_limited(max_per_second)``
Example demonstrating a rate-limited printing functionality:
@ -18,7 +20,6 @@ Example demonstrating a rate-limited printing functionality:
import unittest
from seleniumbase import decorators
class MyTestClass(unittest.TestCase):
@decorators.rate_limited(3.5) # The arg is max calls per second

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 🔮 Console Scripts 🔮
⭐ SeleniumBase console scripts help you get things done, such as getting web drivers, creating a test directory with useful files, activating the SeleniumBase Recorder, launching the SeleniumBase Commander, translating tests into other languages, running a Selenium Grid, and more.
@ -57,16 +59,15 @@ sbase install [DRIVER] [OPTIONS]
* Examples:
```bash
sbase get chromedriver # (Default: 72.0.3626.69 - Tries to detect first.)
sbase get chromedriver
sbase get geckodriver
sbase get edgedriver
sbase get chromedriver 106
sbase get chromedriver 106.0.5249.61
sbase get chromedriver 107
sbase get chromedriver 107.0.5304.62
sbase get chromedriver latest
sbase get chromedriver latest-1 # (Latest minus one)
sbase get chromedriver -p
sbase get chromedriver latest -p
sbase get edgedriver 106.0.1370.42
```
(Drivers: ``chromedriver``, ``geckodriver``, ``edgedriver``,
@ -80,12 +81,10 @@ sbase get edgedriver 106.0.1370.42
* Output:
Downloads the chosen webdriver to ``seleniumbase/drivers/``.
(``chromedriver`` is required for Google Chrome automation)
(``geckodriver`` is required for Mozilla Firefox automation)
(``edgedriver`` is required for Microsoft Edge automation)
(``iedriver`` is required for InternetExplorer automation)
(``operadriver`` is required for Opera Browser automation)
Downloads the webdriver to ``seleniumbase/drivers/``
(``chromedriver`` is required for Chrome automation)
(``geckodriver`` is required for Firefox automation)
(``edgedriver`` is required for MS__Edge automation)
<h3>methods</h3>

View File

@ -1,6 +1,8 @@
[<img src="https://seleniumbase.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="360">](https://github.com/seleniumbase/SeleniumBase)
<!-- SeleniumBase Docs -->
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> SeleniumBase browser extension storage</h2>
[<img src="https://seleniumbase.github.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="360">](https://github.com/seleniumbase/SeleniumBase)
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> SeleniumBase browser extension storage</h2>
<b>The List:</b>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
![](https://seleniumbase.io/cdn/img/masterqa_logo.png "MasterQA")
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> MasterQA combines automation with manual verification steps.</h3>

View File

@ -1,4 +1,6 @@
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Resource Files
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Resource Files
SeleniumBase uses JavaScript libraries for bonus features such as the Website Tour Maker, Presentation Maker, Chart Maker, Demo Mode, HTML Inspector, and more. In general, SeleniumBase retrieves these resources via CDN link.

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="290">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="28" /> The Selenium Grid Hub:</h2>

View File

@ -1,3 +1,5 @@
<!-- SeleniumBase Docs -->
### Converting Katalon recordings into SeleniumBase test scripts
### (NOTE: **[SeleniumBase now has Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md)**, which is recommended over other record & playback tools.)