Skip to content

Commit 3d3c619

Browse files
authored
Merge branch 'main' into philimon/suite_refactor
2 parents da0501c + 5d676e0 commit 3d3c619

File tree

47 files changed

+913
-307
lines changed

Some content is hidden

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

47 files changed

+913
-307
lines changed

.github/workflows/check-beta.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212
Check-Beta-Version:
1313
runs-on: ubuntu-latest
1414
outputs:
15-
reportable: ${{ steps.reportable.outputs.test }}
15+
win_reportable: ${{ steps.reportable.outputs.win }}
16+
mac_reportable: ${{ steps.reportable.outputs.mac }}
1617
steps:
1718
- name: Checkout repository
1819
uses: actions/checkout@v4
@@ -26,9 +27,21 @@ jobs:
2627
run: |
2728
pip3 install 'pipenv==2023.11.15';
2829
pipenv install
29-
echo test=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable())') >> "$GITHUB_OUTPUT"
30-
Run-Smoke-Tests:
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:
3133
needs: Check-Beta-Version
32-
if: ${{ needs.Check-Beta-Version.outputs.reportable == 'True' }}
34+
if: ${{ needs.Check-Beta-Version.outputs.win_reportable == 'True' }}
3335
uses: ./.github/workflows/smoke.yml
36+
with:
37+
job_to_run: Smoke-Windows
3438
secrets: inherit
39+
40+
Run-Mac-Smoke:
41+
needs: Check-Beta-Version
42+
if: ${{ needs.Check-Beta-Version.outputs.mac_reportable == 'True' }}
43+
uses: ./.github/workflows/smoke.yml
44+
with:
45+
job_to_run: Smoke-MacOS
46+
secrets: inherit
47+

.github/workflows/smoke.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ run-name: ${{ github.actor }} is running smoke tests
55
on:
66
pull_request:
77
workflow_call:
8+
inputs:
9+
job_to_run:
10+
required: true
11+
type: string
812
env:
913
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
1014
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
@@ -30,7 +34,7 @@ jobs:
3034
with:
3135
python-version: "3.11"
3236
- name: Set Environment
33-
if: ${{ github.event_name == 'schedule' }}
37+
if: ${{ inputs.job_to_run == 'Smoke-Windows' }}
3438
run: |
3539
$env_contents = @"
3640
TESTRAIL_REPORT='true'
@@ -128,7 +132,7 @@ jobs:
128132
exit $?
129133
echo "Triggered by event: ${{ github.event_name }}"
130134
- name: Set Environment
131-
if: ${{ github.event_name == 'schedule' }}
135+
if: ${{ inputs.job_to_run == 'Smoke-MacOS' }}
132136
run: |
133137
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
134138
echo "Running report for most recent Beta on MacOS";

SELECTOR_INFO.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,20 @@ Location: about:preferences#privacy Saved Addresses popup dialog
571571
Path to .json: modules/data/about_prefs.components.json
572572
```
573573
```
574+
Selector Name: saved-credit-cards
575+
Selector Data: "credit-cards"
576+
Description: The element that contains the saved credit cards
577+
Location: about:preferences#privacy Saved Credit Cards popup dialog
578+
Path to .json: modules/data/about_prefs.components.json
579+
```
580+
```
581+
Selector Name: saved-credit-cards-values
582+
Selector Data: "#credit-cards option"
583+
Description: The element that contains the saved credit cards values
584+
Location: about:preferences#privacy Saved Credit Cards popup dialog
585+
Path to .json: modules/data/about_prefs.components.json
586+
```
587+
```
574588
Selector Name: panel-popup-stack
575589
Selector Data: "dialogStack"
576590
Description: The element that contains the credit card profile values
@@ -1196,6 +1210,69 @@ Description: "Submit" button
11961210
Location: At the bottom of the autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
11971211
Path to .json: modules/data/address_fill.components.json
11981212
```
1213+
```
1214+
Selector Name: name-field
1215+
Selector Data: "input[autocomplete=name]"
1216+
Description: Name field
1217+
Location: Name field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1218+
Path to .json: modules/data/address_fill.components.json
1219+
```
1220+
```
1221+
Selector Name: org-field
1222+
Selector Data: "input[autocomplete=organization]"
1223+
Description: Organization field
1224+
Location: Organization field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1225+
Path to .json: modules/data/address_fill.components.json
1226+
```
1227+
```
1228+
Selector Name: street-field
1229+
Selector Data: "input[autocomplete=street-address]"
1230+
Description: Street field
1231+
Location: Street field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1232+
Path to .json: modules/data/address_fill.components.json
1233+
```
1234+
```
1235+
Selector Name: add-level2-field
1236+
Selector Data: "input[autocomplete=address-level2]"
1237+
Description: Address level 2 field
1238+
Location: Address level 2 field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1239+
Path to .json: modules/data/address_fill.components.json
1240+
```
1241+
```
1242+
Selector Name: add-level1-field
1243+
Selector Data: "input[autocomplete=address-level1]"
1244+
Description: Address level 1 field
1245+
Location: Address level 1 field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1246+
Path to .json: modules/data/address_fill.components.json
1247+
```
1248+
```
1249+
Selector Name: zip-field
1250+
Selector Data: "input[autocomplete=postal-code]"
1251+
Description: Zip field
1252+
Location: Zip field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1253+
Path to .json: modules/data/address_fill.components.json
1254+
```
1255+
```
1256+
Selector Name: country-field
1257+
Selector Data: "input[autocomplete=country]"
1258+
Description: Country field
1259+
Location: Country field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1260+
Path to .json: modules/data/address_fill.components.json
1261+
```
1262+
```
1263+
Selector Name: email-field
1264+
Selector Data: "input[autocomplete=email]"
1265+
Description: Email field
1266+
Location: Email field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1267+
Path to .json: modules/data/address_fill.components.json
1268+
```
1269+
```
1270+
Selector Name: phone-field
1271+
Selector Data: "input[autocomplete=tel]"
1272+
Description: Phone field
1273+
Location: Phone field on autofill address demo page - https://mozilla.github.io/form-fill-examples/basic.html
1274+
Path to .json: modules/data/address_fill.components.json
1275+
```
11991276
#### amo_languages
12001277
```
12011278
Selector Name: language-addons-title

