def test_duocang_order(self, login_web): logging.info("*********入库:开始执行多仓库—多仓打单用例*********") hoen = HomePage(login_web) # 新建订单按钮页面操作 ord = OrderPage(login_web) # 新建订单页面操作 new = NewPage(login_web) move = KdiLeavePage(login_web) kd_snac = KdiScan(login_web) wuli = Wuliu(login_web) hoen.click_to_merge() ord.new_order() code = new.new_order('多仓打单') ord.jian_move_he(code) get_moth_transportation = ord.freight_gu(moth='多仓') if get_moth_transportation != "无快递": #sku dingdan_code = ord.xiu_kdi_moth(wuli_data[get_moth_transportation], code) move.he_move_dengdai(code) move.dengdai_move_duoca(code) sku = move.dadna_move_suo_duocang(code) picihao_code = kd_snac.get_picihao_cuocang(dingdan_code) #~~~~~~~~~~~~~~~~~~~~~扫描阶段~~~~~~~~~~~~ qr = kd_snac.duopin_scan_duocang(picihao_code, sku) kd_snac.hedui_scan_duocang(qr) kd_snac.kdi_scan_cku(wuli_data[get_moth_transportation], code) # ~~~~~~~~~~~~~~~~~~~~~扫描阶段~~~~~~~~~~~~~ wuli.wuliu_scna(dingdan_code) assert wuli.judge_order_cku(dingdan_code) == '等待物流收包' else: BasePage(login_web)._screenshot(model_name='无快递截图') pass
def test_chuku_order_duopin(self, login_web): logging.info("*********入库:开始执行多品打单(快递)用例*********") hoen = HomePage(login_web) # 新建订单按钮页面操作 ord = OrderPage(login_web) # 新建订单页面操作 new = NewPage(login_web) move = KdiLeavePage(login_web) kd_snac = KdiScan(login_web) wuli = Wuliu(login_web) hoen.click_to_merge() ord.new_order() code = new.new_order('多品打单') # 待检查--待合并 ord.jian_move_he(code) get_moth_transportation = ord.freight_gu('快递') if get_moth_transportation != "无快递": # 订单号 dingdan_code = ord.xiu_kdi_moth(wuli_data[get_moth_transportation], code) move.he_move_dengdai(code) move.dengdai_move_print(code, '多品打单') sku = move.dadna_move_suo(code, '多品打单') # ~~~~~~~~~~~~~~~~~~~~~~~~~扫描分割线~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ picihao_code = kd_snac.get_picihao(dingdan_code, '快递-多品打单') qr = kd_snac.duopin_scan_kdi(picihao_code, sku) kd_snac.duo_scan_hedui(qr) #~~~~~~~~~~~~~~~~~~~~~~~~~~扫描分割线~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ order_statu = ord.get_order_statu(dingdan_code) if order_statu == "快递-待处理": ord.xiugai_money() kd_snac.kdi_scan_cku(wuli_data[get_moth_transportation], code) wuli.wuliu_scna(dingdan_code) assert wuli.judge_order_cku(dingdan_code) == '等待物流收包' else: kd_snac.kdi_scan_cku(wuli_data[get_moth_transportation], code) wuli.wuliu_scna(picihao_code) assert wuli.judge_order_cku(dingdan_code) == '等待物流收包' # ~~~~~~~~~~~~~~~~~~~~~~~~~物流分割线~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ else: BasePage(login_web)._screenshot(model_name='无快递截图') pass
def test_permisva_anh(self,login_web): logging.info("*********权限:开始执行平台账号权限验证用例*********") hoen = HomePage(login_web) # 新建订单按钮页面操作 ord = OrderPage(login_web) # 新建订单页面操作 new = NewPage(login_web) move = KdiLeavePage(login_web) kd_snac = KdiScan(login_web) yunshu =YunPipei(login_web) login = LoginPage(login_web) hoen.click_to_merge() ord.new_order() #打单方式 mold = "按货打单" code = new.new_order_qx('AliExpress',mold) #第一行第二列为平台订单号 DoExcel(testcases_dir, 'AliExpress').write_back(1,2,code) login.clear_login() #~~~~~~~~~~~~~~~切换员工账号~~~~~~~~~~~~~ use_yg = DoExcel(testcases_dir,'AliExpress').do_excel('yuangong',1,1) login.login(use_yg['yuangong']) time.sleep(2) #查询订单号并且移动至待合并状态 ord.jian_move_he_qx(code) #~~~~~~~~~~~~~~切换经理账号~~~~~~~~~~~~~~~ login.clear_login() use_jli = DoExcel(testcases_dir, 'AliExpress').do_excel('jingli', 2, 1) login.login(use_jli['jingli']) time.sleep(2) #待合并 ord.chaxun_code(code) #获取运输方式 get_moth_index=ord.freight_gu("权限") time.sleep(1) #修改运输方式和添加跟踪号 dingdan_code = ord.xiu_kdi_moth_qx(wuli_data[get_moth_index], code) # #查找运输方式 yunshu_genre=yunshu.get_yunshu(wuli_data[get_moth_index]) ord.chaxun_code(code) # #待合并---等待打单 yunshu_mold=move.qx_hb_move_daidadan(yunshu_genre) # #判断仓库 cangku=move.get_cangku() login.clear_login() if cangku == "塘厦仓库": use_zhuguan = DoExcel(testcases_dir, 'AliExpress').do_excel('zhuguan', 6, 1) login.login(use_zhuguan['zhuguan']) time.sleep(2) elif cangku == "大浪仓库": use_zhuguan = DoExcel(testcases_dir, 'AliExpress').do_excel('zhuguan', 7, 1) login.login(use_zhuguan['zhuguan']) time.sleep(2) elif cangku == "石岩仓库": use_zhuguan = DoExcel(testcases_dir, 'AliExpress').do_excel('zhuguan', 8, 1) login.login(use_zhuguan['zhuguan']) time.sleep(2) ord.chaxun_code(code) #等待打单——打单 move.qx_dengdai_move_dadan(yunshu_mold,mold) # ~~~~~~~~~~~~~~切换仓库主管账号~~~~~~~~~~~~~~~ #搜索订单 ord.chaxun_code(code) #获取订单状态 order_status=move.get_status() if "核对打单" in order_status: hedui_sku =move.get_sku_qx() scan_mold =move.get_scan_mold() kd_snac.qx_scan(dingdan_code, hedui_sku, scan_mold) kd_snac.kdi_scan_cku(wuli_data[get_moth_index], code) ord.chaxun_code(code) assert '已发货' in move.get_status() else: #锁定订单 sku=move.dadna_move_suo_qx(code,order_status) #扫描,SKU还未保存 #获取扫描方式(注意:核对扫描不存在锁单操作) ord.chaxun_code(code) scan_mold = move.get_scan_mold() kd_snac.qx_scan(dingdan_code,sku,scan_mold) kd_snac.kdi_scan_cku(wuli_data[get_moth_index], code) ord.chaxun_code(code) assert '已发货' in move.get_status()