Skip to content

Commit 2697859

Browse files
committed
Add Bootstrap Google Tour example
1 parent e5ecf82 commit 2697859

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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_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"]')
15+
self.add_tour_step(
16+
"Then click here to search!", 'input[value="Google Search"]',
17+
alignment="bottom")
18+
self.add_tour_step(
19+
"Or click here to see the top result.",
20+
'''[value="I'm Feeling Lucky"]''',
21+
alignment="bottom")
22+
self.add_tour_step("Here's an example Google search:")
23+
self.play_tour()
24+
25+
self.highlight_update_text('input[title="Search"]', "GitHub")
26+
self.highlight_click('input[value="Google Search"]')
27+
28+
self.create_bootstrap_tour() # OR self.create_tour(theme="bootstrap")
29+
self.add_tour_step(
30+
"Search results appear here!", title="(5-second autoplay on)")
31+
self.add_tour_step("Let's take another tour:")
32+
self.play_tour(interval=5) # tour automatically continues after 5 sec
33+
34+
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
35+
self.wait_for_element('input#searchboxinput')
36+
37+
self.create_bootstrap_tour() # OR self.create_tour(theme="bootstrap")
38+
self.add_tour_step("Welcome to Google Maps!")
39+
self.add_tour_step(
40+
"Type in a location here.", "#searchboxinput", title="Search Box")
41+
self.add_tour_step(
42+
"Then click here to show it on the map.",
43+
"#searchbox-searchbutton", alignment="bottom")
44+
self.add_tour_step(
45+
"Or click here to get driving directions.",
46+
"#searchbox-directions", alignment="bottom")
47+
self.add_tour_step(
48+
"Use this button to switch to Satellite view.",
49+
"div.widget-minimap", alignment="right")
50+
self.add_tour_step(
51+
"Click here to zoom in.", "#widget-zoom-in", alignment="left")
52+
self.add_tour_step(
53+
"Or click here to zoom out.", "#widget-zoom-out", alignment="left")
54+
self.add_tour_step(
55+
"Use the Menu button to see more options.",
56+
".searchbox-hamburger-container", alignment="right")
57+
self.add_tour_step(
58+
"Or click here to see more Google apps.", '[title="Google apps"]',
59+
alignment="left")
60+
self.add_tour_step(
61+
"Thanks for trying out SeleniumBase Tours!",
62+
title="End of Guided Tour")
63+
self.play_tour()

0 commit comments

Comments
 (0)