Пример #1
0
 def click_button_search(self):
     '''
     搜索之后点击方法
     '''
     # self.driver.find_element(*HomePage.search_button).click()
     self.click_my(HomePage.search_button)
     logger.debug("This is click operator {}".format(HomePage.search_button))
Пример #2
0
 def testcase_page(self):
     test_data = {"limit": 1}
     res = self.request.send_request('get', 'demo', json=test_data)
     # json_res = json.dumps(res, indent=4)
     self.assertEqual(res['httpstatus'], 200)
     self.assertEqual(len(res['data']), 3)
     # print("首页数据:", res)
     logger.debug(f"首页数据:{res}")
Пример #3
0
 def searchInput(self, value):
     '''
     搜索框输入方法
     '''
     # self.driver.find_element(*HomePage.search_input).send_keys(value)
     self.send_keys_my(HomePage.search_input, value)
     logger.debug("This is click operator {}".format(HomePage.search_input))
     logger.debug("This is input message {}".format(value))
Пример #4
0
 def testcase_user_info(self):
     head = {'Content-Type': "application/x-www-form-urlencoded"}
     test_data = {"userid": "admin"}
     self.request.init_headers(head)
     res = self.request.send_request(method='post',
                                     api_url='userInfo',
                                     data=test_data)
     # print("用户信息列表", res)
     logger.debug(f"用户信息列表:{res}")
Пример #5
0
 def testcase_login(self):
     test_data = {"username": "******", "password": "******"}
     res = self.request.send_request(method='post',
                                     api_url='login',
                                     json=test_data,
                                     params='token')
     self.assertEqual(res['httpstatus'], 200)
     self.assertEqual(res['msg'], 'success')
     self.assertEqual(res['token'], "huacetest")
     # print("登陆响应数据:", res)
     logger.debug(f"登陆响应数据:{res}")
Пример #6
0
 def testcase_auth(self):
     head = {'Authorization': 'Basic YWRtaW46aHVhY2UxMjM0NTY='}
     self.request.init_headers(head)
     res = self.request.send_request(method='post', api_url='auth')
     # print("auth鉴权信息", res)
     logger.debug(f"auth鉴权信息:{res}")
Пример #7
0
 def testcase_vip_list(self):
     res = self.request.send_request(method='get', api_url='userViplist')
     # print("VIP用户列表", res)
     logger.debug(f"VIP用户列表:{res}")
Пример #8
0
 def testcase_user_list(self):
     res = self.request.send_request(method='get', api_url='userList')
     # print('用户列表', res)
     logger.debug(f"用户列表:{res}")