Skip to content

Commit ab14ed2

Browse files
Hani YacoubHani Yacoub
authored andcommitted
Resolve conflicts
2 parents e6e45df + 8a95f25 commit ab14ed2

File tree

67 files changed

+1393
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1393
-85
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ html_dump/
77
/Test Results - .html
88
/geckodriver.log
99
env
10+
*.png
1011
*.dmg
1112
*.tar
1213
*.zip
@@ -175,3 +176,4 @@ cython_debug/
175176
# irrelevant files
176177
drivers/
177178
temp.py
179+
tests/test_scratch.py

Pipfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ pytest-xdist = "*"
1414
pytest-html = "*"
1515
pypom = "*"
1616
jsonpath-ng = "*"
17+
pillow = "*"
1718

1819
[dev-packages]
1920
werkzeug = "*"
2021
selenium-wire = "*"
2122
pdoc = "*"
22-
ruff = "*"
23+
ruff = "0.4.3"
2324
pytest-variables = "*"
2425
taskcluster-taskgraph = "*"

ci_pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ markers = [
1515
testpaths = [
1616
"tests"
1717
]
18-
addopts = "-vs -m 'ci' --ci --html=/builds/worker/artifacts/report.html"
18+
addopts = "-vs --ci -m 'not incident and not unstable' --html=artifacts/report.html"
1919

2020
[tool.ruff]
2121
target-version = "py310"

collect_executables.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ curl -O "$FX_LOC"
8585

8686
mv geckodriver*.tar.gz geckodriver.tar.gz
8787
tar -xvzf geckodriver.tar.gz
88+
chmod +x geckodriver
8889

8990
if [[ $SYSTEM_NAME == "linux" ]]
9091
then

conftest.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
import os
33
import platform
4-
from typing import List, Tuple
4+
from typing import Callable, List, Tuple
55

66
import pytest
77
from selenium import webdriver
@@ -185,23 +185,30 @@ def driver(
185185

186186

187187
@pytest.fixture()
188-
def screenshot(driver: webdriver.Firefox, opt_ci: bool):
189-
def _screenshot(filename):
188+
def screenshot(driver: webdriver.Firefox, opt_ci: bool) -> Callable:
189+
"""
190+
Factory fixture that returns a screenshot function.
191+
"""
192+
193+
def _screenshot(filename: str) -> str:
194+
"""
195+
Given a short filename, save a screenshot and return the image's full path.
196+
"""
190197
if not filename.endswith(".png"):
191198
filename = filename + ".png"
192199
artifacts_loc = ""
193200
if opt_ci:
194-
artifacts_loc = os.path.join("/builds", "worker", "artifacts")
195-
driver.save_screenshot(os.path.join(artifacts_loc, filename))
201+
artifacts_loc = "artifacts"
202+
fullpath = os.path.join(artifacts_loc, filename)
203+
driver.save_screenshot(fullpath)
204+
return fullpath
196205

197206
return _screenshot
198207

199208

200209
@pytest.fixture()
201210
def version(driver: webdriver.Firefox):
202-
driver.get("about:support")
203-
version = driver.find_element("version-box").get_attribute("innerText")
204-
return version
211+
return driver.capabilities["browserVersion"]
205212

206213

207214
@pytest.fixture(scope="session", autouse=True)

modules/browser_object.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from modules.browser_object_about_prefs_cc_popup import *
22
from modules.browser_object_autofill_popup import *
33
from modules.browser_object_credit_card_popup import *
4+
from modules.browser_object_find_toolbar import *
5+
from modules.browser_object_image_context_menu import *
46
from modules.browser_object_navigation import *
57
from modules.browser_object_panel_ui import *
8+
from modules.browser_object_search_bar_context_menu import *
69
from modules.browser_object_tab_context_menu import *
710
from modules.browser_object_tabbar import *

modules/browser_object_autofill_popup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import json
2-
31
from selenium.webdriver.remote.webelement import WebElement
42
from selenium.webdriver.support import expected_conditions as EC
53

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from selenium.webdriver.common.keys import Keys
2+
3+
from modules.browser_object_panel_ui import PanelUi
4+
from modules.page_base import BasePage
5+
6+
7+
class FindToolbar(BasePage):
8+
URL_TEMPLATE = ""
9+
10+
def open(self) -> BasePage:
11+
"""Use PanelUi to open the Find Toolbar, wait for element to load"""
12+
panel_ui = PanelUi(self.driver)
13+
with self.driver.context(self.driver.CONTEXT_CHROME):
14+
panel_ui.open_panel_menu()
15+
panel_ui.select_panel_setting("find-in-page")
16+
self.wait_for_page_to_load()
17+
return self
18+
19+
def find(self, term: str) -> BasePage:
20+
"""Use the Find Toolbar to search"""
21+
with self.driver.context(self.driver.CONTEXT_CHROME):
22+
findbar = self.get_element("find-toolbar-input")
23+
findbar.click()
24+
findbar.clear()
25+
findbar.send_keys(term + Keys.ENTER)
26+
return self
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from modules.browser_object_context_menu import ContextMenu
2+
3+
4+
class HyperlinkContextMenu(ContextMenu):
5+
"""
6+
Browser object model for the context menu for right clicking a hyperlink
7+
"""
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from modules.browser_object_context_menu import ContextMenu
2+
3+
4+
class ImageContextMenu(ContextMenu):
5+
"""
6+
Browser object model for the context menu (after right clicking) a tab
7+
"""
8+
9+
URL_TEMPLATE = ""

0 commit comments

Comments
 (0)