def test_cll_rk_0001_1(self):
     "通过点击APP首页轮播banner「查老赖」图片,可以跳转到查老赖功能页面"
     log.info(self.test_cll_rk_0002_1.__doc__)
     try:
         back_to_index(self.driver)
         self.dishone.entrance()
         search_input = self.operation.new_find_element(
             By.XPATH, self.ELEMENT["dishonest_search_input"])
         assert "输入人名/公司名/身份证号码/组织机构代码" == search_input.text
     except AssertionError as ae:
         raise self.failureException()
     except Exception as e:
         log.error(error_format(e))
         raise Exception
 def is_boss_claim(self):
     back_to_index(self.driver)
     self.new_find_element(By.ID,
                           'com.tianyancha.skyeye:id/tab_iv_5').click()
     if self.isElementExist(By.ID,
                            'com.tianyancha.skyeye:id/iv_company_claim'):
         claim_status = self.ocr(
             By.ID, 'com.tianyancha.skyeye:id/iv_company_claim')
         if claim_status == '认证中':
             return True
         else:
             return False
     else:
         if self.isElementExist(By.XPATH, "//*[contains(@text,'暂无公司信息')]"):
             return False
         else:
             return True
 def test_cll_rk_0002_1(self):
     "通过点击「百宝箱」中的「查老赖」标签,可以跳转到「查老赖」功能页面"
     log.info(self.test_cll_rk_0002_1.__doc__)
     try:
         back_to_index(self.driver)
         self.operation.new_find_elements(
             By.ID, self.ELEMENT["all_in_main"])[4].click()
         self.operation.new_find_element(
             By.XPATH, self.ELEMENT["dishonest_in_all"]).click()
         search_input = self.operation.new_find_element(
             By.XPATH, self.ELEMENT["dishonest_search_input"])
         assert "输入人名/公司名/身份证号码/组织机构代码" == search_input.text
     except AssertionError as ae:
         raise self.failureException()
     except Exception as e:
         log.error(error_format(e))
         raise Exception
 def cancel_boss(self, company='百度'):
     back_to_index(self.driver)
     self.new_find_element(By.ID,
                           'com.tianyancha.skyeye:id/tab_iv_5').click()
     self.new_find_element(By.ID,
                           'com.tianyancha.skyeye:id/iv_haslogin').click()
     self.new_find_element(
         By.ID, 'com.tianyancha.skyeye:id/person_company_tv').click()
     self.new_find_element(
         By.ID,
         'com.tianyancha.skyeye:id/person_info_suggest_clear_iv').click()
     self.new_find_element(
         By.ID,
         'com.tianyancha.skyeye:id/person_info_suggest_input_et').send_keys(
             company)
     self.new_find_elements(
         By.ID, 'com.tianyancha.skyeye:id/tv_com_name')[0].click()
     self.new_find_element(
         By.ID,
         'com.tianyancha.skyeye:id/person_message_submit_btn').click()
     if self.isElementExist(By.XPATH, "//*[@text='确定更换[公司/学校]信息么?']"):
         self.new_find_element(By.ID,
                               'com.tianyancha.skyeye:id/btn_pos').click()
     if self.isElementExist(By.XPATH, "//*[@text='该昵称已被占用']"):
         self.new_find_element(
             By.ID,
             'com.tianyancha.skyeye:id/person_edit_nickname_iv').click()
         self.new_find_element(
             By.ID,
             'com.tianyancha.skyeye:id/person_clear_nickname_iv').click()
         self.new_find_element(
             By.ID,
             'com.tianyancha.skyeye:id/person_nickname_et').send_keys(
                 RandomStr().zh_cn(5))
         self.new_find_element(
             By.ID,
             'com.tianyancha.skyeye:id/person_message_submit_btn').click()
     if self.isElementExist(By.XPATH, "//*[@text='确定更换[公司/学校]信息么?']"):
         self.new_find_element(By.ID,
                               'com.tianyancha.skyeye:id/btn_pos').click()
Beispiel #5
0
 def tearDown(self):
     # 回到首页
     back_to_index(self.driver)