def get_read_counter(driver: webdriver) -> int:
with selenium_action(driver, "Could not find Article Read Counter"):
counter = driver.find_element_by_css_selector(ARTICLES_TO_READ_COUNTER)
if "firefox" not in driver.capabilities["browserName"].lower():
logging.debug("Moving focus to Article Read Counter")
action_chains = ActionChains(driver)
action_chains.move_to_element(counter)
action_chains.perform()
with assertion_msg("Article Read Counter is not visible"):
assert counter.is_displayed()
return int(counter.text)
评论列表
文章目录