Update help docs

This commit is contained in:
Michael Mintz 2019-11-10 23:58:02 -05:00
parent 01b691457a
commit b5dab77b98
4 changed files with 21 additions and 10 deletions

View File

@ -1,9 +1,11 @@
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb4.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
<a id="how_seleniumbase_works"></a> <a id="how_seleniumbase_works"></a>
### <img src="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png" title="SeleniumBase" height="32"> **How SeleniumBase Works:** ## <img src="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png" title="SeleniumBase" height="32"> **How it works:**
At the core, SeleniumBase works by extending [Pytest](https://docs.pytest.org/en/latest/) and [Nosetests](http://nose.readthedocs.io/en/latest/) as a direct plugin to each one. SeleniumBase automatically spins up web browsers for tests, and then gives those tests access to the SeleniumBase libraries through the BaseCase class, [found here](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py). Now you can use "``--browser=chrome``" to specify the web browser to use (Default = "Chrome"). You can also include additional plugins for additional features such as "``--demo_mode``" (for highlighting elements & changing the speed of test runs) and "``--proxy=IP_ADDRESS:PORT``" (for using a proxy server during test runs). There are also other plugins available such as "``--with-db_reporting``", "``--with-s3_logging``", and more. At the core, SeleniumBase works by extending [pytest](https://docs.pytest.org/en/latest/) and [nosetests](http://nose.readthedocs.io/en/latest/) as a direct plugin to each one. SeleniumBase automatically spins up web browsers for tests, and then gives those tests access to the SeleniumBase libraries through the [BaseCase class](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py). Tests are also given access to SeleniumBase [command-line arguments](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/pytest_plugin.py), which provide additional functionality.
(NOTE: Pytest and Nosetests work by automatically running any Python method that starts with "``test``" from the file that you specified on the command line. You can also run all tests from a specific class in a file, or even pick out an individual test to run.) (NOTE: pytest and nosetests use a feature called test discovery to automatically find and run Python methods that start with "``test_``" from the file that you specified on the command line.)
To use SeleniumBase calls you need the following: To use SeleniumBase calls you need the following:
```python ```python

View File

@ -1,4 +1,6 @@
## ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") SeleniumBase Installation [<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb4.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png" title="SeleniumBase" height="32"> Installation
If you're installing SeleniumBase from a cloned copy on your machine, use: If you're installing SeleniumBase from a cloned copy on your machine, use:
``` ```

View File

@ -157,6 +157,8 @@ self.switch_to_default_driver()
self.save_screenshot(name, folder=None) self.save_screenshot(name, folder=None)
self.save_page_source(name, folder=None)
self.wait_for_ready_state_complete(timeout=None) self.wait_for_ready_state_complete(timeout=None)
self.wait_for_angularjs(timeout=None) self.wait_for_angularjs(timeout=None)

View File

@ -1,7 +1,8 @@
## Installing Google Chromedriver, Firefox Geckodriver, Microsoft Edge Driver, etc. [<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb4.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png" title="SeleniumBase" height="32"> Installing webdrivers
To run web automation, you'll need to download a web driver for each browser you plan on using and place those on your System **[PATH](http://java.com/en/download/help/path.xml)**. Additionaly, you can place drivers in the [SeleniumBase `drivers` folder](https://github.com/seleniumbase/SeleniumBase/blob/master/drivers). If you plan on taking the latter option, here are some commands that'll automatically download the driver you need into the ``drivers`` folder once you've installed SeleniumBase: To run web automation, you'll need to download webdrivers for each browser you plan on using, and then place those on your System **[PATH](http://java.com/en/download/help/path.xml)**. Additionaly, you can place drivers in the [SeleniumBase `drivers` folder](https://github.com/seleniumbase/SeleniumBase/blob/master/drivers). If you plan on taking the latter option, here are some commands that'll automatically download the driver you need into the ``drivers`` folder once you've installed SeleniumBase:
```bash ```bash
seleniumbase install chromedriver seleniumbase install chromedriver
@ -10,6 +11,10 @@ seleniumbase install edgedriver
seleniumbase install iedriver seleniumbase install iedriver
seleniumbase install operadriver seleniumbase install operadriver
``` ```
* If you have the latest version of Chrome installed, get the latest chromedriver (<i>otherwise it defaults to chromedriver 2.44 for compatibility reasons</i>):
```bash
seleniumbase install chromedriver latest
```
If you plan on using the [Selenium Grid integration](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md) (which allows for remote webdriver), you'll need to put the drivers on your System PATH. On macOS and Linux, ``/usr/local/bin`` is a good PATH spot. On Windows, you may need to set the System PATH under Environment Variables to include the location where you placed the driver files. As a shortcut, you could place the driver files into your Python ``Scripts/`` folder in the location where you have Python installed, which should already be on your System PATH. If you plan on using the [Selenium Grid integration](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md) (which allows for remote webdriver), you'll need to put the drivers on your System PATH. On macOS and Linux, ``/usr/local/bin`` is a good PATH spot. On Windows, you may need to set the System PATH under Environment Variables to include the location where you placed the driver files. As a shortcut, you could place the driver files into your Python ``Scripts/`` folder in the location where you have Python installed, which should already be on your System PATH.
@ -37,7 +42,7 @@ brew cask install chromedriver
brew install geckodriver brew install geckodriver
``` ```
(NOTE: If your existing version of chromedriver is less than 2.40, **upgrading is required** in order to keep up with the latest version of Chrome!) (NOTE: If your existing version of chromedriver is less than 2.44, **upgrading is required** in order to keep up with the latest version of Chrome!)
```bash ```bash
brew cask upgrade chromedriver brew cask upgrade chromedriver
@ -50,15 +55,15 @@ brew upgrade geckodriver
If you still need the web drivers, here are some scripts to help you install chromedriver and geckodriver on a Linux machine: If you still need the web drivers, here are some scripts to help you install chromedriver and geckodriver on a Linux machine:
```bash ```bash
wget http://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip wget http://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip
unzip chromedriver_linux64.zip unzip chromedriver_linux64.zip
mv chromedriver /usr/local/bin/ mv chromedriver /usr/local/bin/
chmod +x /usr/local/bin/chromedriver chmod +x /usr/local/bin/chromedriver
``` ```
```bash ```bash
wget https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
tar xvfz geckodriver-v0.21.0-linux64.tar.gz tar xvfz geckodriver-v0.26.0-linux64.tar.gz
mv geckodriver /usr/local/bin/ mv geckodriver /usr/local/bin/
chmod +x /usr/local/bin/geckodriver chmod +x /usr/local/bin/geckodriver
``` ```