Skip to content

Commit f3a6dfb

Browse files
Merge branch 'main' into philimon/dynamic_addressfill
2 parents fa3a439 + 29f9596 commit f3a6dfb

File tree

7 files changed

+96
-68
lines changed

7 files changed

+96
-68
lines changed

.github/pull_request_template.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
1-
### Description
1+
### Relevant Links
22

3-
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
3+
Bugzilla: _
4+
TestRail: _
45

5-
### Bugzilla bug ID
6+
### Description of Code / Doc Changes
67

7-
**Testrail:**
8-
**Link:**
8+
_Leave a bullet-pointed list of changes you made._
99

10-
### Type of change
10+
### Process Changes Required
1111

12-
Please delete options that are not relevant.
12+
_Mark the relevant boxes:_
1313

14-
- [ ] New Test
15-
- [ ] New POM
16-
- [ ] Other Changes (Please specify)
14+
- [ ] Adds a dependency (rerun `pipenv install`)
15+
- [ ] Changes the BasePage
16+
- [ ] Changes or creates a BOM/POM (name the object model): _
17+
- [ ] Changes CI flow
18+
- [ ] Changes scheduled Beta or DevEdition
19+
- [ ] Changes Git hooks or Github settings
20+
- [ ] Changes L10n harness
1721

18-
### How does this resolve / make progress on that bug?
22+
### Screenshots or Explanations
1923

20-
Please describe the progress or significance with respect to the bug listed above.
24+
_If you need to explain your code, do it here._
2125

22-
### Screenshots / Explanations
26+
### Comments or Future Work
2327

24-
Please upload any relevant media or add a relevant description with respect to the bug listed above.
28+
_Do we need to start another PR soon to address something you saw while working on this?_
2529

26-
### Comments / Concerns
30+
### Workflow Checklist
2731

28-
Please add a short blurb about any comments or concerns that this change might cause.
32+
- [ ] Please request reviewers
33+
- [ ] If this is an unblocker, please post in Slack.
34+
- [ ] If asked to address comments, please resolve conversations.
35+
- [ ] If asked to change code, please re-request review from the person who wanted changes.
36+
37+
Thank you!

choose_ci_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def dedupe(run_list: list, slash: str) -> list:
139139
.splitlines()
140140
)
141141

142-
main_conftest = os.path.join(SCRIPT_DIR, "conftest.py")
143-
base_page = os.path.join(SCRIPT_DIR, "modules", "page_base.py")
142+
main_conftest = "conftest.py"
143+
base_page = os.path.join("modules", "page_base.py")
144144

145145
if main_conftest in committed_files or base_page in committed_files:
146146
# Run all the tests (no files as arguments) if main conftest or basepage changed

