More logging in selenium test
This commit is contained in:
parent
93e3d52735
commit
5ad34d8dfd
@ -137,11 +137,17 @@ def buy_article(client):
|
|||||||
# did NOT work.
|
# did NOT work.
|
||||||
actions = ActionChains(client)
|
actions = ActionChains(client)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
logger.info("Batching:..")
|
||||||
|
logger.info("..scroll page down")
|
||||||
actions.move_to_element(further_teaser)
|
actions.move_to_element(further_teaser)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
logger.info("..focus on article")
|
||||||
actions.move_to_element(teaser)
|
actions.move_to_element(teaser)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
logger.info("..click on article")
|
||||||
actions.click(teaser)
|
actions.click(teaser)
|
||||||
|
time.sleep(2)
|
||||||
|
logger.info("Performing batched actions")
|
||||||
actions.perform()
|
actions.perform()
|
||||||
except (NoSuchElementException, TimeoutException):
|
except (NoSuchElementException, TimeoutException):
|
||||||
logger.error('Could not choose "Foreword" chapter on blog')
|
logger.error('Could not choose "Foreword" chapter on blog')
|
||||||
@ -150,6 +156,7 @@ def buy_article(client):
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
try:
|
try:
|
||||||
confirm_pay = wait.until(EC.element_to_be_clickable((By.XPATH, "//button[@class='accept']")))
|
confirm_pay = wait.until(EC.element_to_be_clickable((By.XPATH, "//button[@class='accept']")))
|
||||||
|
logger.info("Pay button turned clickable")
|
||||||
except TimeoutException:
|
except TimeoutException:
|
||||||
logger.error('Could not confirm payment on blog')
|
logger.error('Could not confirm payment on blog')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user