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.")
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')