Skip to content

Commit c268e60

Browse files
committed
vs/autofill-hover-test
1 parent 328ca6a commit c268e60

File tree

3 files changed

+55
-4
lines changed

3 files changed

+55
-4
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object_autofill import AddressFill
6+
from modules.page_object_prefs import AboutPrefs
7+
from modules.util import Utilities
8+
9+
10+
@pytest.fixture()
11+
def test_case():
12+
return "2888568"
13+
14+
15+
def test_hover_email_and_phone_autofill_preview(
16+
driver: Firefox,
17+
region: str,
18+
about_prefs_privacy: AboutPrefs,
19+
address_autofill: AddressFill,
20+
autofill_popup: AutofillPopup,
21+
util: Utilities,
22+
):
23+
"""
24+
Verify that hovering over a saved address entry in the dropdown previews all fields
25+
when interacting with both the Email and Phone fields.
26+
27+
"""
28+
# Open the autofill page and fill it with fake data.
29+
address_autofill.open()
30+
autofill_data = util.fake_autofill_data(region)
31+
address_autofill.save_information_basic(autofill_data)
32+
33+
# Click the "Save" button on the autofill popup.
34+
autofill_popup.click_doorhanger_button("save")
35+
36+
# Click inside the Email field to trigger the autofill dropdown.
37+
address_autofill.double_click("form-field", labels=["email"])
38+
# Ensure the dropdown is visible.
39+
autofill_popup.ensure_autofill_dropdown_visible()
40+
# Hover over any saved address entry (without selecting it).
41+
autofill_popup.hover("select-form-option")
42+
# Verify that the preview displays all the fields correctly.
43+
address_autofill.verify_autofill_data_on_hover(autofill_data, autofill_popup, util)
44+
45+
# Click inside the Phone field (using the correct label "tel") to trigger the autofill dropdown.
46+
address_autofill.double_click("form-field", labels=["tel"])
47+
# Ensure the dropdown is visible.
48+
autofill_popup.ensure_autofill_dropdown_visible()
49+
# Hover over any saved address entry (without selecting it).
50+
autofill_popup.hover("select-form-option")
51+
# Verify that the preview displays all the fields correctly.
52+
address_autofill.verify_autofill_data_on_hover(autofill_data, autofill_popup, util)

l10n_CM/Unified/test_demo_ad_hover_verify_address.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import logging
2-
31
import pytest
4-
from selenium.webdriver import ActionChains, Firefox
2+
from selenium.webdriver import Firefox
53

64
from modules.browser_object_autofill_popup import AutofillPopup
75
from modules.page_object_autofill import AddressFill

l10n_CM/region/Unified.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"test_demo_ad_clear_address_fields.py",
2424
"test_demo_ad_clear_tel_email.py",
2525
"test_demo_ad_autofill_dropdown_present_for_email_and_phone.py",
26-
"test_demo_ad_hover_verify_address.py"
26+
"test_demo_ad_hover_verify_address.py",
27+
"test_demo_ad_hover_over_tele_and_email_dropdown.py"
2728
]
2829
}

0 commit comments

Comments
 (0)