def test_bvt_wallet_open(self):
     """开通司机钱包"""
     wallet = WalletOpenCheZhu(self.driver)
     MainTabCheZhu(self.driver).goto_person_center()
     PersonCenterCheZhu(self.driver).goto_user_wallet()
     wallet.wallet_open()
     wallet.set_pwd()
     page_wait = MainTabCheZhu(self.driver).wait_main_page()
     self.assertTrue(page_wait)
     wallet_type = DbOperation().select_wallet_state(self.mobile)
     self.assertEqual('1', str(wallet_type))
Beispiel #2
0
 def test_bvt_waybill_confirm(self):
     """确认发车操作"""
     MainTabCheZhu(self.driver).close_driver_loan_ads()
     self.driver_tools.getScreenShot('waybill_confirm')
     WaybillMainCheZhu(self.driver).go_to_waybill_detail()  # 进入运单详情页面 操作确认发车
     WaybillConfirmCheZhu(self.driver).upload_transport_img()  # 上传运输协议
     self.driver_tools.getScreenShot('waybill_confirm')
     WaybillConfirmCheZhu(self.driver).confirm_waybill()  # 确认发车
     wait_page = MainTabCheZhu(self.driver).wait_main_page()
     self.driver_tools.getScreenShot('waybill_confirm')
     self.assertTrue(wait_page)  # 检查操作完成后页面activity是否切换为主列表页
     waybill_state = DbOperation().select_waybill_state(self.mobile)[0]
     self.assertEqual(waybill_state, 'Y')  # 判断运单状态是否变为  Y司机已确认
Beispiel #3
0
 def test_bvt_waybill_receipt_upload(self):
     """回单上传操作"""
     upload_receipt = WaybillReceiptUploadCheZhu(self.driver)
     MainTabCheZhu(self.driver).close_driver_loan_ads()
     self.driver_tools.getScreenShot('waybill_receipt_upload')
     WaybillMainCheZhu(self.driver).go_to_waybill_detail()  # 跳转运单回单上传操作页面
     self.driver_tools.getScreenShot('waybill_receipt_upload')
     upload_receipt.add_receipt_image()  # 添加回单照片
     upload_receipt.add_receipt_info('自动化回单异常')  # 添加回单异常信息
     upload_receipt.upload_receipt()  # 上传回单相关信息
     wait_page = MainTabCheZhu(self.driver).wait_main_page()
     self.driver_tools.getScreenShot('waybill_receipt_upload')
     self.assertTrue(wait_page)  # 检查操作完成后页面activity是否切换为主列表页
     waybill_state = DbOperation().select_waybill_state(
         self.mobile)[0]  # 判断运单状态是否变为  H回单已上传
     self.assertEqual(waybill_state, 'H')
 def test_bvt_wallet_cash(self):
     """钱包提现"""
     wallet = WalletMainCheZhu(self.driver)
     wallet_cash = WalletCashCheZhu(self.driver)
     MainTabCheZhu(self.driver).goto_person_center()
     PersonCenterCheZhu(self.driver).goto_user_wallet()
     self.driver_tools.getScreenShot('wallet_cash')
     wallet.go_to_cash()
     wallet_cash.wallet_cash()
     WalletPasswordCheZhu(self.driver).send_password(self.wallet_pwd)
     wallet_cash.cash_confirm()
     self.driver_tools.getScreenShot('wallet_cash')
     wait_page = MainTabCheZhu(self.driver).wait_main_page()
     self.assertTrue(wait_page)  # 检查操作完成后页面activity是否切换为主列表页
     wallet_balance = int(wallet.get_wallet_balance())
     self.assertEqual(wallet_balance, 0)
 def test_bvt_login_unregister(self):
     """未认证司机登录"""
     NotificationCheZhu(self.driver).guide_page()
     self.driver_tool.getScreenShot('login_unregister_chezhu')
     LoginCheZhu(self.driver).user_login(self.mobile)
     self.driver_tool.getScreenShot('login_unregister_chezhu')
     activity = MainTabCheZhu(self.driver).wait_main_page()
     self.assertTrue(activity)  # 检查登录操作后页面activity是否切换为主列表页
 def test_bvt_login_register(self):
     """认证司机登录"""
     self.driver_tool.getScreenShot('login_register_chezhu')
     NotificationCheZhu(self.driver).guide_page()  # 引导页操作
     self.driver_tool.getScreenShot('login_register_chezhu')
     LoginCheZhu(self.driver).user_login(self.mobile)  # 登录操作
     self.driver_tool.getScreenShot('login_register_chezhu')
     page_state = MainTabCheZhu(self.driver).wait_main_page()
     self.assertTrue(page_state)  # 检查登录操作后页面activity是否切换为主列表页
Beispiel #7
0
 def test_bvt_logout(self):
     """用户退出登录"""
     self.driver_operation.getScreenShot('TestLogout')
     MainTabCheZhu(self.driver).goto_person_center()
     PersonCenterCheZhu(self.driver).goto_setting_page()
     SettingCheZhu(self.driver).user_logout()
     self.driver_operation.getScreenShot('TestLogout')
     page_wait = LoginCheZhu(self.driver).wait_login_page()
     self.assertTrue(page_wait)
