Skip to content

Commit 089409f

Browse files
sync fxa first fix
1 parent 2c8978a commit 089409f

File tree

8 files changed

+44
-13
lines changed

8 files changed

+44
-13
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"

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…"

modules/data/fxa_home.components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"login-email-input": {
3-
"selectorData": "input[type='email']",
3+
"selectorData": "input[name='email']",
44
"strategy": "css",
55
"groups": [
66
"requiredForPage"

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_object_fxa_home.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def create_new_account(self, password: str, age=30) -> BasePage:
3232
"""Fill out the password and age fields, then submit and wait for code"""
3333
self.fill("signup-password-input", password, press_enter=False)
3434
self.fill("signup-password-repeat-input", password, press_enter=False)
35-
self.fill("age-input", str(age), press_enter=False)
35+
# self.fill("age-input", str(age), press_enter=False)
3636
self.element_clickable("submit-button")
3737
self.get_element("submit-button").click()
3838
self.element_has_text("card-header", "Enter confirmation code")
@@ -42,7 +42,7 @@ def fill_otp_code(self, otp: str) -> BasePage:
4242
"""Given an OTP, confirm the account, submit, and wait for account activation"""
4343
self.fill("otp-input", otp, press_enter=False)
4444
self.get_element("submit-button").click()
45-
self.element_exists("connected-heading")
45+
# self.element_exists("connected-heading")
4646
return self
4747

4848
def finish_account_setup(self, password: str) -> BasePage:

modules/testrail_integration.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,12 @@ def organize_l10n_entries(
392392
if not test_results[category].get(run_id):
393393
test_results[category][run_id] = []
394394
test_results[category][run_id].append(
395-
{"suite_id": suite_id, "site": site, "test_case": test_case, "duration": f"{duration}s"}
395+
{
396+
"suite_id": suite_id,
397+
"site": site,
398+
"test_case": test_case,
399+
"duration": f"{duration}s",
400+
}
396401
)
397402

398403
return test_results

tests/sync_and_fxa/conftest.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ def new_fxa_prep(fxa_url: str, acct_password: str) -> FxaPrep:
6262
prep = FxaPrep(fxa_url, acct_password)
6363
prep.restmail.clear()
6464
yield prep
65-
try:
66-
prep.destroy_account()
67-
except OutOfProtocolError as e:
68-
logging.info(repr(e))
65+
prep.destroy_account()
6966

7067

7168
@pytest.fixture()

tests/sync_and_fxa/test_new_fxa.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ def test_sync_new_fxa(driver: Firefox, fxa_url: str, new_fxa_prep: dict, get_otp
3939
fxa.create_new_account(new_fxa_prep.password)
4040
otp = get_otp_code(new_fxa_prep.restmail)
4141
fxa.fill_otp_code(otp)
42-
fxa.get_element("continue-browsing-link").click()
42+
# fxa.get_element("continue-browsing-link").click()
4343

4444
# Walk through the Finish Account Setup flow and confirm sync
45-
fxa.driver.get(fxa_url)
46-
fxa.get_element("submit-button").click()
47-
panel_ui.manage_fxa_account()
45+
panel_ui.manage_fxa_finish_sign_in()
4846
fxa.finish_account_setup(new_fxa_prep.password)
4947
panel_ui.confirm_sync_in_progress()

0 commit comments

Comments
 (0)