Skip to content

Commit d5f6b6a

Browse files
committed
Update the Google tour example
1 parent f21be3a commit d5f6b6a

File tree

1 file changed

+40
-37
lines changed

1 file changed

+40
-37
lines changed

examples/tour_examples/google_tour.py

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,62 @@ class MyTourClass(BaseCase):
66
def test_google_tour(self):
77
self.open('https://google.com')
88
self.wait_for_element('input[title="Search"]')
9-
try:
10-
# Remove the Privacy Checkup box if present.
11-
self.assert_text('Privacy Checkup', '[role="dialog"]', timeout=2)
12-
self.click('link=NO, THANKS')
13-
except Exception:
14-
pass # Google may have removed the Privacy Checkup. Continue.
9+
1510
self.create_tour(theme="dark")
16-
self.add_tour_step("Click to begin the Google Tour!",
17-
title="SeleniumBase Guided Tours")
18-
self.add_tour_step("Type in your search query here.",
19-
'input[title="Search"]')
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"]')
2015
self.add_tour_step(
2116
"Then click here to search!", 'input[value="Google Search"]',
2217
alignment="bottom", theme="arrows")
2318
self.add_tour_step(
2419
"Or click here to see the top result.",
2520
'''[value="I'm Feeling Lucky"]''',
2621
alignment="bottom", theme="arrows")
27-
self.add_tour_step("Here's an example Google search...",
28-
theme="arrows")
22+
self.add_tour_step("Here's an example Google search:", theme="arrows")
2923
self.play_tour(interval=0) # If interval is 0, tour is fully manual
3024

3125
self.highlight_update_text('input[title="Search"]', "GitHub")
3226
self.highlight_click('input[value="Google Search"]')
27+
3328
self.create_tour(theme="dark")
34-
self.add_tour_step("Search results appear here!",
35-
title="(5-second autoplay on)")
36-
self.add_tour_step("Let's take another tour...",
37-
title="Ready for more?", theme="square")
29+
self.add_tour_step(
30+
"Search results appear here!", title="(5-second autoplay on)")
31+
self.add_tour_step(
32+
"Let's take another tour...",
33+
title="Ready for more?", theme="square")
3834
self.play_tour(interval=5) # tour automatically continues after 3s
3935

4036
self.open("https://www.google.com/maps/@42.3598616,-71.0912631,15z")
4137
self.wait_for_element('input#searchboxinput')
38+
4239
self.create_tour(theme="dark")
43-
self.add_tour_step("Welcome to Google Maps!")
44-
self.add_tour_step("Type in a location here.",
45-
"#searchboxinput", title="Search Box")
46-
self.add_tour_step("Then click here to show it on the map.",
47-
"#searchbox-searchbutton", alignment="bottom")
48-
self.add_tour_step("Or click here to get driving directions.",
49-
"#searchbox-directions",
50-
alignment="bottom", theme="square-dark")
51-
self.add_tour_step("Use this button to switch to Satellite view.",
52-
"div.widget-minimap", alignment="right")
53-
self.add_tour_step("Click here to zoom in.",
54-
"#widget-zoom-in", alignment="left")
55-
self.add_tour_step("Or click here to zoom out.",
56-
"#widget-zoom-out",
57-
alignment="left", theme="default")
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 trying out SeleniumBase tours!",
63-
title="End of Guided Tour", theme="square")
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="square-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="default")
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="square")
6467
self.play_tour() # If interval isn't set, tour is fully manual

0 commit comments

Comments
 (0)