Skip to content

Commit c8d7c5c

Browse files
authored
Merge pull request #367 from seleniumbase/tour-updates
SeleniumBase Tour updates
2 parents 7b2a0e6 + 391518c commit c8d7c5c

File tree

11 files changed

+160
-195
lines changed

11 files changed

+160
-195
lines changed

examples/tour_examples/ReadMe.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,16 @@ class MyTourClass(BaseCase):
8080
self.wait_for_element('input[title="Search"]')
8181

8282
self.create_tour(theme="dark")
83-
self.add_tour_step(
84-
"Click to begin the Google Tour!", title="SeleniumBase Tours")
85-
self.add_tour_step(
86-
"Type in your search query here.", 'input[title="Search"]')
83+
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")
84+
self.add_tour_step("Type in your query here.", 'input[title="Search"]')
8785
self.play_tour()
8886

8987
self.highlight_update_text('input[title="Search"]', "Google")
9088
self.wait_for_element('[role="listbox"]') # Wait for autocomplete
9189

9290
self.create_tour(theme="light")
93-
self.add_tour_step(
94-
"Then click here to search.", 'input[value="Google Search"]')
95-
self.add_tour_step(
96-
"Or press [ENTER] after typing a query here.", '[title="Search"]')
91+
self.add_tour_step("Then click to search.", '[value="Google Search"]')
92+
self.add_tour_step("Or press [ENTER] after entry.", '[title="Search"]')
9793
self.play_tour()
9894
```
9995

examples/tour_examples/bootstrap_google_tour.py

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,25 @@ def test_google_tour(self):
88
self.wait_for_element('input[title="Search"]')
99

1010
self.create_bootstrap_tour() # OR self.create_tour(theme="bootstrap")
11-
self.add_tour_step(
12-
"Click to begin the Google Tour!", title="SeleniumBase Tours")
13-
self.add_tour_step(
14-
"Type in your search query here.", 'input[title="Search"]')
11+
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")
12+
self.add_tour_step("Type in your query here.", 'input[title="Search"]')
1513
self.play_tour()
1614

1715
self.highlight_update_text('input[title="Search"]', "Google")
1816
self.wait_for_element('[role="listbox"]') # Wait for autocomplete
1917

2018
self.create_bootstrap_tour()
21-
self.add_tour_step(
22-
"Then click here to search.", 'input[value="Google Search"]')
23-
self.add_tour_step(
24-
"Or press [ENTER] after typing a query here.", '[title="Search"]')
19+
self.add_tour_step("Then click to search.", '[value="Google Search"]')
20+
self.add_tour_step("Or press [ENTER] after entry.", '[title="Search"]')
2521
self.play_tour()
2622

2723
self.highlight_update_text('input[title="Search"]', "GitHub\n")
2824
self.wait_for_element("#search")
2925

3026
self.create_bootstrap_tour()
3127
self.add_tour_step(
32-
"Search results appear here!", title="(5-second autoplay on)")
33-
self.add_tour_step("Let's take another tour:")
28+
"See results here!", title="(autoplay in 5s)")
29+
self.add_tour_step("Here's the next tour:")
3430
self.play_tour(interval=5) # Tour automatically continues after 5 sec
3531

3632
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
@@ -40,29 +36,23 @@ def test_google_tour(self):
4036

4137
self.create_bootstrap_tour()
4238
self.add_tour_step("Welcome to Google Maps!")
43-
self.add_tour_step(
44-
"Type in a location here.", "#searchboxinput", title="Search Box")
45-
self.add_tour_step(
46-
"Then click here to show it on the map.",
47-
"#searchbox-searchbutton", alignment="bottom")
48-
self.add_tour_step(
49-
"Or click here to get driving directions.",
50-
"#searchbox-directions", alignment="bottom")
51-
self.add_tour_step(
52-
"Use this button to switch to Satellite view.",
53-
"#minimap div.widget-minimap", alignment="right")
54-
self.add_tour_step(
55-
"Click here to zoom in.", "#widget-zoom-in", alignment="left")
56-
self.add_tour_step(
57-
"Or click here to zoom out.", "#widget-zoom-out", alignment="left")
58-
self.add_tour_step(
59-
"Use the Menu button to see more options.",
60-
".searchbox-hamburger-container", alignment="right")
61-
self.add_tour_step(
62-
"Or click here to see more Google apps.", '[title="Google apps"]',
63-
alignment="left")
64-
self.add_tour_step(
65-
"Thanks for trying out SeleniumBase Tours!",
66-
title="End of Guided Tour")
39+
self.add_tour_step("Type in a location here.",
40+
"#searchboxinput", title="Search Box")
41+
self.add_tour_step("Then click here to show it on the map.",
42+
"#searchbox-searchbutton", alignment="bottom")
43+
self.add_tour_step("Or click here to get driving directions.",
44+
"#searchbox-directions", alignment="bottom")
45+
self.add_tour_step("Use this button to switch to Satellite view.",
46+
"#minimap div.widget-minimap", alignment="right")
47+
self.add_tour_step("Click here to zoom in.",
48+
"#widget-zoom-in", alignment="left")
49+
self.add_tour_step("Or click here to zoom out.",
50+
"#widget-zoom-out", alignment="left")
51+
self.add_tour_step("Use the Menu button to see more options.",
52+
".searchbox-hamburger-container", alignment="right")
53+
self.add_tour_step("Or click here to see more Google apps.",
54+
'[title="Google apps"]', alignment="left")
55+
self.add_tour_step("Thanks for using SeleniumBase Tours!",
56+
title="End of Guided Tour")
6757
self.export_tour(filename="bootstrap_google_maps_tour.js")
6858
self.play_tour()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from seleniumbase import BaseCase
2+
3+
4+
class MyTestClass(BaseCase):
5+
6+
def test_basic(self):
7+
self.open('https://xkcd.com/1117/')
8+
self.assert_element('img[alt="My Sky"]')
9+
self.create_bootstrap_tour()
10+
self.add_tour_step("Welcome to XKCD!")
11+
self.add_tour_step("This is the XKCD logo.", "#masthead img")
12+
self.add_tour_step("Here's the daily webcomic.", "#comic img")
13+
self.add_tour_step("This is the title.", "#ctitle", alignment="top")
14+
self.add_tour_step("Click here for the next comic.", 'a[rel="next"]')
15+
self.add_tour_step("Click here for the previous one.", 'a[rel="prev"]')
16+
self.add_tour_step("Learn about the author here.", 'a[rel="author"]')
17+
self.add_tour_step("Click here for the license.", 'a[rel="license"]')
18+
self.add_tour_step("Click for a random comic.", 'a[href*="/random/"]')
19+
self.add_tour_step("Thanks for taking this tour!")
20+
self.export_tour(filename="bootstrap_xkcd_tour.js") # Exports the tour
21+
self.play_tour() # Plays the tour

examples/tour_examples/google_tour.py

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ def test_google_tour(self):
1010
# Create a website tour using the ShepherdJS library with "dark" theme
1111
# Same as: self.create_shepherd_tour(theme="dark")
1212
self.create_tour(theme="dark")
13-
self.add_tour_step(
14-
"Click to begin the Google Tour!", title="SeleniumBase Tours")
15-
self.add_tour_step(
16-
"Type in your search query here.", 'input[title="Search"]')
13+
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")
14+
self.add_tour_step("Type in your query here.", 'input[title="Search"]')
1715
self.play_tour()
1816

1917
self.highlight_update_text('input[title="Search"]', "Google")
@@ -22,10 +20,8 @@ def test_google_tour(self):
2220
# Create a website tour using the ShepherdJS library with "light" theme
2321
# Same as: self.create_shepherd_tour(theme="light")
2422
self.create_tour(theme="light")
25-
self.add_tour_step(
26-
"Then click here to search.", 'input[value="Google Search"]')
27-
self.add_tour_step(
28-
"Or press [ENTER] after typing a query here.", '[title="Search"]')
23+
self.add_tour_step("Then click to search.", '[value="Google Search"]')
24+
self.add_tour_step("Or press [ENTER] after entry.", '[title="Search"]')
2925
self.play_tour()
3026

3127
self.highlight_update_text('input[title="Search"]', "GitHub\n")
@@ -34,9 +30,8 @@ def test_google_tour(self):
3430
# Create a website tour using the Bootstrap Tour JS library
3531
# Same as: self.create_bootstrap_tour()
3632
self.create_tour(theme="bootstrap")
37-
self.add_tour_step(
38-
"Search results appear here!", title="(5-second autoplay on)")
39-
self.add_tour_step("Let's take another tour:", theme="light")
33+
self.add_tour_step("See results here!", title="(autoplay in 5s)")
34+
self.add_tour_step("Here's the next tour:")
4035
self.play_tour(interval=5) # Tour automatically continues after 5 sec
4136

4237
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
@@ -47,31 +42,24 @@ def test_google_tour(self):
4742
# Create a website tour using the IntroJS library
4843
# Same as: self.create_introjs_tour()
4944
self.create_tour(theme="introjs")
50-
self.add_tour_step(
51-
"Welcome to Google Maps!")
52-
self.add_tour_step(
53-
"Type in a location here.", "#searchboxinput", title="Search Box")
54-
self.add_tour_step(
55-
"Then click here to show it on the map.",
56-
"#searchbox-searchbutton", alignment="bottom")
57-
self.add_tour_step(
58-
"Or click here to get driving directions.",
59-
"#searchbox-directions", alignment="bottom")
60-
self.add_tour_step(
61-
"Use this button to switch to Satellite view.",
62-
"#minimap div.widget-minimap", alignment="right")
63-
self.add_tour_step(
64-
"Click here to zoom in.", "#widget-zoom-in", alignment="left")
65-
self.add_tour_step(
66-
"Or click here to zoom out.", "#widget-zoom-out", alignment="left")
67-
self.add_tour_step(
68-
"Use the Menu button to see more options.",
69-
".searchbox-hamburger-container", alignment="right")
70-
self.add_tour_step(
71-
"Or click here to see more Google apps.", '[title="Google apps"]',
72-
alignment="left")
73-
self.add_tour_step(
74-
"Thanks for trying out SeleniumBase Tours!",
75-
title="End of Guided Tour")
76-
self.export_tour()
45+
self.add_tour_step("Welcome to Google Maps!")
46+
self.add_tour_step("Type in a location here.",
47+
"#searchboxinput", title="Search Box")
48+
self.add_tour_step("Then click here to show it on the map.",
49+
"#searchbox-searchbutton", alignment="bottom")
50+
self.add_tour_step("Or click here to get driving directions.",
51+
"#searchbox-directions", alignment="bottom")
52+
self.add_tour_step("Use this button to switch to Satellite view.",
53+
"#minimap div.widget-minimap", alignment="right")
54+
self.add_tour_step("Click here to zoom in.",
55+
"#widget-zoom-in", alignment="left")
56+
self.add_tour_step("Or click here to zoom out.",
57+
"#widget-zoom-out", alignment="left")
58+
self.add_tour_step("Use the Menu button to see more options.",
59+
".searchbox-hamburger-container", alignment="right")
60+
self.add_tour_step("Or click here to see more Google apps.",
61+
'[title="Google apps"]', alignment="left")
62+
self.add_tour_step("Thanks for using SeleniumBase Tours!",
63+
title="End of Guided Tour")
64+
self.export_tour() # The default name for exports is "my_tour.js"
7765
self.play_tour()

examples/tour_examples/hopscotch_google_tour.py

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,25 @@ def test_google_tour(self):
88
self.wait_for_element('input[title="Search"]')
99

1010
self.create_hopscotch_tour() # OR self.create_tour(theme="hopscotch")
11-
self.add_tour_step(
12-
"Click to begin the Google Tour!", title="SeleniumBase Tours")
13-
self.add_tour_step(
14-
"Type in your search query here.", 'input[title="Search"]')
11+
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")
12+
self.add_tour_step("Type in your query here.", 'input[title="Search"]')
1513
self.play_tour()
1614

1715
self.highlight_update_text('input[title="Search"]', "Google")
1816
self.wait_for_element('[role="listbox"]') # Wait for autocomplete
1917

2018
self.create_hopscotch_tour()
21-
self.add_tour_step(
22-
"Then click here to search.", 'input[value="Google Search"]',
23-
alignment="top")
24-
self.add_tour_step(
25-
"Or press [ENTER] after typing a query here.", '[title="Search"]')
19+
self.add_tour_step("Then click to search.", '[value="Google Search"]')
20+
self.add_tour_step("Or press [ENTER] after entry.", '[title="Search"]')
2621
self.play_tour()
2722

2823
self.highlight_update_text('input[title="Search"]', "GitHub\n")
2924
self.wait_for_element("#search")
3025

3126
self.create_hopscotch_tour()
3227
self.add_tour_step(
33-
"Search results appear here!", title="(5-second autoplay on)")
34-
self.add_tour_step("Let's take another tour:")
28+
"See results here!", title="(autoplay in 5s)")
29+
self.add_tour_step("Here's the next tour:")
3530
self.play_tour(interval=5) # Tour automatically continues after 5 sec
3631

3732
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
@@ -41,29 +36,23 @@ def test_google_tour(self):
4136

4237
self.create_hopscotch_tour()
4338
self.add_tour_step("Welcome to Google Maps!")
44-
self.add_tour_step(
45-
"Type in a location here.", "#searchboxinput", title="Search Box")
46-
self.add_tour_step(
47-
"Then click here to show it on the map.",
48-
"#searchbox-searchbutton", alignment="bottom")
49-
self.add_tour_step(
50-
"Or click here to get driving directions.",
51-
"#searchbox-directions", alignment="bottom")
52-
self.add_tour_step(
53-
"Use this button to switch to Satellite view.",
54-
"#minimap div.widget-minimap", alignment="right")
55-
self.add_tour_step(
56-
"Click here to zoom in.", "#widget-zoom-in", alignment="left")
57-
self.add_tour_step(
58-
"Or click here to zoom out.", "#widget-zoom-out", alignment="left")
59-
self.add_tour_step(
60-
"Use the Menu button to see more options.",
61-
".searchbox-hamburger-container", alignment="right")
62-
self.add_tour_step(
63-
"Or click here to see more Google apps.", '[title="Google apps"]',
64-
alignment="left")
65-
self.add_tour_step(
66-
"Thanks for trying out SeleniumBase Tours!",
67-
title="End of Guided Tour")
39+
self.add_tour_step("Type in a location here.",
40+
"#searchboxinput", title="Search Box")
41+
self.add_tour_step("Then click here to show it on the map.",
42+
"#searchbox-searchbutton", alignment="bottom")
43+
self.add_tour_step("Or click here to get driving directions.",
44+
"#searchbox-directions", alignment="bottom")
45+
self.add_tour_step("Use this button to switch to Satellite view.",
46+
"#minimap div.widget-minimap", alignment="right")
47+
self.add_tour_step("Click here to zoom in.",
48+
"#widget-zoom-in", alignment="left")
49+
self.add_tour_step("Or click here to zoom out.",
50+
"#widget-zoom-out", alignment="left")
51+
self.add_tour_step("Use the Menu button to see more options.",
52+
".searchbox-hamburger-container", alignment="right")
53+
self.add_tour_step("Or click here to see more Google apps.",
54+
'[title="Google apps"]', alignment="left")
55+
self.add_tour_step("Thanks for using SeleniumBase Tours!",
56+
title="End of Guided Tour")
6857
self.export_tour(filename="hopscotch_google_maps_tour.js")
6958
self.play_tour()

examples/tour_examples/introjs_google_tour.py

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,24 @@ def test_google_tour(self):
88
self.wait_for_element('input[title="Search"]')
99

1010
self.create_introjs_tour() # OR self.create_tour(theme="introjs")
11-
self.add_tour_step(
12-
"Click to begin the Google Tour!", title="SeleniumBase Tours")
13-
self.add_tour_step(
14-
"Type in your search query here.", 'input[title="Search"]')
11+
self.add_tour_step("Welcome to Google!", title="SeleniumBase Tours")
12+
self.add_tour_step("Type in your query here.", 'input[title="Search"]')
1513
self.play_tour()
1614

1715
self.highlight_update_text('input[title="Search"]', "Google")
1816
self.wait_for_element('[role="listbox"]') # Wait for autocomplete
1917

2018
self.create_introjs_tour()
21-
self.add_tour_step(
22-
"Then click here to search.", 'input[value="Google Search"]')
23-
self.add_tour_step(
24-
"Or press [ENTER] after typing a query here.", '[title="Search"]')
19+
self.add_tour_step("Then click to search.", '[value="Google Search"]')
20+
self.add_tour_step("Or press [ENTER] after entry.", '[title="Search"]')
2521
self.play_tour()
2622

2723
self.highlight_update_text('input[title="Search"]', "GitHub\n")
2824
self.wait_for_element("#search")
2925

3026
self.create_introjs_tour()
31-
self.add_tour_step(
32-
"Search results appear here!", title="(5-second autoplay on)")
33-
self.add_tour_step("Let's take another tour:")
27+
self.add_tour_step("See results here!", title="(autoplay in 5s)")
28+
self.add_tour_step("Here's the next tour:")
3429
self.play_tour(interval=5) # Tour automatically continues after 5 sec
3530

3631
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
@@ -40,29 +35,23 @@ def test_google_tour(self):
4035

4136
self.create_introjs_tour()
4237
self.add_tour_step("Welcome to Google Maps!")
43-
self.add_tour_step(
44-
"Type in a location here.", "#searchboxinput", title="Search Box")
45-
self.add_tour_step(
46-
"Then click here to show it on the map.",
47-
"#searchbox-searchbutton", alignment="bottom")
48-
self.add_tour_step(
49-
"Or click here to get driving directions.",
50-
"#searchbox-directions", alignment="bottom")
51-
self.add_tour_step(
52-
"Use this button to switch to Satellite view.",
53-
"#minimap div.widget-minimap", alignment="right")
54-
self.add_tour_step(
55-
"Click here to zoom in.", "#widget-zoom-in", alignment="left")
56-
self.add_tour_step(
57-
"Or click here to zoom out.", "#widget-zoom-out", alignment="left")
58-
self.add_tour_step(
59-
"Use the Menu button to see more options.",
60-
".searchbox-hamburger-container", alignment="right")
61-
self.add_tour_step(
62-
"Or click here to see more Google apps.", '[title="Google apps"]',
63-
alignment="left")
64-
self.add_tour_step(
65-
"Thanks for trying out SeleniumBase Tours!",
66-
title="End of Guided Tour")
38+
self.add_tour_step("Type in a location here.",
39+
"#searchboxinput", title="Search Box")
40+
self.add_tour_step("Then click here to show it on the map.",
41+
"#searchbox-searchbutton", alignment="bottom")
42+
self.add_tour_step("Or click here to get driving directions.",
43+
"#searchbox-directions", alignment="bottom")
44+
self.add_tour_step("Use this button to switch to Satellite view.",
45+
"#minimap div.widget-minimap", alignment="right")
46+
self.add_tour_step("Click here to zoom in.",
47+
"#widget-zoom-in", alignment="left")
48+
self.add_tour_step("Or click here to zoom out.",
49+
"#widget-zoom-out", alignment="left")
50+
self.add_tour_step("Use the Menu button to see more options.",
51+
".searchbox-hamburger-container", alignment="right")
52+
self.add_tour_step("Or click here to see more Google apps.",
53+
'[title="Google apps"]', alignment="left")
54+
self.add_tour_step("Thanks for using SeleniumBase Tours!",
55+
title="End of Guided Tour")
6756
self.export_tour(filename="introjs_google_maps_tour.js")
6857
self.play_tour()

0 commit comments

Comments
 (0)