Skip to content

Commit e9722c7

Browse files
committed
merge main, fix conflict
2 parents 1878df0 + b00395c commit e9722c7

28 files changed

+391
-990
lines changed

modules/browser_object_navigation.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ def get_awesome_bar(self) -> WebElement:
3737
self.set_awesome_bar()
3838
return self.awesome_bar
3939

40+
def get_awesome_bar_text(self):
41+
"""
42+
Get the text directly from the awesome bar.
43+
This is different from 'driver.current_url' which pulls from href
44+
"""
45+
self.set_chrome_context()
46+
awesome_bar = self.get_element("awesome-bar").get_attribute("value")
47+
return awesome_bar
48+
4049
def clear_awesome_bar(self) -> BasePage:
4150
"""Clear the Awesome Bar. Prefer this over get_element("awesome-bar").clear()"""
4251
self.set_awesome_bar()

modules/browser_object_tabbar.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ def expect_tab_sound_status(
106106
)
107107
return self
108108

109+
def expect_title_contains(self, text: str) -> BasePage:
110+
"""
111+
Check if the page title contains given text
112+
"""
113+
self.expect(EC.title_contains(text))
114+
return self
115+
109116
def open_all_tabs_list(self) -> BasePage:
110117
"""Click the Tab Visibility / List All Tabs button"""
111118
with self.driver.context(self.driver.CONTEXT_CHROME):

modules/data/about_config.components.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,17 @@
1111
"selectorData": "about-config-search",
1212
"strategy": "id",
1313
"groups": []
14+
},
15+
16+
"cell-edit": {
17+
"selectorData": "cell-edit",
18+
"strategy": "class",
19+
"groups": []
20+
},
21+
22+
"form-edit": {
23+
"selectorData": "//input[@aria-label='cookiebanners.service.mode']",
24+
"strategy": "xpath",
25+
"groups": []
1426
}
1527
}

modules/data/about_newtab.components.json

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"incontent-search-input": {
33
"selectorData": "fake-editable",
44
"strategy": "class",
5-
"groups": [
6-
"requiredForPage"
7-
]
5+
"groups": []
86
},
97

108
"loaded-image": {
@@ -25,20 +23,40 @@
2523
"groups": []
2624
},
2725

28-
"top-sites-list": {
29-
"selectorData": "top-sites-list",
26+
"sponsored-site-card": {
27+
"selectorData": "top-site-outer",
3028
"strategy": "class",
3129
"groups": [
32-
"requiredForPage"
30+
"requiredForPage",
31+
"doNotCache"
3332
]
3433
},
3534

35+
"top-site-image-by-index": {
36+
"selectorData": ".top-sites-list li:nth-of-type({index}) .top-site-icon.rich-icon",
37+
"strategy": "css",
38+
"groups": []
39+
},
40+
41+
"sponsored-site-card-menu-button": {
42+
"selectorData": "button[class=\"context-menu-button icon\"]",
43+
"strategy": "css",
44+
"groups": [
45+
"doNotCache"
46+
]
47+
},
48+
49+
50+
"top-sites-list": {
51+
"selectorData": "top-sites-list",
52+
"strategy": "class",
53+
"groups": []
54+
},
55+
3656
"recommended-by-pocket-list": {
3757
"selectorData": "ds-card-grid-include-descriptions",
3858
"strategy": "class",
39-
"groups": [
40-
"requiredForPage"
41-
]
59+
"groups": []
4260
},
4361

4462
"article-description": {
@@ -58,9 +76,7 @@
5876
"popular-topics-list": {
5977
"selectorData": ".ds-navigation > ul",
6078
"strategy": "css",
61-
"groups": [
62-
"requiredForPage"
63-
]
79+
"groups": []
6480
},
6581

6682
"recent-activity-section": {
@@ -73,5 +89,21 @@
7389
"selectorData": "//div[following-sibling::div[@class='section-top-bar']]",
7490
"strategy": "xpath",
7591
"groups": []
92+
},
93+
94+
"sponsored-site-context-menu": {
95+
"selectorData": "context-menu",
96+
"strategy": "class",
97+
"groups": [
98+
"doNotCache"
99+
]
100+
},
101+
102+
"sponsored-site-context-menu-list": {
103+
"selectorData": "ul[class=\"context-menu-list\"]",
104+
"strategy": "css",
105+
"groups": [
106+
"doNotCache"
107+
]
76108
}
77109
}

modules/data/about_prefs.components.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@
135135
"groups": []
136136
},
137137

138+
"show-suggestions": {
139+
"selectorData": "checkbox[data-l10n-id='search-show-suggestions-option']",
140+
"strategy": "css",
141+
"groups": []
142+
},
143+
138144
"firefox-suggest-nonsponsored": {
139145
"selectorData": "firefoxSuggestNonsponsored",
140146
"strategy": "id",

modules/data/navigation.components.json

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@
169169
},
170170

171171
"firefox-suggest": {
172-
"selectorData": "div.urlbarView-row[label=\"Firefox Suggest\"] > span.urlbarView-row-inner",
173-
"strategy": "css",
174-
"groups": []
172+
"selectorData": "div.urlbarView-row[label=\"Firefox Suggest\"] > span.urlbarView-row-inner",
173+
"strategy": "css",
174+
"groups": []
175175
},
176176

177177
"search-result-autofill-adaptive-element": {
@@ -180,27 +180,9 @@
180180
"groups": []
181181
},
182182

183-
"sponsored-site-card": {
184-
"selectorData": "top-site-outer",
185-
"strategy": "class",
186-
"groups": []
187-
},
188-
189-
"sponsored-site-card-menu-button": {
190-
"selectorData": "button[class=\"context-menu-button icon\"]",
191-
"strategy": "css",
192-
"groups": []
193-
},
194-
195-
"sponsored-site-context-menu": {
196-
"selectorData": "context-menu",
197-
"strategy": "class",
198-
"groups": []
199-
},
200-
201-
"sponsored-site-context-menu-list": {
202-
"selectorData": "ul[class=\"context-menu-list\"]",
203-
"strategy": "css",
183+
"search-result": {
184+
"selectorData": "//div[@data-text-ad]//a",
185+
"strategy": "xpath",
204186
"groups": []
205187
}
206188
}

modules/page_object_about_config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,14 @@ def toggle_true_false_config(self, term: str) -> BasePage:
3838
self.search_pref(term)
3939
self.toggle_true_false()
4040
return self
41+
42+
def change_pref_value(self, term: str, value) -> BasePage:
43+
self.set_content_context()
44+
self.driver.get("about:config")
45+
self.search_pref(term)
46+
pref_edit_button = self.get_element("cell-edit")
47+
pref_edit_button.click()
48+
pref_edit = self.get_element("form-edit")
49+
pref_edit.send_keys(value)
50+
pref_edit_button.click()
51+
return self

0 commit comments

Comments
 (0)