Skip to content

Commit 51f7c66

Browse files
svusersvuser
authored andcommitted
Grouped testrail scripts together
1 parent e0a2038 commit 51f7c66

File tree

56 files changed

+199
-214
lines changed

Some content is hidden

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

56 files changed

+199
-214
lines changed

l10n_CM/Unified/test_demo_ad_7a_capture_doorhanger_stored_data_name_org_fields.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ def test_demo_ad_name_org_captured_in_doorhanger_and_stored(
6464
if field_value not in saved_address_profile:
6565
missing_fields.append(f"{field_name}: {field_value}")
6666

67-
assert not missing_fields, (
68-
f"The following fields were not found in the saved address: {', '.join(missing_fields)}"
69-
)
67+
assert not missing_fields, f"The following fields were not found in the saved address: {', '.join(missing_fields)}"
7068
else:
7169
pytest.skip("Doorhanger not tested for Live Sites.")

l10n_CM/Unified/test_demo_ad_7b_capture_doorhanger_stored_data_address_fields.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ def test_demo_ad_address_data_captured_in_doorhanger_and_stored(
7676
if field_value not in saved_address_profile:
7777
missing_fields.append(f"{field_name}: {field_value}")
7878

79-
assert not missing_fields, (
80-
f"The following fields were not found in the saved address: {', '.join(missing_fields)}"
81-
)
79+
assert not missing_fields, f"The following fields were not found in the saved address: {', '.join(missing_fields)}"
8280
else:
8381
pytest.skip("Doorhanger not tested for Live Sites.")

l10n_CM/Unified/test_demo_ad_7c_capture_doorhanger_stored_data_phone_email.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ def test_demo_ad_email_phone_captured_in_doorhanger_and_stored(
6565
if field_value not in saved_address_profile:
6666
missing_fields.append(f"{field_name}: {field_value}")
6767

68-
assert not missing_fields, (
69-
f"The following fields were not found in the saved address: {', '.join(missing_fields)}"
70-
)
68+
assert not missing_fields, f"The following fields were not found in the saved address: {', '.join(missing_fields)}"
7169
else:
7270
pytest.skip("Doorhanger not tested for Live Sites.")

l10n_CM/Unified/test_demo_cc_7_capture_doorhanger_capture_and_stored_data.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ def test_demo_cc_data_captured_in_doorhanger_and_stored(
3333
credit_card_sample_data = credit_card_autofill.fill_and_save(door_hanger=False)
3434

3535
# The "Save credit card?" doorhanger is displayed
36-
assert autofill_popup.element_visible("doorhanger-save-button"), (
37-
"Credit card save doorhanger is not visible"
38-
)
36+
assert autofill_popup.element_visible(
37+
"doorhanger-save-button"
38+
), "Credit card save doorhanger is not visible"
3939

4040
# Verify Credit Card Doorhanger Data
4141
doorhanger_text = autofill_popup.get_cc_doorhanger_data("cc-doorhanger-data")
42-
assert credit_card_sample_data.card_number[-4:] in doorhanger_text, (
43-
f"Expected last 4 digits '{credit_card_sample_data.card_number[-4:]}' but not found."
44-
)
45-
assert credit_card_sample_data.name in doorhanger_text, (
46-
f"Expected name '{credit_card_sample_data.name}' but not found."
47-
)
48-
assert credit_card_sample_data.cvv not in doorhanger_text, (
49-
f"CVV '{credit_card_sample_data.cvv}' should not be saved, but found in doorhanger."
50-
)
42+
assert (
43+
credit_card_sample_data.card_number[-4:] in doorhanger_text
44+
), f"Expected last 4 digits '{credit_card_sample_data.card_number[-4:]}' but not found."
45+
assert (
46+
credit_card_sample_data.name in doorhanger_text
47+
), f"Expected name '{credit_card_sample_data.name}' but not found."
48+
assert (
49+
credit_card_sample_data.cvv not in doorhanger_text
50+
), f"CVV '{credit_card_sample_data.cvv}' should not be saved, but found in doorhanger."
5151

5252
# Click the "Save" button using click_doorhanger_button
5353
autofill_popup.click_doorhanger_button("save")
@@ -63,14 +63,16 @@ def test_demo_cc_data_captured_in_doorhanger_and_stored(
6363
saved_cc_profile = [x.strip() for x in saved_cc_profiles[0].text.split(",")]
6464

6565
# Validate stored values match expected values
66-
assert saved_cc_profile[0].endswith(credit_card_sample_data.card_number[-4:]), (
67-
f"Expected last 4 digits '{credit_card_sample_data.card_number[-4:]}' but got '{saved_cc_profile[0]}'"
68-
)
69-
assert saved_cc_profile[1] == credit_card_sample_data.name, (
70-
f"Expected name '{credit_card_sample_data.name}' but got '{saved_cc_profile[1]}'"
71-
)
72-
assert credit_card_sample_data.cvv not in saved_cc_profile, (
73-
f"CVV '{credit_card_sample_data.cvv}' should not be saved, but found in stored values."
74-
)
66+
assert saved_cc_profile[
67+
0
68+
].endswith(
69+
credit_card_sample_data.card_number[-4:]
70+
), f"Expected last 4 digits '{credit_card_sample_data.card_number[-4:]}' but got '{saved_cc_profile[0]}'"
71+
assert (
72+
saved_cc_profile[1] == credit_card_sample_data.name
73+
), f"Expected name '{credit_card_sample_data.name}' but got '{saved_cc_profile[1]}'"
74+
assert (
75+
credit_card_sample_data.cvv not in saved_cc_profile
76+
), f"CVV '{credit_card_sample_data.cvv}' should not be saved, but found in stored values."
7577
else:
7678
pytest.skip("Doorhanger not tested for Live Sites.")

modules/browser_object_tracker_panel.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,7 @@ def verify_tracker_shield_indicator(self, nav: Navigation) -> BasePage:
145145
assert (
146146
shield_icon.get_attribute("data-l10n-id")
147147
== "tracking-protection-icon-active-container"
148-
), (
149-
"The label detected did not correspond to the expected one: tracking-protection-icon-active-container"
150-
)
148+
), "The label detected did not correspond to the expected one: tracking-protection-icon-active-container"
151149
return self
152150

153151
def open_and_return_cross_site_trackers(self) -> List[WebElement]:

modules/page_base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ def verify_opened_image_url(self, url_substr: str, pattern: str) -> Page:
462462
self.url_contains(url_substr)
463463
current_url = self.driver.current_url
464464

465-
assert re.match(pattern, current_url), (
466-
f"URL does not match the expected pattern: {current_url}"
467-
)
465+
assert re.match(
466+
pattern, current_url
467+
), f"URL does not match the expected pattern: {current_url}"
468468
return self
469469

470470
def fill(
@@ -515,9 +515,9 @@ def fetch(self, reference: Union[str, tuple, WebElement], labels=[]) -> WebEleme
515515
return self.find_element(*reference)
516516
elif isinstance(reference, WebElement):
517517
return reference
518-
assert False, (
519-
"Bad fetch: only selectors, selector names, or WebElements allowed."
520-
)
518+
assert (
519+
False
520+
), "Bad fetch: only selectors, selector names, or WebElements allowed."
521521

522522
def click_on(self, reference: Union[str, tuple, WebElement], labels=[]) -> Page:
523523
"""Click on an element, no matter the context, return the page"""

modules/page_object_autofill.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ def verify_form_data(self, sample_data: CreditCardBase | AutofillAddressBase):
244244
expected_value = self.util.get_state_province_abbreviation(
245245
expected_value
246246
)
247-
assert expected_value in autofilled_field_value, (
248-
f"{autofilled_field_value} is different from {expected_value}"
249-
)
247+
assert (
248+
expected_value in autofilled_field_value
249+
), f"{autofilled_field_value} is different from {expected_value}"
250250

251251
def verify_field_autofill_dropdown(
252252
self,
@@ -388,14 +388,14 @@ def is_yellow_highlight(rgb_tuple):
388388

389389
# Assert based on expectation
390390
if should_be_highlighted:
391-
assert is_field_highlighted, (
392-
f"Expected yellow highlight on '{field}', but none found."
393-
)
391+
assert (
392+
is_field_highlighted
393+
), f"Expected yellow highlight on '{field}', but none found."
394394
logging.info(f"Yellow highlight found in '{field}'.")
395395
else:
396-
assert not is_field_highlighted, (
397-
f"Expected NO yellow highlight on '{field}', but found one."
398-
)
396+
assert (
397+
not is_field_highlighted
398+
), f"Expected NO yellow highlight on '{field}', but found one."
399399
logging.info(f"No yellow highlight in '{field}', as expected.")
400400
else:
401401
logging.info(
@@ -439,9 +439,9 @@ def verify_autofill_data_on_hover(
439439
raise ValueError("Given preview data is incomplete.")
440440
container_data = container.get("fillMessageData", {}).get("profile", {})
441441
assert container_data, "No preview data available."
442-
assert all(field in container_data.keys() for field in self.preview_fields), (
443-
f"Not all fields present in preview data."
444-
)
442+
assert all(
443+
field in container_data.keys() for field in self.preview_fields
444+
), f"Not all fields present in preview data."
445445

446446
# sanitize data
447447
if autofill_data.__class__ == CreditCardBase:
@@ -463,9 +463,7 @@ def verify_autofill_data_on_hover(
463463
is_present = any(
464464
[value in val for val in autofill_data.__dict__.values()]
465465
)
466-
assert is_present, (
467-
f"Mismatched data: {(field, value)} not in {autofill_data.__dict__.values()}."
468-
)
466+
assert is_present, f"Mismatched data: {(field, value)} not in {autofill_data.__dict__.values()}."
469467

470468
def sanitize_preview_data(self, field, value):
471469
if field == "cc-number":

modules/page_object_prefs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ def verify_cc_edit_saved_payments_profile(
170170
field_value = element.get_attribute("value")
171171
if field_value.isnumeric():
172172
field_value = int(field_value)
173-
assert field_value in expected_cc_data, (
174-
f"{(field_name, field_value)} not found in generated data."
175-
)
173+
assert (
174+
field_value in expected_cc_data
175+
), f"{(field_name, field_value)} not found in generated data."
176176
assert field_value != expected_cvv, "CVV is displayed."
177177
select_elements = form_container.find_elements(By.TAG_NAME, "select")
178178
for element in select_elements:
@@ -183,9 +183,9 @@ def verify_cc_edit_saved_payments_profile(
183183
field_value = val.first_selected_option.get_attribute("value")[-2:]
184184
if field_value.isnumeric():
185185
field_value = int(field_value)
186-
assert field_value in expected_cc_data, (
187-
f"{(field_name, field_value)} not found in generated data."
188-
)
186+
assert (
187+
field_value in expected_cc_data
188+
), f"{(field_name, field_value)} not found in generated data."
189189
assert field_value != expected_cvv, "CVV is displayed."
190190
return self
191191

modules/testrail_scripts/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)