def test_empty_credentials(self, test_setup): """ This method checks invalid credentials when trying to login with empty credentials :param test_setup: Connection between device under test (DUT) and Appium :return: boolean """ home = Home(test_setup) home.goto_login_page() login = Login(test_setup) login.click_login() message = login.get_error_message() assert message == constants.credentials['error_message'], "Unexpected message for wrong credentials"
def test_launch_url(self, testcase): """tests login page""" sleep(2.5) obj = Login(self.driver, testcase) # pylint:disable=E1101 # self.driver.implicitly_wait(5) sleep(2.5) obj.enter_username() sleep(2.5) obj.enter_password() sleep(2.5) obj.click_login() sleep(2.5)
def test_empty_username_field(self, test_setup): """ This method tests if it is possible to login using username only :param test_setup: Connection between device under test (DUT) and Appium :return: boolean """ home = Home(test_setup) home.goto_login_page() login = Login(test_setup) login.insert_password(constants.credentials['valid_password_for_valid_username']) login.click_login() message = login.get_error_message() assert message == constants.credentials['error_message'], "Unexpected message for wrong credentials"
def test_valid_login(self, test_setup): """ This method tests a happy happy, trying to login if valid credentials :param test_setup: Connection between device under test (DUT) and Appium :return: boolean """ home = Home(test_setup) home.goto_login_page() login = Login(test_setup) login.insert_username(constants.credentials['valid_username']) login.insert_password(constants.credentials['valid_password_for_valid_username']) login.click_login() is_logged = login.is_logged() if is_logged: assert True else: assert False
def test_login_logout(self, mozwebqa): home_page = Home(mozwebqa) home_page.go_to_page() login_page = Login(mozwebqa) Assert.true(login_page.is_the_current_page) login_page.click_login() login_page.login(user='******') Assert.true(home_page.is_the_current_page) Assert.true(home_page.header.is_user_logged_in) Assert.equal(mozwebqa.credentials['default']['email'], home_page.header.user_account) login_page = home_page.header.sing_out() Assert.true(login_page.is_the_current_page) Assert.true(login_page.is_login_visible)
def test_creating_a_new_user_logging_in_and_logingout(self, mozwebqa): home_page = Home(mozwebqa) home_page.go_to_page() login_page = Login(mozwebqa) Assert.true(login_page.is_the_current_page) new_user = login_page.create_new_user() login_page.click_login() login_page.login(user=new_user) Assert.true(home_page.is_the_current_page) Assert.true(home_page.header.is_user_logged_in) Assert.equal(new_user['email'], home_page.header.user_account) login_page = home_page.header.sing_out() Assert.true(login_page.is_the_current_page) Assert.true(login_page.is_login_visible)