def test_user_Information(self): """个人中心-个人信息验证""" entry_page = Entry_page(self.driver, phone="18048444414", pwd='qwe123') myPersonalCenterPage = entry_page.open_my_Personal_CenterPage() user_information = myPersonalCenterPage.logic_get_user_information() sql = Exce_SQLserver() sql_user_information = sql.execSql_getList( "SELECT Name,new_telephone1,new_certificatenum from AccountBase WHERE new_telephone1={phone}" .format(phone=entry_page.phone)) "" [('username', u'u***1'), ('phonenum', u'144****8098'), ('ID', u'411***********3286')] [(u'14488888098', u'ufo21', 411224197404103286)] "" username = sql_user_information[0][0] phonenum = sql_user_information[0][1] ID = sql_user_information[0][2] entry_page.saveScreenshot('user_Information') #断言 self.assertEquals(user_information["username"], username[:1] + '*' + username[-1:]) self.assertEquals(user_information["phonenum"], phonenum[:3] + '****' + phonenum[-4:]) self.assertEquals(user_information["ID"], ID[:3] + '***********' + ID[-4:])
def test_gesture_cipher(self): """个人中心-修改手势密码""" entry_page = Entry_page(self.driver, phone="18048444414", pwd='qwe123') myPersonalCenterPage = entry_page.open_my_Personal_CenterPage() myPersonalCenterPage.el_gesture_cipher_btn.click() myPersonalCenterPage.logic_drawGestureCode() time.sleep(1) entry_page.saveScreenshot('gesture_cipher')
def test_login_out(self): """个人中心-安全退出测试""" entry_page = Entry_page(self.driver, phone="18048444414", pwd='qwe123') myPersonalCenterPage = entry_page.open_my_Personal_CenterPage() homepage = myPersonalCenterPage.logic_login_out_btn_click() entry_page.saveScreenshot('login_out') product_name = homepage.get_product_title_text() self.assertEquals(product_name, "新手体验计划")