def test_interact_code_null(self): self.login('12345698755', "", CardUrl.INTERACT_QR_CODE_TPLUS_QUERY_LOGIN_URL) interact_error_hint_loc = (By.XPATH, '//*[@id="app"]/div/ul/li[1]/div/div[3]/p') operator = LoginOperator(self.driver) self.assertIn("推广人代码不能为空", operator.get_text(interact_error_hint_loc))
def test_interact_permission(self): self.login(Phone.create_phone(), 4484040029, CardUrl.INTERACT_QR_CODE_TPLUS_QUERY_LOGIN_URL) interact_error_hint_loc = (By.XPATH, '//*[@id="app"]/div/div[3]/div/p[2]') operator = LoginOperator(self.driver) self.assertIn("无权查询", operator.get_text(interact_error_hint_loc))
def test_apply_card(self): self.open(CardUrl.CARD_EXCLE_URL) LoginOperator(self.driver).click( (By.XPATH, '/html/body/div[3]/ul/li[1]/div[3]/div[2]/span')) sleep(2) LoginOperator(self.driver).click((By.XPATH, '//*[@id="GbCard"]/a')) sleep(2) LoginOperator.apply_card('李神经', '512236197807102659', '16000000000')
def test_recommend_friend(self): self.login(CardUrl.RECOMMENDATION_RESULT_QUERY_URL) LoginOperator(self.driver).click((By.XPATH, '//*[@id="app"]/div/div[1]/a')) sleep(2) message = self.driver.find_element_by_xpath('//*[@id="app"]/div/div[3]/p').text self.assertIn(u'立即推荐', message) sleep(120)
def test_change_fashion_click(self): self.open(CardUrl.CARD_EXCLE_URL) LoginOperator(self.driver).click( (By.XPATH, '/html/body/div[1]/ul/li[6]/span')) sleep(2) message = self.driver.find_element_by_xpath( '/html/body/div[3]/ul/li[1]/div[1]').text self.assertIn(u'立享卡51公积金2', message)
def test_trade_click(self): self.open(CardUrl.CARD_EXCLE_URL) LoginOperator(self.driver).click( (By.XPATH, '/html/body/div[3]/ul/li[1]/div[3]/div[1]/span')) sleep(2) message = self.driver.find_element_by_xpath( '/html/body/div[5]/div[1]/span[2]').text self.assertIn(u'权益详情', message)
def test_change_green_click(self): self.open(CardUrl.CARD_EXCLE_URL) LoginOperator(self.driver).click( (By.XPATH, '/html/body/div[1]/ul/li[3]/span')) sleep(2) message = self.driver.find_element_by_xpath( '/html/body/div[3]/ul/li[1]/div[1]').text self.assertIn(u'爱奇艺银联白金联名信用卡(精英版)II', message)
def test_apply_click(self): self.open(CardUrl.CARD_EXCLE_URL) LoginOperator(self.driver).click( (By.XPATH, '/html/body/div[3]/ul/li[1]/div[3]/div[2]/span')) sleep(2) message = self.driver.find_element_by_xpath( '//*[@id="GbCard"]/h4').text self.assertIn(u'本人知晓并同意', message)
def test_send_present(self): self.login(CardUrl.MGM_GIFT_DELIVERY) print("888") sleep(2) text = self.driver.find_element_by_xpath( '//*[@id="app"]/div/ul/li[1]/div/div[2]/input').text print(text) if text == '李白': LoginOperator(self.driver).click( (By.XPATH, '//*[@id="app"]/div/div[1]/p')) sleep(2) else: print('miss')
def login(self, url): LoginOperator(self.driver).mgm_recommendation_login( "17621523736", "李孝雪", url, 1001) sleep(1)
def test_exclude_mgm_custom_recommend(self): self.login(CardUrl.MGM_PERSONALIZATION_URL) LoginOperator(self.driver).click( (By.XPATH, '//*[@id="app"]/div/ul/li[1]/div/div[4]/div/label')) sleep(2)
def login(self, url): LoginOperator(self.driver).recommendation_login( Phone.create_phone(), url) sleep(1)
def get_org_error_text(self): mgm_login_loc = (By.XPATH, '//*[@id="app"]/div/ul/li[3]/div/div[3]/p') operator = LoginOperator(self.driver) return operator.get_text(mgm_login_loc)
def click(self): LoginOperator(self.driver).click(self.salon_banner_loc)
def login(self, url): LoginOperator(self.driver).recommendation_login('14000000000', url)
def login(self, url): LoginOperator(self.driver).mgm_gift_delivery_login('12000000000', url) sleep(1)
def phone_interact_error_text(self): interact_error_hint_loc = (By.XPATH, '//*[@id="app"]/div/ul/li[2]/div/div[3]/p' ) # 交互式二维码的无权限弹框 operator = LoginOperator(self.driver) return operator.get_text(interact_error_hint_loc)
def login(self, phone, code, url): # url = 'https://test.xliane.com/html2/webapp/fastIssue/index.html#/mgm/index' LoginOperator(self.driver).interact_qr_code_tplus_query_login( phone, code, url)
def test_recommend_share(self): self.login(CardUrl.RECOMMENDATION_RESULT_QUERY_URL) LoginOperator(self.driver).click((By.XPATH, '//*[@id="app"]/div/div[1]/div[3]')) sleep(2) message = self.driver.find_element_by_xpath('//*[@id="app"]/div/img').get_attribute('textContent') print(message)
def login(self, identity, url): LoginOperator(self.driver).card_process_query_login(identity, url)
def test_click_custom_recommend(self): self.open(CardUrl.CUSTOMER_RECOMMENDATION) LoginOperator(self.driver).click((By.XPATH, '//*[@id="app"]/div/div[2]/a[1]')) sleep(2) message = self.driver.find_element_by_xpath('/html/body/div/div[1]').text self.assertIn(u'客户参与活动,推荐达标后即可自动领取奖品', message)
def test_click_contract_recommend(self): self.open(CardUrl.CUSTOMER_RECOMMENDATION) LoginOperator(self.driver).click((By.XPATH, '//*[@id="app"]/div/a')) sleep(2) message = self.driver.find_element_by_xpath('//*[@id="app"]/div/div[1]/p').text self.assertIn(u'一、活动时间', message)
def card_error_text(self): card_error_hint_loc = (By.XPATH, '/html/body/div[8]') operator = LoginOperator(self.driver) return operator.get_text(card_error_hint_loc )
def test_login_identity_miss(self): self.login("512236197807102659", CardUrl.CARD_PROCESS_QUERY_LOGIN_URL) LoginOperator(self.driver) sleep(2)
def open(self, url): LoginOperator(self.driver).open(url) sleep(1)
def login(self, phone, username, url, org): LoginOperator(self.driver).mgm_recommendation_login(phone, username, url, org)
def test_click_method_recommend(self): self.open(CardUrl.CUSTOMER_RECOMMENDATION) LoginOperator(self.driver).click((By.XPATH, '//*[@id="app"]/div/div[2]/a[3]')) sleep(2) message = self.driver.find_element_by_xpath('/html/body/div/div[1]').text self.assertIn(u'礼品太壕,等不及要推荐', message)
def get_phone_error_text(self): phone_error_hint_loc = (By.XPATH, '//*[@id="app"]/div/ul/li[1]/div/div[3]/p') operator = LoginOperator(self.driver) return operator.get_text(phone_error_hint_loc)
def login(self, phone, url, org): LoginOperator(self.driver).tplus_query_login(phone, url, org)
def get_identify_error_text(self): fast_identity_error_hint_loc = ( By.XPATH, '//*[@id="app"]/div/ul/li[1]/div/div[3]/p ' ) # 卡号进度申请查询错误提示弹框定位 operator = LoginOperator(self.driver) return operator.get_text(fast_identity_error_hint_loc)