From 15a3be88cea8510562892b48eae951c7f1619d47 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 17 Aug 2020 16:28:28 -0400 Subject: [PATCH] Update the docs --- README.md | 8 ++-- docs/requirements.txt | 2 +- help_docs/customizing_test_runs.md | 2 +- help_docs/virtualenv_instructions.md | 63 ++++++++++++++++++------- mkdocs.yml | 2 +- seleniumbase/plugins/pytest_plugin.py | 2 +- seleniumbase/plugins/selenium_plugin.py | 2 +- 7 files changed, 54 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 83840ca4..ebf753c2 100755 --- a/README.md +++ b/README.md @@ -60,10 +60,8 @@ Tests are run with "pytest". Browsers are controlled by WebDriver. * [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. See shortcut. * Upgrade **[pip](https://pypi.org/project/pip/)** to prevent warnings: - -```bash -python -m pip install -U pip -``` +-- macOS/Linux: ``python3 -m pip install -U pip`` +-- Windows(Cmd): ``py -m pip install -U pip``

Install SeleniumBase:

@@ -315,7 +313,7 @@ SeleniumBase provides additional ``pytest`` command-line options for tests: --agent=STRING # (Modify the web browser's User-Agent string.) --mobile # (Use the mobile device emulator while running tests.) --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.) --headless # (Run tests headlessly. Default mode on Linux OS.) --headed # (Run tests with a GUI on Linux OS.) diff --git a/docs/requirements.txt b/docs/requirements.txt index 40fb5ee4..28297885 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ livereload==2.6.2;python_version>="3.6" pymdown-extensions==8.0 mkdocs==1.1.2 -mkdocs-material==5.5.6 +mkdocs-material==5.5.7 mkdocs-simple-hooks==0.1.1 mkdocs-material-extensions==1.0 mkdocs-minify-plugin==0.3.0 diff --git a/help_docs/customizing_test_runs.md b/help_docs/customizing_test_runs.md index d46b30b4..82be5fa8 100755 --- a/help_docs/customizing_test_runs.md +++ b/help_docs/customizing_test_runs.md @@ -109,7 +109,7 @@ SeleniumBase provides additional ``pytest`` command-line options for tests: --proxy=USERNAME:PASSWORD@SERVER:PORT # (Use authenticated proxy server.) --mobile # (Use the mobile device emulator while running tests.) --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.) --headless # (Run tests headlessly. Default mode on Linux OS.) --headed # (Run tests with a GUI on Linux OS.) diff --git a/help_docs/virtualenv_instructions.md b/help_docs/virtualenv_instructions.md index c4b43447..862bbafa 100755 --- a/help_docs/virtualenv_instructions.md +++ b/help_docs/virtualenv_instructions.md @@ -7,8 +7,8 @@ (*Shortcut*: Run "``source virtualenv_install.sh``" from the top-level SeleniumBase folder to perform the following steps.) ```bash -python -m pip install --upgrade virtualenv -python -m pip install --upgrade virtualenvwrapper +python3 -m pip install pip wheel --force-reinstall +python3 -m pip install virtualenvwrapper --force-reinstall export WORKON_HOME=$HOME/.virtualenvs 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.) ```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: -### macOS / Linux / Windows: +### macOS / Linux: -* Using ``mkvirtualenv``: +* Using ``mkvirtualenv`` (any version of Python): ```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.) -* Using ``virtualenv``: +* (Python 2) Using ``virtualenv``: ```bash -virtualenv seleniumbase_venv -source seleniumbase_venv/bin/activate +virtualenv sbase_env +source sbase_env/bin/activate ``` -* (Python 3) Using ``mvenv``: +* (Python 3) Using ``python3 -m venv``: ```bash -python3 -mvenv seleniumbase_venv -source seleniumbase_venv/bin/activate +python3 -m venv sbase_env +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 deactivate ``` -You can always jump back into your virtual environment later: +Returning to a virtual environment: ```bash -workon seleniumbase_venv +workon sbase_env ``` -To list all existing virtual environments: +Listing all virtual environments: ```bash lsvirtualenv ``` -To delete a virtual environment: +Deleting a virtual environment: ```bash rmvirtualenv VIRTUAL_ENV_NAME diff --git a/mkdocs.yml b/mkdocs.yml index b24ebf2a..326b0186 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -24,7 +24,7 @@ markdown_extensions: # Configuration theme: name: material - logo: https://seleniumbase.io/cdn/img/sb_logo_dh.png + logo: img/logo3a.png favicon: img/logo3a.png include_homepage_in_sidebar: true sticky_navigation: true diff --git a/seleniumbase/plugins/pytest_plugin.py b/seleniumbase/plugins/pytest_plugin.py index 7ca58478..f056dc32 100644 --- a/seleniumbase/plugins/pytest_plugin.py +++ b/seleniumbase/plugins/pytest_plugin.py @@ -30,7 +30,7 @@ def pytest_addoption(parser): --agent=STRING (Modify the web browser's User-Agent string.) --mobile (Use the mobile device emulator while running tests.) --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.) --headless (Run tests headlessly. Default mode on Linux OS.) --headed (Run tests with a GUI on Linux OS.) diff --git a/seleniumbase/plugins/selenium_plugin.py b/seleniumbase/plugins/selenium_plugin.py index d0842d9b..5c124e3f 100755 --- a/seleniumbase/plugins/selenium_plugin.py +++ b/seleniumbase/plugins/selenium_plugin.py @@ -21,7 +21,7 @@ class SeleniumBrowser(Plugin): --agent=STRING (Modify the web browser's User-Agent string.) --mobile (Use the mobile device emulator while running tests.) --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.) --headless (Run tests headlessly. Default mode on Linux OS.) --headed (Run tests with a GUI on Linux OS.)