Skip to content

Commit 5075555

Browse files
Hani YacoubHani Yacoub
authored andcommitted
Merge main
2 parents bde4cfd + b118750 commit 5075555

16 files changed

+238
-175
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pypom = "2.2.4"
1616
taskcluster-taskgraph = "==9.0.0"
1717
jsonpath-ng = "1.6.1"
1818
pillow = "<10.5"
19-
pyfxa = "0.7.0"
19+
pyfxa = "0.8.1"
2020
ruff = "0.9.6"
2121
pytest-rerunfailures = "14.0"
2222
slack-sdk = "3.31.0"

SELECTOR_INFO.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,6 +2042,34 @@ Location: In the FxA signin page flow
20422042
Path to .json: modules/data/fxa_home.components.json
20432043
```
20442044
```
2045+
Selector Name: do-it-later-button
2046+
Selector Data: "inline_recovery_key_setup_create_do_it_later"
2047+
Description: Coninute fxa account creation flow
2048+
Location: In the FxA signin page flow
2049+
Path to .json: modules/data/fxa_home.components.json
2050+
```
2051+
```
2052+
Selector Name: login-password-input
2053+
Selector Data: "choice-pair-not-now"
2054+
Description: Dont pair with phone now
2055+
Location: In the FxA signin page flow
2056+
Path to .json: modules/data/fxa_home.components.json
2057+
```
2058+
```
2059+
Selector Name: signed-in-status
2060+
Selector Data: "div[role='status']"
2061+
Description: Sign in status
2062+
Location: In the FxA signin page flow
2063+
Path to .json: modules/data/fxa_home.components.json
2064+
```
2065+
```
2066+
Selector Name: manage-sync-button
2067+
Selector Data: "signup_confirmed_sync_manage_sync_button"
2068+
Description: sign up and sync confirmation
2069+
Location: In the FxA signin page flow
2070+
Path to .json: modules/data/fxa_home.components.json
2071+
```
2072+
```
20452073
Selector Name: signin-otp-input
20462074
Selector Data: "[data-testid='signin-token-code-input-field']"
20472075
Description: The FxAccount One Time Password entry field

choose_l10n_ci_set.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def select_l10n_mappings(beta_version):
8989
beta_split = (beta_version % 3) + 1
9090
if os.path.exists(f"l10n_CM/beta_run_splits/l10n_split_{beta_split}.json"):
9191
with open(f"l10n_CM/beta_run_splits/l10n_split_{beta_split}.json", "r") as f:
92-
return json.load(f)
92+
current_split_mappings = {k: set(v) for k, v in json.load(f).items()}
93+
return current_split_mappings
9394
else:
9495
return valid_l10n_mappings()
9596

l10n_CM/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ The harness relies on several configuration files:
3131
]
3232
}
3333
```
34+
**NOTE**: If both the address and credit card tests are skipped for the site, do not add it to the region files.
35+
3436
- **Site Test Configuration**: Located in `constants/{site_name}.json` or `constants/{site_name}/{region}.json`, defining site-specific test configurations and skipped tests. Here we map the attributes for either `AutofillAddressBase` or `CreditCardBase` to the corresponding selectors.
3537

3638
```aiignore

