Skip to content

Commit 7d67685

Browse files
Hani YacoubHani Yacoub
authored andcommitted
resolve conflicts
2 parents dbd358c + 93d1288 commit 7d67685

File tree

7 files changed

+97
-4
lines changed

7 files changed

+97
-4
lines changed

SELECTOR_INFO.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,20 @@ Description: Save address doorhanger phone section
13671367
Location: Address bar
13681368
Path to .json: modules/data/autofill_popup.components.json
13691369
```
1370+
```
1371+
Selector Name: address-doorhanger-name
1372+
Selector Data: "div.address-save-update-row-container:nth-of-type(1) div p:first-of-type span"
1373+
Description: Save address doorhanger name section
1374+
Location: Address bar
1375+
Path to .json: modules/data/autofill_popup.components.json
1376+
```
1377+
```
1378+
Selector Name: address-doorhanger-org
1379+
Selector Data: "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(2) span"
1380+
Description: Save address doorhanger organization section
1381+
Location: Address bar
1382+
Path to .json: modules/data/autofill_popup.components.json
1383+
```
13701384
#### context_menu
13711385
```
13721386
Selector Name: context-menu-search-selected-text
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object_about_pages import AboutConfig
6+
from modules.page_object_autofill import AddressFill
7+
from modules.page_object_prefs import AboutPrefs
8+
from modules.util import Utilities, BrowserActions
9+
10+
11+
@pytest.fixture()
12+
def test_case():
13+
return "2888701"
14+
15+
16+
def test_demo_ad_name_org_captured_in_doorhanger_and_stored(driver: Firefox, region: str):
17+
"""
18+
C2888701 - Verify name/org fields are captured in the Capture Doorhanger and stored in about:preferences
19+
"""
20+
# instantiate objects
21+
address_autofill = AddressFill(driver)
22+
address_autofill_popup = AutofillPopup(driver)
23+
util = Utilities()
24+
about_config = AboutConfig(driver)
25+
browser_action_obj = BrowserActions(driver)
26+
27+
# Change pref value of region
28+
about_config.change_config_value("browser.search.region", region)
29+
30+
# create fake data and fill it in
31+
address_autofill.open()
32+
address_autofill_data = util.fake_autofill_data(region)
33+
address_autofill.save_information_basic(address_autofill_data)
34+
35+
# The "Save address?" doorhanger is displayed
36+
address_autofill_popup.element_visible("address-save-doorhanger")
37+
38+
# containing name field
39+
expected_name = address_autofill_data.name
40+
address_autofill_popup.element_has_text("address-doorhanger-name", expected_name)
41+
42+
# containing org field
43+
expected_org = address_autofill_data.organization
44+
address_autofill_popup.element_has_text("address-doorhanger-org", expected_org)
45+
46+
# Click the "Save" button
47+
address_autofill_popup.click_doorhanger_button("save")
48+
49+
# Navigate to about:preferences#privacy => "Autofill" section
50+
about_prefs = AboutPrefs(driver, category="privacy").open()
51+
iframe = about_prefs.get_save_addresses_popup_iframe()
52+
browser_action_obj.switch_to_iframe_context(iframe)
53+
54+
# The address saved in step 2 is listed in the "Saved addresses" modal: name and organization
55+
elements = about_prefs.get_elements("saved-addresses-values")
56+
expected_values = [expected_name, expected_org]
57+
found_name_org = any(
58+
all(value in element.text for value in expected_values)
59+
for element in elements
60+
)
61+
assert (
62+
found_name_org
63+
), "Name or organization were not found in any of the address entries!"

l10n_CM/region/CA.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
55
"test_demo_cc_add_new_credit_card.py",
66
"test_demo_ad_doorhanger_shown_on_valid_address_submission.py",
7-
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored"
7+
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py",
8+
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py"
89
]
910
}

l10n_CM/region/DE.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
55
"test_demo_cc_add_new_credit_card.py",
66
"test_demo_ad_doorhanger_shown_on_valid_address_submission.py",
7-
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored"
7+
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py",
8+
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py"
89
]
910
}

l10n_CM/region/FR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
55
"test_demo_cc_add_new_credit_card.py",
66
"test_demo_ad_doorhanger_shown_on_valid_address_submission.py",
7-
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored"
7+
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py",
8+
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py"
89
]
910
}

l10n_CM/region/US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
55
"test_demo_cc_add_new_credit_card.py",
66
"test_demo_ad_doorhanger_shown_on_valid_address_submission.py",
7-
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored"
7+
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py",
8+
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py"
89
]
910
}

modules/data/autofill_popup.components.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@
9595
"selectorData": "div.address-save-update-row-container:nth-of-type(2) div p:nth-of-type(2) span",
9696
"strategy": "css",
9797
"groups": []
98+
},
99+
100+
"address-doorhanger-name": {
101+
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:first-of-type span",
102+
"strategy": "css",
103+
"groups": []
104+
},
105+
106+
"address-doorhanger-org": {
107+
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(2) span",
108+
"strategy": "css",
109+
"groups": []
98110
}
99111
}
100112

0 commit comments

Comments
 (0)