Esempio n. 1
0
def test_register_user_shorter(driver):
    with m.step("Step 1 - Registering new user"):
        login = LoginPage(driver)
        register = login.click_on_register_lnk_and_go_to_register_page()
        login = register.do_register_and_go_to_login_page(FIRST_NAME, LAST_NAME, USER_NAME, PASSWORD)

    with m.step("Step 2 - Performing log in with the new user"):
        dashboard = login.do_login_and_got_to_dashboard_page(USER_NAME, PASSWORD)

    with m.step("Step 3 - Deleting the new created user"):
        dashboard.click_on_delete_user_lnk(USER_NAME)
        dashboard.click_on_logout_btn_and_go_to_login_page()
Esempio n. 2
0
def test_register_user_shorter(driver):
    with m.step('Step 1 - Registering new user'):
        login = LoginPage(driver)
        register = login.click_on_register_lnk_and_go_to_register_page()
        login = register.do_register_and_go_to_login_page(
            FIRST_NAME, LAST_NAME, USER_NAME, PASSWORD)

    with m.step("Step 2 - Performing log in with the new user"):
        dashboard = login.do_login_and_got_to_dashboard_page(
            USER_NAME, PASSWORD)

    with m.step("Step 3 - Deleting the new created user"):
        dashboard.click_on_delete_user_lnk(USER_NAME)
        dashboard.click_on_logout_btn_and_go_to_login_page()
Esempio n. 3
0
def test_that_fails_with_error(driver):
    with m.step("Step 1 - Doing some operations and then fails"):
        login = LoginPage(driver)
        login.type_to_username_tb("WrongUser")
        login.type_to_password_tb("Wrong password")
        login.click_on_login_btn_and_stay_in_login_page()
        login.do_failure()
Esempio n. 4
0
def test_that_fails_with_failure(driver):
    with m.step("Step 1 - Performing log in with wrong user"):
        login = LoginPage(driver)
        login.type_to_username_tb("WrongUser")
        login.type_to_password_tb("Wrong password")
        login.click_on_login_btn_and_stay_in_login_page()
        text = login.get_alert_msg_text()
        assert text == "Some silly message"
Esempio n. 5
0
def test_login_with_wrong_user_name(driver):
    with m.step("Step 1 - Performing log in with wrong user"):
        login = LoginPage(driver)
        login.type_to_username_tb("WrongUser")
        login.type_to_password_tb("Wrong password")
        login.click_on_login_btn_and_stay_in_login_page()
        text = login.get_alert_msg_text()
        assert text == "Username or password is incorrect"
Esempio n. 6
0
def test_register_user(driver):
    with m.step('Step 1 - Registering new user'):
        login = LoginPage(driver)
        register = login.click_on_register_lnk_and_go_to_register_page()
        register.type_to_first_name_tb(FIRST_NAME)
        register.type_to_last_name_tb(LAST_NAME)
        register.type_to_username_tb(USER_NAME)
        register.type_to_password_tb(PASSWORD)
        login = register.click_on_register_btn_and_go_to_login_page()

    with m.step("Step 2 - Performing log in with the new user"):
        login.type_to_username_tb(USER_NAME)
        login.type_to_password_tb(PASSWORD)
        dashboard = login.click_on_login_btn_and_go_to_dashboard_page()

    with m.step("Step 3 - Deleting the new created user"):
        dashboard.click_on_delete_user_lnk(USER_NAME)
        login = dashboard.click_on_logout_btn_and_go_to_login_page()
Esempio n. 7
0
def test_register_user(driver):
    with m.step("Step 1 - Registering new user"):
        login = LoginPage(driver)
        register = login.click_on_register_lnk_and_go_to_register_page()
        register.type_to_first_name_tb(FIRST_NAME)
        register.type_to_last_name_tb(LAST_NAME)
        register.type_to_username_tb(USER_NAME)
        register.type_to_password_tb(PASSWORD)
        login = register.click_on_register_btn_and_go_to_login_page()

    with m.step("Step 2 - Performing log in with the new user"):
        login.type_to_username_tb(USER_NAME)
        login.type_to_password_tb(PASSWORD)
        dashboard = login.click_on_login_btn_and_go_to_dashboard_page()

    with m.step("Step 3 - Deleting the new created user"):
        dashboard.click_on_delete_user_lnk(USER_NAME)
        login = dashboard.click_on_logout_btn_and_go_to_login_page()