Skip to content

Commit e016c4a

Browse files
tracy/Add Bing search codes test for bug 1999968 (#927)
* Add Bing search codes test * Add to Key.yaml manfest * Add to the manifests * Add to the key manifest * Only functional in key manifest * fix chooser for min test runs --------- Co-authored-by: Ben Chatterton <[email protected]>
1 parent 92390b4 commit e016c4a

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

choose_ci_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ def dedupe(run_list: list) -> list:
207207
if not found:
208208
run_list.append(changed_test)
209209

210+
ci_paths = manifest.gather_split("ci")
211+
ci_paths = dedupe(ci_paths)
210212
if not run_list:
211-
ci_paths = manifest.gather_split("ci")
212-
ci_paths = dedupe(ci_paths)
213213
with open(OUTPUT_FILE, "w") as fh:
214214
fh.write("\n".join(ci_paths))
215215
sys.exit(0)

manifests/key.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ address_bar_and_search:
2424
result: pass
2525
splits:
2626
- functional1
27+
test_bing_search_codes:
28+
result: pass
29+
splits:
30+
- functional1
2731
test_copied_url_contains_https:
2832
result: pass
2933
splits:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object import Navigation, TabBar
5+
from modules.page_object import AboutPrefs
6+
7+
SEARCH_ENGINE = "Bing"
8+
SEARCH_TERM = "earth"
9+
TAB_TITLE = f"{SEARCH_TERM} - Search"
10+
BING_CODES = ["form=MOZLBR&pc=MOZI", "pc=MOZI&form=MOZLBR"]
11+
12+
13+
@pytest.fixture()
14+
def test_case():
15+
return "3029767"
16+
17+
18+
def test_bing_search_codes(driver: Firefox):
19+
"""
20+
C3029767 - Verify that Search Code Testing: Bing - US is correctly displayed and functional.
21+
"""
22+
nav = Navigation(driver)
23+
prefs = AboutPrefs(driver)
24+
tab = TabBar(driver)
25+
26+
# Go to search engine settings
27+
nav.open_searchmode_switcher_settings()
28+
29+
# Change the default search engine
30+
prefs.search_engine_dropdown().select_option(SEARCH_ENGINE)
31+
32+
# Open a tab and verify Bing search code
33+
driver.get("about:newtab")
34+
nav.search(SEARCH_TERM)
35+
tab.expect_title_contains(TAB_TITLE)
36+
assert any(code in driver.current_url for code in BING_CODES)
37+
nav.clear_awesome_bar()

0 commit comments

Comments
 (0)