Update the docs

This commit is contained in:
Michael Mintz 2021-10-18 01:49:29 -04:00
parent 25b7bd456f
commit 8b11e33fa1
8 changed files with 122 additions and 29 deletions

View File

@ -16,11 +16,11 @@ readme-renderer==30.0
pymdown-extensions==9.0;python_version>="3.6" pymdown-extensions==9.0;python_version>="3.6"
importlib-metadata==4.8.1;python_version>="3.6" importlib-metadata==4.8.1;python_version>="3.6"
bleach==4.1.0 bleach==4.1.0
lunr==0.6.0;python_version>="3.6" lunr==0.6.1;python_version>="3.6"
nltk==3.6.5;python_version>="3.6" nltk==3.6.5;python_version>="3.6"
watchdog==2.1.6;python_version>="3.6" watchdog==2.1.6;python_version>="3.6"
mkdocs==1.2.3;python_version>="3.6" mkdocs==1.2.3;python_version>="3.6"
mkdocs-material==7.3.3;python_version>="3.6" mkdocs-material==7.3.4;python_version>="3.6"
mkdocs-exclude-search==0.5.2;python_version>="3.6" mkdocs-exclude-search==0.5.2;python_version>="3.6"
mkdocs-simple-hooks==0.1.3 mkdocs-simple-hooks==0.1.3
mkdocs-material-extensions==1.0.3;python_version>="3.6" mkdocs-material-extensions==1.0.3;python_version>="3.6"

View File

@ -2,8 +2,7 @@
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Running Example Tests:</h2> <h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Running Example Tests:</h2>
<p align="left"><a align="center" href="https://github.com/seleniumbase/SeleniumBase/blob/master/README.md"><img align="center" src="https://seleniumbase.io/cdn/img/sb_demo_page.png" alt="SeleniumBase" width="420" /></a></p> <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.io/cdn/img/sb_demo_page.png" alt="SeleniumBase Demo Page" width="420" /></a></p>
* <b>SeleniumBase</b> tests are run with <b>pytest</b>. * <b>SeleniumBase</b> tests are run with <b>pytest</b>.
* Chrome is the default browser if not specified. * Chrome is the default browser if not specified.

View File

@ -1,4 +1,4 @@
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="285">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md) [<img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" title="SeleniumBase" width="240">](https://github.com/seleniumbase/SeleniumBase/)
<!-- 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> <!-- 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> <!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw">Watch the tutorial on YouTube</a></b>)</p>
@ -45,3 +45,5 @@
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0"><img src="http://img.youtube.com/vi/yEQeAU_mrg0/0.jpg" title="SeleniumBase on YouTube" width="285" /></a> <!-- YouTube View --><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0"><img src="http://img.youtube.com/vi/yEQeAU_mrg0/0.jpg" title="SeleniumBase on YouTube" width="285" /></a>
<!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0">Have fun with test automation!</a></b>)</p> <!-- GitHub Only --><p>(<b><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0">Have fun with test automation!</a></b>)</p>
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="285">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)

View File

