Skip to content

Commit 4ce2a84

Browse files
Merge branch 'main' into philimon/l10n_modify
2 parents 90d52da + b71e029 commit 4ce2a84

File tree

9 files changed

+179
-19
lines changed

9 files changed

+179
-19
lines changed

.github/workflows/check-beta.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Check new beta version
22

33
on:
44
schedule:
5-
- cron: "49 */1 * * *"
5+
- cron: "12 */1 * * *"
66
env:
77
LATEST: ""
88
permissions:
9-
contents: 'write'
9+
contents: "write"
1010

1111
jobs:
1212
Check-Beta-Version:
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/checkout@v4
2020
- name: Check if the run is reportable
2121
id: reportable
22-
env:
22+
env:
2323
TESTRAIL_REPORT: true
2424
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
2525
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
@@ -29,19 +29,18 @@ jobs:
2929
pipenv install
3030
echo win=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Windows"))') >> "$GITHUB_OUTPUT"
3131
echo mac=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Darwin"))') >> "$GITHUB_OUTPUT"
32-
Run-Win-Smoke:
32+
Run-Win-Smoke:
3333
needs: Check-Beta-Version
3434
if: ${{ needs.Check-Beta-Version.outputs.win_reportable == 'True' }}
3535
uses: ./.github/workflows/smoke.yml
3636
with:
3737
job_to_run: Smoke-Windows
3838
secrets: inherit
3939

40-
Run-Mac-Smoke:
40+
Run-Mac-Smoke:
4141
needs: Check-Beta-Version
4242
if: ${{ needs.Check-Beta-Version.outputs.mac_reportable == 'True' }}
4343
uses: ./.github/workflows/smoke.yml
4444
with:
4545
job_to_run: Smoke-MacOS
4646
secrets: inherit
47-
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Check new devedition version
2+
3+
on:
4+
schedule:
5+
- cron: "46 */12 * * *"
6+
env:
7+
LATEST: ""
8+
permissions:
9+
contents: "write"
10+
11+
jobs:
12+
Check-DevEdition-Version:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
reportable: ${{ steps.reportable.outputs.test }}
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
- name: Check if the run is reportable
20+
id: reportable
21+
env:
22+
TESTRAIL_REPORT: true
23+
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
24+
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
25+
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }}
26+
FX_CHANNEL: "devedition"
27+
run: |
28+
pip3 install 'pipenv==2023.11.15';
29+
pipenv install
30+
echo win=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Windows"))') >> "$GITHUB_OUTPUT"
31+
echo mac=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Darwin"))') >> "$GITHUB_OUTPUT"
32+
Run-Win-Smoke:
33+
needs: Check-Beta-Version
34+
if: ${{ needs.Check-Beta-Version.outputs.win_reportable == 'True' }}
35+
uses: ./.github/workflows/smoke.yml
36+
with:
37+
channel: "devedition"
38+
job_to_run: Smoke-Windows
39+
secrets: inherit
40+
41+
Run-Mac-Smoke:
42+
needs: Check-Beta-Version
43+
if: ${{ needs.Check-Beta-Version.outputs.mac_reportable == 'True' }}
44+
uses: ./.github/workflows/smoke.yml
45+
with:
46+
channel: "devedition"
47+
job_to_run: Smoke-MacOS
48+
secrets: inherit

.github/workflows/smoke.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ on:
66
pull_request:
77
workflow_call:
88
inputs:
9-
job_to_run:
9+
channel:
10+
description: "Channel to run tests against"
11+
default: "beta"
12+
required: false
13+
job_to_run:
1014
required: true
1115
type: string
1216
env:
17+
FX_CHANNEL: ${{ inputs.channel }}
1318
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
1419
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
1520
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }}
@@ -137,7 +142,7 @@ jobs:
137142
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
138143
echo "Running report for most recent Beta on MacOS";
139144
- name: Install dependencies
140-
id: setup
145+
id: setup
141146
run: |
142147
mkdir -p artifacts;
143148
pip3 install 'pipenv==2023.11.15';

collect_executables.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,33 @@ def get_gd_platform():
102102
if not language:
103103
language = "en-US"
104104

