Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anca/ US demo - Add new credit card #423

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions l10n_CM/US/test_us_demo_cc_add_new_credit_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,35 @@ def test_case():
@pytest.mark.xfail(platform.system() == "Linux", reason="Autofill Linux instability")
def test_create_new_cc_profile(driver: Firefox):
"""
C122389, tests you can create and save a new Credit Card profile
C2886595 - tests you can create and save a new Credit Card profile
"""
# instantiate objects

# Instantiate objects
util = Utilities()
browser_action_obj = BrowserActions(driver)
about_prefs = AboutPrefs(driver, category="privacy")
about_prefs_cc_popup = AboutPrefs(driver)

# go to about:preferences#privacy and open Saved Payment Methods
about_prefs = AboutPrefs(driver, category="privacy").open()
# Go to about:preferences#privacy and open Saved Payment Methods
about_prefs.open()
iframe = about_prefs.get_saved_payments_popup_iframe()
browser_action_obj.switch_to_iframe_context(iframe)

# save CC data by using the fake data
# Save CC information using fake data
credit_card_sample_data = util.fake_credit_card_data()
about_prefs_cc_popup = AboutPrefs(driver)

# add a new CC profile
about_prefs_cc_popup.get_element(
# Add a new CC profile
about_prefs_cc_popup.element_clickable(
"panel-popup-button", labels=["autofill-manage-add-button"]
).click()

)
about_prefs_cc_popup.click_on(
"panel-popup-button", labels=["autofill-manage-add-button"]
)
about_prefs.fill_cc_panel_information(credit_card_sample_data)

# get the saved CC data
# Get the saved CC data
cc_profiles = about_prefs_cc_popup.get_all_saved_cc_profiles()
cc_info_json = json.loads(cc_profiles[0].get_dom_attribute("data-l10n-args"))

# compare input CC data with saved CC data
# Compare input CC data with saved CC data
about_prefs.verify_cc_json(cc_info_json, credit_card_sample_data)
Loading