Skip to content

Commit e9839a8

Browse files
Hani YacoubHani Yacoub
authored andcommitted
merge main
2 parents a04c5fb + fe0c3be commit e9839a8

File tree

96 files changed

+777
-270
lines changed

Some content is hidden

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

96 files changed

+777
-270
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

conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def driver(
394394
fx_executable: str,
395395
opt_headless: bool,
396396
opt_implicit_timeout: int,
397-
set_prefs: List[Tuple],
397+
prefs_list: List[Tuple],
398398
opt_ci: bool,
399399
opt_window_size: str,
400400
use_profile: Union[bool, str],
@@ -426,7 +426,7 @@ def driver(
426426
opt_implicit_timeout: int
427427
Timeout, in seconds for driver-level wait attribute.
428428
429-
set_prefs: List[Tuple]
429+
prefs_list: List[Tuple]
430430
Preferences to set before the Firefox object is created.
431431
Usually set in the conftest.py inside a test suite folder.
432432
@@ -454,7 +454,7 @@ def driver(
454454
profile_path = tmp_path / use_profile
455455
unpack_archive(os.path.join("profiles", f"{use_profile}.zip"), profile_path)
456456
options.profile = profile_path
457-
for opt, value in set_prefs:
457+
for opt, value in prefs_list:
458458
options.set_preference(opt, value)
459459
driver = Firefox(options=options)
460460
separator = "x"

l10n_CM/Unified/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ def region():
1515

1616

1717
@pytest.fixture()
18-
def add_prefs(region: str):
18+
def add_to_prefs_list(region: str):
1919
return []
2020

2121

2222
@pytest.fixture()
23-
def set_prefs(add_prefs: List[tuple[str, str | bool]], region: str):
24-
"""Set prefs"""
23+
def prefs_list(add_to_prefs_list: List[tuple[str, str | bool]], region: str):
24+
"""List of prefs to send to main conftest.py driver fixture"""
2525
prefs = [
2626
("extensions.formautofill.creditCards.reauth.optout", False),
2727
("extensions.formautofill.reauth.enabled", False),
2828
("browser.aboutConfig.showWarning", False),
2929
("browser.search.region", region),
3030
]
31-
prefs.extend(add_prefs)
31+
prefs.extend(add_to_prefs_list)
3232
return prefs
3333

3434

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_autofill import AddressFill
6+
from modules.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888567"
12+
13+
14+
def test_dropdown_presence_email_phone_field(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
20+
):
21+
"""
22+
C2888567 - Verify that the autofill dropdown is displayed for the email and phone fields
23+
after the contact information was previously saved.
24+
"""
25+
26+
# Open autofill page
27+
address_autofill.open()
28+
29+
# Generate and save fake data
30+
address_autofill_data = util.fake_autofill_data(region)
31+
address_autofill.save_information_basic(address_autofill_data)
32+
33+
# Click the "Save" button
34+
autofill_popup.click_doorhanger_button("save")
35+
36+
fields_to_test = ["email", "tel"]
37+
38+
address_autofill.verify_autofill_dropdown_addresses(
39+
autofill_popup=autofill_popup, fields_to_test=fields_to_test, region=region
40+
)

l10n_CM/Unified/test_demo_ad_autofill_name_org.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,11 @@ 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 = ["name", "organization"]
34+
35+
# Loop through each field and perform the autofill test
36+
for field in fields_to_test:
37+
address_autofill.autofill_and_verify(
38+
autofill_popup, field, address_autofill_data, util
39+
)

l10n_CM/Unified/test_demo_ad_autofill_phone_email.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,11 @@ 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 = ["email", "tel"]
35+
36+
# Loop through each field and perform the autofill test
37+
for field in fields_to_test:
38+
address_autofill.autofill_and_verify(
39+
autofill_popup, field, address_autofill_data, util
40+
)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object_autofill import AddressFill
6+
from modules.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888565"
12+
13+
14+
def test_demo_ad_clear_address_fields(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
20+
):
21+
"""
22+
C2888565 - Verify clear functionality after selecting an entry from address fields
23+
"""
24+
# Create fake data and fill it in
25+
address_autofill.open()
26+
address_autofill_data = util.fake_autofill_data(region)
27+
address_autofill.save_information_basic(address_autofill_data)
28+
29+
# Click the "Save" button
30+
autofill_popup.click_doorhanger_button("save")
31+
32+
# List of field labels to be autofilled and verified
33+
fields_to_test = [
34+
"street-address",
35+
"address-level2",
36+
"address-level1", # This will be skipped for DE/FR
37+
"postal-code",
38+
"country",
39+
]
40+
41+
# Loop through each field and perform the autofill test
42+
for field in fields_to_test:
43+
address_autofill.clear_and_verify(autofill_popup, field, address_autofill_data)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object_autofill import AddressFill
6+
from modules.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888560"
12+
13+
14+
def test_demo_ad_clear_name_org(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
20+
):
21+
"""
22+
C2888560 - Verify clear functionality after selecting an entry from name/org fields
23+
"""
24+
# Create fake data and fill it in
25+
address_autofill.open()
26+
address_autofill_data = util.fake_autofill_data(region)
27+
address_autofill.save_information_basic(address_autofill_data)
28+
29+
# Click the "Save" button
30+
autofill_popup.click_doorhanger_button("save")
31+
32+
# List of field labels to be autofilled and verified
33+
fields_to_test = ["name", "organization"]
34+
35+
# Loop through each field and perform the autofill test
36+
for field in fields_to_test:
37+
address_autofill.clear_and_verify(autofill_popup, field, address_autofill_data)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import pytest
2+
from selenium.webdriver import Firefox
3+
4+
from modules.browser_object_autofill_popup import AutofillPopup
5+
from modules.page_object_autofill import AddressFill
6+
from modules.util import Utilities
7+
8+
9+
@pytest.fixture()
10+
def test_case():
11+
return "2888571"
12+
13+
14+
def test_demo_ad_clear_tel_email(
15+
driver: Firefox,
16+
region: str,
17+
address_autofill: AddressFill,
18+
util: Utilities,
19+
autofill_popup: AutofillPopup,
20+
):
21+
"""
22+
C2888571 - Verify clear functionality after selecting an entry from tele/email fields
23+
"""
24+
25+
# Create fake data and fill it in
26+
address_autofill.open()
27+
address_autofill_data = util.fake_autofill_data(region)
28+
address_autofill.save_information_basic(address_autofill_data)
29+
30+
# Click the "Save" button
31+
autofill_popup.click_doorhanger_button("save")
32+
33+
# List of field labels to be autofilled and verified
34+
fields_to_test = ["email", "tel"]
35+
36+
# Loop through each field and perform the autofill test
37+
for field in fields_to_test:
38+
address_autofill.clear_and_verify(autofill_popup, field, address_autofill_data)

0 commit comments

Comments
 (0)