def test_home_1(self): App.element(self, HomeScreen.homeMenu) App.element(self, HomeScreen.loginMenu) App.element(self, HomeScreen.formsMenu) App.element(self, HomeScreen.swipeMenu)
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_home_2(self): App.is_displayed(self, HomeScreen.homeMenu, True) App.is_displayed(self, HomeScreen.loginMenu, True)
def test_home_2(self): App.element(self, HomeScreen.homeMenu) App.element(self, HomeScreen.loginMenu)
def test_home_1(self): App.is_displayed(self, HomeScreen.homeMenu, True) App.is_displayed(self, HomeScreen.loginMenu, True) App.is_displayed(self, HomeScreen.formsMenu, True) App.is_displayed(self, HomeScreen.swipeMenu, True)
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)
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.')
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')
def test_home_1(self): App.element(self, HomeScreen.homeMenu) App.element(self, HomeScreen.loginMenu) App.element(self, HomeScreen.formsMenu) App.element(self, HomeScreen.swipeMenu) App.swipe_until(self, HomeScreen.supportLink, start_x=144, start_y=434)