Update the docs

This commit is contained in:
Michael Mintz 2020-08-17 16:28:28 -04:00
parent 2138dfd61e
commit 15a3be88ce
7 changed files with 54 additions and 27 deletions

View File

@ -60,10 +60,8 @@ Tests are run with "pytest". Browsers are controlled by WebDriver.
* [<img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE" alt="Python:2.7|3.5|3.6|3.7|3.8" />](https://www.python.org/downloads/) * [<img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE" alt="Python:2.7|3.5|3.6|3.7|3.8" />](https://www.python.org/downloads/)
* A [Python virtual env](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/) is recommended. <i><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md">See shortcut</a>.</i> * A [Python virtual env](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/) is recommended. <i><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md">See shortcut</a>.</i>
* Upgrade **[pip](https://pypi.org/project/pip/)** to prevent warnings: * Upgrade **[pip](https://pypi.org/project/pip/)** to prevent warnings:
-- macOS/Linux: ``python3 -m pip install -U pip``
```bash -- Windows(Cmd): ``py -m pip install -U pip``
python -m pip install -U pip
```
<a id="install_seleniumbase"></a> <a id="install_seleniumbase"></a>
<h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Install SeleniumBase:</h2> <h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Install SeleniumBase:</h2>
@ -315,7 +313,7 @@ SeleniumBase provides additional ``pytest`` command-line options for tests:
--agent=STRING # (Modify the web browser's User-Agent string.) --agent=STRING # (Modify the web browser's User-Agent string.)
--mobile # (Use the mobile device emulator while running tests.) --mobile # (Use the mobile device emulator while running tests.)
--metrics=STRING # (Set mobile "CSSWidth,CSSHeight,PixelRatio".) --metrics=STRING # (Set mobile "CSSWidth,CSSHeight,PixelRatio".)
--extension-zip=ZIP # (Load a Chrome Extension .zip file, comma-separated.) --extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.) --extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
--headless # (Run tests headlessly. Default mode on Linux OS.) --headless # (Run tests headlessly. Default mode on Linux OS.)
--headed # (Run tests with a GUI on Linux OS.) --headed # (Run tests with a GUI on Linux OS.)

View File

@ -1,7 +1,7 @@
livereload==2.6.2;python_version>="3.6" livereload==2.6.2;python_version>="3.6"
pymdown-extensions==8.0 pymdown-extensions==8.0
mkdocs==1.1.2 mkdocs==1.1.2
mkdocs-material==5.5.6 mkdocs-material==5.5.7
mkdocs-simple-hooks==0.1.1 mkdocs-simple-hooks==0.1.1
mkdocs-material-extensions==1.0 mkdocs-material-extensions==1.0
mkdocs-minify-plugin==0.3.0 mkdocs-minify-plugin==0.3.0

View File

@ -109,7 +109,7 @@ SeleniumBase provides additional ``pytest`` command-line options for tests:
--proxy=USERNAME:PASSWORD@SERVER:PORT # (Use authenticated proxy server.) --proxy=USERNAME:PASSWORD@SERVER:PORT # (Use authenticated proxy server.)
--mobile # (Use the mobile device emulator while running tests.) --mobile # (Use the mobile device emulator while running tests.)
--metrics=STRING # (Set mobile "CSSWidth,CSSHeight,PixelRatio".) --metrics=STRING # (Set mobile "CSSWidth,CSSHeight,PixelRatio".)
--extension-zip=ZIP # (Load a Chrome Extension .zip file, comma-separated.) --extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.) --extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
--headless # (Run tests headlessly. Default mode on Linux OS.) --headless # (Run tests headlessly. Default mode on Linux OS.)
--headed # (Run tests with a GUI on Linux OS.) --headed # (Run tests with a GUI on Linux OS.)

View File

@ -7,8 +7,8 @@
(*Shortcut*: Run "``source virtualenv_install.sh``" from the top-level SeleniumBase folder to perform the following steps.) (*Shortcut*: Run "``source virtualenv_install.sh``" from the top-level SeleniumBase folder to perform the following steps.)
```bash ```bash
python -m pip install --upgrade virtualenv python3 -m pip install pip wheel --force-reinstall
python -m pip install --upgrade virtualenvwrapper python3 -m pip install virtualenvwrapper --force-reinstall
export WORKON_HOME=$HOME/.virtualenvs export WORKON_HOME=$HOME/.virtualenvs
source `which virtualenvwrapper.sh` source `which virtualenvwrapper.sh`
``` ```
@ -20,52 +20,81 @@ If you add ``source `which virtualenvwrapper.sh` `` to your local bash file (``~
(*Shortcut*: Run "``virtualenv_install.bat``" from the top-level SeleniumBase folder to perform the following steps.) (*Shortcut*: Run "``virtualenv_install.bat``" from the top-level SeleniumBase folder to perform the following steps.)
```bash ```bash
python -m pip install --upgrade virtualenvwrapper-win py -m pip install pip wheel --force-reinstall --user
py -m pip install virtualenvwrapper-win --force-reinstall --user
``` ```
### Step 2: Create a virtual environment: ### Step 2: Create a virtual environment:
### macOS / Linux / Windows: ### macOS / Linux:
* Using ``mkvirtualenv``: * Using ``mkvirtualenv`` (any version of Python):
```bash ```bash
mkvirtualenv seleniumbase_venv mkvirtualenv sbase_env
``` ```
(If you have multiple versions of Python installed on your machine, and you want your virtual environment to use a specific Python version, add ``--python=PATH_TO_PYTHON_EXE`` with the Python executable to use.) (If you have multiple versions of Python installed on your machine, and you want your virtual environment to use a specific Python version, add ``--python=PATH_TO_PYTHON_EXE`` with the Python executable to use.)
* Using ``virtualenv``: * (Python 2) Using ``virtualenv``:
```bash ```bash
virtualenv seleniumbase_venv virtualenv sbase_env
source seleniumbase_venv/bin/activate source sbase_env/bin/activate
``` ```
* (Python 3) Using ``mvenv``: * (Python 3) Using ``python3 -m venv``:
```bash ```bash
python3 -mvenv seleniumbase_venv python3 -m venv sbase_env
source seleniumbase_venv/bin/activate source sbase_env/bin/activate
```
### Windows:
* Using ``mkvirtualenv`` (any version of Python):
```bash
mkvirtualenv sbase_env
```
(If you have multiple versions of Python installed on your machine, and you want your virtual environment to use a specific Python version, add ``--python=PATH_TO_PYTHON_EXE`` with the Python executable to use.)
* (Python 2) Using ``virtualenv``:
```bash
virtualenv sbase_env
call sbase_env\\Scripts\\activate
```
* (Python 3) Using ``py -m venv``:
```bash
py -m venv sbase_env
call sbase_env\\Scripts\\activate
``` ```
--- ---
If you ever need to leave your virtual environment, use the following command: ### mkvirtualenv Commands
Creating a virtual environment:
```bash
mkvirtualenv sbase_env
```
Leaving your virtual environment:
```bash ```bash
deactivate deactivate
``` ```
You can always jump back into your virtual environment later: Returning to a virtual environment:
```bash ```bash
workon seleniumbase_venv workon sbase_env
``` ```
To list all existing virtual environments: Listing all virtual environments:
```bash ```bash
lsvirtualenv lsvirtualenv
``` ```
To delete a virtual environment: Deleting a virtual environment:
```bash ```bash
rmvirtualenv VIRTUAL_ENV_NAME rmvirtualenv VIRTUAL_ENV_NAME

View File

@ -24,7 +24,7 @@ markdown_extensions:
# Configuration # Configuration
theme: theme:
name: material name: material
logo: https://seleniumbase.io/cdn/img/sb_logo_dh.png logo: img/logo3a.png
favicon: img/logo3a.png favicon: img/logo3a.png
include_homepage_in_sidebar: true include_homepage_in_sidebar: true
sticky_navigation: true sticky_navigation: true

View File

@ -30,7 +30,7 @@ def pytest_addoption(parser):
--agent=STRING (Modify the web browser's User-Agent string.) --agent=STRING (Modify the web browser's User-Agent string.)
--mobile (Use the mobile device emulator while running tests.) --mobile (Use the mobile device emulator while running tests.)
--metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".) --metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".)
--extension-zip=ZIP (Load a Chrome Extension .zip file, comma-separated.) --extension-zip=ZIP (Load a Chrome Extension .zip|.crx, comma-separated.)
--extension-dir=DIR (Load a Chrome Extension directory, comma-separated.) --extension-dir=DIR (Load a Chrome Extension directory, comma-separated.)
--headless (Run tests headlessly. Default mode on Linux OS.) --headless (Run tests headlessly. Default mode on Linux OS.)
--headed (Run tests with a GUI on Linux OS.) --headed (Run tests with a GUI on Linux OS.)

View File

@ -21,7 +21,7 @@ class SeleniumBrowser(Plugin):
--agent=STRING (Modify the web browser's User-Agent string.) --agent=STRING (Modify the web browser's User-Agent string.)
--mobile (Use the mobile device emulator while running tests.) --mobile (Use the mobile device emulator while running tests.)
--metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".) --metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".)
--extension-zip=ZIP (Load a Chrome Extension .zip file, comma-separated.) --extension-zip=ZIP (Load a Chrome Extension .zip|.crx, comma-separated.)
--extension-dir=DIR (Load a Chrome Extension directory, comma-separated.) --extension-dir=DIR (Load a Chrome Extension directory, comma-separated.)
--headless (Run tests headlessly. Default mode on Linux OS.) --headless (Run tests headlessly. Default mode on Linux OS.)
--headed (Run tests with a GUI on Linux OS.) --headed (Run tests with a GUI on Linux OS.)