Skip to content

Commit 251a8e0

Browse files
committed
Minor improvement on comments
1 parent 5b0e79a commit 251a8e0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/page_object_autofill.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,28 +326,28 @@ def verify_field_yellow_highlights(self, expected_highlighted_fields=None):
326326
Verifies that specified form fields have the expected highlight state
327327
"""
328328
if expected_highlighted_fields is None:
329-
expected_highlighted_fields = (
330-
self.fields
331-
) # Uses the default fields defined in the class
329+
expected_highlighted_fields = self.fields
332330

333331
browser_action_obj = BrowserActions(self.driver)
334332

333+
# Check if a color is yellow-ish
335334
def is_yellow_highlight(rgb_tuple):
336335
if len(rgb_tuple) == 3:
337336
r, g, b = rgb_tuple
338337
elif len(rgb_tuple) >= 4:
339338
r, g, b, *_ = rgb_tuple
340339
else:
341340
return False
341+
# Uses a tolerance to detect a yellow highlight
342342
return r >= 250 and g >= 250 and 180 < b < 220
343343

344344
all_fields = self.fields + ["cc-csc"]
345345

346346
for field_name in all_fields:
347-
# Bring the field into focus
347+
# Bring the fields into focus
348348
self.click_on("form-field", labels=[field_name])
349349

350-
# Get color of the fields
350+
# Get the color of the fields
351351
selector = self.get_selector("form-field", labels=[field_name])
352352
colors = browser_action_obj.get_all_colors_in_element(selector)
353353
logging.info(f"Colors found in {field_name}: {colors}")

0 commit comments

Comments
 (0)