l10n_CM/Unified/test_demo_ad_autofill_name_org.py

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,13 @@ def test_demo_ad_autofill_name_org(
2929
# Click the "Save" button
3030
autofill_popup.click_doorhanger_button("save")
3131

32-
# Double inside Name field and select a saved address entry from the dropdown
33-
address_autofill.double_click("form-field", labels=["name"])
34-
35-
# Click on the first element from the autocomplete dropdown
36-
first_item = autofill_popup.get_nth_element(1)
37-
autofill_popup.click_on(first_item)
38-
39-
# Verify autofill data
40-
address_autofill.verify_autofill_data(address_autofill_data, region, util)
41-
42-
# Double inside Name field and select clear form autofill
43-
address_autofill.double_click("form-field", labels=["name"])
44-
autofill_popup.click_clear_form_option()
45-
46-
# Double inside Organization field and select a saved address entry from the dropdown
47-
address_autofill.double_click("form-field", labels=["organization"])
48-
49-
# Click on the first element from the autocomplete dropdown
50-
first_item = autofill_popup.get_nth_element(1)
51-
autofill_popup.click_on(first_item)
52-
53-
# Verify autofill data
54-
address_autofill.verify_autofill_data(address_autofill_data, region, util)
32+
# List of field labels to be autofilled and verified
33+
fields_to_test = [
34+
"name",
35+
"organization"
36+
]
37+
38+
# Loop through each field and perform the autofill test
39+
for field in fields_to_test:
40+
address_autofill.autofill_and_verify(autofill_popup, field,
41+
address_autofill_data, util)

l10n_CM/Unified/test_demo_ad_autofill_phone_email.py

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,13 @@ def test_demo_ad_autofill_phone_email(
3030
# Click the "Save" button
3131
autofill_popup.click_doorhanger_button("save")
3232

33-
# Double inside phone field and select a saved address entry from the dropdown
34-
address_autofill.double_click("form-field", labels=["tel"])
35-
36-
# Click on the first element from the autocomplete dropdown
37-
first_item = autofill_popup.get_nth_element(1)
38-
autofill_popup.click_on(first_item)
39-
40-
# Verify autofill data
41-
address_autofill.verify_autofill_data(address_autofill_data, region, util)
42-
43-
# Double inside phone field and select clear form autofill
44-
address_autofill.double_click("form-field", labels=["tel"])
45-
autofill_popup.click_clear_form_option()
46-
47-
# Double inside email field and select a saved address entry from the dropdown
48-
address_autofill.double_click("form-field", labels=["email"])
49-
50-
# Click on the first element from the autocomplete dropdown
51-
first_item = autofill_popup.get_nth_element(1)
52-
autofill_popup.click_on(first_item)
53-
54-
# Verify autofill data
55-
address_autofill.verify_autofill_data(address_autofill_data, region, util)
33+
# List of field labels to be autofilled and verified
34+
fields_to_test = [
35+
"email",
36+
"tel"
37+
]
38+
39+
# Loop through each field and perform the autofill test
40+
for field in fields_to_test:
41+
address_autofill.autofill_and_verify(autofill_popup, field,
42+
address_autofill_data, util)
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 import AboutPrefs, CreditCardFill
6+
from modules.util import Utilities
7+
8+
9+
10+
@pytest.fixture()
11+
def test_case():
12+
return "2886600"
13+
14+
15+
def test_cc_autofill_from_dropdown(
16+
driver: Firefox,
17+
util: Utilities,
18+
autofill_popup: AutofillPopup,
19+
credit_card_fill_obj: CreditCardFill,
20+
21+
):
22+
"""
23+
Verify that saved credit card information is autofilled correctly when selected from the dropdown,
24+
except for the CVV field.
25+
"""
26+
27+
# Open credit card form page
28+
credit_card_fill_obj.open()
29+
30+
# Create and save fake credit card data
31+
credit_card_data = util.fake_credit_card_data()
32+
credit_card_fill_obj.fill_credit_card_info(credit_card_data)
33+
autofill_popup.click_doorhanger_button("save")
34+
35+
# Autocomplete and clear all fields
36+
credit_card_fill_obj.autofill_and_clear_all_fields(autofill_popup, credit_card_data)
37+
38+
# Step 5: Click the csc field (cc-csc), ensure autofill popup is not present
39+
credit_card_fill_obj.click_on("form-field", labels=["cc-csc"]) # Use single click
40+
autofill_popup.ensure_autofill_dropdown_not_visible()

l10n_CM/region/Unified.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"test_demo_cc_doorhanger_data_is_stored_in_about_prefs.py",
1313
"test_demo_cc_doorhanger_shown_on_valid_credit_card_submission.py",
1414
"test_demo_cc_dropdown_presence.py",
15+
"test_demo_cc_autofill_from_dropdown.py",
1516
"test_demo_cc_yellow_highlight.py",
1617
"test_demo_ad_autofill_address_fields.py",
1718
"test_demo_ad_yellow_highlight_name_org.py",

modules/page_base.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,9 @@ def wait_for_num_tabs(self, num_tabs: int) -> Page:
674674
try:
675675
self.wait.until(lambda _: len(self.driver.window_handles) == num_tabs)
676676
except TimeoutException:
677-
logging.warn("Timeout waiting for the number of windows to be:", num_tabs)
677+
logging.warning(
678+
"Timeout waiting for the number of windows to be:", num_tabs
679+
)
678680
return self
679681

680682
def switch_to_new_tab(self) -> Page:
@@ -723,9 +725,11 @@ def open_and_switch_to_private_window_via_keyboard(self) -> Page:
723725
self.actions.send_keys("p")
724726
self.actions.key_up(Keys.SHIFT)
725727
self.actions.key_up(mod_key).perform()
726-
expected_window_count = window_count + 1
727-
self.wait_for_num_windows(expected_window_count)
728-
self.switch_to_new_window()
728+
expected_window_count = window_count + 1
729+
self.wait_for_num_windows(expected_window_count)
730+
self.switch_to_new_window()
731+
self.title_contains("Private")
732+
self.driver.get("about:blank")
729733
return self
730734

731735
def switch_to_frame(self, frame: str, labels=[]) -> Page:

0 commit comments

Comments
 (0)