def test_as_addworkorder(self): '''查看首页是否显示正常''' try: api.get(as_work_order_list) as_workorder = ASWorkOrder() as_workorder.add_work_order(cpno) time.sleep(10) except: log.exception()
def test_OA0_登录_期望接口登录成功(self): api.get(login_url) res = api.driver.get_cookies() cookie = res[0]['name'] + '=' + res[0]['value'] api.cookie = cookie Common.oa_api_login(cookie) api.driver.add_cookie({ 'name': 'h3bpmportal', 'value': res[0]['value'] })
def setUpClass(cls): """ 测试固件的setUp()的代码,主要是测试的前提准备工作 :return: """ driver_init = DriverInit(is_headless=False) cls.driver = driver_init.driver api.driver = driver_init.driver api.get(as_work_order_list) token = Common.zhengt_yun_login() log.info('正通云平台token的值为[%s]'%token) api.driver.add_cookie({'name': 'token', 'value': token})
def get_url_pagehome(): """判断当前页面地址是否为首页,非首页则跳转到首页""" if DriverApi.get_current_url() == index_url: return else: DriverApi.get(index_url)
def test_OA首页显示正常(self): '''查看首页是否显示正常''' api.get('https://baidu.com')