Skip to content

Commit 43f9230

Browse files
Merge branch 'main' into philimon/add-new-address
2 parents b983755 + 239b0de commit 43f9230

34 files changed

+145
-138
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ taskcluster-taskgraph = "==9.0.0"
1717
jsonpath-ng = "1.6.1"
1818
pillow = "<10.5"
1919
pyfxa = "0.7.0"
20-
ruff = "0.5.2"
20+
ruff = "0.9.6"
2121
pytest-rerunfailures = "14.0"
2222
slack-sdk = "3.31.0"
2323
google-cloud-storage = "2.18.0"

collect_executables.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,23 @@ def get_gd_platform():
111111
minor = int(minor)
112112
beta = int(beta)
113113

114-
next_major = f"{major+1}.0b1"
114+
next_major = f"{major + 1}.0b1"
115115
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_major}-candidates/build1/"
116116
rs = requests.get(fx_download_dir_url)
117117
if rs.status_code < 300:
118118
latest_beta_ver = next_major
119119
this_beta = next_major
120120
continue
121121

122-
next_minor = f"{major}.{minor+1}b1"
122+
next_minor = f"{major}.{minor + 1}b1"
123123
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_minor}-candidates/build1/"
124124
rs = requests.get(fx_download_dir_url)
125125
if rs.status_code < 300:
126126
latest_beta_ver = next_minor
127127
this_beta = next_minor
128128
continue
129129

130-
next_beta = f"{major}.{minor}b{beta+1}"
130+
next_beta = f"{major}.{minor}b{beta + 1}"
131131
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{next_beta}-candidates/build1/"
132132
rs = requests.get(fx_download_dir_url)
133133
if rs.status_code < 300:

l10n_CM/Unified/test_demo_ad_address_data_captured_in_doorhanger_and_stored.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,6 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
8787
found_address_data = any(
8888
all(value in element.text for value in expected_values) for element in elements
8989
)
90-
assert found_address_data, "Street, city, state (if applicable), zip, or country were not found in any of the address entries!"
90+
assert found_address_data, (
91+
"Street, city, state (if applicable), zip, or country were not found in any of the address entries!"
92+
)

l10n_CM/Unified/test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
6060
found_email_phone = any(
6161
all(value in element.text for value in expected_values) for element in elements
6262
)
63-
assert (
64-
found_email_phone
65-
), "Email or phone were not found in any of the address entries!"
63+
assert found_email_phone, (
64+
"Email or phone were not found in any of the address entries!"
65+
)

l10n_CM/Unified/test_demo_ad_name_org_captured_in_doorhanger_and_stored.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ def test_demo_ad_name_org_captured_in_doorhanger_and_stored(
5151
found_name_org = any(
5252
all(value in element.text for value in expected_values) for element in elements
5353
)
54-
assert (
55-
found_name_org
56-
), "Name or organization were not found in any of the address entries!"
54+
assert found_name_org, (
55+
"Name or organization were not found in any of the address entries!"
56+
)

modules/browser_object_tracker_panel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ def verify_tracker_shield_indicator(self, nav: Navigation) -> BasePage:
145145
assert (
146146
shield_icon.get_attribute("data-l10n-id")
147147
== "tracking-protection-icon-active-container"
148-
), "The label detected did not correspond to the expected one: tracking-protection-icon-active-container"
148+
), (
149+
"The label detected did not correspond to the expected one: tracking-protection-icon-active-container"
150+
)
149151
return self
150152

151153
def open_and_return_cross_site_trackers(self) -> List[WebElement]:

modules/page_base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,9 @@ def verify_opened_image_url(self, url_substr: str, pattern: str) -> Page:
437437
self.url_contains(url_substr)
438438
current_url = self.driver.current_url
439439

440-
assert re.match(
441-
pattern, current_url
442-
), f"URL does not match the expected pattern: {current_url}"
440+
assert re.match(pattern, current_url), (
441+
f"URL does not match the expected pattern: {current_url}"
442+
)
443443
return self
444444

445445
def fill(
@@ -490,9 +490,9 @@ def fetch(self, reference: Union[str, tuple, WebElement], labels=[]) -> WebEleme
490490
return self.find_element(*reference)
491491
elif isinstance(reference, WebElement):
492492
return reference
493-
assert (
494-
False
495-
), "Bad fetch: only selectors, selector names, or WebElements allowed."
493+
assert False, (
494+
"Bad fetch: only selectors, selector names, or WebElements allowed."
495+
)
496496

497497
def click_on(self, reference: Union[str, tuple, WebElement], labels=[]) -> Page:
498498
"""Click on an element, no matter the context, return the page"""

modules/testrail.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ def matching_configs(self, testrail_project_id, config_group_id, config_name):
351351
matching_group = next(c for c in configs if c.get("id") == config_group_id)
352352
logging.info(f"matching group|| {matching_group}")
353353
cfgs = [
354-
c for c in matching_group.get("configs") if config_name in c.get("name")
354+
c
355+
for c in matching_group.get("configs")
356+
if config_name == c.get("name").strip()
355357
]
356358
return cfgs
357359

modules/testrail_integration.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def reportable():
124124
covered_suites = 0
125125
for entry in plan_entries:
126126
for run_ in entry.get("runs"):
127-
if platform in run_.get("config"):
127+
if run_.get("config") and platform in run_.get("config"):
128128
covered_suites += 1
129129

130130
num_suites = 0
@@ -378,6 +378,10 @@ def collect_changes(testrail_session: TestRail, report):
378378
release = ".".join(release.split(".")[:-1])
379379
config = f"{os_name} {release} {arch}"
380380

381+
logging.warning(f"Reporting for config: {config}")
382+
if not config.strip():
383+
raise ValueError("Config cannot be blank.")
384+
381385
with open(".tmp_testrail_info", "w") as fh:
382386
fh.write(f"{plan_title}|{config}")
383387

@@ -421,8 +425,7 @@ def collect_changes(testrail_session: TestRail, report):
421425
logging.info("Creating config...")
422426
testrail_session.add_config(CONFIG_GROUP_ID, config)
423427
tried = True
424-
if len(config_matches) >= 1:
425-
# TODO: change above to == 1
428+
if len(config_matches) == 1:
426429
config_id = config_matches[0].get("id")
427430
logging.info(f"config id: {config_id}")
428431
else:

tests/address_bar_and_search/test_adaptive_history_autofill.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ def test_add_adaptive_history_autofill(driver: Firefox):
6161
)
6262

6363
# Assertion to verify that the 'autofill_adaptive' type is found
64-
assert (
65-
autofill_adaptive_element.get_attribute("type") == "autofill_adaptive"
66-
), f"Expected element type to be 'autofill_adaptive' but found '{autofill_adaptive_element.get_attribute('type')}'"
64+
assert autofill_adaptive_element.get_attribute("type") == "autofill_adaptive", (
65+
f"Expected element type to be 'autofill_adaptive' but found '{autofill_adaptive_element.get_attribute('type')}'"
66+
)
6767

6868
# Assertion to check the autofilled URL is the expected one
69-
assert (
70-
"nationalgeographic.com/science" in autofill_adaptive_element.text
71-
), "URL 'https://www.nationalgeographic.com/science' not found in autofill suggestions."
69+
assert "nationalgeographic.com/science" in autofill_adaptive_element.text, (
70+
"URL 'https://www.nationalgeographic.com/science' not found in autofill suggestions."
71+
)

0 commit comments

Comments
 (0)