You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Above: Actual demo of [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) running on [xkcd.com](http://xkcd.com/353/))
53
53
54
54
There are many more examples to try out from the [SeleniumBase/examples](https://github.com/seleniumbase/SeleniumBase/blob/master/examples) directory, which you can run easily if you clone SeleniumBase.
<imgsrc="https://cdn2.hubspot.net/hubfs/100006/google_tour_3.gif"title="SeleniumBase Tour of Google"height="260"><br>
64
64
(Above: Actual demo of [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py) running on [google.com](https://google.com))
65
65
66
66
For more detailed steps on getting started, see the [**Detailed Instructions**](#seleniumbase_installation) section.
Copy file name to clipboardExpand all lines: examples/tour_examples/ReadMe.md
+32-20Lines changed: 32 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,40 +1,58 @@
1
-
## Creating SeleniumBase Tours
1
+
## SeleniumBase Website Tours
2
2
3
-
SeleniumBase Tours utilize the **[Shepherd Javascript Library](https://cdnjs.com/libraries/shepherd/1.8.1)** and the **[Bootstrap Tour Library](https://cdnjs.com/libraries/bootstrap-tour)** for creating and running tours, demos, and walkthroughs on any website.
3
+
SeleniumBase Tours utilize the following three Javascript libraries for creating and running tours, demos, and walkthroughs on any website: **[Shepherd JS](https://cdnjs.com/libraries/shepherd/1.8.1)**, **[Bootstrap Tour JS](https://cdnjs.com/libraries/bootstrap-tour)**, and **[Intro JS](https://cdnjs.com/libraries/intro.js)**.
4
4
5
-
Example tour utilizing the Shepherd Javascript Library:
By default, the Shepherd Javascript Library is used when creating a tour with:
12
+
By default, Shepherd JS is used when creating a tour with:
14
13
15
14
``self.create_tour()``
16
15
17
-
To create a tour utilizing the Bootstrap Javascript Library, you can use either of the following:
16
+
You can also do:
17
+
18
+
``self.create_shepherd_tour()``
19
+
20
+
With the ``create_tour()`` and ``create_shepherd_tour()`` methods, you can pass a default theme to change the look & feel of the tour steps. Valid themes for Shepherd Tours are ``dark``, ``light`` / ``arrows``, ``default``, ``square``, and ``square-dark``.
21
+
22
+
To create a tour utilizing the Bootstrap Tour Library, you can use either of the following:
18
23
19
24
``self.create_bootstrap_tour()``
20
25
21
26
OR
22
27
23
28
``self.create_tour(theme="bootstrap")``
24
29
30
+
To create a tour utilizing the Intro JS Library, you can use either of the following:
31
+
32
+
``self.create_introjs_tour()``
33
+
34
+
OR
35
+
36
+
``self.create_tour(theme="introjs")``
37
+
38
+
39
+
### Adding a step to a tour:
40
+
25
41
To add a tour step, use the following: (Only ``message`` is required. The other args are optional.)
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 (Shepherd tours only), and even specify the alignment (which is the side of the element that you want the tour message to tether to).
30
46
31
-
``self.play_tour(interval)``
32
47
33
-
With the ``create_tour()`` method, you can pass a default theme to change the look & feel of the tour steps. Valid themes for Shepherd Tours are ``dark``, ``light`` / ``arrows``, ``default``, ``square``, and ``square-dark``.
48
+
### Playing a tour:
49
+
50
+
You can play a tour by calling:
51
+
52
+
``self.play_tour(interval)``
34
53
35
-
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).
54
+
If you specify an interval (optional), the tour will automatically walk through each step after that many seconds have passed.
36
55
37
-
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.
38
56
39
57
All methods have the optional ``name`` argument, which is only needed if you're creating multiple tours at once. Then, when you're adding a step or playing a tour, SeleniumBase knows which tour you're referring too. You can avoid using the ``name`` arg for multiple tours if you play a tour before creating a new one.
40
58
@@ -63,7 +81,7 @@ class MyTourClass(BaseCase):
63
81
self.add_tour_step(
64
82
"Then click here to search.", 'input[value="Google Search"]')
65
83
self.add_tour_step(
66
-
"Or press [ENTER] after typing.", '[title="Search"]', theme="dark")
84
+
"Or press [ENTER] after typing a query here.", '[title="Search"]')
67
85
self.play_tour()
68
86
```
69
87
@@ -72,9 +90,3 @@ class MyTourClass(BaseCase):
72
90
```bash
73
91
pytest google_tour.py
74
92
```
75
-
76
-
#### There's also the Bootstrap Google Tour, which you can play with the following command:
0 commit comments