4
4
from modules .browser_object_autofill_popup import AutofillPopup
5
5
from modules .page_object_autofill import AddressFill
6
6
from modules .page_object_prefs import AboutPrefs
7
- from modules .util import Utilities , BrowserActions
7
+ from modules .util import BrowserActions , Utilities
8
8
9
9
10
10
@pytest .fixture ()
11
11
def test_case ():
12
12
return "2886581"
13
13
14
14
15
- def test_demo_ad_email_phone_captured_in_doorhanger_and_stored (driver : Firefox , region : str
16
- ):
15
+ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored (
16
+ driver : Firefox , region : str
17
+ ):
17
18
"""
18
19
C2888704 - Verify tele/email data are captured in the Capture Doorhanger and stored in about:preferences
19
20
"""
@@ -38,7 +39,9 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(driver: Firefox,
38
39
# containing phone field
39
40
expected_phone = address_autofill_data .telephone
40
41
with driver .context (driver .CONTEXT_CHROME ):
41
- actual_phone = address_autofill_popup .get_element ("address-doorhanger-phone" ).text
42
+ actual_phone = address_autofill_popup .get_element (
43
+ "address-doorhanger-phone"
44
+ ).text
42
45
normalize_expected = util .normalize_phone_number (expected_phone )
43
46
normalized_actual = util .normalize_phone_number (actual_phone )
44
47
assert normalized_actual == normalize_expected
@@ -48,15 +51,14 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(driver: Firefox,
48
51
49
52
# Navigate to about:preferences#privacy => "Autofill" section
50
53
about_prefs = AboutPrefs (driver , category = "privacy" ).open ()
51
- iframe = about_prefs .get_save_addresses_popup_iframe ()
54
+ iframe = about_prefs .get_saved_addresses_popup_iframe ()
52
55
browser_action_obj .switch_to_iframe_context (iframe )
53
56
54
57
# The address saved in step 2 is listed in the "Saved addresses" modal: Email and phone
55
58
elements = about_prefs .get_elements ("saved-addresses-values" )
56
59
expected_values = [expected_phone , expected_email ]
57
60
found_email_phone = any (
58
- all (value in element .text for value in expected_values )
59
- for element in elements
61
+ all (value in element .text for value in expected_values ) for element in elements
60
62
)
61
63
assert (
62
64
found_email_phone
0 commit comments