def test_sso_btn(self): queryDict = queryFactory().getQuery().login_login_SSOBtn() sso_btn = self.driver.findView(queryDict) self.driver.clickOnView(sso_btn) self.driver.waitForSeconds(5) filename = self.filePath() + "/" + "sso.png" self.driver.takeScreenshotAsPNGFileByPath(filename) imgBase64 = self.driver.page_base64(self.filePath(), 'sso') screenshotBase64 = self.driver.screenshot_base64( self.filePath(), 'sso') query_dict = queryFactory().getQuery().login_sso_backBtn() back_btn = self.driver.findView(query_dict) self.driver.clickOnView(back_btn) self.assertTrue(imgBase64 == screenshotBase64)
def allow_permission(self): # permission allow if self.driver.name == "EMA Android driver": queryDict = queryFactory().getQuery().app_permission_allow() if self.driver.viewIsVisibily(queryDict): app_permission_allow = self.driver.findView(queryDict) if app_permission_allow is not None: self.driver.clickOnView(app_permission_allow) self.driver.waitForSeconds(2) else: pass
def test_startUsingNow_btn(self): self.driver.waitForSeconds(2) queryDict = queryFactory().getQuery().login_welcome_startUsingBtn() startUsing_btn = self.driver.findView(queryDict) self.driver.clickOnView(startUsing_btn) self.driver.waitForSeconds(3) filename = self.filePath() + "/" + "anonymousMain.png" self.driver.takeScreenshotAsPNGFileByPath(filename) imgBase64 = self.driver.page_base64(self.filePath(), 'anonymousMain') screenshotBase64 = self.driver.screenshot_base64( self.filePath(), 'anonymousMain') self.assertTrue(imgBase64 == screenshotBase64)
def test_ui(self): self.driver.waitForSeconds(2) # click login button query = queryFactory().getQuery() login_btn = self.driver.findView(query.login_welcome_loginBtn()) self.driver.clickOnView(login_btn) self.driver.waitForSeconds(3) filename = self.filePath() + "/" + "login.png" self.driver.takeScreenshotAsPNGFileByPath(filename) imgBase64 = self.driver.page_base64(self.filePath(), 'login') screenshotBase64 = self.driver.screenshot_base64( self.filePath(), 'login') self.assertTrue(imgBase64 == screenshotBase64)
def test_ui(self): # click login button self.driver.waitForSeconds(2) query = queryFactory().getQuery() sso_login_btn = self.driver.findView(query.login_login_SSOBtn()) self.driver.clickOnView(sso_login_btn) self.driver.waitForSeconds(3) filename = self.filePath() + "/" + "sso.png" self.driver.takeScreenshotAsPNGFileByPath(filename) imgBase64 = self.driver.page_base64(self.filePath(), 'sso') screenshotBase64 = self.driver.screenshot_base64( self.filePath(), 'sso') self.assertTrue(imgBase64 == screenshotBase64)
def test_menu_ui(self): # click login button self.driver.waitForSeconds(3) query = queryFactory().getQuery() left_menu = self.driver.findView(query.top_bar_menu()) self.driver.clickOnView(left_menu) self.driver.waitForSeconds(2) filename = self.filePath() + "/" + "left_menu.png" self.driver.takeScreenshotAsPNGFileByPath(filename) self.driver.waitForSeconds(2) local_item = self.driver.findView(query.menu_local_item()) self.driver.clickOnView(local_item) # imgBase64 = self.driver.page_base64(self.filePath(), 'left_menu') # screenshotBase64 = self.driver.screenshot_base64(self.filePath(), 'left_menu') # self.assertTrue(imgBase64 == screenshotBase64) pass
def test_menu_ui(self): # click login button self.driver.waitForSeconds(13) query = queryFactory().getQuery() left_menu = self.driver.findView(query.top_bar_menu()) self.driver.clickOnView(left_menu) self.driver.waitForSeconds(3) filename = self.filePath() + "/" + "left_menu.png" self.driver.takeScreenshotAsPNGFileByPath(filename) self.driver.waitForSeconds(5) # query = queryFactory().getQuery() # messageList = self.driver.findView(query.msg_messages_list()) self.driver.swipe(800, 1200, 800, 400, 500) # touchActions = self.driver.moveTo(200, 400, touchActions,True) # self.driver.touchUp(200, 400, touchActions) filename = self.filePath() + "/" + "scroolTo.png" self.driver.takeScreenshotAsPNGFileByPath(filename) # self.driver.waitForSeconds(2) # message_item = self.driver.findView(query.menu_messages_item()) # self.driver.clickOnView(message_item) # # self.driver.waitForSeconds(12) # messageList = self.driver.findView(query.msg_messages_list()) # self.driver.scroolOnView(messageList, 200, 120, None, False) self.driver.waitForSeconds(10) # imgBase64 = self.driver.page_base64(self.filePath(), 'left_menu') # screenshotBase64 = self.driver.screenshot_base64(self.filePath(), 'left_menu') # self.assertTrue(imgBase64 == screenshotBase64) pass