def testSearch001(self): HomePageIndex().SearchBox().click() time.sleep(5) #SearchPageIndex().TopSearch_By_Ids(0).click()# 选择热门搜索的数据项 SearchPageIndex().TopSearch_By_xpath().click()# 选择热门搜索的数据项 expValue = self.conn.find_element_by_xpath(RES.expValue) self.assertEqual(RES.actValue,expValue)
def testLogin001(self): HomePageIndex().HomeBtn_Android_Uiautomator().click() time.sleep(2) MyPageIndex().MyLoginText_by_Id().click() time.sleep(2) LoginPageIndex().LoginPage_Text_Usr_Uiautotor().send_keys( "18983838625") #LoginPageIndex().LoginPage_Text_Usr_Uiautotor().send_keys(ReadXMLDriver().returnXMLfile("LoginData.xml","LoginData","Login001")) time.sleep(2) LoginPageIndex().LoginPage_Text_Pwd_By_Id().send_keys("12345678") time.sleep(2) LoginPageIndex().LoginPage_Btn_by_Id().click() time.sleep(2) expValue = "CC83483282" actValue = MyPageIndex().MyLoginText_by_Id().text msg = "登录测试失败" self.assertEqual(expValue, actValue, msg) #fail, if expValue != actValue,and print (msg)
def testLogin002(self): HomePageIndex().HomeBtn_By_Id().click() time.sleep(1) MyPageIndex().MyLoginText_by_Id().click() time.sleep(1) LoginPageIndex().LoginPage_Text_Usr_Uiautotor().send_keys("18983838625") time.sleep(1) LoginPageIndex().LoginPage_Text_Pwd_By_Id().send_keys("12345678") time.sleep(2) LoginPageIndex().LoginPage_Btn_by_Id().click() time.sleep(2) expValue = "CC83483282" actValue = MyPageIndex().MyLoginText_by_Id().text self.assertEqual(expValue,actValue)
def testLogin002(self): HomePageIndex().HomeBtn_By_Id().click() time.sleep(2) #MyPage click the login button MyPageIndex().MyLoginText_by_Id().click() time.sleep(2) #input username LoginPageIndex().LoginPage_Text_Usr_Uiautotor().send_keys( "18983838625") time.sleep(2) #input password LoginPageIndex().LoginPage_Text_Pwd_By_Id().send_keys("12345678") time.sleep(2) # Login click LoginPageIndex().LoginPage_Btn_by_Id().click() time.sleep(2) expValue = "CC83483282" actValue = MyPageIndex().MyLoginText_by_Id().text # self.assertEqual(expValue,actValue,msg) #fail, if expValue != actValue,and print (msg) self.assertEqual(expValue, actValue)