Skip to content

Commit f324197

Browse files
minor error fix
1 parent 20f31e7 commit f324197

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

l10n_CM/Unified/test_demo_ad_5c_clear_phone_email_fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_demo_ad_clear_tel_email(
2525
address_autofill.open()
2626
address_autofill.fill_and_save(region)
2727

28-
# List of field labels to be autofilled and verified
28+
# List of field labels to be auto filled and verified
2929
fields_to_test = ["email", "tel"]
3030

3131
# Loop through each field and perform the autofill test

modules/page_object_autofill.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,16 @@ def verify_field_highlight(
186186
else:
187187
fields_to_actually_check = fields_to_test
188188

189-
is_yellow_highlight = lambda rgb: (
190-
rgb[0] >= 250 and rgb[1] >= 250 and 180 < rgb[2] < 220
191-
)
189+
def is_yellow_highlight(rgb_tuple):
190+
"""
191+
Returns True if the color tuple is bright yellow-ish.
192+
"""
193+
if len(rgb_tuple) == 3:
194+
r, g, b = rgb_tuple
195+
else:
196+
r, g, b, *_ = rgb_tuple
197+
198+
return (r >= 250) and (g >= 250) and (180 < b < 220)
192199

193200
for field_name in fields_to_actually_check:
194201
# Focus the field so the highlight is visible

0 commit comments

Comments
 (0)