def setUp(self): self.logger = Log() self.logger.info( '######################## TestProfitReportSelect START ########################' ) carType = str(random.randint(1, 2)) self.applyDate = time.strftime('%Y-%m-%d') photoAirWay = FileUtil.getProjectObsPath() + '/image/photoAirWay.jpg' receipt_0 = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'logo.png' wayBillId = CreateWayBill().create_waybill( carType, self.applyDate, photoAirWay, '北京', '北京', '', '天津', '天津', '', '1000', '10', '0.01', '0.02', '0.03', '0.04', '1', '备注我要录单测试', 'TMS', '零担', '10', '100', '1000', '10000', '100000', '20', '30', '40', '50', 'DD001', 'YK001', 'LSVAM4187C2184847', '6222810001000', '中国银行', '张三')[0] WayBillDepartureConfirm().waybill_departure_confirm(wayBillId) waybill_transport_detail = WayBillDetailGet().waybill_detail_get( wayBillId).json()['content'] self.wayBillNo = waybill_transport_detail['transportCash'][ 'tmsBillCode'] WayBillArrivalConfirm().waybill_arrival_confirm( wayBillId, waybill_transport_detail['transportCash']['destAmt'], waybill_transport_detail['transportCash']['destAmtMemo']) WayBillReceiptUpload().waybill_receipt_upload(wayBillId, 'Y', 'Y', 'N', '回单上传测试', 'C', receipt_0) waybill_arrived_detail = WayBillDetailGet().waybill_detail_get( wayBillId).json()['content'] WayBillReceiptConfirm().waybill_receipt_confirm( wayBillId, waybill_arrived_detail['transportCash']['retAmt'], '金额变动', '有异常', receipt_0)
def setUp(self): self.logger = Log() self.logger.info( '########################### TestUpdateWayBill START ###########################' ) self.carType = str(random.randint(1, 2)) self.applyDate = time.strftime('%Y-%m-%d') self.photoAirWay = FileUtil.getProjectObsPath( ) + '/image/photoAirWay.jpg' self.startTime = time.strftime('%Y-%M-%d') self.endTime = time.strftime('%Y-%m-%d', time.localtime(time.time() + 86400)) self.photoIdFront = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'frontIdCard.jpg' self.photoIdReserve = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'backIdCard.jpg' self.photoDriverCard = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'photoDriverCard.jpg' self.photoTransPort = FileUtil.getProjectObsPath( ) + os.path.sep + 'image' + os.path.sep + 'photoTransPort.jpg' self.wayBillId, self.mobile, self.name, self.idNo,self.carNo,self.carLength, self.carModel, self.projectName, \ self.projectId, self.supplierName, self.supplierId= CreateWayBill().create_waybill( self.carType, self.applyDate, self.photoAirWay, '北京', '北京', '', '天津', '天津', '', '1000', '10', '0.01', '0.02', '0.03', '0.04', '1', '备注我要录单测试', 'TMS', '零担', '10', '100', '1000', '10000', '100000', '20', '30','40', '50', 'DD001', 'YK001', 'LSVAM4187C2184847', '6222810001000', '中国银行','张三')
def setUp(self): self.logger = Log() self.logger.info('##################### TestWayBillTempGet START #####################') Settings().system_params_update() file = FileUtil.getProjectObsPath() + os.path.sep + 'file' + os.path.sep + 'waybill_temp_import.xlsx' self.logger.info('批量导入运单的文件是:{0}'.format(file)) self.temp_waybillId = CreateWayBill().create_temp_waybill(file, '德邦物流', '德邦集团', 'DB20171101100')
def test_singlePay_OFFLINE(self): ''' 运费支付方式:线下支付 ''' waybillID = CreateWayBill().create_waybill_register() response = PaymentSingle().payment_single(waybillID, paymentMethod=4, amountType=1, amount='0.01') self.logger.info('线下支付返回状态码:{0}'.format(response)) self.logger.info('线下支付结果:{}'.format(response.json())) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['code'], 0)
def test_singlePay_KEKING_TO_COMPANY(self): ''' 运费支付方式:贷款付商户 ''' waybillID = CreateWayBill().create_waybill_register() response = PaymentSingle().payment_single(waybillID, paymentMethod=3, amountType=9, amount='0.05') self.logger.info('贷款付商户支付返回状态码:{0}'.format(response)) self.logger.info('贷款付商户支付结果:{}'.format(response.json())) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['code'], 0)
def setUp(self): self.logger = Log() self.logger.info('########################### TestDefinedFeeUpdate START ###########################') Settings().system_params_update() self.logger.info('更新系统属性配置信息') self.waybillID = CreateWayBill().create_waybill_register(handlingFee='1', deliveryFee='1', oilCardDeposit='1', otherFee='1') self.logger.info('新建运单,录入的自定义费用项数值均为1,生成的运单号为{0}'.format(self.waybillID)) self.handlingFee = random.randint(1, 100) self.deliveryFee = random.randint(1, 100) self.oilCardDeposit = random.randint(1, 100) self.otherFee = random.randint(1, 100)
def setUp(self): self.logger = Log() self.logger.info('####################### TestReceiptConfirmWayBill START #######################') carType = str(random.randint(1, 2)) applyDate = time.strftime('%Y-%m-%d') photoAirWay = FileUtil.getProjectObsPath() + '/image/photoAirWay.jpg' self.wayBillId = CreateWayBill().create_waybill(carType, applyDate, photoAirWay, '北京', '北京', '', '天津', '天津', '', '1000', '10', '0.01', '0.02', '0.03', '0.04', '1', '备注我要录单测试', 'TMS', '零担', '10', '100', '1000', '10000', '100000', '20', '30', '40', '50', 'DD001', 'YK001', 'LSVAM4187C2184847', '6222810001000', '中国银行','张三')[0] self.receipt_0 = FileUtil.getProjectObsPath() + os.path.sep + 'image' + os.path.sep + 'logo.png'
def setUp(self): self.logger = Log() self.logger.info('######################## TestDepartureConfirmWayBill START ########################') carType = str(random.randint(1, 2)) applyDate = time.strftime('%Y-%m-%d') photoAirWay = FileUtil.getProjectObsPath() + '/image/photoAirWay.jpg' self.wayBillId = CreateWayBill().create_waybill(carType, applyDate, photoAirWay, '北京', '北京', '', '天津', '天津', '', '1000', '10', '0.01', '0.02', '0.03', '0.04', '1', '备注我要录单测试', 'TMS', '零担', '10', '100', '1000', '10000', '100000', '20', '30', '40', '50', 'DD001', 'YK001', 'LSVAM4187C2184847', '6222810001000', '中国银行','张三')[0] wayBillNo = WayBillDetailGet().waybill_detail_get(self.wayBillId).json()['content']['transportCashDetail']['tmsBillCode'] self.logger.info('添加跟踪备注信息的运单号是:{0}'.format(wayBillNo))
def test_waybill_create_outside_driver_success(self): '''我要录单 创建外请车运单''' wayBillId, mobile, name, idNo, carNo = CreateWayBill().create_waybill( '2', self.applyDate, self.photoAirWay, '北京', '北京', '', '天津', '天津', '', '1000', '10', '0.01', '0.02', '0.03', '0.04', '1', '备注我要录单测试', 'TMS', '零担', '10', '100', '1000', '10000', '100000', '20', '30', '40', '50', 'DD001', 'YK001', 'LSVAM4187C2184847', '6222810001000', '中国银行', '张三')[:5] waybill_list = WayBillSelect().waybill_select( normalCondition=carNo, searchStatus=True).json()['content']['dataList'] L = [] for waybill in waybill_list: L.append(waybill['id']) self.assertIn(wayBillId, L, 'Waybill created fail!')
def setUp(self): self.logger = Log() self.logger.info( '########################### TestGetDetailWayBill START ###########################' ) self.carType = str(random.randint(1, 2)) self.applyDate = time.strftime('%Y-%m-%d') photoAirWay = FileUtil.getProjectObsPath() + '/image/photoAirWay.jpg' self.wayBillId = CreateWayBill().create_waybill( self.carType, self.applyDate, photoAirWay, '北京', '北京', '', '天津', '天津', '', '1000', '10', '0.01', '0.02', '0.03', '0.04', '1', '备注我要录单测试', 'TMS', '零担', '10', '100', '1000', '10000', '100000', '20', '30', '40', '50', 'DD001', 'YK001', 'LSVAM4187C2184847', '6222810001000', '中国银行', '张三')[0] Settings().system_params_update() WayBillDelete().waybill_delete(self.wayBillId)
def test_waybill_temp_import_success(self): '''批量导入运单''' file = FileUtil.getProjectObsPath( ) + os.path.sep + 'file' + os.path.sep + 'waybill_temp_import.xlsx' self.logger.info('批量导入运单的文件是:{0}'.format(file)) temp_waybillId = CreateWayBill().create_temp_waybill( file, '德邦物流', '德邦集团', 'DB20171101100') temp_waybill_list = WayBillTempSelect().waybill_temp_select( searchMode='general', globalCondition='德邦物流').json()['content']['dataList'] if temp_waybill_list != None: L = [] for temp_waybill in temp_waybill_list: L.append(str(temp_waybill['id'])) self.assertIn(temp_waybillId, L, '批量运单导入失败!') else: self.logger.error('批量运单导入失败!')
def setUp(self): self.logger = Log() self.logger.info( '########################### TestPaymentDetailGet START ###########################' ) self.wayBillId = CreateWayBill().create_waybill_register()