예제 #1
0
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
예제 #2
0
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
예제 #3
0
def get_last_answer_text() -> str:
    number_of_answers = get_number_of_answers()
    return web_driver.find_elements(ANSWER)[number_of_answers - 1].text
예제 #4
0
def get_number_of_opened_answers() -> int:
    return len(web_driver.find_elements(ANSWER)) - len(
        web_driver.find_elements(HIDDEN_ANSWER))
예제 #5
0
def get_number_of_answers() -> int:
    return len(web_driver.find_elements(ANSWER))
예제 #6
0
def click_on_last_question():
    number_of_questions = get_number_of_questions()
    web_driver.find_elements(QUESTION)[number_of_questions - 1].click()
예제 #7
0
def get_list_of_questions() -> [str]:
    return [element.text for element in web_driver.find_elements(QUESTION)]
예제 #8
0
def get_number_of_questions() -> int:
    return len(web_driver.find_elements(QUESTION))