@@ -30,26 +30,13 @@ def test_demo_ad_autofill_phone_email(
30
30
# Click the "Save" button
31
31
autofill_popup .click_doorhanger_button ("save" )
32
32
33
- # Double inside phone field and select a saved address entry from the dropdown
34
- address_autofill .double_click ("form-field" , labels = ["tel" ])
35
-
36
- # Click on the first element from the autocomplete dropdown
37
- first_item = autofill_popup .get_nth_element (1 )
38
- autofill_popup .click_on (first_item )
39
-
40
- # Verify autofill data
41
- address_autofill .verify_autofill_data (address_autofill_data , region , util )
42
-
43
- # Double inside phone field and select clear form autofill
44
- address_autofill .double_click ("form-field" , labels = ["tel" ])
45
- autofill_popup .click_clear_form_option ()
46
-
47
- # Double inside email field and select a saved address entry from the dropdown
48
- address_autofill .double_click ("form-field" , labels = ["email" ])
49
-
50
- # Click on the first element from the autocomplete dropdown
51
- first_item = autofill_popup .get_nth_element (1 )
52
- autofill_popup .click_on (first_item )
53
-
54
- # Verify autofill data
55
- address_autofill .verify_autofill_data (address_autofill_data , region , util )
33
+ # List of field labels to be autofilled and verified
34
+ fields_to_test = [
35
+ "email" ,
36
+ "tel"
37
+ ]
38
+
39
+ # Loop through each field and perform the autofill test
40
+ for field in fields_to_test :
41
+ address_autofill .autofill_and_verify (autofill_popup , field ,
42
+ address_autofill_data , util )
0 commit comments