Skip to content

Commit 52132dc

Browse files
authored
Merge branch 'main' into philimon/add-new-address
2 parents 89b9dd0 + 5d31cf1 commit 52132dc

File tree

7 files changed

+374
-2
lines changed

7 files changed

+374
-2
lines changed

SELECTOR_INFO.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,69 @@ Description: "Submit" button
11821182
Location: At the bottom of the autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
11831183
Path to .json: modules/data/address_fill.components.json
11841184
```
1185+
```
1186+
Selector Name: name-field
1187+
Selector Data: "input[autocomplete=name]"
1188+
Description: Name field
1189+
Location: Name field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1190+
Path to .json: modules/data/address_fill.components.json
1191+
```
1192+
```
1193+
Selector Name: org-field
1194+
Selector Data: "input[autocomplete=organization]"
1195+
Description: Organization field
1196+
Location: Organization field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1197+
Path to .json: modules/data/address_fill.components.json
1198+
```
1199+
```
1200+
Selector Name: street-field
1201+
Selector Data: "input[autocomplete=street-address]"
1202+
Description: Street field
1203+
Location: Street field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1204+
Path to .json: modules/data/address_fill.components.json
1205+
```
1206+
```
1207+
Selector Name: add-level2-field
1208+
Selector Data: "input[autocomplete=address-level2]"
1209+
Description: Address level 2 field
1210+
Location: Address level 2 field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1211+
Path to .json: modules/data/address_fill.components.json
1212+
```
1213+
```
1214+
Selector Name: add-level1-field
1215+
Selector Data: "input[autocomplete=address-level1]"
1216+
Description: Address level 1 field
1217+
Location: Address level 1 field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1218+
Path to .json: modules/data/address_fill.components.json
1219+
```
1220+
```
1221+
Selector Name: zip-field
1222+
Selector Data: "input[autocomplete=postal-code]"
1223+
Description: Zip field
1224+
Location: Zip field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1225+
Path to .json: modules/data/address_fill.components.json
1226+
```
1227+
```
1228+
Selector Name: country-field
1229+
Selector Data: "input[autocomplete=country]"
1230+
Description: Country field
1231+
Location: Country field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1232+
Path to .json: modules/data/address_fill.components.json
1233+
```
1234+
```
1235+
Selector Name: email-field
1236+
Selector Data: "input[autocomplete=email]"
1237+
Description: Email field
1238+
Location: Email field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1239+
Path to .json: modules/data/address_fill.components.json
1240+
```
1241+
```
1242+
Selector Name: phone-field
1243+
Selector Data: "input[autocomplete=tel]"
1244+
Description: Phone field
1245+
Location: Phone field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1246+
Path to .json: modules/data/address_fill.components.json
1247+
```
11851248
#### amo_languages
11861249
```
11871250
Selector Name: language-addons-title
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888558"
12+
13+
14+
def test_demo_ad_autofill_name_org(driver: Firefox, region: str):
15+
"""
16+
C2888558 - Verify Autofill functionality when selecting an entry from the dropdown for name/org fields
17+
"""
18+
# Instantiate objects
19+
address_autofill = AddressFill(driver)
20+
address_autofill_popup = AutofillPopup(driver)
21+
util = Utilities()
22+
23+
# Create fake data and fill it in
24+
address_autofill.open()
25+
address_autofill_data = util.fake_autofill_data(region)
26+
address_autofill.save_information_basic(address_autofill_data)
27+
28+
# Click the "Save" button
29+
address_autofill_popup.click_doorhanger_button("save")
30+
31+
# Double inside Name field and select a saved address entry from the dropdown
32+
address_autofill.double_click("form-field", labels=["name"])
33+
34+
# 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+
38+
# Verify autofill data
39+
address_autofill.verify_autofill_data(address_autofill_data, region, util)
40+
41+
# Double inside Name field and select clear form autofill
42+
address_autofill.double_click("form-field", labels=["name"])
43+
address_autofill_popup.click_clear_form_option()
44+
45+
# Double inside Organization field and select a saved address entry from the dropdown
46+
address_autofill.double_click("form-field", labels=["organization"])
47+
48+
# 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+
52+
# Verify autofill data
53+
address_autofill.verify_autofill_data(address_autofill_data, region, util)
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888569"
12+
13+
14+
def test_demo_ad_autofill_phone_email(driver: Firefox, region: str):
15+
"""
16+
C2888569 - Verify Autofill functionality when selecting an entry from the dropdown for tele/email fields
17+
"""
18+
# Instantiate objects
19+
address_autofill = AddressFill(driver)
20+
address_autofill_popup = AutofillPopup(driver)
21+
util = Utilities()
22+
23+
# Create fake data and fill it in
24+
address_autofill.open()
25+
address_autofill_data = util.fake_autofill_data(region)
26+
address_autofill.save_information_basic(address_autofill_data)
27+
28+
# Click the "Save" button
29+
address_autofill_popup.click_doorhanger_button("save")
30+
31+
# Double inside phone field and select a saved address entry from the dropdown
32+
address_autofill.double_click("form-field", labels=["tel"])
33+
34+
# 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+
38+
# Verify autofill data
39+
address_autofill.verify_autofill_data(address_autofill_data, region, util)
40+
41+
# Double inside phone field and select clear form autofill
42+
address_autofill.double_click("form-field", labels=["tel"])
43+
address_autofill_popup.click_clear_form_option()
44+
45+
# Double inside email field and select a saved address entry from the dropdown
46+
address_autofill.double_click("form-field", labels=["email"])
47+
48+
# 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+
52+
# Verify autofill data
53+
address_autofill.verify_autofill_data(address_autofill_data, region, util)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object import AboutPrefs, CreditCardFill
6+
from modules.util import BrowserActions, Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2886601"
12+
13+
14+
def test_cc_yellow_highlight(driver: Firefox):
15+
"""
16+
C2886601 - Verify the yellow highlight appears on autofilled fields and make sure csv field is not highlighted
17+
"""
18+
19+
# Initialize objects
20+
util = Utilities()
21+
about_prefs = AboutPrefs(driver, category="privacy")
22+
about_prefs_cc_popup = AboutPrefs(driver)
23+
browser_action_obj = BrowserActions(driver)
24+
credit_card_fill_obj = CreditCardFill(driver)
25+
autofill_popup = AutofillPopup(driver)
26+
27+
# Save a credit card in about:preferences
28+
about_prefs.open()
29+
iframe = about_prefs.get_saved_payments_popup_iframe()
30+
browser_action_obj.switch_to_iframe_context(iframe)
31+
credit_card_sample_data = util.fake_credit_card_data()
32+
about_prefs_cc_popup.click_on(
33+
"panel-popup-button", labels=["autofill-manage-add-button"]
34+
)
35+
about_prefs.fill_cc_panel_information(credit_card_sample_data)
36+
37+
# Open the credit card fill form and trigger the autofill option
38+
credit_card_fill_obj.open()
39+
credit_card_fill_obj.click_on("form-field", labels=["cc-name"])
40+
autofill_popup.click_autofill_form_option()
41+
42+
# Verify that all fields have the yellow highlight, except for the cc-csv field
43+
credit_card_fill_obj.verify_field_yellow_highlights()