Beispiel #8
0
 def test_bvt_bankcard_delete(self):
     """提现银行卡解绑"""
     bankcard = BankCardMainCheZhu(self.driver)
     MainTabCheZhu(self.driver).goto_person_center()
     PersonCenterCheZhu(self.driver).goto_account_bankcard()
     self.driver_tools.getScreenShot('bankcard_delete')
     bankcard.untie_cash_card()
     WalletPasswordCheZhu(self.driver).send_password(self.wallet_pwd)
     WalletPasswordCheZhu(self.driver).confirm_pwd()
     self.driver_tools.getScreenShot('bankcard_delete')
     cash_card = bankcard.find_cash_card()
     self.assertEqual(cash_card, False)
Beispiel #9
0
 def test_bvt_wallet_password_change(self):
     """ 修改钱包密码 """
     wallet_pwd = WalletChangePwdCheZhu(self.driver)
     self.driver_tools.getScreenShot('wallet_password_change')
     MainTabCheZhu(self.driver).goto_person_center()
     PersonCenterCheZhu(self.driver).goto_user_wallet()
     WalletMainCheZhu(self.driver).go_to_change_pwd()
     wallet_pwd.change_pwd(oldpwd=self.pwd, newpwd=self.newpwd)
     wallet_pwd.confirm_change_pwd()
     wait_page = WalletMainCheZhu(self.driver).wait_wallet_page()
     self.driver_tools.getScreenShot('wallet_password_change')
     self.assertTrue(wait_page)  # 检查操作完成后页面activity是否切换为钱包主页面
     WalletMainCheZhu(self.driver).go_to_change_pwd()
     wallet_pwd.change_pwd(oldpwd=self.newpwd, newpwd=self.pwd)
     wallet_pwd.confirm_change_pwd()
Beispiel #10
0
 def test_bvt_car_certification(self):
     """车辆认证"""
     car_certificate = CarCertificateCheZhu(self.driver)
     choosePhoto = ChoosePhotoCheZhu(self.driver)
     MainTabCheZhu(self.driver).goto_person_center()  # 进入个人中心
     PersonCenterCheZhu(self.driver).goto_certification_page()  # 进入认证页面
     car_certificate.upload_car_img_first()  # 选择行驶证正面照片
     choosePhoto.choose_driving_license_front()
     car_certificate.upload_car_img_second()  # 选择行驶证反面照片
     choosePhoto.choose_id_card_back()
     car_certificate.input_car_number()
     car_certificate.choose_car_info()
     car_certificate.submit_car_info()
     WalletOpenCheZhu(self.driver).wait_page()
     driver_info = self.db.select_driver_info(self.mobile)
     self.assertEqual('Y', driver_info['isCarCertificate'])
Beispiel #11
0
 def test_bvt_certification(self):
     """身份认证"""
     certificate = CertificationCheZhu(self.driver)
     choosePhoto = ChoosePhotoCheZhu(self.driver)
     MainTabCheZhu(self.driver).goto_person_center()
     PersonCenterCheZhu(self.driver).goto_certification_page()
     certificate.upload_card_front()
     choosePhoto.choose_id_card_front()
     certificate.upload_card_back()
     choosePhoto.choose_id_card_back()
     certificate.input_id_card_info(self.name, self.idNo)
     certificate.submit_id_card_info()
     CarCertificateCheZhu(self.driver).wait_page()
     driver_info = self.db.select_driver_info(self.mobile)
     self.assertEqual(self.name, driver_info['name'])
     self.assertEqual(str(self.idNo), str(driver_info['idNo']))
     self.assertEqual('Y', driver_info['isCertifacate'])
 def test_bvt_wallet_consignor_add(self):
     """新增委托代收人"""
     wallet_consignor = WalletConsignorCheZhu(self.driver)
     self.driver_tools.getScreenShot('wallet_consignor_add')
     MainTabCheZhu(self.driver).goto_person_center()
     PersonCenterCheZhu(self.driver).goto_user_wallet()
     WalletMainCheZhu(self.driver).go_to_consignor()
     WalletPasswordCheZhu(self.driver).send_password(self.wallet_pwd)
     wallet_consignor.go_to_add_consignor()
     wallet_consignor.add_consignor(name=self.consignor_name,
                                    idNo=self.consignor_idNo,
                                    mobile=self.consignor_mobile)
     wait_page = wallet_consignor.wait_consignor_page()
     self.driver_tools.getScreenShot('wallet_consignor_add')
     self.assertTrue(wait_page)  # 检查操作完成后页面activity是否切换为主列表页
     consignor_state = wallet_consignor.find_consignor()
     self.assertTrue(consignor_state)
Beispiel #13
0
        self.driver.send_keys(self.__card_name)
        self.driver.click_element(self.__card_id)
        self.driver.click_element(self.__info_del)
        self.driver.send_keys(self.__card_id)

    @catch_exception
    def submit_id_card_info(self):
        self.driver.click_element(self.__next_step)


if __name__ == '__main__':
    import time
    from util.driver.driver import AppUiDriver
    from page_object.chezhu.chezhu_common.main_tab_chezhu import MainTabCheZhu
    from page_object.chezhu.chezhu_userCenter.personCenter_chezhu import PersonCenterCheZhu
    from page_object.chezhu.chezhu_common.choose_photo_chezhu import ChoosePhotoCheZhu

    try:
        driver = AppUiDriver().app_ui_driver(
            appPackage='com.mustang', appActivity='.account.SplashActivity')
        main_tab = MainTabCheZhu(driver)
        person_center = PersonCenterCheZhu(driver)
        choose_img = ChoosePhotoCheZhu(driver)
        main_tab.goto_person_center()
        person_center.goto_certification_page()
        CertificationCheZhu(driver).upload_card_front()
        choose_img.choose_id_card_front()
        time.sleep(10)
    finally:
        driver.quit()