def are_answers_displayed() -> bool: if len(web_driver.find_elements(ANSWER)) == len(web_driver.find_elements(HIDDEN_ANSWER))\ and len(web_driver.find_elements(ANSWER)) > 0: return False else: print("Some answers are opened") return True
def is_last_answer_displayed() -> bool: number_of_questions = len(web_driver.find_elements(QUESTION)) last_answer = web_driver.find_elements(ANSWER)[number_of_questions - 1] return False if last_answer.size.get("height") == 0 and last_answer.size.get("width") == 0\ else True
def get_last_answer_text() -> str: number_of_answers = get_number_of_answers() return web_driver.find_elements(ANSWER)[number_of_answers - 1].text
def get_number_of_opened_answers() -> int: return len(web_driver.find_elements(ANSWER)) - len( web_driver.find_elements(HIDDEN_ANSWER))
def get_number_of_answers() -> int: return len(web_driver.find_elements(ANSWER))
def click_on_last_question(): number_of_questions = get_number_of_questions() web_driver.find_elements(QUESTION)[number_of_questions - 1].click()
def get_list_of_questions() -> [str]: return [element.text for element in web_driver.find_elements(QUESTION)]
def get_number_of_questions() -> int: return len(web_driver.find_elements(QUESTION))