Skip to content

Commit e2e812a

Browse files
committed
fix formatting and on launch:
1 parent 2247c30 commit e2e812a

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

modules/data/panel_ui.components.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@
9191
]
9292
},
9393

94+
"panel-ui-new-window": {
95+
"selectorData": "appMenu-new-window-button2",
96+
"strategy": "id",
97+
"groups": []
98+
},
99+
94100
"panel-ui-history": {
95101
"selectorData": "appMenu-history-button",
96102
"strategy": "id",

modules/page_object_about_prefs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, page, **kwargs):
4646
def loaded(self):
4747
return self.root if EC.element_to_be_clickable(self.root) else False
4848

49-
def select_option(self, option_name: str, double_click=False):
49+
def select_option(self, option_name: str, double_click=False, wait_for_selection=True):
5050
"""Select an option in the dropdown. Does not return self."""
5151
if not self.dropmarker.get_attribute("open") == "true":
5252
self.root.click()
@@ -64,6 +64,7 @@ def select_option(self, option_name: str, double_click=False):
6464
)
6565
else:
6666
matching_menuitems[0].click()
67+
if wait_for_selection:
6768
self.wait.until(EC.element_to_be_selected(matching_menuitems[0]))
6869
return self
6970
else:

tests/address_bar_and_search/test_google_search_counts_us.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from time import sleep
22

3-
import pytest
43
from selenium.webdriver import Firefox
54

65
from modules.browser_object import Navigation

tests/language_packs/test_language_pack_install_addons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_language_pack_install_from_addons(
5757
about_prefs = AboutPrefs(driver, category="general").open()
5858
language_dropdown = about_prefs.get_element("language-dropdown")
5959
dropdown = about_prefs.Dropdown(page=about_prefs, root=language_dropdown)
60-
dropdown.select_option(drop_down_name, double_click=True)
60+
dropdown.select_option(drop_down_name, double_click=True, wait_for_selection=False)
6161

6262
about_prefs.custom_wait(timeout=15).until(
6363
lambda _: about_prefs.get_element("html-root").get_attribute("lang")
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
from time import sleep
21

32
import pytest
43
from selenium.webdriver import Firefox
54

6-
from modules.browser_object import TabBar
7-
8-
# from modules.page_object import AboutNewtab, AboutPrefs
9-
from modules.page_object import AboutPrefs
5+
from modules.browser_object import TabBar, PanelUi
106

7+
from modules.page_object import AboutPrefs, AboutNewtab
118

129
@pytest.fixture()
1310
def set_prefs():
@@ -23,22 +20,23 @@ def test_firefox_home_on_launch(driver: Firefox, sys_platform: str):
2320
C143543: setting the default new window to be Firefox Home
2421
"""
2522
# instantiate objs
26-
# tabs = TabBar(driver)
23+
tabs = TabBar(driver)
24+
new_tab = AboutNewtab(driver)
2725
about_prefs = AboutPrefs(driver, category="home").open()
26+
panel_ui = PanelUi(driver)
2827

2928
# click the dropdown
3029
drop_down = about_prefs.get_element("home-new-window-dropdown")
3130
dropdown = about_prefs.Dropdown(page=about_prefs, root=drop_down)
32-
dropdown.select_option("Firefox Home (Default)")
31+
dropdown.select_option("Firefox Home (Default)", double_click=True)
3332

3433
# make sure that the option was selected correctly
3534
assert drop_down.get_attribute("label") == "Firefox Home (Default)"
36-
sleep(3)
37-
driver.switch_to.new_window("window")
38-
sleep(3)
35+
panel_ui.open_panel_menu()
36+
panel_ui.select_panel_setting("panel-ui-new-window")
3937
# # wait for the number of tabs and switch
40-
# tabs.wait_for_num_tabs(2)
41-
# driver.switch_to.window(driver.window_handles[-1])
38+
tabs.wait_for_num_tabs(2)
39+
driver.switch_to.window(driver.window_handles[-1])
4240
# sleep(10)
43-
# # make sure we are on the correct new tab page
44-
# assert about_prefs.get_element("body-logo") is not None
41+
# make sure we are on the correct new tab page
42+
assert new_tab.get_element("body-logo") is not None

0 commit comments

Comments
 (0)