collect_executables.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,17 @@ def get_gd_platform():
152152
fx_download_dir_url = f"https://archive.mozilla.org/pub/firefox/candidates/{latest_beta_ver}-candidates/build{build}/{get_fx_platform()}/{language}/"
153153
response = requests.get(fx_download_dir_url)
154154
status = response.status_code
155-
if status < 300:
156-
response_text = response.text
155+
response_text = None
156+
for _ in range(3):
157+
if status < 300:
158+
response_text = response.text
159+
else:
160+
sleep(3)
161+
response = requests.get(fx_download_dir_url)
162+
status = response.status_code
163+
164+
if response_text is None:
165+
exit(f"Could not find build at {fx_download_dir_url}.")
157166

158167
# Parse the HTML content
159168
soup = BeautifulSoup(response_text, "html.parser")

l10n_CM/Unified/conftest.py

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import os
2+
from typing import List
23

34
import pytest
45

6+
from modules.browser_object_autofill_popup import AutofillPopup
7+
from modules.page_object_autofill import AddressFill, CreditCardFill
8+
from modules.page_object_prefs import AboutPrefs
9+
from modules.util import Utilities
10+
511

612
@pytest.fixture()
713
def region():
@@ -10,17 +16,47 @@ def region():
1016

1117
@pytest.fixture()
1218
def add_prefs(region: str):
13-
return [
19+
return []
20+
21+
22+
@pytest.fixture()
23+
def set_prefs(add_prefs: List[tuple[str, str | bool]], region: str):
24+
"""Set prefs"""
25+
prefs = [
1426
("extensions.formautofill.creditCards.reauth.optout", False),
1527
("extensions.formautofill.reauth.enabled", False),
1628
("browser.aboutConfig.showWarning", False),
1729
("browser.search.region", region),
1830
]
31+
prefs.extend(add_prefs)
32+
return prefs
1933

2034

2135
@pytest.fixture()
22-
def set_prefs(add_prefs: dict):
23-
"""Set prefs"""
24-
prefs = []
25-
prefs.extend(add_prefs)
26-
return prefs
36+
def address_autofill(driver):
37+
yield AddressFill(driver)
38+
39+
40+
@pytest.fixture()
41+
def autofill_popup(driver):
42+
yield AutofillPopup(driver)
43+
44+
45+
@pytest.fixture()
46+
def util():
47+
yield Utilities()
48+
49+
50+
@pytest.fixture()
51+
def about_prefs_privacy(driver):
52+
yield AboutPrefs(driver, category="privacy")
53+
54+
55+
@pytest.fixture()
56+
def about_prefs(driver):
57+
yield AboutPrefs(driver)
58+
59+
60+
@pytest.fixture()
61+
def credit_card_fill_obj(driver):
62+
yield CreditCardFill(driver)

l10n_CM/Unified/test_demo_ad_address_data_captured_in_doorhanger_and_stored.py

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from modules.browser_object_autofill_popup import AutofillPopup
55
from modules.page_object_autofill import AddressFill
66
from modules.page_object_prefs import AboutPrefs
7-
from modules.util import BrowserActions, Utilities
7+
from modules.util import Utilities
88

99

1010
@pytest.fixture()
@@ -13,41 +13,37 @@ def test_case():
1313

1414

1515
def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
16-
driver: Firefox, region: str
16+
driver: Firefox,
17+
region: str,
18+
address_autofill: AddressFill,
19+
util: Utilities,
20+
autofill_popup: AutofillPopup,
21+
about_prefs_privacy: AboutPrefs,
1722
):
1823
"""
1924
C2888703 - Verify Address data are captured in the Capture Doorhanger and stored in about:preferences
2025
"""
21-
# instantiate objects
22-
address_autofill = AddressFill(driver)
23-
address_autofill_popup = AutofillPopup(driver)
24-
util = Utilities()
25-
browser_action_obj = BrowserActions(driver)
26-
27-
# create fake data and fill it in
26+
# Create fake data and fill it in
2827
address_autofill.open()
2928
address_autofill_data = util.fake_autofill_data(region)
3029
address_autofill.save_information_basic(address_autofill_data)
3130