105+
if channel == "-devedition":
106+
this_devedition = BACKSTOP
107+
fx_download_dir_url = (
108+
"https://archive.mozilla.org/pub/devedition/releases/135.0b5/"
109+
)
110+
111+
while True:
112+
(major, _) = this_devedition.split(".")
113+
major = int(major)
114+
this_devedition = f"{major + 1}.0b5"
115+
next_candidate = f"https://archive.mozilla.org/pub/devedition/releases/{this_devedition}/"
116+
117+
rs = requests.get(next_candidate)
118+
if rs.status_code > 399:
119+
break
120+
121+
fx_download_dir_url = next_candidate
122+
123+
devedition_version = fx_download_dir_url.split("/")[-2]
124+
if NUMBER_ONLY:
125+
print(devedition_version)
126+
else:
127+
print(
128+
f"{fx_download_dir_url}{get_fx_platform()}/{language}/Firefox%20{devedition_version}.{get_fx_executable_extension()}"
129+
)
130+
exit()
131+
105132
candidate_exists = True
106133
this_beta = BACKSTOP
107134
while candidate_exists:

l10n_CM/Unified/test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
3939
# containing phone field
4040
expected_phone = address_autofill_data.telephone
4141
actual_phone = autofill_popup.get_cc_doorhanger_data("address-doorhanger-phone")
42-
normalize_expected = util.normalize_phone_number(expected_phone)
43-
normalized_actual = util.normalize_phone_number(actual_phone)
42+
normalize_expected = util.normalize_regional_phone_numbers(expected_phone, region)
43+
normalized_actual = util.normalize_regional_phone_numbers(actual_phone, region)
4444
assert normalized_actual == normalize_expected, (
4545
f"Phone number mismatch for {region} | Expected: {normalize_expected}, Got: {normalized_actual}"
4646
)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object_autofill import AddressFill
6+
from modules.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888570"
12+
13+
14+
def test_address_yellow_highlight_address_fields(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
20+
):
21+
"""
22+
C2888570 - Verify the yellow highlight appears on autofilled fields for the email and phone fields.
23+
"""
24+
25+
# Create fake data and fill it in
26+
address_autofill.open()
27+
address_autofill_data = util.fake_autofill_data(region)
28+
address_autofill.save_information_basic(address_autofill_data)
29+
30+
# Click the "Save" button
31+
autofill_popup.click_doorhanger_button("save")
32+
33+
# Double click inside email field and select a saved address entry from the dropdown
34+
address_autofill.double_click("form-field", labels=["email"])
35+
36+
# Click on the first element from the autocomplete dropdown
37+
first_item = autofill_popup.get_nth_element(1)
38+
autofill_popup.click_on(first_item)
39+
40+
# Verify the email and phone fields are highlighted
41+
address_autofill.verify_field_yellow_highlights(
42+
fields_to_test=["email", "tel"], expected_highlighted_fields=["email", "tel"]
43+
)

l10n_CM/region/Unified.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"test_demo_cc_doorhanger_data_is_stored_in_about_prefs.py",
1313
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
1414
"test_demo_cc_dropdown_presence.py",
15-
"test_demo_cc_yellow_highlight.py"
15+
"test_demo_ad_verify_new_address_added.py",
16+
"test_demo_ad_yellow_highlight_phone_email.py"
1617
]
1718
}

