Skip to content

Commit f6c513f

Browse files
committed
vs/ Test that pref for history is changed
1 parent 56b515c commit f6c513f

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

modules/data/about_prefs.components.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,5 +387,11 @@
387387
"selectorData": "description[data-l10n-id='history-dontremember-description']",
388388
"strategy": "css",
389389
"groups": []
390+
},
391+
392+
"history_menulist": {
393+
"selectorData": "historyMode",
394+
"strategy": "id",
395+
"groups": []
390396
}
391397
}

modules/page_object_about_prefs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,9 @@ def get_iframe(self) -> WebElement:
322322
Gets the webelement for the iframe that commonly appears in about:preferences
323323
"""
324324
return self.get_element("browser-popup")
325+
326+
def get_history_menulist(self) -> WebElement:
327+
"""
328+
Gets the webelement for the list of history items that appear in about:preferences
329+
"""
330+
return self.get_element("history_menulist")

tests/preferences/test_never_remember_history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def test_never_remember_history(driver: Firefox, sys_platform: str):
1919
C143604: Make sure to set the pref via about:preferences, then check in about:config that the pref has been changed
2020
"""
2121

22-
AboutPrefs(driver, category="privacy").open()
22+
about_prefs = AboutPrefs(driver, category="privacy").open()
2323

2424
# Change the settings to not remember the browser history
25-
history_menulist = driver.find_element(By.ID, "historyMode")
25+
history_menulist = about_prefs.get_history_menulist()
2626
menulist_popup = history_menulist.find_element(By.TAG_NAME, "menupopup")
2727
options = menulist_popup.find_elements(By.TAG_NAME, "menuitem")
2828

0 commit comments

Comments
 (0)