l10n_CM/constants/calvinklein/US/calvinklein_ad.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
"email": "0c994dc2-4e0b-4734-8582-74ce9a1bff55",
1111
"telephone": "e1f86567-396f-473c-8666-47447f52d722"
1212
},
13-
1413
"form_field": "*[data-moz-autofill-inspect-id='{given_name}']",
15-
"skip": "True",
1614
"fields": [
1715
"5d2af5cb-8f6d-4fdc-8ae5-21c7e5e97a43",
1816
"82900c67-963c-40f8-b0ef-c986a2accc43",

modules/browser_object_panel_ui.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,21 @@ def click_sync_sign_in_button(self) -> BasePage:
7171
self.click_on("fxa-sign-in")
7272
return self
7373

74+
def open_account_toolbar(self):
75+
"""
76+
Open the FxA account toolbar.
77+
"""
78+
self.click_on("sync-user-button")
79+
return self
80+
81+
def click_finish_sign_in_button(self):
82+
"""
83+
Click FxA finish sign in button.
84+
"""
85+
self.open_account_toolbar()
86+
self.click_on("fxa-finish-sign-in")
87+
return self
88+
7489
def log_out_fxa(self) -> BasePage:
7590
"""
7691
Click FxA signout button.
@@ -89,6 +104,15 @@ def manage_fxa_account(self) -> BasePage:
89104
self.get_element("fxa-manage-account-button").click()
90105
return self
91106

107+
@BasePage.context_chrome
108+
def manage_fxa_finish_sign_in(self):
109+
"""
110+
Open the FxA management flow to finish sign in.
111+
"""
112+
self.open_account_toolbar()
113+
self.click_on("fxa-manage-account-button")
114+
return self
115+
92116
def confirm_sync_in_progress(self) -> BasePage:
93117
"""
94118
Check that FxA Sync Label is set to "Syncing…"
Lines changed: 89 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,91 @@
11
{
2-
"login-email-input": {
3-
"selectorData": "input[type='email']",
4-
"strategy": "css",
5-
"groups": [
6-
"requiredForPage"
7-
]
8-
9-
},
10-
11-
"submit-button": {
12-
"selectorData": "button[type='submit']",
13-
"strategy": "css",
14-
"groups": [
15-
"doNotCache"
16-
]
17-
},
18-
19-
"signup-password-input": {
20-
"selectorData": "[data-testid='new-password-input-field']",
21-
"strategy": "css",
22-
"groups": []
23-
},
24-
25-
"signup-password-repeat-input": {
26-
"selectorData": "[data-testid='verify-password-input-field']",
27-
"strategy": "css",
28-
"groups": []
29-
},
30-
31-
"age-input": {
32-
"selectorData": "[data-testid='age-input-field']",
33-
"strategy": "css",
34-
"groups": []
35-
},
36-
37-
"card-header": {
38-
"selectorData": "card-header",
39-
"strategy": "class",
40-
"groups": []
41-
},
42-
43-
"signup-otp-input": {
44-
"selectorData": "[data-testid='confirm-signup-code-input-field']",
45-
"strategy": "css",
46-
"groups": []
47-
},
48-
49-
"signin-otp-input": {
50-
"selectorData": "[data-testid='signin-token-code-input-field']",
51-
"strategy": "css",
52-
"groups": []
53-
},
54-
55-
"otp-input": {
56-
"selectorData": "input[inputmode='numeric']",
57-
"strategy": "css",
58-
"groups": []
59-
},
60-
61-
"connected-heading": {
62-
"selectorData": "fxa-connected-heading",
63-
"strategy": "id",
64-
"groups": []
65-
},
66-
67-
"continue-browsing-link": {
68-
"selectorData": "cad-not-now",
69-
"strategy": "id",
70-
"groups": []
71-
},
72-
73-
"login-password-input": {
74-
"selectorData": "input[type='password']",
75-
"strategy": "css",
76-
"groups": []
77-
},
78-
79-
"sign-in-button": {
80-
"selectorData": "use-logged-in",
81-
"strategy": "id",
82-
"groups": []
83-
}
2+
"login-email-input": {
3+
"selectorData": "input[name='email']",
4+
"strategy": "css",
5+
"groups": [
6+
"requiredForPage"
7+
]
8+
},
9+
"submit-button": {
10+
"selectorData": "button[type='submit']",
11+
"strategy": "css",
12+
"groups": [
13+
"doNotCache"
14+
]
15+
},
16+
"signup-password-input": {
17+
"selectorData": "[data-testid='new-password-input-field']",
18+
"strategy": "css",
19+
"groups": []
20+
},
21+
"signup-password-repeat-input": {
22+
"selectorData": "[data-testid='verify-password-input-field']",
23+
"strategy": "css",
24+
"groups": []
25+
},
26+
"age-input": {
27+
"selectorData": "[data-testid='age-input-field']",
28+
"strategy": "css",
29+
"groups": []
30+
},
31+
"card-header": {
32+
"selectorData": "card-header",
33+
"strategy": "class",
34+
"groups": []
35+
},
36+
"signup-otp-input": {
37+
"selectorData": "[data-testid='confirm-signup-code-input-field']",
38+
"strategy": "css",
39+
"groups": []
40+
},
41+
"signin-otp-input": {
42+
"selectorData": "[data-testid='signin-token-code-input-field']",
43+
"strategy": "css",
44+
"groups": []
45+
},
46+
"otp-input": {
47+
"selectorData": "input[inputmode='numeric']",
48+
"strategy": "css",
49+
"groups": []
50+
},
51+
"connected-heading": {
52+
"selectorData": "fxa-connected-heading",
53+
"strategy": "id",
54+
"groups": []
55+
},
56+
"continue-browsing-link": {
57+
"selectorData": "cad-not-now",
58+
"strategy": "id",
59+
"groups": []
60+
},
61+
"login-password-input": {
62+
"selectorData": "input[type='password']",
63+
"strategy": "css",
64+
"groups": []
65+
},
66+
"signed-in-status": {
67+
"selectorData": "div[role='status']",
68+
"strategy": "css",
69+
"groups": []
70+
},
71+
"manage-sync-button": {
72+
"selectorData": "signup_confirmed_sync_manage_sync_button",
73+
"strategy": "id",
74+
"groups": []
75+
},
76+
"do-it-later-button": {
77+
"selectorData": "inline_recovery_key_setup_create_do_it_later",
78+
"strategy": "id",
79+
"groups": []
80+
},
81+
"not-now-button": {
82+
"selectorData": "choice-pair-not-now",
83+
"strategy": "id",
84+
"groups": []
85+
},
86+
"sign-in-button": {
87+
"selectorData": "use-logged-in",
88+
"strategy": "id",
89+
"groups": []
90+
}
8491
}

modules/data/panel_ui.components.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
"strategy": "css",
3939
"groups": []
4040
},
41+
"fxa-finish-sign-in": {
42+
"selectorData": "appMenu-header-description",
43+
"strategy": "id",
44+
"groups": []
45+
},
4146

