Skip to content

Commit b6fe182

Browse files
committed
merge changes in
2 parents d276c20 + bca2479 commit b6fe182

19 files changed

+249
-211
lines changed

.github/workflows/smoke.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Mac and Windows Smoke
2+
3+
run-name: ${{ github.actor }} is running smoke tests
4+
on:
5+
push:
6+
branches: ["bc/gha"]
7+
pull_request:
8+
types:
9+
- created
10+
jobs:
11+
Smoke-Windows:
12+
runs-on: windows-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
- name: Set up Python 3.13
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: "3.11"

modules/browser_object.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from modules.browser_object_credit_card_popup import *
44
from modules.browser_object_devtools import *
55
from modules.browser_object_find_toolbar import *
6+
from modules.browser_object_hyperlink_context_menu import *
67
from modules.browser_object_image_context_menu import *
78
from modules.browser_object_navigation import *
89
from modules.browser_object_panel_ui import *

modules/browser_object_context_menu.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ class ContextMenu(BasePage):
1212

1313
URL_TEMPLATE = ""
1414

15-
def get_context_item(self, item: str) -> WebElement:
16-
"""
17-
Gets the context menu item from the context menu
18-
"""
19-
with self.driver.context(self.driver.CONTEXT_CHROME):
20-
return self.get_element(item)
21-
2215
def click_context_item(
2316
self, reference: Union[str, tuple, WebElement], labels=[]
2417
) -> BasePage:
@@ -28,11 +21,3 @@ def click_context_item(
2821
with self.driver.context(self.driver.CONTEXT_CHROME):
2922
self.fetch(reference, labels=labels).click()
3023
return self
31-
32-
def click_and_hide(
33-
self, reference: Union[str, tuple, WebElement], labels=[]
34-
) -> BasePage:
35-
with self.driver.context(self.driver.CONTEXT_CHROME):
36-
self.fetch(reference, labels=labels).click()
37-
self.hide_popup_by_child_node(reference, labels=labels)
38-
return self

modules/browser_object_tabbar.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,19 @@ def get_tab(self, identifier: Union[str, int]) -> Union[WebElement, None]:
104104
else:
105105
# if we get an unexpected type, we shouldn't assume that the user wants sys exit
106106
# but we have to cause problems for them nonetheless
107-
assert False
107+
assert False, "Error getting tab root"
108108
tab = None
109109
return tab
110110

111+
def is_pinned(self, tab_root: WebElement) -> bool:
112+
"""Is this tab pinned?"""
113+
with self.driver.context(self.driver.CONTEXT_CHROME):
114+
pinned = tab_root.get_attribute("pinned")
115+
if pinned in ["true", "false"]:
116+
return pinned == "true"
117+
else:
118+
assert False, "Error checking tab pinned status"
119+
111120
def click_tab_mute_button(self, identifier: Union[str, int]) -> BasePage:
112121
"""Click the tab icon overlay, no matter what's happening with media"""
113122
logging.info(f"toggling tab mute for {identifier}")

modules/data/about_prefs.components.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,5 +321,35 @@
321321
"selectorData": "primaryBrowserLocale",
322322
"strategy": "id",
323323
"groups": []
324+
},
325+
326+
"cookies-privacy-label": {
327+
"selectorData": "description[data-l10n-id='sitedata-delete-on-close-private-browsing2']",
328+
"strategy": "css",
329+
"groups": []
330+
},
331+
332+
"cookies-delete-on-close": {
333+
"selectorData": "deleteOnClose",
334+
"strategy": "id",
335+
"groups": []
336+
},
337+
338+
"logins-ask-to-save-password": {
339+
"selectorData": "savePasswords",
340+
"strategy": "id",
341+
"groups": []
342+
},
343+
344+
"logins-exceptions": {
345+
"selectorData": "passwordExceptions",
346+
"strategy": "id",
347+
"groups": []
348+
},
349+
350+
"history-privacy-label": {
351+
"selectorData": "description[data-l10n-id='history-dontremember-description']",
352+
"strategy": "css",
353+
"groups": []
324354
}
325355
}

modules/data/hyperlink_context_menu.components.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"context": "chrome",
23
"do-not-cache": true,
34
"context-menu-open-in-new-window": {
45
"selectorData": "context-openlink",

modules/data/panel_ui.components.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@
131131
"selectorData": "#appMenu_historyMenu .toolbarbutton-text",
132132
"strategy": "css",
133133
"groups": []
134+
},
135+
136+
"panel-ui-history-recent-history-container": {
137+
"selectorData": "appMenu_historyMenu",
138+
"strategy": "id",
139+
"groups": []
140+
},
141+
142+
"panel-ui-history-recent-history-item": {
143+
"selectorData": "toolbarbutton",
144+
"strategy": "tag",
145+
"groups": []
134146
}
135147

136148
}

modules/page_base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,15 @@ def context_click(
508508
self.actions.context_click(el).perform()
509509
return self
510510

511+
def click_and_hide_menu(
512+
self, reference: Union[str, tuple, WebElement], labels=[]
513+
) -> Page:
514+
"""Click an option in a context menu, then hide it"""
515+
with self.driver.context(self.driver.CONTEXT_CHROME):
516+
self.fetch(reference, labels=labels).click()
517+
self.hide_popup_by_child_node(reference, labels=labels)
518+
return self
519+
511520
def hover(self, reference: Union[str, tuple, WebElement], labels=[]):
512521
"""
513522
Hover over the specified element.

tests/address_bar_and_search/test_search_code_google_non_us.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ def search_code_assert():
6161
h1_tag = (By.TAG_NAME, "h1")
6262
example.triple_click(h1_tag)
6363
example.context_click(h1_tag)
64-
context_menu.get_context_item("context-menu-search-selected-text").click()
65-
nav.hide_popup("contentAreaContextMenu")
64+
context_menu.click_and_hide_menu("context-menu-search-selected-text")
6665

6766
# Switch to the newly opened tab and run the code check
6867
window_handles = driver.window_handles

tests/address_bar_and_search/test_search_code_google_us.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def search_code_assert():
5151
h1_tag = (By.TAG_NAME, "h1")
5252
example.triple_click(h1_tag)
5353
example.context_click(h1_tag)
54-
context_menu.get_context_item("context-menu-search-selected-text").click()
55-
nav.hide_popup("contentAreaContextMenu")
54+
context_menu.click_and_hide_menu("context-menu-search-selected-text")
5655

5756
# Switch to the newly opened tab and run the code check
5857
window_handles = driver.window_handles

0 commit comments

Comments
 (0)