@@ -28,25 +28,25 @@ def __init__(self, driver: Firefox, **kwargs):
28
28
self .search_bar = None
29
29
self .change_search_settings_button = None
30
30
31
- @BasePage .content_context
31
+ @BasePage .context_content
32
32
def expect_in_content (self , condition ) -> BasePage :
33
33
"""Like BasePage.expect, but guarantee we're looking at CONTEXT_CONTENT"""
34
34
self .wait .until (condition )
35
35
return self
36
36
37
- @BasePage .chrome_context
37
+ @BasePage .context_chrome
38
38
def set_awesome_bar (self ) -> BasePage :
39
39
"""Set the awesome_bar attribute of the Navigation object"""
40
40
self .awesome_bar = self .get_element ("awesome-bar" )
41
41
return self
42
42
43
- @BasePage .chrome_context
43
+ @BasePage .context_chrome
44
44
def get_awesome_bar (self ) -> WebElement :
45
45
"""Get the Awesome Bar. Prefer this over get_element."""
46
46
self .set_awesome_bar ()
47
47
return self .awesome_bar
48
48
49
- @BasePage .chrome_context
49
+ @BasePage .context_chrome
50
50
def get_awesome_bar_text (self ):
51
51
"""
52
52
Get the text directly from the awesome bar.
@@ -55,14 +55,14 @@ def get_awesome_bar_text(self):
55
55
awesome_bar = self .get_element ("awesome-bar" ).get_attribute ("value" )
56
56
return awesome_bar
57
57
58
- @BasePage .chrome_context
58
+ @BasePage .context_chrome
59
59
def clear_awesome_bar (self ) -> BasePage :
60
60
"""Clear the Awesome Bar. Prefer this over get_element("awesome-bar").clear()"""
61
61
self .set_awesome_bar ()
62
62
self .awesome_bar .clear ()
63
63
return self
64
64
65
- @BasePage .chrome_context
65
+ @BasePage .context_chrome
66
66
def type_in_awesome_bar (self , term : str ) -> BasePage :
67
67
"""Enter text into the Awesome Bar. You probably want self.search()"""
68
68
self .set_awesome_bar ()
@@ -97,7 +97,7 @@ def set_search_mode_via_awesome_bar(self, mode: str) -> BasePage:
97
97
)
98
98
return self
99
99
100
- @BasePage .chrome_context
100
+ @BasePage .context_chrome
101
101
def search (self , term : str , mode = None ) -> BasePage :
102
102
"""
103
103
Search using the Awesome Bar, optionally setting the search mode first. Returns self.
@@ -119,13 +119,13 @@ def search(self, term: str, mode=None) -> BasePage:
119
119
self .type_in_awesome_bar (term + Keys .ENTER )
120
120
return self
121
121
122
- @BasePage .chrome_context
122
+ @BasePage .context_chrome
123
123
def set_search_bar (self ) -> BasePage :
124
124
"""Set the search_bar attribute of the Navigation object"""
125
125
self .search_bar = self .find_element (By .CLASS_NAME , "searchbar-textbox" )
126
126
return self
127
127
128
- @BasePage .chrome_context
128
+ @BasePage .context_chrome
129
129
def search_bar_search (self , term : str ) -> BasePage :
130
130
"""
131
131
Search using the *Old* Search Bar. Returns self.
@@ -141,7 +141,7 @@ def search_bar_search(self, term: str) -> BasePage:
141
141
self .search_bar .send_keys (term + Keys .ENTER )
142
142
return self
143
143
144
- @BasePage .chrome_context
144
+ @BasePage .context_chrome
145
145
def type_in_search_bar (self , term : str ) -> BasePage :
146
146
"""
147
147
Type in the *Old* Search Bar. Returns self.
@@ -162,7 +162,7 @@ def open_awesome_bar_settings(self):
162
162
self .click_on ("search-settings" )
163
163
return self
164
164
165
- @BasePage .chrome_context
165
+ @BasePage .context_chrome
166
166
def click_on_change_search_settings_button (self ) -> BasePage :
167
167
self .search_bar = self .find_element (By .CLASS_NAME , "searchbar-textbox" )
168
168
self .search_bar .click ()
@@ -172,21 +172,21 @@ def click_on_change_search_settings_button(self) -> BasePage:
172
172
self .change_search_settings_button .click ()
173
173
return self
174
174
175
- @BasePage .chrome_context
175
+ @BasePage .context_chrome
176
176
def click_in_awesome_bar (self ) -> BasePage :
177
177
self .set_awesome_bar ()
178
178
self .awesome_bar .click ()
179
179
return self
180
180
181
- @BasePage .chrome_context
181
+ @BasePage .context_chrome
182
182
def get_download_button (self ) -> WebElement :
183
183
"""
184
184
Gets the download button WebElement
185
185
"""
186
186
downloads_button = self .get_element ("downloads-button" )
187
187
return downloads_button
188
188
189
- @BasePage .chrome_context
189
+ @BasePage .context_chrome
190
190
def wait_for_download_animation_finish (
191
191
self , downloads_button : WebElement
192
192
) -> BasePage :
@@ -201,15 +201,15 @@ def wait_for_download_animation_finish(
201
201
logging .warning ("Animation did not finish or did not play." )
202
202
return self
203
203
204
- @BasePage .chrome_context
204
+ @BasePage .context_chrome
205
205
def open_tracker_panel (self ) -> BasePage :
206
206
"""
207
207
Clicks the shield icon and opens the panel associated with it
208
208
"""
209
209
self .get_element ("shield-icon" ).click ()
210
210
return self
211
211
212
- @BasePage .chrome_context
212
+ @BasePage .context_chrome
213
213
def bookmark_page_other (self ) -> BasePage :
214
214
self .get_element ("star-button" ).click ()
215
215
dropdown = self .get_element ("bookmarks-type-dropdown" )
@@ -219,7 +219,7 @@ def bookmark_page_other(self) -> BasePage:
219
219
self .get_element ("save-bookmark-button" ).click ()
220
220
return self
221
221
222
- @BasePage .chrome_context
222
+ @BasePage .context_chrome
223
223
def add_bookmark_advanced (
224
224
self , bookmark_data : Bookmark , ba : BrowserActions
225
225
) -> BasePage :
@@ -242,7 +242,7 @@ def add_bookmark_advanced(
242
242
ba .switch_to_content_context ()
243
243
return self
244
244
245
- @BasePage .chrome_context
245
+ @BasePage .context_chrome
246
246
def add_bookmark_via_star (self ) -> BasePage :
247
247
"""
248
248
Bookmark a site via star button and click save on the bookmark panel
@@ -251,7 +251,7 @@ def add_bookmark_via_star(self) -> BasePage:
251
251
self .get_element ("save-bookmark-button" ).click ()
252
252
return self
253
253
254
- @BasePage .chrome_context
254
+ @BasePage .context_chrome
255
255
def add_bookmark_via_menu (self ) -> BasePage :
256
256
"""
257
257
Bookmark a site via bookmarks menu and click save on the bookmark panel
@@ -261,7 +261,7 @@ def add_bookmark_via_menu(self) -> BasePage:
261
261
self .get_element ("save-bookmark-button" ).click ()
262
262
return self
263
263
264
- @BasePage .chrome_context
264
+ @BasePage .context_chrome
265
265
def toggle_bookmarks_toolbar_with_key_combo (self ) -> BasePage :
266
266
"""Use Cmd/Ctrl + B to open the Print Preview, wait for load"""
267
267
@@ -295,7 +295,7 @@ def wait_for_item_to_download(self, filename: str) -> BasePage:
295
295
self .driver .implicitly_wait (original_timeout )
296
296
return self
297
297
298
- @BasePage .chrome_context
298
+ @BasePage .context_chrome
299
299
def confirm_bookmark_exists (self , match_string : str ) -> BasePage :
300
300
"""
301
301
For a given string, return self if it exists in the label of a bookmark, else assert False.
@@ -315,7 +315,7 @@ def confirm_bookmark_exists(self, match_string: str) -> BasePage:
315
315
assert matches_short_string or matches_long_string
316
316
return self
317
317
318
- @BasePage .chrome_context
318
+ @BasePage .context_chrome
319
319
def refresh_page (self ) -> BasePage :
320
320
"""
321
321
Refreshes the current page by clicking the refresh button in the browser.
0 commit comments