Skip to content

Commit 2afda2c

Browse files
Merge pull request #554 from mozilla/philimon/autofill_refactor_#2
Philimon/autofill refactor #2
2 parents 95704bd + b70d6f6 commit 2afda2c

File tree

48 files changed

+492
-772
lines changed

Some content is hidden

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

48 files changed

+492
-772
lines changed

SELECTOR_INFO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,7 @@ Path to .json: modules/data/autofill_popup.components.json
13831383
```
13841384
```
13851385
Selector Name: doorhanger-save-button
1386-
Selector Data: button[label='Save'].popup-notification-primary-button
1386+
Selector Data: button[label^='Save'].popup-notification-primary-button
13871387
Description: The "Save" button
13881388
Location: Inside the autofill save doorhangers (address and credit card) that is triggered in navigation bar
13891389
Path to .json: modules/data/autofill_popup.components.json
@@ -1418,7 +1418,7 @@ Path to .json: modules/data/autofill_popup.components.json
14181418
```
14191419
```
14201420
Selector Name: doorhanger-update-button
1421-
Selector Data: "button[label='Update']"
1421+
Selector Data: "button[label^='Update']"
14221422
Description: The "Update" button
14231423
Location: Inside the autofill save addreses doorhanger that is triggered in navigation bar
14241424
Path to .json: modules/data/autofill_popup.components.json

l10n_CM/Unified/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ def about_prefs(driver):
5858

5959

6060
@pytest.fixture()
61-
def credit_card_fill_obj(driver):
61+
def credit_card_autofill(driver):
6262
yield CreditCardFill(driver)

l10n_CM/Unified/test_demo_ad_1a_dropdown_name_org_fields.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ def test_dropdown_presence_name_organization(
2525

2626
# Create fake data and fill it in
2727
address_autofill.open()
28-
address_autofill.fill_and_save(util, autofill_popup, region)
28+
address_autofill.fill_and_save(region)
2929

3030
# Verify that the name and organization fields have the autofill dropdown present
3131
fields_to_test = ["name", "organization"]
3232

33-
address_autofill.verify_autofill_dropdown_addresses(
34-
autofill_popup=autofill_popup, fields_to_test=fields_to_test, region=region
33+
address_autofill.verify_field_autofill_dropdown(
34+
region=region, fields_to_test=fields_to_test
3535
)

l10n_CM/Unified/test_demo_ad_1b_dropdown_address_fields.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_dropdown_presence_address_field(
2525

2626
# Create fake data and fill it in
2727
address_autofill.open()
28-
address_autofill.fill_and_save(util, autofill_popup, region)
28+
address_autofill.fill_and_save(region)
2929

3030
fields_to_test = [
3131
"street-address",
@@ -35,6 +35,6 @@ def test_dropdown_presence_address_field(
3535
"country",
3636
]
3737

38-
address_autofill.verify_autofill_dropdown_addresses(
39-
autofill_popup=autofill_popup, fields_to_test=fields_to_test, region=region
38+
address_autofill.verify_field_autofill_dropdown(
39+
region=region, fields_to_test=fields_to_test
4040
)

l10n_CM/Unified/test_demo_ad_1c_dropdown_phone_email_fields.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ def test_dropdown_presence_email_phone_field(
2525

2626
# Open autofill page and fill fake data
2727
address_autofill.open()
28-
address_autofill.fill_and_save(util, autofill_popup, region)
28+
address_autofill.fill_and_save(region)
2929

3030
fields_to_test = ["email", "tel"]
3131

32-
address_autofill.verify_autofill_dropdown_addresses(
33-
autofill_popup=autofill_popup, fields_to_test=fields_to_test, region=region
32+
address_autofill.verify_field_autofill_dropdown(
33+
region=region, fields_to_test=fields_to_test
3434
)

l10n_CM/Unified/test_demo_ad_2a_preview_name_org_fields.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ def test_demo_ad_hover_name_org(
2323
"""
2424
# Create fake data and fill it in
2525
address_autofill.open()
26-
autofill_data = address_autofill.fill_and_save(util, autofill_popup, region)
26+
autofill_data = address_autofill.fill_and_save(region)
2727

2828
# Hover over each field and check data preview
2929
fields_to_test = ["name", "organization"]
3030
for field in fields_to_test:
31-
address_autofill.check_autofill_preview_for_field(
32-
field, autofill_data, autofill_popup, util, region
33-
)
31+
address_autofill.check_autofill_preview_for_field(field, autofill_data, region)

l10n_CM/Unified/test_demo_ad_2b_preview_address_fields.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_hover_address_is_previewed(
3333
"""
3434
# Create fake data and fill it in
3535
address_autofill.open()
36-
autofill_data = address_autofill.fill_and_save(util, autofill_popup, region)
36+
autofill_data = address_autofill.fill_and_save(region)
3737

3838
# Hover over each field and check data preview
3939
fields_to_test = [
@@ -44,6 +44,4 @@ def test_hover_address_is_previewed(
4444
"country",
4545
]
4646
for field in fields_to_test:
47-
address_autofill.check_autofill_preview_for_field(
48-
field, autofill_data, autofill_popup, util, region
49-
)
47+
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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ def test_hover_email_and_phone_autofill_preview(
2222
):
2323
# Create fake data and fill it in
2424
address_autofill.open()
25-
autofill_data = address_autofill.fill_and_save(util, autofill_popup, region)
25+
autofill_data = address_autofill.fill_and_save(region)
2626

2727
# Hover over each field and check data preview
2828
fields_to_test = ["email", "tel"]
2929
for field in fields_to_test:
30-
address_autofill.check_autofill_preview_for_field(
31-
field, autofill_data, autofill_popup, util, region
32-
)
30+
address_autofill.check_autofill_preview_for_field(field, autofill_data, region)

l10n_CM/Unified/test_demo_ad_3a_autofill_address_fields.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_demo_ad_autofill_address_fields(
2323
"""
2424
# Create fake data and fill it in
2525
address_autofill.open()
26-
address_autofill_data = address_autofill.fill_and_save(util, autofill_popup, region)
26+
address_autofill_data = address_autofill.fill_and_save(region)
2727

2828
# List of field labels to be autofilled and verified
2929
fields_to_test = [
@@ -36,6 +36,4 @@ def test_demo_ad_autofill_address_fields(
3636

3737
# Loop through each field and perform the autofill test
3838
for field in fields_to_test:
39-
address_autofill.autofill_and_verify(
40-
autofill_popup, field, address_autofill_data, util
41-
)
39+
address_autofill.clear_and_verify(field, address_autofill_data, region=region)

l10n_CM/Unified/test_demo_ad_3b_autofill_name_org_fields.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@ def test_demo_ad_autofill_name_org(
2323
"""
2424
# Create fake data and fill it in
2525
address_autofill.open()
26-
address_autofill_data = address_autofill.fill_and_save(util, autofill_popup, region)
26+
address_autofill_data = address_autofill.fill_and_save(region)
2727

2828
# List of field labels to be autofilled and verified
2929
fields_to_test = ["name", "organization"]
3030

3131
# Loop through each field and perform the autofill test
3232
for field in fields_to_test:
33-
address_autofill.autofill_and_verify(
34-
autofill_popup, field, address_autofill_data, util
35-
)
33+
address_autofill.clear_and_verify(field, address_autofill_data, region=region)

0 commit comments

Comments
 (0)