This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
/
partners.py
executable file
·268 lines (249 loc) · 11.2 KB
/
partners.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from selenium.webdriver.common.by import By
from pages.desktop.base import Base
class Partners(Base):
_firefox_os_header_locator = (By.CSS_SELECTOR, '#main-feature > h2')
_welcome_section_locator = (By.CSS_SELECTOR, '#primary')
_new_web_standards_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(1) > h3:nth-of-type(1)')
_freedom_platforms_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(1) > h3:nth-of-type(2)')
_customizations_for_oems_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(2) > h3')
_developer_opportunities_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(3) > h3')
_consumer_freedom_header_locator = (By.CSS_SELECTOR, '#secondary div.section:nth-of-type(4) > h3')
_overview_menu_icon_locator = (By.CSS_SELECTOR, '#menu-overview > a')
_os_menu_icon_locator = (By.CSS_SELECTOR, '#menu-os > a')
_marketplace_menu_icon_locator = (By.CSS_SELECTOR, '#menu-marketplace > a')
_android_menu_icon_locator = (By.CSS_SELECTOR, '#menu-android > a')
_form_icon_locator = (By.CSS_SELECTOR, 'menu-form > a')
_partner_pager_button_locator = (By.CSS_SELECTOR, '.pager-tabs > li:nth-of-type(2) > a')
_partner_page_one_button_locator = (By.CSS_SELECTOR, '.pager-tabs a[href="#mozilla-pager-page-1"]')
_partner_with_us_button_locator = (By.CSS_SELECTOR, '.partner-button > a')
_phone_foxtail_image_locator = (By.CSS_SELECTOR, '.phone > #screen-overview > #foxtail')
_phone_os_image_locator = (By.ID, 'screen-os')
_os_overview_button_locator = (By.CSS_SELECTOR, '#os > .article-header > .tween > a.view-section:nth-of-type(1)')
_operators_button_locator = (By.CSS_SELECTOR, '#os > .article-header > .tween > a.view-section:nth-of-type(2)')
_phone_marketplace_image_locator = (By.ID, 'screen-marketplace')
_phone_image_locator = (By.CSS_SELECTOR, '.phone-overlay')
partner_images_pager_list_one = [
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(1) > img'),
'img_name_suffix': 'telefonica.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(2) > img'),
'img_name_suffix': 'dt.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(3) > img'),
'img_name_suffix': 'lg.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(4) > img'),
'img_name_suffix': 'qualcomm.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(5) > img'),
'img_name_suffix': 'zte.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(6) > img'),
'img_name_suffix': 'telenor.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(7) > img'),
'img_name_suffix': 'americamovil.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(8) > img'),
'img_name_suffix': 'tcl.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(9) > img'),
'img_name_suffix': 'telecomitalia.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(10) > img'),
'img_name_suffix': 'chinaunicom.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(11) > img'),
'img_name_suffix': 'kddi.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(12) > img'),
'img_name_suffix': 'sprint.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(13) > img'),
'img_name_suffix': 'singtel.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(14) > img'),
'img_name_suffix': 'etisalat.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(15) > img'),
'img_name_suffix': 'koreatelecom.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-1 > .logos > li:nth-of-type(16) > img'),
'img_name_suffix': 'vimpelcom.png'
}
]
partner_images_pager_list_two = [
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(1) > img'),
'img_name_suffix': 'smartcom.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(2) > img'),
'img_name_suffix': 'portugaltelecom.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(3) > img'),
'img_name_suffix': 'megafon.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(4) > img'),
'img_name_suffix': 'facebook.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(5) > img'),
'img_name_suffix': 'twitter.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(6) > img'),
'img_name_suffix': 'soundcloud.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(7) > img'),
'img_name_suffix': 'here-com.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(8) > img'),
'img_name_suffix': 'box.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(9) > img'),
'img_name_suffix': 'ea.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(10) > img'),
'img_name_suffix': 'ebay.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(11) > img'),
'img_name_suffix': 'cuttherope.png'
},
{
'locator': (By.CSS_SELECTOR, '#page-mozilla-pager-page-2 > .logos > li:nth-of-type(12) > img'),
'img_name_suffix': 'wikipedia.png'
}
]
_operators_image_list = [
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(1) > img'),
'url_suffix': 'telefonica.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(2) > img'),
'url_suffix': 'dt.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(3) > img'),
'url_suffix': 'lg.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(4) > img'),
'url_suffix': 'qualcomm.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(5) > img'),
'url_suffix': 'zte.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(6) > img'),
'url_suffix': 'telenor.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(7) > img'),
'url_suffix': 'kddi.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(8) > img'),
'url_suffix': 'tcl.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(9) > img'),
'url_suffix': 'telecomitalia.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(10) > img'),
'url_suffix': 'chinaunicom.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(11) > img'),
'url_suffix': 'sprint.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(12) > img'),
'url_suffix': 'vimpelcom.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(13) > img'),
'url_suffix': 'singtel.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(14) > img'),
'url_suffix': 'etisalat.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(15) > img'),
'url_suffix': 'koreatelecom.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(16) > img'),
'url_suffix': 'smartcom.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(17) > img'),
'url_suffix': 'megafon.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(18) > img'),
'url_suffix': 'portugaltelecom.png'
},
{
'locator': (By.CSS_SELECTOR, '#os-operators-logos1 > li:nth-of-type(19) > img'),
'url_suffix': 'americamovil.png'
}
]
def go_to_page(self):
self.open('/firefox/partners/')
self.wait_for_element_visible(*self._partner_with_us_button_locator)
def click_partner_pager_button(self):
return self.selenium.find_element(*self._partner_pager_button_locator).click()
def click_overview_menu(self):
return self.selenium.find_element(*self._overview_menu_icon_locator).click()
def click_marketplace_menu(self):
return self.selenium.find_element(*self._marketplace_menu_icon_locator).click()
def click_os_menu(self):
return self.selenium.find_element(*self._os_menu_icon_locator).click()
def click_operators_button(self):
return self.selenium.find_element(*self._operators_button_locator).click()
@property
def is_marketplace_image_visible(self):
return self.is_element_visible(*self._phone_marketplace_image_locator)
@property
def is_partner_with_us_button_visible(self):
return self.is_element_visible(*self._partner_with_us_button_locator)
@property
def is_foxtail_image_visible(self):
return self.is_element_visible(*self._phone_foxtail_image_locator)
@property
def is_phone_overlay_visible(self):
return self.is_element_visible(*self._phone_image_locator)
def click_partner_page_one_button(self):
self.selenium.find_element(*self._partner_page_one_button_locator).click()