1
+ from time import sleep
2
+
1
3
import pytest
4
+ from selenium .webdriver import Firefox
2
5
from selenium .webdriver .common .by import By
3
6
from selenium .webdriver .common .keys import Keys
4
- from selenium .webdriver import Firefox
5
7
from selenium .webdriver .support import expected_conditions as EC
6
8
from selenium .webdriver .support .wait import WebDriverWait
7
- from modules .page_object import AboutPrefs , AboutConfig
8
9
9
10
from modules .browser_object import Navigation
10
11
from modules .browser_object_context_menu import ContextMenu
11
- from time import sleep
12
+ from modules . page_object import AboutConfig , AboutPrefs
12
13
13
14
14
15
@pytest .fixture ()
@@ -17,6 +18,7 @@ def add_prefs():
17
18
("browser.search.region" , "US" ),
18
19
]
19
20
21
+
20
22
def test_default_search_provider_change (driver : Firefox ):
21
23
"""
22
24
C1365245 - This test makes sure that the default search
@@ -29,7 +31,6 @@ def test_default_search_provider_change(driver: Firefox):
29
31
search_term = "what is life?"
30
32
31
33
# enable search bar via about:config
32
- #about_config.change_pref_value("cookiebanners.service.mode", 1)
33
34
pref = "browser.search.widget.inNavBar"
34
35
about_config .toggle_true_false_config (pref )
35
36
nav .clear_awesome_bar ()
@@ -45,7 +46,6 @@ def test_default_search_provider_change(driver: Firefox):
45
46
driver .switch_to .window (driver .window_handles [1 ])
46
47
sleep (1 )
47
48
48
-
49
49
# check that the current URL is about:preferences#search
50
50
assert driver .current_url == "about:preferences#search"
51
51
@@ -64,7 +64,9 @@ def test_default_search_provider_change(driver: Firefox):
64
64
65
65
# Open the search bar and type in a keyword and check if it's with the right provider
66
66
nav .type_in_search_bar (search_term )
67
- search_engine_name_element = driver .find_element (By .CSS_SELECTOR , '.searchbar-engine-name' )
67
+ with driver .context (driver .CONTEXT_CHROME ):
68
+ search_engine_name_element = driver .find_element (
69
+ By .CSS_SELECTOR , ".searchbar-engine-name"
70
+ )
68
71
69
- assert search_engine_name_element .text == "DuckDuckGo"
70
- sleep (4 )
72
+ assert search_engine_name_element .get_attribute ("value" ) == "DuckDuckGo Search"
0 commit comments