l10n_CM/region/US.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"region": "US",
3-
"tests": []
2+
"region": "US",
3+
"tests": [
4+
]
45
}

modules/data/address_fill.components.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,59 @@
1010
"selectorData": "input[type='{name}']",
1111
"strategy": "css",
1212
"groups": []
13+
},
14+
15+
"name-field": {
16+
"selectorData": "input[autocomplete=name]",
17+
"strategy": "css",
18+
"groups": []
19+
},
20+
21+
"org-field": {
22+
"selectorData": "input[autocomplete=organization]",
23+
"strategy": "css",
24+
"groups": []
25+
},
26+
27+
"street-field": {
28+
"selectorData": "input[autocomplete=street-address]",
29+
"strategy": "css",
30+
"groups": []
31+
},
32+
33+
"add-level2-field": {
34+
"selectorData": "input[autocomplete=address-level2]",
35+
"strategy": "css",
36+
"groups": []
37+
},
38+
39+
"add-level1-field": {
40+
"selectorData": "input[autocomplete=address-level1]",
41+
"strategy": "css",
42+
"groups": []
43+
},
44+
45+
"zip-field": {
46+
"selectorData": "input[autocomplete=postal-code]",
47+
"strategy": "css",
48+
"groups": []
49+
},
50+
51+
"country-field": {
52+
"selectorData": "input[autocomplete=country]",
53+
"strategy": "css",
54+
"groups": []
55+
},
56+
57+
"email-field": {
58+
"selectorData": "input[autocomplete=email]",
59+
"strategy": "css",
60+
"groups": []
61+
},
62+
63+
"phone-field": {
64+
"selectorData": "input[autocomplete=tel]",
65+
"strategy": "css",
66+
"groups": []
1367
}
1468
}

0 commit comments

Comments
 (0)