Skip to content

Commit 915c59b

Browse files
removed isolated and moved cc tests back to unified as well as add region to fake cc data
1 parent d7bcfc1 commit 915c59b

11 files changed

+35
-38
lines changed

l10n_CM/Unified/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@pytest.fixture()
1313
def region():
14-
return os.environ.get("FX_REGION", "FR")
14+
return os.environ.get("FX_REGION", "DE")
1515

1616

1717
@pytest.fixture()

l10n_CM/Unified/test_demo_cc_add_new_credit_card.py

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

6+
from l10n_CM.Unified.conftest import region
67
from modules.page_object import AboutPrefs
78
from modules.util import Utilities
89

@@ -14,6 +15,7 @@ def test_case():
1415

1516
def test_create_new_cc_profile(
1617
driver: Firefox,
18+
region: str,
1719
util: Utilities,
1820
about_prefs_privacy: AboutPrefs,
1921
about_prefs: AboutPrefs,
@@ -27,7 +29,7 @@ def test_create_new_cc_profile(
2729
about_prefs_privacy.switch_to_saved_payments_popup_iframe()
2830

2931
# Save CC information using fake data
30-
credit_card_sample_data = util.fake_credit_card_data()
32+
credit_card_sample_data = util.fake_credit_card_data(region)
3133

3234
# Add a new CC profile
3335
about_prefs.click_on("panel-popup-button", labels=["autofill-manage-add-button"])

l10n_CM/Unified/test_demo_cc_clear_form.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def test_case():
1313

1414
def test_cc_clear_form(
1515
driver: Firefox,
16+
region: str,
1617
util: Utilities,
1718
autofill_popup: AutofillPopup,
1819
about_prefs_privacy: AboutPrefs,
@@ -28,7 +29,7 @@ def test_cc_clear_form(
2829
about_prefs_privacy.open()
2930
about_prefs_privacy.switch_to_saved_payments_popup_iframe()
3031

31-
credit_card_sample_data = util.fake_credit_card_data()
32+
credit_card_sample_data = util.fake_credit_card_data(region)
3233
about_prefs.click_on("panel-popup-button", labels=["autofill-manage-add-button"])
3334
about_prefs_privacy.fill_cc_panel_information(credit_card_sample_data)
3435

l10n_CM/Unified/test_demo_cc_doorhanger_data_is_stored_in_about_prefs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import time
2-
31
import pytest
42
from selenium.webdriver import Firefox
53

4+
from l10n_CM.Unified.conftest import region
65
from modules.browser_object_autofill_popup import AutofillPopup
76
from modules.page_object_autofill import CreditCardFill
87
from modules.page_object_prefs import AboutPrefs
9-
from modules.util import BrowserActions, Utilities
8+
from modules.util import Utilities
109

1110

1211
@pytest.fixture()
@@ -16,6 +15,7 @@ def test_case():
1615

1716
def test_demo_cc_data_captured_in_doorhanger_and_stored(
1817
driver: Firefox,
18+
region: str,
1919
credit_card_fill_obj: CreditCardFill,
2020
autofill_popup: AutofillPopup,
2121
util: Utilities,
@@ -28,7 +28,7 @@ def test_demo_cc_data_captured_in_doorhanger_and_stored(
2828
credit_card_fill_obj.open()
2929

3030
# Fill data
31-
credit_card_sample_data = util.fake_credit_card_data()
31+
credit_card_sample_data = util.fake_credit_card_data(region)
3232
credit_card_fill_obj.fill_credit_card_info(credit_card_sample_data)
3333

3434
# The "Save credit card?" doorhanger is displayed

l10n_CM/Unified/test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def test_case():
1313

1414
def test_cc_check_door_hanger_is_displayed(
1515
driver: Firefox,
16+
region: str,
1617
util: Utilities,
1718
autofill_popup: AutofillPopup,
1819
credit_card_fill_obj: CreditCardFill,
@@ -24,7 +25,7 @@ def test_cc_check_door_hanger_is_displayed(
2425
credit_card_fill_obj.open()
2526

2627
# Fill data
27-
credit_card_sample_data = util.fake_credit_card_data()
28+
credit_card_sample_data = util.fake_credit_card_data(region)
2829
credit_card_fill_obj.fill_credit_card_info(credit_card_sample_data)
2930

3031
# Check if an element from the door hanger is visible

l10n_CM/Unified/test_demo_cc_dropdown_presence.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def test_case():
1313

1414
def test_dropdown_presence_credit_card(
1515
driver: Firefox,
16+
region: str,
1617
util: Utilities,
1718
autofill_popup: AutofillPopup,
1819
about_prefs_privacy: AboutPrefs,
@@ -27,7 +28,7 @@ def test_dropdown_presence_credit_card(
2728
about_prefs_privacy.open()
2829
about_prefs_privacy.switch_to_saved_payments_popup_iframe()
2930

30-
credit_card_sample_data = util.fake_credit_card_data()
31+
credit_card_sample_data = util.fake_credit_card_data(region)
3132
about_prefs.click_on("panel-popup-button", labels=["autofill-manage-add-button"])
3233
about_prefs_privacy.fill_cc_panel_information(credit_card_sample_data)
3334

l10n_CM/Unified/test_demo_cc_yellow_highlight.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from modules.browser_object_autofill_popup import AutofillPopup
55
from modules.page_object import AboutPrefs, CreditCardFill
6-
from modules.util import BrowserActions, Utilities
6+
from modules.util import Utilities
77

88

99
@pytest.fixture()
@@ -13,6 +13,7 @@ def test_case():
1313

1414
def test_cc_yellow_highlight(
1515
driver: Firefox,
16+
region: str,
1617
util: Utilities,
1718
about_prefs_privacy: AboutPrefs,
1819
about_prefs: AboutPrefs,
@@ -26,7 +27,7 @@ def test_cc_yellow_highlight(
2627
# Save a credit card in about:preferences
2728
about_prefs_privacy.open()
2829
about_prefs_privacy.switch_to_saved_payments_popup_iframe()
29-
credit_card_sample_data = util.fake_credit_card_data()
30+
credit_card_sample_data = util.fake_credit_card_data(region)
3031
about_prefs.click_on("panel-popup-button", labels=["autofill-manage-add-button"])
3132
about_prefs.fill_cc_panel_information(credit_card_sample_data)
3233

l10n_CM/region/Isolated.json

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

l10n_CM/region/Unified.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
{
22
"tests": [
3-
"test_demo_ad_address_data_captured_in_doorhanger_and_stored.py",
4-
"test_demo_ad_autofill_name_org.py",
5-
"test_demo_ad_autofill_phone_email.py",
6-
"test_demo_ad_doorhanger_shown_on_valid_address_submission.py",
7-
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py",
8-
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py",
9-
"test_demo_ad_yellow_highlight.py"
3+
"test_demo_ad_address_data_captured_in_doorhanger_and_stored.py",
4+
"test_demo_ad_autofill_name_org.py",
5+
"test_demo_ad_autofill_phone_email.py",
6+
"test_demo_ad_doorhanger_shown_on_valid_address_submission.py",
7+
"test_demo_ad_email_phone_captured_in_doorhanger_and_stored.py",
8+
"test_demo_ad_name_org_captured_in_doorhanger_and_stored.py",
9+
"test_demo_ad_yellow_highlight.py",
10+
"test_demo_cc_add_new_credit_card.py",
11+
"test_demo_cc_clear_form.py",
12+
"test_demo_cc_doorhanger_data_is_stored_in_about_prefs.py",
13+
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
14+
"test_demo_cc_dropdown_presence.py",
15+
"test_demo_cc_yellow_highlight.py"
1016
]
1117
}

l10n_CM/run_l10n.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from json import load
66

77
current_dir = os.path.dirname(__file__)
8-
valid_flags = {"--run-headless", "-n", "--reruns", "-isolated"}
8+
valid_flags = {"--run-headless", "-n", "--reruns"}
99
flag_with_parameter = {"-n", "--reruns"}
1010
valid_region = {"US", "CA", "DE", "FR"}
1111

@@ -108,11 +108,6 @@ def run_unified(regions, unified_flags):
108108
if __name__ == "__main__":
109109
arguments = sys.argv[1:]
110110
flags = get_flags_and_sanitize(arguments)
111-
if "-isolated" in flags:
112-
tests = get_region_tests("Isolated")
113-
flags.remove("-isolated")
114-
logging.info(f"Running Region Independent Tests.")
115-
run_tests("US", flags, tests)
116111
if len(arguments) == 0:
117112
logging.info(f"Running Unified Tests for {valid_region} Regions.")
118113
run_unified(list(valid_region), flags)

0 commit comments

Comments
 (0)