Skip to content

Commit d6fda2b

Browse files
Merge pull request #737 from mozilla/philimon/l10n_reporting
philimon/l10n_reporting_fix_again
2 parents 5893c75 + 7227667 commit d6fda2b

File tree

6 files changed

+37
-26
lines changed

6 files changed

+37
-26
lines changed

SELECTOR_INFO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3022,7 +3022,7 @@ Path to .json: modules/data/navigation.components.json
30223022
```
30233023
```
30243024
Selector Name: searchmode-switcher-settings
3025-
Selector Data: searchmode-switcher-popup-search-settings-button
3025+
Selector Data: menuitem[data-l10n-id='urlbar-searchmode-popup-search-settings-menuitem']
30263026
Description: Search settings button in the searchmode switcher dropdown
30273027
Location: Address bar
30283028
Path to .json: modules/data/navigation.components.json

ci_l10n_pyproject_headed.toml

Lines changed: 0 additions & 21 deletions
This file was deleted.

modules/browser_object_navigation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ def open_tracker_panel(self) -> BasePage:
267267
self.get_element("shield-icon").click()
268268
return self
269269

270+
@BasePage.context_chrome
271+
def click_file_download_warning_panel(self) -> BasePage:
272+
""" exit file download warning panel if present """
273+
self.element_clickable("file-download-warning-button")
274+
self.click_on("file-download-warning-button")
275+
return self
270276
def wait_for_item_to_download(self, filename: str) -> BasePage:
271277
"""
272278
Check the downloads tool in the toolbar to wait for a given file to download

modules/data/navigation.components.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,18 @@
393393
"groups": []
394394
},
395395

396+
"file-download-warning-panel": {
397+
"selectorData": "downloadsPanel-privateBrowsing",
398+
"strategy": "id",
399+
"groups": []
400+
},
401+
402+
"file-download-warning-button": {
403+
"selectorData": "button[data-l10n-id='downloads-private-browsing-accept-button']",
404+
"strategy": "css",
405+
"groups": []
406+
},
407+
396408
"bookmark-in-bar": {
397409
"selectorData": "toolbarbutton.bookmark-item",
398410
"strategy": "css",
@@ -552,8 +564,8 @@
552564
},
553565

554566
"searchmode-switcher-settings": {
555-
"selectorData": "searchmode-switcher-popup-search-settings-button",
556-
"strategy": "id",
567+
"selectorData": "menuitem[data-l10n-id='urlbar-searchmode-popup-search-settings-menuitem']",
568+
"strategy": "css",
557569
"groups": []
558570
},
559571

modules/testrail_integration.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,21 @@ def reportable(platform_to_test=None):
189189
if os.environ.get("FX_L10N"):
190190
beta_version = int(minor_num.split("b")[-1])
191191
distributed_mappings = select_l10n_mappings(beta_version)
192-
expected_mappings = len(distributed_mappings)
192+
expected_mappings = sum(map(lambda x: len(x), distributed_mappings.values()))
193193
covered_mappings = 0
194194
# keeping this logic to still see how many mappings are reported.
195195
for entry in plan_entries:
196196
if entry.get("name") in distributed_mappings:
197-
covered_mappings += 1
197+
site = entry.get("name")
198+
for run_ in entry.get("runs"):
199+
if run_.get("config"):
200+
run_region, run_platform = run_.get("config").split("-")
201+
if (
202+
run_region in distributed_mappings[site]
203+
and platform in run_platform
204+
):
205+
logging.warning(f"Already reported: {site} {run_region},{run_platform}")
206+
covered_mappings += 1
198207
logging.warning(
199208
f"Potentially matching run found for {platform}, may be reportable. (Found {covered_mappings} site/region mappings reported, expected {expected_mappings}.)"
200209
)

tests/security_and_privacy/test_downloads_from_private_not_leaked.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,16 @@ def test_downloads_from_private_not_leaked(driver: Firefox, delete_files, screen
5959
and el.is_displayed()
6060
]
6161
# first link is large, skip it
62+
panel_skipped = False
6263
for link in valid_links[1 : (NUM_LINKS + 1)]:
6364
target = link.get_attribute("href")
6465
logging.info(f"Downloading target {target}:")
6566
logging.info(link.text)
6667
link.click()
68+
if not panel_skipped:
69+
# skip download warning panel once.
70+
nav.click_file_download_warning_panel()
71+
panel_skipped = True
6772
nav.wait_for_item_to_download(target.split("/")[-1])
6873

6974
# Check that everything looks good in About:Downloads

0 commit comments

Comments
 (0)