예제 #1
0
class TestCertification(unittest.TestCase):
    """凯京车主APP 身份认证"""
    def setUp(self):
        """前置条件准备"""
        self.logger = Log()
        self.logger.info(
            '########################### TestCertification START ###########################'
        )
        config = ReadYaml(FileUtil.getProjectObsPath() +
                          '/config/config.yaml').getValue()
        app_package = config['appPackage_chezhu']
        app_activity = config['appActivity_chezhu']
        # AppUiDriver(appPackage=app_package, appActivity=app_activity).app_ui_driver()

        self.db = DbOperation()
        self.driver = AppUiDriver(appPackage=app_package,
                                  appActivity=app_activity).get_driver()
        self.mobile = config['mobile_unregister']
        self.name = config['name_unregister']
        self.idNo = config['idNo_unregister']
        self.db.initialize_driver_info(self.mobile)
        self.driver.start_activity(app_activity=app_activity,
                                   app_package=app_package)
        pass

    def tearDown(self):
        """测试环境重置"""
        self.db.initialize_driver_info(self.mobile)
        self.logger.info(
            '########################### TestCertification END ###########################'
        )
        pass

    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'])
예제 #2
0
class TestCarCertification(unittest.TestCase):
    """凯京车主APP 车辆认证"""
    def setUp(self):
        """前置条件准备"""
        self.logger = Log()
        self.logger.info(
            '########################### TestCarCertification START ###########################'
        )
        config = ReadYaml(FileUtil.getProjectObsPath() +
                          '/config/config.yaml').getValue()
        app_package = config['appPackage_chezhu']
        app_activity = config['appActivity_chezhu']
        # AppUiDriver(appPackage=app_package, appActivity=app_activity).app_ui_driver()
        self.mobile = config['mobile_unregister']
        self.db = DbOperation()
        self.driver = AppUiDriver(appPackage=app_package,
                                  appActivity=app_activity).get_driver()
        self.db.update_driver_info()
        self.driver.start_activity(app_activity=app_activity,
                                   app_package=app_package)
        pass

    def tearDown(self):
        """测试环境重置"""
        self.db.initialize_driver_info(self.mobile)
        self.logger.info(
            '########################### TestCarCertification END ###########################'
        )
        pass

    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'])