Skip to content

Commit 113dbca

Browse files
Changing variable names to be more descriptive
1 parent cdca502 commit 113dbca

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

utils/dataset_field_util.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ def _check_table_row(
168168
if row.count() == 0 or not row.is_visible():
169169
return False
170170
cells = row.locator("xpath=./*").all()
171-
cell_idx = next(
171+
label_cell_index = next(
172172
(
173-
i
174-
for i, cell in enumerate(cells)
173+
cell_index
174+
for cell_index, cell in enumerate(cells)
175175
if text.strip() in cell.inner_text().strip()
176176
),
177177
None,
178178
)
179-
if cell_idx is None or cell_idx + 1 >= len(cells):
179+
if label_cell_index is None or label_cell_index + 1 >= len(cells):
180180
return False
181-
right_cell = cells[cell_idx + 1]
181+
right_cell = cells[label_cell_index + 1]
182182
if self._assert_right_cell(right_cell, text, expected_text):
183183
logging.info(f"The cell next to {text} contains {expected_text}")
184184
return True
@@ -196,19 +196,19 @@ def _assert_right_cell(
196196
Returns:
197197
bool: True if the expected value is found, False otherwise.
198198
"""
199-
input_el = right_cell.locator("input")
200-
if input_el.count() > 0:
201-
value = input_el.first.input_value().strip()
199+
input_locator = right_cell.locator("input")
200+
if input_locator.count() > 0:
201+
value = input_locator.first.input_value().strip()
202202
if value == expected_text:
203203
logging.info(
204204
f'Input to the right of "{text}" contains "{expected_text}"'
205205
)
206206
return True
207207
return False
208208

209-
select_el = right_cell.locator("select")
210-
if select_el.count() > 0:
211-
selected = select_el.locator("option:checked").inner_text().strip()
209+
select_locator = right_cell.locator("select")
210+
if select_locator.count() > 0:
211+
selected = select_locator.locator("option:checked").inner_text().strip()
212212
if selected == expected_text:
213213
logging.info(
214214
f'Select to the right of "{text}" contains "{expected_text}"'
@@ -375,8 +375,8 @@ def assert_radio_to_right_is_selected(
375375

376376
found_match = False
377377

378-
for i in range(count):
379-
radio = radio_buttons.nth(i)
378+
for radio_index in range(count):
379+
radio = radio_buttons.nth(radio_index)
380380
if radio.is_checked():
381381
# Try both wrapped label and label-for approaches
382382
label_text = radio.evaluate(

0 commit comments

Comments
 (0)