Skip to content

Commit 8c48448

Browse files
authored
Merge pull request #193 from seleniumbase/update-google-tour-example
Update Google tour example
2 parents f21be3a + 240034b commit 8c48448

File tree

3 files changed

+52
-48
lines changed

3 files changed

+52
-48
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/SB_Logo16.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
1+
<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_2d1.png" title="SeleniumBase" height="48">
22

33
[<img src="https://img.shields.io/pypi/v/seleniumbase.svg" alt="Version" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://img.shields.io/badge/python-2.7,_3.*-22AADD.svg" alt="Python versions" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt="Build Status" />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="Join the Gitter Chat" />](https://gitter.im/seleniumbase/SeleniumBase) [<img src="http://img.shields.io/badge/license-MIT-22BBCC.svg" alt="MIT License" />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers)<br />
44

examples/tour_examples/ReadMe.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ class MyTourClass(BaseCase):
2929
self.open('https://google.com')
3030
self.wait_for_element('input[title="Search"]')
3131
self.create_tour(theme="dark")
32-
self.add_tour_step("Click to begin the Google Tour!",
33-
title="SeleniumBase Guided Tours")
34-
self.add_tour_step("Type in your search query here.",
35-
'input[title="Search"]')
36-
self.add_tour_step("Then click here to search!",
37-
'input[value="Google Search"]',
38-
alignment="bottom", theme="arrows")
39-
self.add_tour_step("Or click here to see the top result.",
40-
'''[value="I'm Feeling Lucky"]''',
41-
alignment="bottom", theme="arrows")
32+
self.add_tour_step(
33+
"Click to begin the Google Tour!", title="SeleniumBase Tours")
34+
self.add_tour_step(
35+
"Type in your search query here.", 'input[title="Search"]')
36+
self.add_tour_step(
37+
"Then click here to search!", 'input[value="Google Search"]',
38+
alignment="bottom", theme="arrows")
39+
self.add_tour_step(
40+
"Or click here to see the top result.",
41+
'''[value="I'm Feeling Lucky"]''',
42+
alignment="bottom", theme="arrows")
4243
self.play_tour()
4344
```
4445

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)