Skip to content

Commit c3df632

Browse files
committed
merge changes from main in
2 parents d269289 + 0e4dab9 commit c3df632

30 files changed

+935
-48
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pytest-html = "*"
1515
pypom = "*"
1616
jsonpath-ng = "*"
1717
pillow = "*"
18+
pyfxa = "*"
1819

1920
[dev-packages]
2021
werkzeug = "*"

modules/browser_object_autofill_popup.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ def verify_no_popup_panel(self):
2626
element = self.get_element("autofill-panel")
2727
self.expect_not(EC.element_to_be_clickable(element))
2828

29-
def hover_over_element(self, element: str):
30-
"""
31-
Hover over the specified element.
32-
Parameters: element (str): The element to hover over.
33-
"""
34-
with self.driver.context(self.driver.CONTEXT_CHROME):
35-
self.actions.move_to_element(element).perform()
36-
return self
37-
3829
def get_nth_element(self, index: str) -> WebElement:
3930
"""
4031
Get the nth element from the autocomplete list.

modules/browser_object_panel_ui.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,30 @@ def navigate_to_about_addons(self):
6565
self.select_panel_setting("customize-toolbar")
6666
with self.driver.context(self.driver.CONTEXT_CHROME):
6767
self.get_element("manage-themes").click()
68+
69+
def click_sync_sign_in_button(self) -> BasePage:
70+
"""
71+
Click FxA sync button.
72+
"""
73+
with self.driver.context(self.driver.CONTEXT_CHROME):
74+
self.open_panel_menu()
75+
self.select_panel_setting("fxa-sign-in")
76+
return self
77+
78+
def manage_fxa_account(self) -> BasePage:
79+
"""
80+
Open the FxA management flow.
81+
"""
82+
with self.driver.context(self.driver.CONTEXT_CHROME):
83+
self.click_sync_sign_in_button()
84+
self.get_element("fxa-manage-account-button").click()
85+
return self
86+
87+
def confirm_sync_in_progress(self) -> BasePage:
88+
"""
89+
Check that FxA Sync Label is set to "Syncing…"
90+
"""
91+
with self.driver.context(self.driver.CONTEXT_CHROME):
92+
self.click_sync_sign_in_button()
93+
self.element_has_text("fxa-sync-label", "Syncing")
94+
return self

modules/browser_object_tabbar.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
from typing import Union
33

4-
from selenium.common.exceptions import NoSuchElementException, TimeoutException
4+
from selenium.common.exceptions import NoSuchElementException
55
from selenium.webdriver import Keys
66
from selenium.webdriver.common.by import By
77
from selenium.webdriver.remote.webelement import WebElement
@@ -237,12 +237,3 @@ def get_bar_y():
237237
self.actions.move_by_offset(0, (sign * pixels))
238238
self.actions.release()
239239
self.actions.perform()
240-
241-
def wait_for_num_tabs(self, num_tabs: int) -> BasePage:
242-
"""
243-
Waits for the driver.window_handles to be updated accordingly with the number of tabs requested
244-
"""
245-
try:
246-
self.wait.until(lambda _: len(self.driver.window_handles) == num_tabs)
247-
except TimeoutException:
248-
logging.warn("Timeout waiting for the number of windows to be:", num_tabs)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"error-title": {
3+
"selectorData": ".title-text[data-l10n-id='dnsNotFound-title']",
4+
"strategy": "css",
5+
"groups": []
6+
},
7+
8+
"error-short-description": {
9+
"selectorData": "errorShortDesc",
10+
"strategy": "id",
11+
"groups": []
12+
},
13+
14+
"error-suggestion-link": {
15+
"selectorData": "#errorShortDesc a[data-l10n-name='website']",
16+
"strategy": "css",
17+
"groups": []
18+
},
19+
20+
"error-long-description-items": {
21+
"selectorData": "#errorLongDesc li",
22+
"strategy": "css",
23+
"groups": []
24+
},
25+
26+
"try-again-button": {
27+
"selectorData": "#netErrorButtonContainer #neterrorTryAgainButton",
28+
"strategy": "css",
29+
"groups": []
30+
}
31+
32+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"login-email-input": {
3+
"selectorData": "input[type='email']",
4+
"strategy": "css",
5+
"groups": [
6+
"requiredForPage"
7+
]
8+
},
9+
10+
"submit-button": {
11+
"selectorData": "button[type='submit']",
12+
"strategy": "css",
13+
"groups": [
14+
"doNotCache"
15+
]
16+
},
17+
18+
"password-input": {
19+
"selectorData": "[data-testid='new-password-input-field']",
20+
"strategy": "css",
21+
"groups": []
22+
},
23+
24+
"password-repeat-input": {
25+
"selectorData": "[data-testid='verify-password-input-field']",
26+
"strategy": "css",
27+
"groups": []
28+
},
29+
30+
"age-input": {
31+
"selectorData": "[data-testid='age-input-field']",
32+
"strategy": "css",
33+
"groups": []
34+
},
35+
36+
"card-header": {
37+
"selectorData": "card-header",
38+
"strategy": "class",
39+
"groups": []
40+
},
41+
42+
"otp-input": {
43+
"selectorData": "[data-testid='confirm-signup-code-input-field']",
44+
"strategy": "css",
45+
"groups": []
46+
},
47+
48+
"connected-heading": {
49+
"selectorData": "fxa-connected-heading",
50+
"strategy": "id",
51+
"groups": []
52+
},
53+
54+
"continue-browsing-link": {
55+
"selectorData": "cad-not-now",
56+
"strategy": "id",
57+
"groups": []
58+
},
59+
60+
"login-password-input": {
61+
"selectorData": "input#password",
62+
"strategy": "css",
63+
"groups": []
64+
},
65+
66+
"sign-in-button": {
67+
"selectorData": "use-logged-in",
68+
"strategy": "id",
69+
"groups": []
70+
}
71+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"body": {
3+
"selectorData": "body",
4+
"strategy": "tag",
5+
"groups": []
6+
}
7+
}

modules/data/navigation.components.json

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
"refresh-intervention-card": {
5353
"selectorData": "div[tip-type=\"intervention_refresh\"]",
5454
"strategy": "css",
55-
"groups": []
55+
"groups": [
56+
"doNotCache"
57+
]
5658
},
5759

5860
"fx-refresh-text": {
@@ -79,6 +81,12 @@
7981
"groups": []
8082
},
8183

84+
"fx-refresh-menu-get-help-item-get-help": {
85+
"selectorData": "urlbarView-result-menuitem",
86+
"strategy": "class",
87+
"groups": []
88+
},
89+
8290
"search-engine-suggestion-row": {
8391
"selectorData": "div[class=\"urlbarView-row\"][type=\"search_engine\"]",
8492
"strategy": "css",
@@ -134,7 +142,13 @@
134142
"groups": []
135143
},
136144

137-
"addon-suggestion": {
145+
"search-results-container": {
146+
"selectorData": "urlbar-results",
147+
"strategy": "id",
148+
"groups": []
149+
},
150+
151+
"addon-suggestion": {
138152
"selectorData": "div.urlbarView-row[type='rust_amo'] span.urlbarView-title.urlbarView-overflowable",
139153
"strategy": "css",
140154
"groups": []
@@ -158,5 +172,29 @@
158172
"selectorData": ".//*[@type='autofill_adaptive']",
159173
"strategy": "xpath",
160174
"groups": []
175+
},
176+
177+
"sponsored-site-card": {
178+
"selectorData": "top-site-outer",
179+
"strategy": "class",
180+
"groups": []
181+
},
182+
183+
"sponsored-site-card-menu-button": {
184+
"selectorData": "button[class=\"context-menu-button icon\"]",
185+
"strategy": "css",
186+
"groups": []
187+
},
188+
189+
"sponsored-site-context-menu": {
190+
"selectorData": "context-menu",
191+
"strategy": "class",
192+
"groups": []
193+
},
194+
195+
"sponsored-site-context-menu-list": {
196+
"selectorData": "ul[class=\"context-menu-list\"]",
197+
"strategy": "css",
198+
"groups": []
161199
}
162-
}
200+
}

modules/data/panel_ui.components.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,40 @@
44
"selectorData": "PanelUI-menu-button",
55
"strategy": "id",
66
"groups": [
7-
"requiredForPage"
7+
"requiredForPage",
8+
"doNotCache"
9+
]
10+
},
11+
12+
"sync-user-button": {
13+
"selectorData": "toolbarbutton[id='fxa-toolbar-menu-button']",
14+
"strategy": "css",
15+
"groups": []
16+
},
17+
18+
"fxa-manage-account-button": {
19+
"selectorData": "fxa-manage-account-button",
20+
"strategy": "id",
21+
"groups": []
22+
},
23+
24+
"sync-fxa": {
25+
"selectorData": "appMenu-fxa-status2",
26+
"strategy": "id",
27+
"groups": []
28+
},
29+
30+
"fxa-sign-in": {
31+
"selectorData": "#appMenu-fxa-status2 toolbarbutton",
32+
"strategy": "css",
33+
"groups": []
34+
},
35+
36+
"fxa-sync-label": {
37+
"selectorData": "syncnow-label",
38+
"strategy": "class",
39+
"groups": [
40+
"doNotCache"
841
]
942
},
1043

0 commit comments

Comments
 (0)