Skip to content

Commit bcba1b7

Browse files
committed
Update website tour examples
1 parent aad7d24 commit bcba1b7

File tree

3 files changed

+96
-13
lines changed

3 files changed

+96
-13
lines changed

examples/tour_examples/bootstrap_google_tour.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,26 @@ def test_google_tour(self):
1212
"Click to begin the Google Tour!", title="SeleniumBase Tours")
1313
self.add_tour_step(
1414
"Type in your search query here.", 'input[title="Search"]')
15-
self.add_tour_step('Then click "Google Search" or press [ENTER].')
1615
self.play_tour()
1716

18-
self.highlight_update_text('input[title="Search"]', "GitHub")
17+
self.highlight_update_text('input[title="Search"]', "Google")
1918
self.wait_for_element('[role="listbox"]') # Wait for autocomplete
20-
self.highlight_click('input[value="Google Search"]')
19+
20+
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"]')
25+
self.play_tour()
26+
27+
self.highlight_update_text('input[title="Search"]', "GitHub\n")
28+
self.wait_for_element("#search")
2129

2230
self.create_bootstrap_tour()
2331
self.add_tour_step(
2432
"Search results appear here!", title="(5-second autoplay on)")
2533
self.add_tour_step("Let's take another tour:")
26-
self.play_tour(interval=5) # tour automatically continues after 5 sec
34+
self.play_tour(interval=5) # Tour automatically continues after 5 sec
2735

2836
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
2937
self.wait_for_element('input#searchboxinput')

examples/tour_examples/google_tour.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ def test_google_tour(self):
77
self.open('https://google.com')
88
self.wait_for_element('input[title="Search"]')
99

10+
# Create a website tour using the ShepherdJS library with "dark" theme
11+
# Same as: self.create_shepherd_tour(theme="dark")
1012
self.create_tour(theme="dark")
1113
self.add_tour_step(
1214
"Click to begin the Google Tour!", title="SeleniumBase Tours")
@@ -17,25 +19,32 @@ def test_google_tour(self):
1719
self.highlight_update_text('input[title="Search"]', "Google")
1820
self.wait_for_element('[role="listbox"]') # Wait for autocomplete
1921

22+
# Create a website tour using the ShepherdJS library with "light" theme
23+
# Same as: self.create_shepherd_tour(theme="light")
2024
self.create_tour(theme="light")
2125
self.add_tour_step(
2226
"Then click here to search.", 'input[value="Google Search"]')
2327
self.add_tour_step(
24-
"Or press [ENTER] after typing.", '[title="Search"]', theme="dark")
28+
"Or press [ENTER] after typing a query here.", '[title="Search"]')
2529
self.play_tour()
2630

2731
self.highlight_update_text('input[title="Search"]', "GitHub\n")
32+
self.wait_for_element("#search")
2833

29-
self.create_tour(theme="dark")
34+
# Create a website tour using the Bootstrap Tour JS library
35+
# Same as: self.create_bootstrap_tour()
36+
self.create_tour(theme="bootstrap")
3037
self.add_tour_step(
3138
"Search results appear here!", title="(5-second autoplay on)")
3239
self.add_tour_step("Let's take another tour:", theme="light")
33-
self.play_tour(interval=5) # tour automatically continues after 5 sec
40+
self.play_tour(interval=5) # Tour automatically continues after 5 sec
3441

3542
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
3643
self.wait_for_element('input#searchboxinput')
3744

38-
self.create_tour(theme="dark")
45+
# Create a website tour using the IntroJS library
46+
# Same as: self.create_introjs_tour()
47+
self.create_tour(theme="introjs")
3948
self.add_tour_step(
4049
"Welcome to Google Maps!")
4150
self.add_tour_step(
@@ -45,15 +54,14 @@ def test_google_tour(self):
4554
"#searchbox-searchbutton", alignment="bottom")
4655
self.add_tour_step(
4756
"Or click here to get driving directions.",
48-
"#searchbox-directions", alignment="bottom", theme="square-dark")
57+
"#searchbox-directions", alignment="bottom")
4958
self.add_tour_step(
5059
"Use this button to switch to Satellite view.",
5160
"div.widget-minimap", alignment="right")
5261
self.add_tour_step(
5362
"Click here to zoom in.", "#widget-zoom-in", alignment="left")
5463
self.add_tour_step(
55-
"Or click here to zoom out.", "#widget-zoom-out",
56-
alignment="left", theme="default")
64+
"Or click here to zoom out.", "#widget-zoom-out", alignment="left")
5765
self.add_tour_step(
5866
"Use the Menu button to see more options.",
5967
".searchbox-hamburger-container", alignment="right")
@@ -62,5 +70,5 @@ def test_google_tour(self):
6270
alignment="left")
6371
self.add_tour_step(
6472
"Thanks for trying out SeleniumBase Tours!",
65-
title="End of Guided Tour", theme="light")
66-
self.play_tour() # If interval isn't set, tour is fully manual
73+
title="End of Guided Tour")
74+
self.play_tour()
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
from seleniumbase import BaseCase
2+
3+
4+
class MyTourClass(BaseCase):
5+
6+
def test_google_tour(self):
7+
self.open('https://google.com')
8+
self.wait_for_element('input[title="Search"]')
9+
10+
self.create_shepherd_tour(theme="dark")
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"]')
15+
self.play_tour()
16+
17+
self.highlight_update_text('input[title="Search"]', "Google")
18+
self.wait_for_element('[role="listbox"]') # Wait for autocomplete
19+
20+
self.create_shepherd_tour(theme="light")
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"]')
25+
self.play_tour()
26+
27+
self.highlight_update_text('input[title="Search"]', "GitHub\n")
28+
self.wait_for_element("#search")
29+
30+
self.create_shepherd_tour(theme="dark")
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:", theme="light")
34+
self.play_tour(interval=5) # Tour automatically continues after 5 sec
35+
36+
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
37+
self.wait_for_element('input#searchboxinput')
38+
39+
self.create_shepherd_tour(theme="dark")
40+
self.add_tour_step(
41+
"Welcome to Google Maps!")
42+
self.add_tour_step(
43+
"Type in a location here.", "#searchboxinput", title="Search Box")
44+
self.add_tour_step(
45+
"Then click here to show it on the map.",
46+
"#searchbox-searchbutton", alignment="bottom")
47+
self.add_tour_step(
48+
"Or click here to get driving directions.",
49+
"#searchbox-directions", alignment="bottom", theme="dark")
50+
self.add_tour_step(
51+
"Use this button to switch to Satellite view.",
52+
"div.widget-minimap", alignment="right")
53+
self.add_tour_step(
54+
"Click here to zoom in.", "#widget-zoom-in", alignment="left")
55+
self.add_tour_step(
56+
"Or click here to zoom out.", "#widget-zoom-out",
57+
alignment="left", theme="light")
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", theme="light")
67+
self.play_tour()

0 commit comments

Comments
 (0)