예제 #1
0
def test_singup_page_should_display_confirm_input_empty_validation_error_when_it_is_focused(responsive_target):

    signup_page = SignupPage(responsive_target['driver'])

    # open search input
    signup_page.click_element('confirm_input')
    # enter text in the input
    assert signup_page.does_have_text_in_page('confirm is a required field')
예제 #2
0
def test_singup_page_should_route_login_page_when_click_the_link(responsive_target):

    signup_page = SignupPage(responsive_target['driver'])

    # open search input
    signup_page.click_element('login_link')

    login_page = LoginPage(responsive_target['driver'], independent=False)

    assert login_page.does_have_text_in_page('Login')
예제 #3
0
def test_singup_page_should_not_allow_to_submit_when_at_least_one_error(responsive_target):

    signup_page = SignupPage(responsive_target['driver'])

    # open search input
    signup_page.click_element('confirm_input')

    signup_page.click_element('submit_btn')

    assert signup_page.does_have_text_in_page('please fix validation errors before submit')
예제 #4
0
def test_singup_page_should_display_user_already_exist_message_when_email_already_exist(responsive_target):

    signup_page = SignupPage(responsive_target['driver'])

    signup_page.type_text_in_input(locator='name_input', text='dummy user')
    signup_page.type_text_in_input(locator='email_input', text=cfg.test_user_email)
    signup_page.type_text_in_input(locator='password_input', text='dummy')
    signup_page.type_text_in_input(locator='confirm_input', text='dummy')

    signup_page.click_element('submit_btn')

    signup_page.wait_for_element('fetch_err_msg')

    assert signup_page.does_have_text_in_page("provided email already exists.")
예제 #5
0
def test_singup_page_should_route_home_page_when_successfully_signup(responsive_target):

    signup_page = SignupPage(responsive_target['driver'])

    signup_page.type_text_in_input(locator='name_input', text='dummy user')
    # use fake email address to avoid duplication of existing email
    signup_page.type_text_in_input(locator='email_input', text=fake.email())
    signup_page.type_text_in_input(locator='password_input', text='dummy')
    signup_page.type_text_in_input(locator='confirm_input', text='dummy')

    signup_page.click_element('submit_btn')

    home_page = HomePage(responsive_target['driver'], independent=False)

    # if fetch and move pages, you need to wait for fetch done and next page is loaded like below otherwise, selenium can assert before target element is loaded
    home_page.wait_for_element('slogan')

    assert home_page.does_have_text_in_page('Share Your Knowledge and Expand What You Can Do')