better logs

This commit is contained in:
piair 2023-04-17 22:28:26 +02:00
parent 6f325c5a6a
commit 710c272659
2 changed files with 8 additions and 5 deletions

5
V5.py
View File

@ -106,10 +106,12 @@ def play_quiz2(override=10) -> None:
if somme + offset == int(correct_answer_value):
answer_elem = driver.find_element(By.ID, "rqAnswerOption0")
answer_elem.click()
if g.log:
progressBar(j, 10, name="quiz 2")
else:
answer_elem = driver.find_element(By.ID, "rqAnswerOption1")
answer_elem.click()
if g.log:
progressBar(j, 10, name="quiz 2")
except exceptions.ElementNotInteractableException as e:
@ -141,6 +143,7 @@ def play_quiz8():
for answer_id in correct_answers:
wait_until_visible(By.ID, answer_id, timeout = 20, browser=driver)
counter += 1
if g.log :
progressBar(counter, 16, name="Quiz 8")
try:
answer_elem = driver.find_element(By.ID, answer_id)
@ -214,7 +217,6 @@ def all_cards():
try :
promo()
except Exception as e:
#printf(format_error(e))
printf("no promo card")
for i in range(len(liste)):
@ -246,6 +248,7 @@ def all_cards():
if ("mee-icon-AddMedium" in liste[i].get_attribute("innerHTML")) :
printf(f"carte {i} not okay. Retrying.")
liste[i].click()
log_error(f"Card {i} with issue. WTF ?", driver)
driver.switch_to.window(driver.window_handles[1])
try_play(driver.title)
close_tab(driver.window_handles[1])

View File

@ -1 +1 @@
v5.9.3
v5.9.4