add sanity check
This commit is contained in:
parent
11e58c891e
commit
726f0b11dc
@ -153,8 +153,9 @@ def filter_row_by_date(reservation_row: webelement.WebElement) -> bool:
|
||||
|
||||
rows = get_reservation_rows()
|
||||
|
||||
print('found ' + str(len(rows)) + ' reservations to add reservation comment to')
|
||||
for i in range(0, len(rows)):
|
||||
row_count = len(rows)
|
||||
print('found ' + str(row_count) + ' reservations to add reservation comment to')
|
||||
for i in range(0, row_count):
|
||||
row = rows[i]
|
||||
student_name = row.find_element(By.XPATH, './td[contains(@class, "cdk-column-Customer")]').get_attribute("innerText")
|
||||
reservation_date = row.find_element(By.XPATH, './td[contains(@class, "cdk-column-date")]').get_attribute("innerText")
|
||||
@ -186,7 +187,7 @@ for i in range(0, len(rows)):
|
||||
textarea = comments.find_element(By.ID, 'comments')
|
||||
|
||||
textarea.clear()
|
||||
comment_text = "c172 " + today.strftime('%d %b, %H:%M')
|
||||
comment_text = "c172 " + today.strftime('%d %b %H%M')
|
||||
print('comment text: ' + comment_text)
|
||||
textarea.send_keys(comment_text)
|
||||
|
||||
@ -200,5 +201,8 @@ for i in range(0, len(rows)):
|
||||
|
||||
driver.find_element(By.XPATH, '//button[contains(@ng-click, "dismissModal()")]').click()
|
||||
rows = get_reservation_rows()
|
||||
# If count of reservation rows changes, something is wrong
|
||||
if len(rows) is not row_count:
|
||||
die('reservation row count changed, aborting...')
|
||||
|
||||
die()
|
||||
Loading…
Reference in New Issue
Block a user