Skip to content

Commit 77d042c

Browse files
fix for preview test
1 parent c4f4cb9 commit 77d042c

File tree

4 files changed

+214
-193
lines changed

4 files changed

+214
-193
lines changed

SELECTOR_INFO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ Path to .json: modules/data/autofill_popup.components.json
13761376
```
13771377
```
13781378
Selector Name: cc-preview-form-container
1379-
Selector Data: "credit-card-save-update-notification-content"
1379+
Selector Data: ".autocomplete-richlistbox richlistitem"
13801380
Description: Form container that is hidden in chrome context. Used to verify hover preview data
13811381
Location: Inside chrome context, holds the data that would be showed as a preview when autofill is hovered.
13821382
Path to .json: modules/data/autofill_popup.components.json

l10n_CM/Unified/test_demo_cc_2_preview.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@ def test_cc_preview(
4242
# Open credit card form page
4343
credit_card_fill_obj.open()
4444

45-
# Verify the autofill preview
46-
for field in CreditCardFill.fields:
47-
credit_card_fill_obj.click_on("form-field", labels=[field])
48-
autofill_popup.ensure_autofill_dropdown_visible()
49-
autofill_popup.hover("select-form-option")
50-
credit_card_fill_obj.verify_autofill_cc_data_on_hover(
51-
credit_card_sample_data, autofill_popup
45+
# Hover over each field and check data preview
46+
fields_to_test = ["cc-name", "cc-number", "cc-exp-month", "cc-exp-year"]
47+
for field in fields_to_test:
48+
credit_card_fill_obj.check_cc_autofill_preview_for_field(
49+
field, credit_card_sample_data, autofill_popup
5250
)
5351

5452
credit_card_fill_obj.click_on("form-field", labels=["cc-csc"])
Lines changed: 144 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,147 @@
11
{
2-
"context": "chrome",
3-
"do-not-cache": true,
4-
"autofill-panel": {
5-
"selectorData": "PopupAutoComplete",
6-
"strategy": "id",
7-
"groups": []
8-
},
9-
10-
"doorhanger-save-button": {
11-
"selectorData": "button[label='Save'].popup-notification-primary-button",
12-
"strategy": "css",
13-
"groups": []
14-
},
15-
16-
"doorhanger-dropdown-button": {
17-
"selectorData": "button[aria-label='More actions']",
18-
"strategy": "css",
19-
"groups": []
20-
},
21-
22-
"doorhanger-dropdown-never-save-cards-button": {
23-
"selectorData": "menuitem[label='Never save cards']",
24-
"strategy": "css",
25-
"groups": []
26-
},
27-
28-
"doorhanger-more-actions-button": {
29-
"selectorData": "[data-l10n-id='popup-notification-more-actions-button']",
30-
"strategy": "css",
31-
"groups": []
32-
},
33-
34-
"doorhanger-never-save-login-button": {
35-
"selectorData": "menuitem[label='Never save']",
36-
"strategy": "css",
37-
"groups": []
38-
},
39-
40-
"doorhanger-update-button": {
41-
"selectorData": "button[label='Update']",
42-
"strategy": "css",
43-
"groups": []
44-
},
45-
46-
"pop-up-component": {
47-
"selectorData": "PopupAutoComplete",
48-
"strategy": "id",
49-
"groups": []
50-
},
51-
52-
"select-form-option": {
53-
"selectorData": ".autocomplete-richlistbox .autocomplete-richlistitem",
54-
"strategy":"css",
55-
"groups": []
56-
},
57-
58-
"select-form-option-by-value": {
59-
"selectorData": ".autocomplete-richlistbox .autocomplete-richlistitem[ac-value='{value}']",
60-
"strategy":"css",
61-
"groups": []
62-
},
63-
64-
"clear-form-option": {
65-
"selectorData": ".autocomplete-richlistbox .autocomplete-richlistitem[ac-value='Clear Autofill Form']",
66-
"strategy":"css",
67-
"groups": []
68-
},
69-
70-
"select-form-option-by-index": {
71-
"selectorData": ".autocomplete-richlistbox .autocomplete-richlistitem:nth-child({index})",
72-
"strategy":"css",
73-
"groups": [
74-
"doNotCache"
75-
]
76-
},
77-
78-
"update-card-info-popup-button": {
79-
"selectorData": "button[label='Update existing card']",
80-
"strategy": "css",
81-
"groups": []
82-
},
83-
84-
"cc-saved-options": {
85-
"selectorData": "option[data-l10n-id='credit-card-label-number-name-expiration-2']",
86-
"strategy": "css",
87-
"groups": []
88-
},
89-
90-
"password-update-doorhanger": {
91-
"selectorData": "//*[contains(@class, 'popup-notification-description') and @popupid='password']",
92-
"strategy": "xpath",
93-
"groups": []
94-
},
95-
96-
"address-save-doorhanger": {
97-
"selectorData": "address-save-update-notification-content",
98-
"strategy": "class",
99-
"groups": []
100-
},
101-
102-
"cc-doorhanger-data": {
103-
"selectorData": "popupnotificationcontent[class='credit-card-save-update-notification-content'] description",
104-
"strategy": "css",
105-
"groups": []
106-
},
107-
108-
"address-doorhanger-email": {
109-
"selectorData": "div.address-save-update-row-container:nth-of-type(2) div p:first-of-type span",
110-
"strategy": "css",
111-
"groups": []
112-
},
113-
114-
"address-doorhanger-phone": {
115-
"selectorData": "div.address-save-update-row-container:nth-of-type(2) div p:nth-of-type(2) span",
116-
"strategy": "css",
117-
"groups": []
118-
},
119-
120-
"address-doorhanger-name": {
121-
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:first-of-type span",
122-
"strategy": "css",
123-
"groups": []
124-
},
125-
126-
"address-doorhanger-org": {
127-
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(2) span",
128-
"strategy": "css",
129-
"groups": []
130-
},
131-
132-
"address-doorhanger-street": {
133-
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(3) span",
134-
"strategy": "css",
135-
"groups": []
136-
},
137-
138-
"address-doorhanger-city": {
139-
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(4) span:nth-of-type(1)",
140-
"strategy": "css",
141-
"groups": []
142-
},
143-
144-
"address-doorhanger-state": {
145-
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(4) span:nth-of-type(3)",
146-
"strategy": "css",
147-
"groups": []
148-
},
149-
150-
"address-doorhanger-zip": {
151-
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(4) span:nth-last-of-type(1)",
152-
"strategy": "css",
153-
"groups": []
154-
},
155-
156-
"address-doorhanger-country": {
157-
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(5) span",
158-
"strategy": "css",
159-
"groups": []
160-
},
161-
162-
"address-preview-form-container": {
163-
"selectorData": "address-save-update-notification-content",
164-
"strategy": "class",
165-
"groups": []
166-
},
167-
168-
"cc-preview-form-container": {
169-
"selectorData": "credit-card-save-update-notification-content",
170-
"strategy": "class",
171-
"groups": []
172-
}
2+
"context": "chrome",
3+
"do-not-cache": true,
4+
"autofill-panel": {
5+
"selectorData": "PopupAutoComplete",
6+
"strategy": "id",
7+
"groups": []
8+
},
9+
"doorhanger-save-button": {
10+
"selectorData": "button[label='Save'].popup-notification-primary-button",
11+
"strategy": "css",
12+
"groups": []
13+
},
14+
"doorhanger-dropdown-button": {
15+
"selectorData": "button[aria-label='More actions']",
16+
"strategy": "css",
17+
"groups": []
18+
},
19+
"doorhanger-dropdown-never-save-cards-button": {
20+
"selectorData": "menuitem[label='Never save cards']",
21+
"strategy": "css",
22+
"groups": []
23+
},
24+
"doorhanger-more-actions-button": {
25+
"selectorData": "[data-l10n-id='popup-notification-more-actions-button']",
26+
"strategy": "css",
27+
"groups": []
28+
},
29+
"doorhanger-never-save-login-button": {
30+
"selectorData": "menuitem[label='Never save']",
31+
"strategy": "css",
32+
"groups": []
33+
},
34+
"doorhanger-update-button": {
35+
"selectorData": "button[label='Update']",
36+
"strategy": "css",
37+
"groups": []
38+
},
39+
"pop-up-component": {
40+
"selectorData": "PopupAutoComplete",
41+
"strategy": "id",
42+
"groups": []
43+
},
44+
"select-form-option": {
45+
"selectorData": ".autocomplete-richlistbox .autocomplete-richlistitem",
46+
"strategy": "css",
47+
"groups": []
48+
},
49+
"select-form-option-by-value": {
50+
"selectorData": ".autocomplete-richlistbox .autocomplete-richlistitem[ac-value='{value}']",
51+
"strategy": "css",
52+
"groups": []
53+
},
54+
"clear-form-option": {
55+
"selectorData": ".autocomplete-richlistbox .autocomplete-richlistitem[ac-value='Clear Autofill Form']",
56+
"strategy": "css",
57+
"groups": []
58+
},
59+
"select-form-option-by-index": {
60+
"selectorData": ".autocomplete-richlistbox .autocomplete-richlistitem:nth-child({index})",
61+
"strategy": "css",
62+
"groups": [
63+
"doNotCache"
64+
]
65+
},
66+
"update-card-info-popup-button": {
67+
"selectorData": "button[label='Update existing card']",
68+
"strategy": "css",
69+
"groups": []
70+
},
71+
"cc-saved-options": {
72+
"selectorData": "option[data-l10n-id='credit-card-label-number-name-expiration-2']",
73+
"strategy": "css",
74+
"groups": []
75+
},
76+
"password-update-doorhanger": {
77+
"selectorData": "//*[contains(@class, 'popup-notification-description') and @popupid='password']",
78+
"strategy": "xpath",
79+
"groups": []
80+
},
81+
"address-save-doorhanger": {
82+
"selectorData": "address-save-update-notification-content",
83+
"strategy": "class",
84+
"groups": []
85+
},
86+
"cc-doorhanger-data": {
87+
"selectorData": "popupnotificationcontent[class='credit-card-save-update-notification-content'] description",
88+
"strategy": "css",
89+
"groups": []
90+
},
91+
"address-doorhanger-email": {
92+
"selectorData": "div.address-save-update-row-container:nth-of-type(2) div p:first-of-type span",
93+
"strategy": "css",
94+
"groups": []
95+
},
96+
"address-doorhanger-phone": {
97+
"selectorData": "div.address-save-update-row-container:nth-of-type(2) div p:nth-of-type(2) span",
98+
"strategy": "css",
99+
"groups": []
100+
},
101+
"address-doorhanger-name": {
102+
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:first-of-type span",
103+
"strategy": "css",
104+
"groups": []
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": []
110+
},
111+
"address-doorhanger-street": {
112+
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(3) span",
113+
"strategy": "css",
114+
"groups": []
115+
},
116+
"address-doorhanger-city": {
117+
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(4) span:nth-of-type(1)",
118+
"strategy": "css",
119+
"groups": []
120+
},
121+
"address-doorhanger-state": {
122+
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(4) span:nth-of-type(3)",
123+
"strategy": "css",
124+
"groups": []
125+
},
126+
"address-doorhanger-zip": {
127+
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(4) span:nth-last-of-type(1)",
128+
"strategy": "css",
129+
"groups": []
130+
},
131+
"address-doorhanger-country": {
132+
"selectorData": "div.address-save-update-row-container:nth-of-type(1) div p:nth-of-type(5) span",
133+
"strategy": "css",
134+
"groups": []
135+
},
136+
"address-preview-form-container": {
137+
"selectorData": "address-save-update-notification-content",
138+
"strategy": "class",
139+
"groups": []
140+
},
141+
"cc-preview-form-container": {
142+
"selectorData": ".autocomplete-richlistbox richlistitem",
143+
"strategy": "css",
144+
"groups": []
145+
}
173146
}
174147

0 commit comments

Comments
 (0)