Skip to content

Commit 76974d1

Browse files
authored
Merge pull request #99 from mozilla/sl/firefox-home-new-tab
Firefox Home New Tab
2 parents b00395c + 110fc35 commit 76974d1

File tree

6 files changed

+49
-1
lines changed

6 files changed

+49
-1
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Please include a summary of the changes and the related issue. Please also inclu
44

55
## Bugzilla bug ID
66

7-
**ID:**
7+
**Testrail:**
88
**Link:**
99

1010
## Type of change

modules/data/about_newtab.components.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,11 @@
105105
"groups": [
106106
"doNotCache"
107107
]
108+
},
109+
110+
"body-logo": {
111+
"selectorData": "logo",
112+
"strategy": "class",
113+
"groups": []
108114
}
109115
}

modules/data/about_prefs.components.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,17 @@
151151
"selectorData": "firefoxSuggestSponsored",
152152
"strategy": "id",
153153
"groups": []
154+
},
155+
156+
"home-new-tabs-dropdown": {
157+
"selectorData": "newTabMode",
158+
"strategy": "id",
159+
"groups": []
160+
},
161+
162+
"home-new-tabs-dropdown-option-default": {
163+
"selectorData": "menuitem[data-l10n-id=\"home-mode-choice-default-fx\"]",
164+
"strategy": "css",
165+
"groups": []
154166
}
155167
}
File renamed without changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from selenium.webdriver import Firefox
2+
3+
from modules.browser_object import TabBar
4+
from modules.page_object import AboutNewtab, AboutPrefs
5+
6+
7+
def test_firefox_home_new_tab(driver: Firefox):
8+
"""
9+
C161472: setting the default new window to be Firefox Home
10+
"""
11+
# instantiate objs
12+
about_prefs = AboutPrefs(driver, category="home").open()
13+
tabs = TabBar(driver)
14+
about_new_tab = AboutNewtab(driver)
15+
16+
# click the dropdown
17+
drop_down = about_prefs.get_element("home-new-tabs-dropdown")
18+
dropdown = about_prefs.Dropdown(page=about_prefs, root=drop_down)
19+
dropdown.select_option("Firefox Home (Default)")
20+
21+
# make sure that the option was selected correctly
22+
assert drop_down.get_attribute("label") == "Firefox Home (Default)"
23+
tabs.new_tab_by_button()
24+
25+
# wait for the number of tabs and switch
26+
tabs.wait_for_num_tabs(2)
27+
driver.switch_to.window(driver.window_handles[-1])
28+
29+
# make sure we are on the correct new tab page
30+
assert about_new_tab.get_element("body-logo") is not None

0 commit comments

Comments
 (0)