def test_email_blank(browser): """ Testing the email field is required and gives correct error. :param browser: """ page = GCLPOM(browser) page.load() page.test_name("Test") page.click_submit() assert page.email_error() == "Please fill out this field."
def test_name_entered(browser): """ Testing the name will not error when name is entered. :param browser: """ page = GCLPOM(browser) page.load() page.test_name("Test") page.click_submit() assert page.name_error() == ""
def test_msg_blank(browser): """ Testing the message field is required and errors correctly. :param browser: """ page = GCLPOM(browser) page.load() page.test_name("Test") page.test_email("*****@*****.**") page.click_submit() assert page.message_error() == "Please fill out this field."
def test_email_invalid_3(browser): """ Testing the email needs to have content with @ but needs something after . and errors correctly. :param browser: """ page = GCLPOM(browser) page.load() page.test_name("Test") page.test_email("test@example.") page.click_submit() assert page.email_error( ) == "'.' is used at a wrong position in 'example.'."
def test_email_invalid_2(browser): """ Testing the email needs to have content with @ and errors correctly. :param browser: """ page = GCLPOM(browser) page.load() page.test_name("Test") page.test_email("test@") page.click_submit() assert page.email_error( ) == "Please enter a part following '@'. 'test@' is incomplete."
def test_email_invalid_1(browser): """ Testing the email needs to have content without @ and errors correctly. :param browser: """ page = GCLPOM(browser) page.load() page.test_name("Test") page.test_email("test") page.click_submit() assert page.email_error( ) == "Please include an '@' in the email address. 'test' is missing an '@'."
def test_contact_form(browser): """ Testing that the message submits and doesn't take you to a new page. Message will not email or properly submit in local container. :param browser: """ page = GCLPOM(browser) page.load() page.test_name("Test") page.test_email("*****@*****.**") page.test_message('Test message please ignore') page.click_submit() assert browser.current_url == page.get_url() + "/"