1
1
import pytest
2
2
from selenium .webdriver import Firefox
3
3
4
+ from l10n_CM .Unified .conftest import autofill_popup
4
5
from modules .browser_object_autofill_popup import AutofillPopup
5
6
from modules .page_object_autofill import AddressFill
6
7
from modules .util import Utilities
@@ -11,43 +12,44 @@ def test_case():
11
12
return "2888558"
12
13
13
14
14
- def test_demo_ad_autofill_name_org (driver : Firefox , region : str ):
15
+ def test_demo_ad_autofill_name_org (
16
+ driver : Firefox ,
17
+ region : str ,
18
+ address_autofill : AddressFill ,
19
+ autofill_popup : AutofillPopup ,
20
+ util : Utilities ,
21
+ ):
15
22
"""
16
23
C2888558 - Verify Autofill functionality when selecting an entry from the dropdown for name/org fields
17
24
"""
18
- # Instantiate objects
19
- address_autofill = AddressFill (driver )
20
- address_autofill_popup = AutofillPopup (driver )
21
- util = Utilities ()
22
-
23
25
# Create fake data and fill it in
24
26
address_autofill .open ()
25
27
address_autofill_data = util .fake_autofill_data (region )
26
28
address_autofill .save_information_basic (address_autofill_data )
27
29
28
30
# Click the "Save" button
29
- address_autofill_popup .click_doorhanger_button ("save" )
31
+ autofill_popup .click_doorhanger_button ("save" )
30
32
31
33
# Double inside Name field and select a saved address entry from the dropdown
32
34
address_autofill .double_click ("form-field" , labels = ["name" ])
33
35
34
36
# Click on the first element from the autocomplete dropdown
35
- first_item = address_autofill_popup .get_nth_element (1 )
36
- address_autofill_popup .click_on (first_item )
37
+ first_item = autofill_popup .get_nth_element (1 )
38
+ autofill_popup .click_on (first_item )
37
39
38
40
# Verify autofill data
39
41
address_autofill .verify_autofill_data (address_autofill_data , region , util )
40
42
41
43
# Double inside Name field and select clear form autofill
42
44
address_autofill .double_click ("form-field" , labels = ["name" ])
43
- address_autofill_popup .click_clear_form_option ()
45
+ autofill_popup .click_clear_form_option ()
44
46
45
47
# Double inside Organization field and select a saved address entry from the dropdown
46
48
address_autofill .double_click ("form-field" , labels = ["organization" ])
47
49
48
50
# Click on the first element from the autocomplete dropdown
49
- first_item = address_autofill_popup .get_nth_element (1 )
50
- address_autofill_popup .click_on (first_item )
51
+ first_item = autofill_popup .get_nth_element (1 )
52
+ autofill_popup .click_on (first_item )
51
53
52
54
# Verify autofill data
53
55
address_autofill .verify_autofill_data (address_autofill_data , region , util )
0 commit comments