modules/testrail_integration.py

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
FX_PRERC_VERSION_RE = re.compile(r"(\d+)\.(\d\d?)[ab](\d\d?)-build(\d+)")
1212
FX_RC_VERSION_RE = re.compile(r"(\d+)\.(\d\d?)(.*)")
13+
FX_DEVED_VERSION_RE = re.compile(r"(\d+)\.(\d\d?)b(\d\d?)")
1314
FX_RELEASE_VERSION_RE = re.compile(r"(\d+)\.(\d\d?)\.(\d\d?)(.*)")
1415
TESTRAIL_RUN_FMT = (
1516
"[{channel} {major}] Automated testing {major}.{minor}b{beta}-build{build}"
@@ -23,7 +24,18 @@ def get_plan_title(version_str: str, channel: str) -> str:
2324
"""Given a version string, get the plan_title"""
2425

2526
version_match = FX_PRERC_VERSION_RE.match(version_str)
26-
if version_match:
27+
if channel == "Devedition":
28+
logging.info(f"DevEdition: {version_str}")
29+
version_match = FX_DEVED_VERSION_RE.match(version_str)
30+
(major, minor, beta) = [version_match[n] for n in range(1, 4)]
31+
plan_title = (
32+
TESTRAIL_RUN_FMT.replace("{channel}", channel)
33+
.replace("{major}", major)
34+
.replace("{minor}", minor)
35+
.replace("{beta}", beta)
36+
.split("-")[0]
37+
)
38+
elif version_match:
2739
logging.info(version_match)
2840
(major, minor, beta, build) = [version_match[n] for n in range(1, 5)]
2941
logging.info(f"major {major} minor {minor} beta {beta} build {build}")
@@ -87,8 +99,12 @@ def reportable(platform_to_test=None):
8799
tr_session = testrail_init()
88100
major_number, second_half = version.split(".")
89101
minor_num, build_num = second_half.split("-")
90-
channel = "Beta" if "b" in minor_num else "Release"
91-
# TODO: Logic for Nightly testing
102+
channel = os.environ.get("FX_CHANNEL").title()
103+
if not channel:
104+
if "b" in minor_num:
105+
channel = "Beta"
106+
else:
107+
channel = "Release"
92108

93109
major_version = f"Firefox {major_number}"
94110
major_milestone = tr_session.matching_milestone(TESTRAIL_FX_DESK_PRJ, major_version)
@@ -102,10 +118,15 @@ def reportable(platform_to_test=None):
102118
major_milestone, f"{channel} {major_number}"
103119
)
104120
if not channel_milestone:
105-
logging.warning(
106-
f"Not reporting: Could not find matching submilestone for {channel} {major_number}"
107-
)
108-
return False
121+
if channel == "Devedition":
122+
channel_milestone = tr_session.matching_submilestone(
123+
major_milestone, f"Beta {major_number}"
124+
)
125+
if not channel_milestone:
126+
logging.warning(
127+
f"Not reporting: Could not find matching submilestone for {channel} {major_number}"
128+
)
129+
return False
109130

110131
plan_title = get_plan_title(version, channel)
111132
logging.warning(f"Plan title: {plan_title}")
@@ -347,7 +368,7 @@ def collect_changes(testrail_session: TestRail, report):
347368
"""
348369

349370
# Find milestone to attach to
350-
channel = os.environ.get("STARFOX_CHANNEL")
371+
channel = os.environ.get("FX_CHANNEL").title()
351372
if not channel:
352373
channel = "Beta"
353374
if channel == "Release":
@@ -394,6 +415,10 @@ def collect_changes(testrail_session: TestRail, report):
394415
channel_milestone = testrail_session.matching_submilestone(
395416
major_milestone, f"{channel} {major}"
396417
)
418+
if (not channel_milestone) and channel == "Devedition":
419+
channel_milestone = testrail_session.matching_submilestone(
420+
major_milestone, f"Beta {major}"
421+
)
397422

398423
# Find plan to attach runs to, create if doesn't exist
399424
logging.info(f"Plan title: {plan_title}")

taskcluster/kinds/new-beta-qa/kind.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ tasks:
4747
mv ./ci_pyproject_headed.toml ./pyproject.toml;
4848
export REPORTABLE=1;
4949
pipenv run pytest --fx-executable $FX_EXECUTABLE tests;
50+
export BETA_VERSION=$(pipenv run python collect_executables.py -n)
51+
if ![[ "${BETA_VERSION}" == *"b6"* ]] && ![[ "${BETA_VERSION}" == *"b8"* ]]; then exit 0;
52+
export FX_CHANNEL="devedition";
53+
mv ./ci_pyproject.toml ./pyproject.toml;
54+
./collect_executables.sh;
55+
pipenv run python -c 'from modules import testrail_integration as tri; tri.tc_reportable()' || exit 0;
56+
$FX_EXECUTABLE --version;
57+
pipenv run pytest --fx-executable $FX_EXECUTABLE -n 4 tests;
58+
export FAILURE=${?};
59+
mv ./ci_pyproject_headed.toml ./pyproject.toml;
60+
export REPORTABLE=1;
61+
pipenv run pytest --fx-executable $FX_EXECUTABLE tests;
5062
exit $((${?} | ${FAILURE}))
5163
notify:
5264
recipients:

0 commit comments

Comments
 (0)