Skip to content

Commit c62a5fe

Browse files
Merge branch 'main' into philimon/suite_refactor
2 parents ad09daa + fe0c3be commit c62a5fe

File tree

89 files changed

+434
-229
lines changed

Some content is hidden

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

89 files changed

+434
-229
lines changed

conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def driver(
394394
fx_executable: str,
395395
opt_headless: bool,
396396
opt_implicit_timeout: int,
397-
set_prefs: List[Tuple],
397+
prefs_list: List[Tuple],
398398
opt_ci: bool,
399399
opt_window_size: str,
400400
use_profile: Union[bool, str],
@@ -426,7 +426,7 @@ def driver(
426426
opt_implicit_timeout: int
427427
Timeout, in seconds for driver-level wait attribute.
428428
429-
set_prefs: List[Tuple]
429+
prefs_list: List[Tuple]
430430
Preferences to set before the Firefox object is created.
431431
Usually set in the conftest.py inside a test suite folder.
432432
@@ -454,7 +454,7 @@ def driver(
454454
profile_path = tmp_path / use_profile
455455
unpack_archive(os.path.join("profiles", f"{use_profile}.zip"), profile_path)
456456
options.profile = profile_path
457-
for opt, value in set_prefs:
457+
for opt, value in prefs_list:
458458
options.set_preference(opt, value)
459459
driver = Firefox(options=options)
460460
separator = "x"

l10n_CM/Unified/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ def region():
1515

1616

1717
@pytest.fixture()
18-
def add_prefs(region: str):
18+
def add_to_prefs_list(region: str):
1919
return []
2020

2121

2222
@pytest.fixture()
23-
def set_prefs(add_prefs: List[tuple[str, str | bool]], region: str):
24-
"""Set prefs"""
23+
def prefs_list(add_to_prefs_list: List[tuple[str, str | bool]], region: str):
24+
"""List of prefs to send to main conftest.py driver fixture"""
2525
prefs = [
2626
("extensions.formautofill.creditCards.reauth.optout", False),
2727
("extensions.formautofill.reauth.enabled", False),
2828
("browser.aboutConfig.showWarning", False),
2929
("browser.search.region", region),
3030
]
31-
prefs.extend(add_prefs)
31+
prefs.extend(add_to_prefs_list)
3232
return prefs
3333

3434

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 "2888567"
12+
13+
14+
def test_dropdown_presence_email_phone_field(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
20+
):
21+
"""
22+
C2888567 - Verify that the autofill dropdown is displayed for the email and phone fields
23+
after the contact information was previously saved.
24+
"""
25+
26+
# Open autofill page
27+
address_autofill.open()
28+
29+
# Generate and save fake data
30+
address_autofill_data = util.fake_autofill_data(region)
31+
address_autofill.save_information_basic(address_autofill_data)
32+
33+
# Click the "Save" button
34+
autofill_popup.click_doorhanger_button("save")
35+
36+
fields_to_test = ["email", "tel"]
37+
38+
address_autofill.verify_autofill_dropdown_addresses(
39+
autofill_popup=autofill_popup, fields_to_test=fields_to_test, region=region
40+
)

l10n_CM/Unified/test_demo_ad_autofill_name_org.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ def test_demo_ad_autofill_name_org(
3030
autofill_popup.click_doorhanger_button("save")
3131

3232
# List of field labels to be autofilled and verified
33-
fields_to_test = [
34-
"name",
35-
"organization"
36-
]
33+
fields_to_test = ["name", "organization"]
3734

3835
# Loop through each field and perform the autofill test
3936
for field in fields_to_test:
40-
address_autofill.autofill_and_verify(autofill_popup, field,
41-
address_autofill_data, util)
37+
address_autofill.autofill_and_verify(
38+
autofill_popup, field, address_autofill_data, util
39+
)

l10n_CM/Unified/test_demo_ad_autofill_phone_email.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ def test_demo_ad_autofill_phone_email(
3131
autofill_popup.click_doorhanger_button("save")
3232

3333
# List of field labels to be autofilled and verified
34-
fields_to_test = [
35-
"email",
36-
"tel"
37-
]
34+
fields_to_test = ["email", "tel"]
3835

3936
# Loop through each field and perform the autofill test
4037
for field in fields_to_test:
41-
address_autofill.autofill_and_verify(autofill_popup, field,
42-
address_autofill_data, util)
38+
address_autofill.autofill_and_verify(
39+
autofill_popup, field, address_autofill_data, util
40+
)

l10n_CM/Unified/test_demo_ad_clear_address_fields.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ def test_case():
1212

1313

1414
def test_demo_ad_clear_address_fields(
15-
driver: Firefox,
16-
region: str,
17-
address_autofill: AddressFill,
18-
util: Utilities,
19-
autofill_popup: AutofillPopup
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
2020
):
2121
"""
2222
C2888565 - Verify clear functionality after selecting an entry from address fields
@@ -35,7 +35,7 @@ def test_demo_ad_clear_address_fields(
3535
"address-level2",
3636
"address-level1", # This will be skipped for DE/FR
3737
"postal-code",
38-
"country"
38+
"country",
3939
]
4040

4141
# Loop through each field and perform the autofill test

l10n_CM/Unified/test_demo_ad_clear_name_org.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ def test_case():
1212

1313

1414
def test_demo_ad_clear_name_org(
15-
driver: Firefox,
16-
region: str,
17-
address_autofill: AddressFill,
18-
util: Utilities,
19-
autofill_popup: AutofillPopup
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
2020
):
2121
"""
2222
C2888560 - Verify clear functionality after selecting an entry from name/org fields
@@ -30,10 +30,7 @@ def test_demo_ad_clear_name_org(
3030
autofill_popup.click_doorhanger_button("save")
3131

3232
# List of field labels to be autofilled and verified
33-
fields_to_test = [
34-
"name",
35-
"organization"
36-
]
33+
fields_to_test = ["name", "organization"]
3734

3835
# Loop through each field and perform the autofill test
3936
for field in fields_to_test:

l10n_CM/Unified/test_demo_ad_clear_tel_email.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ def test_case():
1212

1313

1414
def test_demo_ad_clear_tel_email(
15-
driver: Firefox,
16-
region: str,
17-
address_autofill: AddressFill,
18-
util: Utilities,
19-
autofill_popup: AutofillPopup
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
2020
):
2121
"""
2222
C2888571 - Verify clear functionality after selecting an entry from tele/email fields
@@ -31,10 +31,7 @@ def test_demo_ad_clear_tel_email(
3131
autofill_popup.click_doorhanger_button("save")
3232

3333
# List of field labels to be autofilled and verified
34-
fields_to_test = [
35-
"email",
36-
"tel"
37-
]
34+
fields_to_test = ["email", "tel"]
3835

3936
# Loop through each field and perform the autofill test
4037
for field in fields_to_test:

l10n_CM/Unified/test_demo_ad_verify_new_address_added.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def region():
1818

1919

2020
@pytest.fixture()
21-
def add_prefs(region: str):
21+
def add_to_prefs_list(region: str):
2222
return [
2323
("extensions.formautofill.creditCards.supportedCountries", region),
2424
("extensions.formautofill.addresses.supported", "on"),

l10n_CM/Unified/test_demo_cc_autofill_from_dropdown.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from modules.util import Utilities
77

88

9-
109
@pytest.fixture()
1110
def test_case():
1211
return "2886600"
@@ -17,7 +16,6 @@ def test_cc_autofill_from_dropdown(
1716
util: Utilities,
1817
autofill_popup: AutofillPopup,
1918
credit_card_fill_obj: CreditCardFill,
20-
2119
):
2220
"""
2321
Verify that saved credit card information is autofilled correctly when selected from the dropdown,
@@ -37,4 +35,4 @@ def test_cc_autofill_from_dropdown(
3735

3836
# Step 5: Click the csc field (cc-csc), ensure autofill popup is not present
3937
credit_card_fill_obj.click_on("form-field", labels=["cc-csc"]) # Use single click
40-
autofill_popup.ensure_autofill_dropdown_not_visible()
38+
autofill_popup.ensure_autofill_dropdown_not_visible()

0 commit comments

Comments
 (0)