-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathmaps_introjs_tour.py
64 lines (61 loc) · 2.38 KB
/
maps_introjs_tour.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__)
class MyTourClass(BaseCase):
def test_google_maps_tour(self):
self.open("https://www.google.com/maps/@42.3591234,-71.0915634,15z")
self.wait_for_element("#searchboxinput", timeout=20)
self.wait_for_element("#minimap", timeout=20)
self.wait_for_element("#zoom", timeout=20)
self.wait_for_element("#widget-zoom-out")
self.wait_for_element('[jsaction*="minimap.main;"]')
self.create_tour(theme="introjs")
self.add_tour_step(
"Welcome to Google Maps", title="✅ SeleniumBase Tours 🌎"
)
self.add_tour_step(
"The location goes here.", "#searchboxinput", title="Search Box"
)
self.add_tour_step(
"Then click here to show it on the map.",
"#searchbox-searchbutton",
alignment="bottom",
)
self.add_tour_step(
"Or click here to get driving directions.",
'button[aria-label="Directions"]',
alignment="bottom",
)
self.add_tour_step(
"Use this button to switch to Satellite view.",
'button[jsaction*="minimap.main;"]',
alignment="right",
)
self.add_tour_step(
"Click here to zoom in.", "#widget-zoom-in", alignment="left"
)
self.add_tour_step(
"Or click here to zoom out.", "#widget-zoom-out", alignment="left"
)
if self.is_element_visible('button[jsaction*="settings.open;"]'):
self.add_tour_step(
"Use the Menu button to see more options.",
'button[jsaction*="settings.open;"]',
alignment="right",
)
elif self.is_element_visible('button[jsaction="navigationrail.more"]'):
self.add_tour_step(
"Use the Menu button to see more options.",
'button[jsaction="navigationrail.more"]',
alignment="right",
)
self.add_tour_step(
"Or click here to see more Google apps.",
'[title="Google apps"]',
alignment="left",
)
self.add_tour_step(
"Thanks for using SeleniumBase Tours!",
title="🚃 End of Guided Tour 🚃",
)
self.export_tour(filename="maps_introjs_tour.js")
self.play_tour()