def test_that_user_can_login_and_logout(self, mozwebqa, existing_user): from pages.login_page import MozTrapLoginPage login_pg = MozTrapLoginPage(mozwebqa) home_pg = MozTrapHomePage(mozwebqa) home_pg.get_relative_path('/') Assert.false(home_pg.header.is_user_logged_in) login_pg.go_to_login_page() login_pg.login(existing_user['email'], existing_user['password']) Assert.true(home_pg.header.is_user_logged_in) Assert.equal(home_pg.header.username_text, existing_user['name']) home_pg.header.click_logout() home_pg.get_relative_path('/') Assert.false(home_pg.header.is_user_logged_in)
def test_that_user_can_login_and_logout(self, base_url, selenium, existing_user): from pages.login_page import MozTrapLoginPage login_pg = MozTrapLoginPage(base_url, selenium) home_pg = MozTrapHomePage(base_url, selenium) home_pg.get_relative_path('/') assert not home_pg.header.is_user_logged_in login_pg.go_to_login_page() login_pg.login(existing_user['email'], existing_user['password']) assert home_pg.header.is_user_logged_in assert existing_user['name'] == home_pg.header.username_text home_pg.header.click_logout() home_pg.get_relative_path('/') assert not home_pg.header.is_user_logged_in
def test_that_user_can_login_and_logout(self, mozwebqa): from pages.login_page import MozTrapLoginPage login_pg = MozTrapLoginPage(mozwebqa) home_pg = MozTrapHomePage(mozwebqa) home_pg.get_relative_path('/') Assert.false(home_pg.header.is_user_logged_in) login_pg.go_to_login_page() login_pg.login() user = home_pg.testsetup.credentials['default'] users_name = user['name'] Assert.true(home_pg.header.is_user_logged_in) Assert.equal(home_pg.header.username_text, users_name) home_pg.header.click_logout() home_pg.get_relative_path('/') Assert.false(home_pg.header.is_user_logged_in)