@ -7,6 +7,7 @@
* [Veracode](https://www.veracode.com/) * [Veracode](https://www.veracode.com/)
* [Autodesk](https://www.autodesk.com/) * [Autodesk](https://www.autodesk.com/)
* [Broadcom](https://www.broadcom.com/) * [Broadcom](https://www.broadcom.com/)
* [FortressIQ](https://www.fortressiq.com/)
* [Thoma Bravo](https://www.thomabravo.com/) * [Thoma Bravo](https://www.thomabravo.com/)
* [Expedia Group](https://lifeatexpediagroup.com/) * [Expedia Group](https://lifeatexpediagroup.com/)
* [Texture Health](https://www.texturehealth.com/) * [Texture Health](https://www.texturehealth.com/)
@ -35,8 +36,8 @@
* [netLex](https://netlex.io/en/) * [netLex](https://netlex.io/en/)
* [Cubic](https://www.cubic.com/) * [Cubic](https://www.cubic.com/)
* [Baidu](https://www.baidu.com/) * [Baidu](https://www.baidu.com/)
* [Iver](https://www.iver.com/)
* [HqO](https://www.hqo.co/) * [HqO](https://www.hqo.co/)
* [Iver](https://www.iver.com/)
* And more... * And more...
<h3>Case Study: (<i>HubSpot</i>)</h3> <h3>Case Study: (<i>HubSpot</i>)</h3>

View File

@ -1,4 +1,4 @@
[<img src="https://seleniumbase.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="360">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md) [<img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" title="SeleniumBase" width="240">](https://github.com/seleniumbase/SeleniumBase/)
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Methods (API Reference)</h2> <h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Methods (API Reference)</h2>
@ -709,3 +709,5 @@ self._print(TEXT) # Calls Python's print() / Allows for translations
* [test_suite.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_suite.py) * [test_suite.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_suite.py)
* [test_tinymce.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_tinymce.py) * [test_tinymce.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_tinymce.py)
* And many more... * And many more...
[<img src="https://seleniumbase.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="360">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)

View File

@ -74,6 +74,8 @@ class RecorderTest(BaseCase):
<p>🔴 SeleniumBase <code>1.66.14</code> improves the algorithm for converting recorded assertions into SeleniumBase code. Text assertions that contain the newline character will now be handled correctly. If a text assertion has a <code>:contains</code> selector, then the text assertion will be changed to an element assertion. Asserted text from multi-line assertions will use <code>self.assert_text()</code> on the first non-empty line. Asserted text from single-line assertions will use <code>self.assert_exact_text()</code>. Element assertions will be handled with <code>self.assert_element()</code>.</p> <p>🔴 SeleniumBase <code>1.66.14</code> improves the algorithm for converting recorded assertions into SeleniumBase code. Text assertions that contain the newline character will now be handled correctly. If a text assertion has a <code>:contains</code> selector, then the text assertion will be changed to an element assertion. Asserted text from multi-line assertions will use <code>self.assert_text()</code> on the first non-empty line. Asserted text from single-line assertions will use <code>self.assert_exact_text()</code>. Element assertions will be handled with <code>self.assert_element()</code>.</p>
<p>🔴 SeleniumBase <code>2.0.1</code> adds the ability to preview selectors via the page title when hovering over elements. It also fixes an issue that may occur when opening up new URLs while in Recorder Mode.</p>
-------- --------
<div>To learn more about SeleniumBase, check out the Docs Site:</div> <div>To learn more about SeleniumBase, check out the Docs Site:</div>

View File

@ -12,7 +12,7 @@ There are multiple ways of creating a **[Python virtual environment](https://pac
(The [Python Software Foundation](https://www.python.org/psf/) recommends ``venv`` for creating virtual environments.) (The [Python Software Foundation](https://www.python.org/psf/) recommends ``venv`` for creating virtual environments.)
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Part 1: Using "venv"</h3> <h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Option 1: Using "venv"</h3>
> macOS/Linux terminal (``python3 -m venv ENV``) > macOS/Linux terminal (``python3 -m venv ENV``)
@ -32,7 +32,7 @@ To exit a virtual env, type ``deactivate``.
-------- --------
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Part 2: Using virtualenvwrapper</h3> <h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Option 2: Using virtualenvwrapper</h3>
> macOS/Linux terminal: > macOS/Linux terminal:

View File

@ -1,6 +1,6 @@
[<img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" title="SeleniumBase" width="240">](https://github.com/seleniumbase/SeleniumBase/) [<img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" title="SeleniumBase" width="240">](https://github.com/seleniumbase/SeleniumBase/)
## Console Scripts <h2>Console Scripts</h2>
SeleniumBase console scripts help you get things done more easily, such as installing web drivers, creating a test directory with necessary configuration files, converting old WebDriver unittest scripts into SeleniumBase code, translating tests into multiple languages, and using the Selenium Grid. SeleniumBase console scripts help you get things done more easily, such as installing web drivers, creating a test directory with necessary configuration files, converting old WebDriver unittest scripts into SeleniumBase code, translating tests into multiple languages, and using the Selenium Grid.
@ -12,7 +12,36 @@ SeleniumBase console scripts help you get things done more easily, such as insta
(<i>For running tests, [use <b>pytest</b> with SeleniumBase](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md).</i>) (<i>For running tests, [use <b>pytest</b> with SeleniumBase](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md).</i>)
### install ```
COMMANDS:
install [DRIVER] [OPTIONS]
methods (List common Python methods)
options (List common pytest options)
mkdir [DIRECTORY] [OPTIONS]
mkfile [FILE.py] [OPTIONS]
mkrec [FILE.py]
mkpres [FILE.py] [LANG]
mkchart [FILE.py] [LANG]
print [FILE] [OPTIONS]
translate [SB_FILE.py] [LANG] [ACTION]
convert [WEBDRIVER_UNITTEST_FILE.py]
extract-objects [SB_FILE.py]
inject-objects [SB_FILE.py] [OPTIONS]
objectify [SB_FILE.py] [OPTIONS]
revert-objects [SB_FILE.py] [OPTIONS]
encrypt (OR: obfuscate)
decrypt (OR: unobfuscate)
download server (The Selenium Grid JAR file)
grid-hub [start|stop] [OPTIONS]
grid-node [start|stop] --hub=[HOST/IP]
* (EXAMPLE: "sbase install chromedriver latest") *
Type "sbase help [COMMAND]" for specific command info.
For info on all commands, type: "seleniumbase --help".
Use "pytest" for running tests.
```
<h3>install</h3>
* Usage: * Usage:
``sbase install [DRIVER] [OPTIONS]`` ``sbase install [DRIVER] [OPTIONS]``
@ -49,7 +78,7 @@ Installs the specified webdriver.
(``iedriver`` is required for Internet Explorer automation) (``iedriver`` is required for Internet Explorer automation)
(``operadriver`` is required for Opera Browser automation) (``operadriver`` is required for Opera Browser automation)
### methods <h3>methods</h3>
* Usage: * Usage:
``sbase methods`` ``sbase methods``
@ -57,7 +86,7 @@ Installs the specified webdriver.
* Output: * Output:
Displays common SeleniumBase Python methods. Displays common SeleniumBase Python methods.
### options <h3>options</h3>
* Usage: * Usage:
``sbase options`` ``sbase options``
@ -66,7 +95,53 @@ Displays common SeleniumBase Python methods.
Displays common pytest command-line options Displays common pytest command-line options
that are available when using SeleniumBase. that are available when using SeleniumBase.
### mkdir ```
--browser=BROWSER (The web browser to use. Default is "chrome")
--headless (Run tests headlessly. Default mode on Linux OS.)
--demo (Slow down and visually see test actions as they occur.)
--slow (Slow down the automation. Faster than using Demo Mode.)
--reuse-session / --rs (Reuse browser session between tests.)
--crumbs (Clear all cookies between tests reusing a session.)
--maximize (Start tests with the web browser window maximized.)
--dashboard (Enable SeleniumBase's Dashboard at dashboard.html)
--incognito (Enable Chromium's Incognito mode.)
--guest (Enable Chromium's Guest mode.)
-m=MARKER (Run tests with the specified pytest marker.)
-n=NUM (Multithread the tests using that many threads.)
-v (Verbose mode. Print the full names of each test run.)
--html=report.html (Create a detailed pytest-html report.)
--collect-only / --co (Only show discovered tests. No run.)
--co -q (Only show full names of discovered tests. No run.)
--pdb (Enter the Post Mortem Debug Mode after any test fails.)
--trace (Enter Debug Mode immediately after starting any test.)
| Debug Mode Commands >>> help / h: List all commands. |
| n: Next line of method. s: Step through. c: Continue. |
| return / r: Run until method returns. j: Jump to line. |
| where / w: Show stack spot. u: Up stack. d: Down stack. |
| longlist / ll: See code. dir(): List namespace objects. |
--recorder (Record browser actions to generate test scripts.)
--save-screenshot (Save a screenshot at the end of each test.)
-x (Stop running the tests after the first failure is reached.)
--archive-logs (Archive old log files instead of deleting them.)
--check-js (Check for JavaScript errors after page loads.)
--start-page=URL (The browser start page when tests begin.)
--agent=STRING (Modify the web browser's User-Agent string.)
--mobile (Use Chromium's mobile device emulator during tests.)
--metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".)
--ad-block (Block some types of display ads after page loads.)
--settings-file=FILE (Override default SeleniumBase settings.)
--env=ENV (Set the test env. Access with "self.env" in tests.)
--data=DATA (Extra test data. Access with "self.data" in tests.)
--disable-csp (Disable the Content Security Policy of websites.)
--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=USER:PASS@SERVER:PORT (Use authenticated proxy server.)
For the full list of command-line options, type: "pytest --help".
```
<h3>mkdir</h3>
* Usage: * Usage:
``sbase mkdir [DIRECTORY] [OPTIONS]`` ``sbase mkdir [DIRECTORY] [OPTIONS]``
@ -118,7 +193,7 @@ ui_tests/
└── setup.cfg └── setup.cfg
``` ```
### mkfile <h3>mkfile</h3>
* Usage: * Usage:
``sbase mkfile [FILE.py] [OPTIONS]`` ``sbase mkfile [FILE.py] [OPTIONS]``
@ -147,7 +222,19 @@ methods, which are "open", "type", "click",
basic boilerplate option, only the "open" method basic boilerplate option, only the "open" method
is included. is included.
### mkpres <h3>mkrec</h3>
* Usage:
``sbase mkrec [FILE.py]``
* Example:
``sbase mkrec new_test.py``
* Output:
Creates a new SeleniumBase test using the Recorder.
If the filename already exists, an error is raised.
<h3>mkpres</h3>
* Usage: * Usage:
``sbase mkpres [FILE.py] [LANG]`` ``sbase mkpres [FILE.py] [LANG]``
@ -169,7 +256,7 @@ By default, the slides are written in English,
and use "serif" theme with "slide" transition. and use "serif" theme with "slide" transition.
The slides can be used as a basic boilerplate. The slides can be used as a basic boilerplate.
### mkchart <h3>mkchart</h3>
* Usage: * Usage:
``sbase mkchart [FILE.py] [LANG]`` ``sbase mkchart [FILE.py] [LANG]``
@ -191,7 +278,7 @@ By default, the slides are written in English,
and use a "sky" theme with "slide" transition. and use a "sky" theme with "slide" transition.
The chart can be used as a basic boilerplate. The chart can be used as a basic boilerplate.
### print <h3>print</h3>
* Usage: * Usage:
``sbase print [FILE] [OPTIONS]`` ``sbase print [FILE] [OPTIONS]``
@ -203,7 +290,7 @@ The chart can be used as a basic boilerplate.
Prints the code/text of any file Prints the code/text of any file
with syntax-highlighting. with syntax-highlighting.
### translate <h3>translate</h3>
* Usage: * Usage:
``sbase translate [SB_FILE.py] [LANGUAGE] [ACTION]`` ``sbase translate [SB_FILE.py] [LANGUAGE] [ACTION]``
@ -234,7 +321,7 @@ plus the 2-letter language code of the new language.
(Example: Translating "test_1.py" into Japanese with (Example: Translating "test_1.py" into Japanese with
``-c`` will create a new file called "test_1_ja.py".) ``-c`` will create a new file called "test_1_ja.py".)
### extract-objects <h3>extract-objects</h3>
* Usage: * Usage:
``sbase extract-objects [SB_FILE.py]`` ``sbase extract-objects [SB_FILE.py]``
@ -244,7 +331,7 @@ Creates page objects based on selectors found in a
seleniumbase Python file and saves those objects to the seleniumbase Python file and saves those objects to the
"page_objects.py" file in the same folder as the tests. "page_objects.py" file in the same folder as the tests.
### inject-objects <h3>inject-objects</h3>
* Usage: * Usage:
``sbase inject-objects [SB_FILE.py] [OPTIONS]`` ``sbase inject-objects [SB_FILE.py] [OPTIONS]``
@ -257,7 +344,7 @@ Takes the page objects found in the "page_objects.py"
file and uses those to replace matching selectors in file and uses those to replace matching selectors in
the selected seleniumbase Python file. the selected seleniumbase Python file.
### objectify <h3>objectify</h3>
* Usage: * Usage:
``sbase objectify [SB_FILE.py] [OPTIONS]`` ``sbase objectify [SB_FILE.py] [OPTIONS]``
@ -272,7 +359,7 @@ have been replaced with variable names defined in
(This has the same outcome as combining (This has the same outcome as combining
``extract-objects`` with ``inject-objects``) ``extract-objects`` with ``inject-objects``)
### revert-objects <h3>revert-objects</h3>
* Usage: * Usage:
``sbase revert-objects [SB_FILE.py] [OPTIONS]`` ``sbase revert-objects [SB_FILE.py] [OPTIONS]``
@ -286,7 +373,7 @@ Reverts the changes made by ``seleniumbase objectify ...`` or
seleniumbase Python file. Objects will get replaced by seleniumbase Python file. Objects will get replaced by
selectors stored in the "page_objects.py" file. selectors stored in the "page_objects.py" file.
### convert <h3>convert</h3>
* Usage: * Usage:
``sbase convert [WEBDRIVER_UNITTEST_FILE.py]`` ``sbase convert [WEBDRIVER_UNITTEST_FILE.py]``
@ -298,7 +385,7 @@ file name while keeping the original file intact.
Works with Katalon Recorder scripts. Works with Katalon Recorder scripts.
See [This ReadMe](https://seleniumbase.io/seleniumbase/utilities/selenium_ide/ReadMe/) for details. See [This ReadMe](https://seleniumbase.io/seleniumbase/utilities/selenium_ide/ReadMe/) for details.
### encrypt / obfuscate <h3>encrypt / obfuscate</h3>
* Usage: * Usage:
``sbase encrypt`` OR ``sbase obfuscate`` ``sbase encrypt`` OR ``sbase obfuscate``
@ -307,7 +394,7 @@ See [This ReadMe](https://seleniumbase.io/seleniumbase/utilities/selenium_ide/Re
Runs the password encryption/obfuscation tool. Runs the password encryption/obfuscation tool.
(Where you can enter a password to encrypt/obfuscate.) (Where you can enter a password to encrypt/obfuscate.)
### decrypt / unobfuscate <h3>decrypt / unobfuscate</h3>
* Usage: * Usage:
``sbase decrypt`` OR ``sbase unobfuscate`` ``sbase decrypt`` OR ``sbase unobfuscate``
@ -316,7 +403,7 @@ Runs the password encryption/obfuscation tool.
Runs the password decryption/unobfuscation tool. Runs the password decryption/unobfuscation tool.
(Where you can enter an encrypted password to decrypt.) (Where you can enter an encrypted password to decrypt.)
### download <h3>download</h3>
* Usage: * Usage:
``sbase download server`` ``sbase download server``
@ -325,7 +412,7 @@ Runs the password decryption/unobfuscation tool.
Downloads the Selenium Server JAR file for Grid usage. Downloads the Selenium Server JAR file for Grid usage.
(That JAR file is required when using a Selenium Grid) (That JAR file is required when using a Selenium Grid)
### grid-hub <h3>grid-hub</h3>
* Usage: * Usage:
``sbase grid-hub {start|stop|restart} [OPTIONS]`` ``sbase grid-hub {start|stop|restart} [OPTIONS]``
@ -341,7 +428,7 @@ to speed up test runs and reduce the total time
of test suite execution. of test suite execution.
You can start, restart, or stop the Grid Hub server. You can start, restart, or stop the Grid Hub server.
### grid-node <h3>grid-node</h3>
* Usage: * Usage:
``sbase grid-node {start|stop|restart} [OPTIONS]`` ``sbase grid-node {start|stop|restart} [OPTIONS]``