Skip to content

Commit 40cbb10

Browse files
philimon-resetvsangereanMOZ
authored andcommitted
base structure for live testing set for walmart address page
1 parent be7f2c8 commit 40cbb10

25 files changed

+277
-196
lines changed

l10n_CM/Unified/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def prefs_list(add_to_prefs_list: List[tuple[str, str | bool]], region: str):
3838

3939
@pytest.fixture()
4040
def site_data():
41-
live_site = os.environ.get("FX_SITE", None)
41+
# live_site = os.environ.get("FX_SITE", None)
4242
# un comment to test a live site form
43-
# live_site = "walmart/walmart_ad"
43+
live_site = "walmart/walmart_ad"
4444
if live_site:
4545
path_to_site = parent_dir + "/constants/"
4646
with open(path_to_site + live_site + ".json", "r") as fp:

l10n_CM/Unified/test_demo_ad_1a_dropdown_name_org_fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_dropdown_presence_name_organization(
2828
address_autofill.open()
2929

3030
# Verify that the name and organization fields have the autofill dropdown present
31-
fields_to_test = ["name", "organization"]
31+
fields_to_test = ["name", "given_name", "family_name", "organization"]
3232

3333
address_autofill.verify_field_autofill_dropdown(
3434
region=region, fields_to_test=fields_to_test

l10n_CM/Unified/test_demo_ad_2a_preview_name_org_fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ def test_demo_ad_hover_name_org(
3030
autofill_data = fill_and_save_address
3131

3232
# Hover over each field and check data preview
33-
fields_to_test = ["name", "organization"]
33+
fields_to_test = ["name", "given_name", "family_name", "organization"]
3434
for field in fields_to_test:
3535
address_autofill.check_autofill_preview_for_field(field, autofill_data, region)

l10n_CM/Unified/test_demo_ad_2c_preview_phone_email_fields.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from selenium.webdriver import Firefox
33

44
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.classes.autofill_base import AutofillAddressBase
56
from modules.page_object_autofill import AddressFill
67
from modules.page_object_prefs import AboutPrefs
78
from modules.util import Utilities
@@ -19,10 +20,13 @@ def test_hover_email_and_phone_autofill_preview(
1920
address_autofill: AddressFill,
2021
autofill_popup: AutofillPopup,
2122
util: Utilities,
23+
fill_and_save_address: AutofillAddressBase,
2224
):
23-
# Create fake data and fill it in
25+
# Create fake data
2426
address_autofill.open()
25-
autofill_data = address_autofill.fill_and_save(region)
27+
28+
# created fake data
29+
autofill_data = fill_and_save_address
2630

2731
# Hover over each field and check data preview
2832
fields_to_test = ["email", "telephone"]

l10n_CM/Unified/test_demo_ad_3a_autofill_address_fields.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from selenium.webdriver import Firefox
33

44
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.classes.autofill_base import AutofillAddressBase
56
from modules.page_object_autofill import AddressFill
67
from modules.util import Utilities
78

@@ -17,13 +18,16 @@ def test_demo_ad_autofill_address_fields(
1718
address_autofill: AddressFill,
1819
util: Utilities,
1920
autofill_popup: AutofillPopup,
21+
fill_and_save_address: AutofillAddressBase,
2022
):
2123
"""
2224
C2888563 - Verify Autofill functionality when selecting an entry from the dropdown for address fields
2325
"""
24-
# Create fake data and fill it in
26+
# Create fake data
2527
address_autofill.open()
26-
address_autofill_data = address_autofill.fill_and_save(region)
28+
29+
# created fake data
30+
autofill_data = fill_and_save_address
2731

2832
# List of field labels to be autofilled and verified
2933
fields_to_test = [
@@ -35,4 +39,4 @@ def test_demo_ad_autofill_address_fields(
3539
]
3640
# Loop through each field and perform the autofill test
3741
for field in fields_to_test:
38-
address_autofill.clear_and_verify(field, address_autofill_data, region=region)
42+
address_autofill.clear_and_verify(field, autofill_data, region=region)

l10n_CM/Unified/test_demo_ad_3b_autofill_name_org_fields.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from selenium.webdriver import Firefox
33

44
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.classes.autofill_base import AutofillAddressBase
56
from modules.page_object_autofill import AddressFill
67
from modules.util import Utilities
78

@@ -17,17 +18,20 @@ def test_demo_ad_autofill_name_org(
1718
address_autofill: AddressFill,
1819
autofill_popup: AutofillPopup,
1920
util: Utilities,
21+
fill_and_save_address: AutofillAddressBase,
2022
):
2123
"""
2224
C2888558 - Verify Autofill functionality when selecting an entry from the dropdown for name/org fields
2325
"""
24-
# Create fake data and fill it in
26+
# Create fake data
2527
address_autofill.open()
26-
address_autofill_data = address_autofill.fill_and_save(region)
28+
29+
# created fake data
30+
autofill_data = fill_and_save_address
2731

2832
# List of field labels to be autofilled and verified
29-
fields_to_test = ["name", "organization"]
33+
fields_to_test = ["name", "given_name", "family_name", "organization"]
3034

3135
# Loop through each field and perform the autofill test
3236
for field in fields_to_test:
33-
address_autofill.clear_and_verify(field, address_autofill_data, region=region)
37+
address_autofill.clear_and_verify(field, autofill_data, region=region)

l10n_CM/Unified/test_demo_ad_3c_autofill_phone_email_fields.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from selenium.webdriver import Firefox
33

44
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.classes.autofill_base import AutofillAddressBase
56
from modules.page_object_autofill import AddressFill
67
from modules.util import Utilities
78

@@ -17,17 +18,20 @@ def test_demo_ad_autofill_phone_email(
1718
address_autofill: AddressFill,
1819
autofill_popup: AutofillPopup,
1920
util: Utilities,
21+
fill_and_save_address: AutofillAddressBase,
2022
):
2123
"""
2224
C2888569 - Verify Autofill functionality when selecting an entry from the dropdown for tele/email fields
2325
"""
24-
# Create fake data and fill it in
26+
# Create fake data
2527
address_autofill.open()
26-
address_autofill_data = address_autofill.fill_and_save(region)
28+
29+
# created fake data
30+
autofill_data = fill_and_save_address
2731

2832
# List of field labels to be autofilled and verified
2933
fields_to_test = ["email", "telephone"]
3034

3135
# Loop through each field and perform the autofill test
3236
for field in fields_to_test:
33-
address_autofill.clear_and_verify(field, address_autofill_data, region=region)
37+
address_autofill.clear_and_verify(field, autofill_data, region=region)

l10n_CM/Unified/test_demo_ad_4a_highlight_name_org_fields.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from selenium.webdriver import Firefox
33

44
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.classes.autofill_base import AutofillAddressBase
56
from modules.page_object_autofill import AddressFill
67
from modules.util import Utilities
78

@@ -17,14 +18,16 @@ def test_address_yellow_highlight_on_name_organization_fields(
1718
address_autofill: AddressFill,
1819
util: Utilities,
1920
autofill_popup: AutofillPopup,
21+
fill_and_save_address: AutofillAddressBase,
2022
):
2123
"""
2224
C2888559 - Verify the yellow highlight appears on autofilled fields for name and organization.
2325
"""
24-
if address_autofill.is_field_present("name"):
26+
if address_autofill.is_field_present("name") or address_autofill.is_field_present(
27+
"given_name"
28+
):
2529
# Create fake data and fill it in
2630
address_autofill.open()
27-
address_autofill.fill_and_save(region)
2831

2932
# Double click inside name field and select a saved address entry from the dropdown
3033
address_autofill.click_form_field("name")

l10n_CM/Unified/test_demo_ad_4b_highlight_address_fields.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from selenium.webdriver import Firefox
33

44
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.classes.autofill_base import AutofillAddressBase
56
from modules.page_object_autofill import AddressFill
67
from modules.util import Utilities
78

@@ -17,14 +18,14 @@ def test_address_yellow_highlight_address_fields(
1718
address_autofill: AddressFill,
1819
util: Utilities,
1920
autofill_popup: AutofillPopup,
21+
fill_and_save_address: AutofillAddressBase,
2022
):
2123
"""
2224
C2888564 - Verify the yellow highlight appears on autofilled fields for the address fields.
2325
"""
2426
if address_autofill.is_field_present("street_address"):
2527
# Create fake data and fill it in
2628
address_autofill.open()
27-
address_autofill.fill_and_save(region)
2829

2930
# Double click inside name field and select a saved address entry from the dropdown
3031
address_autofill.click_form_field("street_address")

l10n_CM/Unified/test_demo_ad_4c_highlight_phone_email_fields.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from selenium.webdriver import Firefox
33

44
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.classes.autofill_base import AutofillAddressBase
56
from modules.page_object_autofill import AddressFill
67
from modules.util import Utilities
78

@@ -17,14 +18,14 @@ def test_address_yellow_highlight_address_fields(
1718
address_autofill: AddressFill,
1819
util: Utilities,
1920
autofill_popup: AutofillPopup,
21+
fill_and_save_address: AutofillAddressBase,
2022
):
2123
"""
2224
C2888570 - Verify the yellow highlight appears on autofilled fields for the email and phone fields.
2325
"""
2426
if address_autofill.is_field_present("email"):
2527
# Create fake data and fill it in
2628
address_autofill.open()
27-
address_autofill.fill_and_save(region)
2829

2930
# Double click inside name field and select a saved address entry from the dropdown
3031
address_autofill.click_form_field("email")

0 commit comments

Comments
 (0)