4247
"fxa-sync-label": {
4348
"selectorData": "syncnow-label",
@@ -57,6 +62,8 @@
5762
"groups": []
5863
},
5964

65+
66+
6067
"customize-toolbar": {
6168
"selectorData": "overflowMenu-customize-button",
6269
"strategy": "id",

modules/page_base.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from typing import List, Union
1212

1313
from pynput.keyboard import Controller, Key
14-
from pynput.mouse import Button, Controller as MouseController
14+
from pynput.mouse import Button
15+
from pynput.mouse import Controller as MouseController
1516
from pypom import Page
1617
from selenium.common import NoAlertPresentException
1718
from selenium.common.exceptions import (
@@ -454,6 +455,11 @@ def title_contains(self, url_part: str) -> Page:
454455
self.expect(EC.title_contains(url_part))
455456
return self
456457

458+
def title_is(self, url_part: str) -> Page:
459+
"""Expect helper: wait until driver URL is given text or timeout"""
460+
self.expect(EC.title_is(url_part))
461+
return self
462+
457463
def verify_opened_image_url(self, url_substr: str, pattern: str) -> Page:
458464
"""
459465
Given a part of a URL and a regex, wait for that substring to exist in
@@ -559,7 +565,9 @@ def triple_click(self, reference: Union[str, tuple, WebElement], labels=[]) -> P
559565
"""Actions helper: perform triple-click on a given element"""
560566
return self.multi_click(3, reference, labels)
561567

562-
def control_click(self, reference: Union[str, tuple, WebElement], labels=[]) -> Page:
568+
def control_click(
569+
self, reference: Union[str, tuple, WebElement], labels=[]
570+
) -> Page:
563571
"""Actions helper: perform control-click on given element"""
564572
element = self.fetch(reference, labels)
565573
if self.sys_platform() == "Darwin":
@@ -569,10 +577,9 @@ def control_click(self, reference: Union[str, tuple, WebElement], labels=[]) ->
569577
self.actions.key_down(mod_key).click(element).key_up(mod_key).perform()
570578
return self
571579

572-
def middle_click(self, reference: Union[str, tuple, WebElement], labels =[]):
573-
"""Perform a middle mouse click on desired element"""
574-
with self.driver.context(self.driver.CONTEXT_CONTENT):
575-
self.driver.maximize_window()
580+
def middle_click(self, reference: Union[str, tuple, WebElement], labels=[]):
581+
"""Actions helper: Perform a middle mouse click on desired element"""
582+
with self.driver.context(self.context_id):
576583
mouse = MouseController()
577584
element = self.fetch(reference, labels)
578585

@@ -584,14 +591,24 @@ def middle_click(self, reference: Union[str, tuple, WebElement], labels =[]):
584591
outer_height = self.driver.execute_script("return window.outerHeight;")
585592
chrome_height = outer_height - inner_height
586593

587-
element_x = window_position['x'] + element_location['x'] + (element_size['width'] / 2)
588-
element_y = window_position['y'] + element_location['y'] + (element_size['height'] / 2) + chrome_height
594+
element_x = (
595+
window_position["x"]
596+
+ element_location["x"]
597+
+ (element_size["width"] / 2)
598+
)
599+
element_y = (
600+
window_position["y"]
601+
+ element_location["y"]
602+
+ (element_size["height"] / 2)
603+
+ chrome_height
604+
)
589605
mouse.position = (element_x, element_y)
590606

591-
time.sleep(1)
607+
# Need a short wait to ensure the mouse move completes, then middle click
608+
time.sleep(0.5)
592609
mouse.click(Button.middle, 1)
593610
return self
594-
611+
595612
def context_click(
596613
self, reference: Union[str, tuple, WebElement], labels=[]
597614
) -> Page:

0 commit comments

Comments
 (0)