Ejemplo n.º 1
0
    def test_login_negative(self):
        App.is_displayed(self, NewsScreen.accountTab)
        App.is_displayed(self, NewsScreen.hamburgerMenu)
        App.assert_text(self, NewsScreen.newsHeader, 'News')

        App.click(self, NewsScreen.hamburgerMenu)
        App.assert_text(self, NewsScreen.menuHeader, 'Menu')

        # login as real user
        LoginScreen.login_user(self, 'invalid password')
        App.assert_text(self, LoginScreen.invalidMsg, 'Incorrect username or password.')
Ejemplo n.º 2
0
    def test_login_positive(self):
        App.is_displayed(self, NewsScreen.accountTab)
        App.is_displayed(self, NewsScreen.hamburgerMenu)
        App.assert_text(self, NewsScreen.newsHeader, 'News')

        App.click(self, NewsScreen.hamburgerMenu)
        App.assert_text(self, NewsScreen.menuHeader, 'Menu')

        # login as real user
        LoginScreen.login_user(self, 'valid password')
        App.assert_text(self, NewsScreen.newsHeader, 'News')

        App.click(self, NewsScreen.accountTab)
        App.is_displayed(self, DashboardScreen.profileImage)
        App.assert_text(self, DashboardScreen.profileName, 'hack')
        App.assert_text(self, DashboardScreen.dashboardHeader, 'My Dashboard')
Ejemplo n.º 3
0
    def login_user(self, password):
        if App.is_exist(self, NewsScreen.signOutButton):
            App.click(self, NewsScreen.signOutButton)
            App.wait_until_disappear(self, NewsScreen.Loading)
            App.click(self, NewsScreen.loginButton)
            if password == "valid password": App.send_keys(self, LoginScreen.inputField1, CONST.login['PASSWORD'])
            if password == "invalid password": App.send_keys(self, LoginScreen.inputField1, CONST.login['INVALID PASSWORD'])
        else:
            App.click(self, NewsScreen.loginButton)
            if App.is_exist(self, LoginScreen.inputField2):
                App.send_keys(self, LoginScreen.inputField1, CONST.login['USERNAME'])
                if password == "valid password": App.send_keys(self, LoginScreen.inputField2, CONST.login['PASSWORD'])
                if password == "invalid password": App.send_keys(self, LoginScreen.inputField2, CONST.login['INVALID PASSWORD'])
            else:
                if password == "valid password": App.send_keys(self, LoginScreen.inputField1, CONST.login['PASSWORD'])
                if password == "invalid password": App.send_keys(self, LoginScreen.inputField1, CONST.login['INVALID PASSWORD'])

        App.click(self, LoginScreen.loginButton)
 def test_login(self):
     App.click(self, HomeScreen.loginMenu)
     App.send_keys(self, LoginScreen.inputField, "*****@*****.**")
     App.send_keys(self, LoginScreen.passwordField, "password", index=0)
     App.tap(self, LoginScreen.inputField)