def test_click_on_mychoise_button_from_mainpage_logined(web_driver):
    """Check if the action of 'МІЙ ВИБІР' button is correct - logined user"""
    homepage = MainPage(web_driver)
    login_page = homepage.click_to_login_button(web_driver)
    my_choise_page = login_page.login_with_valid_card(
        web_driver, card_number='0291077164447')
    assert "Мій вибір" in my_choise_page.page_content(web_driver)
def test_validation_message_caused_by_sending_empty_field(web_driver):
    """Check if the validation message 'Поле обов'зкове для заповнення' has correct function with empty input field"""
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    loginpage.login_with_empty_fieldweb_driver
    validation_message_text = loginpage.validation_message(web_driver)
    assert validation_message_text == 'Поле обов\'зкове для заповнення'
def test_error_message_does_not_exists_with_valid_card_number(web_driver):
    """Check if the validation message does not exists after entering the valid card number - 0291077164447"""
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    loginpage.fill_the_card_number_field(driver=web_driver,
                                         card_number='0291077164447')
    error_message = loginpage.get_validation_message(web_driver)
    assert len(error_message) == 0
def test_validation_message_caused_by_invalid_card_number(web_driver):
    """Check if the validation message 'Невірний номер карти' has correct function with invalid card numder - 1111111111111"""
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    loginpage.login_with_not_full_card_number(driver=web_driver,
                                              card_number='1111111111111')
    validation_text_message = loginpage.validation_message(web_driver)
    assert validation_text_message == 'Невірний номер карти'
def test_validation_message_caused_by_invalid_card_number_1_symbol(web_driver):
    """Check if the validation message 'Номер має містити 13 цифр' has correct function with invalid card numder - 0"""
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    loginpage.login_with_not_full_card_number(driver=web_driver,
                                              card_number='0')
    validation_text_message = loginpage.get_validation_message(web_driver)
    assert validation_text_message.lower() == 'номер має містити 13 цифр'
def test_login_with_correct_card_number(web_driver):
    """Check if the loginisation has correct functioning with valid card numder (029 0226351066). Cardnumber contains one space"""
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    my_choise_page = loginpage.login_with_valid_card(
        driver=web_driver, card_number='029 0226351066')
    search_word = 'Мій вибір'
    assert search_word in my_choise_page.page_content(web_driver)
def test_validation_message_caused_by_sending_short_card_number_5_symbols(
        web_driver):
    """Check if the validation message 'Номер має містити 13 цифр' has correct function with notfull card numder - 02910"""
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    loginpage.login_with_not_full_card_number(driver=web_driver,
                                              card_number='02910')
    validation_text_message = loginpage.validation_message(web_driver)
    assert validation_text_message == 'Номер має містити 13 цифр'
def test_awards_title_two(web_driver):
    """Check if the title of 'Вхід до голосування' page is correct"""
    homepage = MainPage(web_driver)
    homepage.click_to_login_button(web_driver)
    assert "Голосуйте" in homepage.title_text(web_driver)
def test_click_on_login_button_from_mainpage(web_driver):
    """Check action of the button 'Увійти'"""
    homepage = MainPage(web_driver)
    login_page = homepage.click_to_login_button(web_driver)
    assert "Вхід до голосування" in login_page.page_content(web_driver)
def test_is_button_disabled(web_driver):
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    assert loginpage.submit_button_is_active(
        web_driver), 'submit button is not active'
def test_login_button_font_size(web_driver):
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    status = loginpage
def test_title_text_margin_bottom(web_driver):
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    title_text_margin_bottom = loginpage.title_text_margin_bottom(
        driver=web_driver)
    assert title_text_margin_bottom == '40px'
def test_title_text_size(web_driver):
    homepage = MainPage(web_driver)
    loginpage = homepage.click_to_login_button(web_driver)
    assert loginpage.title_text_size(web_driver) == '32px'