Update the Docs

This commit is contained in:
Michael Mintz 2018-08-19 03:53:31 -04:00
parent 8c48448927
commit ce5da2d1fb
3 changed files with 16 additions and 18 deletions

View File

@ -1,10 +1,12 @@
<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_2d1.png" title="SeleniumBase" height="48">
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_2f1.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
[<img src="https://img.shields.io/pypi/v/seleniumbase.svg" alt="Version" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://img.shields.io/badge/python-2.7,_3.*-22AADD.svg" alt="Python versions" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt="Build Status" />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="Join the Gitter Chat" />](https://gitter.im/seleniumbase/SeleniumBase) [<img src="http://img.shields.io/badge/license-MIT-22BBCC.svg" alt="MIT License" />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers)<br />
SeleniumBase transforms [WebDriver](https://www.seleniumhq.org/) into a complete test framework that runs with [Pytest](https://github.com/pytest-dev/pytest).
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Automated Testing Made Easy
## ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Quick Start
SeleniumBase is a complete framework for end-to-end testing and [website walkthroughs](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md). It uses [WebDriver](https://www.seleniumhq.org/) to control web browsers while using [Pytest](https://github.com/pytest-dev/pytest) for running Python scripts.
## ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Quick Start in minutes
(Requires [Python](https://www.python.org/downloads/), [Git](https://git-scm.com/), and an optional [Python virtual environment](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md).)
@ -52,7 +54,7 @@ pytest google_tour.py
For more detailed steps on getting started, see the [**Detailed Instructions**](#seleniumbase_installation) section.
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Learn More:
## ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Learn More:
#### **No more repetitive WebDriver code:**<br />
SeleniumBase automatically handles common WebDriver actions such as spinning up web browsers, waiting for page objects to load, saving screenshots during test failures, using a proxy server, and more. (<i>[Read about customizing test runs](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md).</i>)

View File

@ -1,3 +1,3 @@
theme: jekyll-theme-cayman
title: SeleniumBase
description: Web Automation & Testing Framework
description: Automated Testing Made Easy

View File

@ -2,7 +2,7 @@
![](https://cdn2.hubspot.net/hubfs/100006/images/google_tour.gif "SeleniumBase Tours")<br>
SeleniumBase Tours utilize the [Shepherd Library](https://cdnjs.com/libraries/shepherd/1.8.1) for creating and running tours, demos, and walkthroughs on any website.
SeleniumBase Tours utilize the [Shepherd Javascript Library](https://cdnjs.com/libraries/shepherd/1.8.1) for creating and running tours, demos, and walkthroughs on any website.
To utilize tours, there are three methods that you need to know at the basic level (which contain optional arguments):
@ -14,7 +14,7 @@ To utilize tours, there are three methods that you need to know at the basic lev
With the ``create_tour()`` method, you can pass a default theme to change the look & feel of the tour steps. Valid themes are ``dark``, ``default``, ``arrows``, ``square``, and ``square-dark``.
With the ``self.add_tour_step()`` method, at minimum you must pass a message to display. Then you can specify a web element to attach to (by CSS selector). If no element is specified, the tour step will tether to the top of the screen by default. You can also add an optional title above the message to display with the tour step, as well as change the theme for that step, and even specify the alignment (which is the side of the element that you want the tour message to tether to).
With the ``self.add_tour_step()`` method, you must first pass a message to display. You can then specify a web element to attach to (by using [CSS selectors](https://www.w3schools.com/cssref/css_selectors.asp)). If no element is specified, the tour step will tether to the top of the screen by default. You can also add an optional title above the message to display with the tour step, as well as change the theme for that step, and even specify the alignment (which is the side of the element that you want the tour message to tether to).
Finally, you can play a tour you created by calling the ``self.play_tour()`` method. If you specify an interval, the tour will automatically walk through each step after that many seconds have passed.
@ -28,22 +28,18 @@ class MyTourClass(BaseCase):
def test_google_tour(self):
self.open('https://google.com')
self.wait_for_element('input[title="Search"]')
self.create_tour(theme="dark")
self.add_tour_step(
"Click to begin the Google Tour!", title="SeleniumBase Tours")
self.add_tour_step(
"Type in your search query here.", 'input[title="Search"]')
self.add_tour_step(
"Then click here to search!", 'input[value="Google Search"]',
alignment="bottom", theme="arrows")
self.add_tour_step(
"Or click here to see the top result.",
'''[value="I'm Feeling Lucky"]''',
self.add_tour_step("Click to begin the Google Tour!", title="SeleniumBase Tours")
self.add_tour_step("Type in your search query here.", 'input[title="Search"]')
self.add_tour_step("Then click here to search!", 'input[value="Google Search"]',
alignment="bottom", theme="arrows")
self.add_tour_step("Or click here to see the top result.",
'''[value="I'm Feeling Lucky"]''', alignment="bottom", theme="arrows")
self.play_tour()
```
### This example was taken from [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py), which you can run with:
#### This example was taken from [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py), which you can run from the ``examples/tour_examples`` folder with the following command:
```bash
pytest google_tour.py