3231
# The "Save address?" doorhanger is displayed
33-
address_autofill_popup.element_visible("address-save-doorhanger")
32+
autofill_popup.element_visible("address-save-doorhanger")
3433

35-
# containing Street Address field
34+
# Containing Street Address field
3635
expected_street_add = address_autofill_data.street_address
37-
address_autofill_popup.element_has_text(
38-
"address-doorhanger-street", expected_street_add
39-
)
4036

41-
# containing City field
37+
autofill_popup.element_has_text("address-doorhanger-street", expected_street_add)
38+
39+
# Containing City field
4240
expected_city = address_autofill_data.address_level_2
43-
address_autofill_popup.element_has_text("address-doorhanger-city", expected_city)
41+
autofill_popup.element_has_text("address-doorhanger-city", expected_city)
4442

4543
expected_state = address_autofill_data.address_level_1
4644
if region not in ["FR", "DE"]:
4745
state_abbreviation = util.get_state_province_abbreviation(expected_state)
48-
address_autofill_popup.element_has_text(
49-
"address-doorhanger-state", state_abbreviation
50-
)
46+
autofill_popup.element_has_text("address-doorhanger-state", state_abbreviation)
5147

5248
# Verify Zip Code field (Different selector for DE/FR)
5349
expected_zip = address_autofill_data.postal_code
@@ -56,24 +52,23 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
5652
if region in ["FR", "DE"]
5753
else "address-doorhanger-zip"
5854
)
59-
address_autofill_popup.element_has_text(zip_selector, expected_zip)
6055

61-
# containing Country field
56+
autofill_popup.element_has_text(zip_selector, expected_zip)
57+
58+
# Containing Country field
6259
expected_country = address_autofill_data.country
63-
address_autofill_popup.element_has_text(
64-
"address-doorhanger-country", expected_country
65-
)
60+
61+
autofill_popup.element_has_text("address-doorhanger-country", expected_country)
6662

6763
# Click the "Save" button
68-
address_autofill_popup.click_doorhanger_button("save")
64+
autofill_popup.click_doorhanger_button("save")
6965

7066
# Navigate to about:preferences#privacy => "Autofill" section
71-
about_prefs = AboutPrefs(driver, category="privacy").open()
72-
iframe = about_prefs.get_save_addresses_popup_iframe()
73-
browser_action_obj.switch_to_iframe_context(iframe)
67+
about_prefs_privacy.open()
68+
about_prefs_privacy.switch_to_saved_addresses_popup_iframe()
7469

7570
# Verify saved addresses
76-
elements = about_prefs.get_elements("saved-addresses-values")
71+
elements = about_prefs_privacy.get_elements("saved-addresses-values")
7772

7873
# Expected values for verification
7974
expected_values = [
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 "2888558"
12+
13+
14+
def test_demo_ad_autofill_name_org(driver: Firefox, region: str):
15+
"""
16+
C2888558 - Verify Autofill functionality when selecting an entry from the dropdown for name/org fields
17+
"""
18+
# Instantiate objects
19+
address_autofill = AddressFill(driver)
20+
address_autofill_popup = AutofillPopup(driver)
21+
util = Utilities()
22+
23+
# Create fake data and fill it in
24+
address_autofill.open()
25+
address_autofill_data = util.fake_autofill_data(region)
26+
address_autofill.save_information_basic(address_autofill_data)
27+
28+
# Click the "Save" button
29+
address_autofill_popup.click_doorhanger_button("save")
30+
31+
# Double inside Name field and select a saved address entry from the dropdown
32+
address_autofill.double_click("form-field", labels=["name"])
33+
34+
# Click on the first element from the autocomplete dropdown
35+
first_item = address_autofill_popup.get_nth_element(1)
36+
address_autofill_popup.click_on(first_item)
37+
38+
# Verify autofill data
39+
address_autofill.verify_autofill_data(address_autofill_data, region, util)
40+
41+
# Double inside Name field and select clear form autofill
42+
address_autofill.double_click("form-field", labels=["name"])
43+
address_autofill_popup.click_clear_form_option()
44+
45+
# Double inside Organization field and select a saved address entry from the dropdown
46+
address_autofill.double_click("form-field", labels=["organization"])
47+
48+
# Click on the first element from the autocomplete dropdown
49+
first_item = address_autofill_popup.get_nth_element(1)
50+
address_autofill_popup.click_on(first_item)
51+
52+
# Verify autofill data
53+
address_autofill.verify_autofill_data(address_autofill_data, region, util)

0 commit comments

Comments
 (0)