def test_new_order_online(self, login_web): logging.info("*********入库:开始执行线上现结入库用例*********") number = random.randint(100000, 1000000) PutSto = PutStor(login_web) # 库存管理方法 GetOrder = GetOrdervalue(login_web) # 采购页面方法,包含BasePage listp = ListPu(login_web) sca = Scan(login_web) time.sleep(4) # 点击库存管理按钮 PutSto.click_stocon() # 点击建议采购按钮 PutSto.click_suging() # 增加筛选订单条件 GetOrder.filtrate_order('线上现结') # 获取订单SKU try: sku = GetOrder.get_order_sku() except: assert GetOrder.get_no_text() == '没有记录' else: # 获取订单采购数量 size = int(GetOrder.get_order_size()) logging.info('采购的数量为{0}'.format(size)) time.sleep(1) # 获取库存 kucun = KuCun(login_web).get_kucun(sku) logging.info("库存为:{0}".format(kucun)) # 点击库存管理按钮 PutSto.click_stocon() # 点击建议采购按钮 PutSto.click_suging() # 输入SKU搜索 GetOrder.input_sku(sku) # 勾选订单并且生成采购订单 time.sleep(3) GetOrder.choose_order() time.sleep(3) # alert弹窗处理 GetOrder.get_alert() time.sleep(3) # ~~~~~~~~~~~~~~采购单列表 # listp.input_SUK(sku) listp.bulk_operation(sku, number) time.sleep(2) # ~~~~~~~~~扫描区~~~~~~~~~~~~ sca.back_to_scan(number) sca.ex_to_scan(number, size) # t=MySql().get_sku(sku) # qr=t+'.'+sku # login_web.switch_to.default_content() sca.qc_to_scan(sku) # sca.rku_to_scan(qr) time.sleep(1) kucun_gei = KuCun(login_web).get_kucun(sku) assert int(int(kucun) + int(size)) == int(kucun_gei)
def test_permisva_rku_ng_qx(self, login_web): logging.info("*********入库:开始执行周结入库权限的用例*********") number = random.randint(100000, 1000000) PutSto = PutStor(login_web) # 库存管理方法 GetOrder = GetOrdervalue(login_web) # 采购页面方法,包含BasePage listp = ListPu(login_web) login = LoginPage(login_web) sca = Scan(login_web) ng = NgPending(login_web) qcno = NoGoodPage(login_web) login.clear_login() use_zhuguan = DoExcel(testcases_dir, 'qxrku').do_excel('zhuguan', 1, 1) login.login(use_zhuguan['zhuguan']) time.sleep(2) # 点击库存管理按钮 PutSto.click_stocon() # 点击建议采购按钮 PutSto.click_suging() # 增加筛选订单条件 GetOrder.filtrate_order_qx() # 获取订单SKU try: sku = GetOrder.get_order_sku() except: assert GetOrder.get_no_text() == '没有记录' else: # 获取订单采购数量 size = int(GetOrder.get_order_size()) logging.info('采购的数量为{0}'.format(size)) time.sleep(1) # 获取库存 kucun = KuCun(login_web).get_kucun(sku) logging.info("库存为:{0}".format(kucun)) # 点击库存管理按钮 PutSto.click_stocon() # 点击建议采购按钮 PutSto.click_suging() # 输入SKU搜索 GetOrder.input_sku(sku) # 勾选订单并且生成采购订单 time.sleep(3) GetOrder.choose_order() time.sleep(3) # alert弹窗处理 GetOrder.get_alert() time.sleep(3) # ~~~~~~~~~~~~~~采购单列表 listp.bulk_operation(sku, number) xuhao = listp.get_xuhao() time.sleep(2) login.clear_login() use_huihscan = DoExcel(testcases_dir, 'qxrku').do_excel('huihscan', 2, 1) login.login(use_huihscan['huihscan']) time.sleep(2) # # # ~~~~~~~~~扫描区~~~~~~~~~~~~ sca.back_to_scan(number) time.sleep(2) login.clear_login() use_kdiscan = DoExcel(testcases_dir, 'qxrku').do_excel('kdiscan', 3, 1) login.login(use_kdiscan['kdiscan']) time.sleep(2) sca.ex_to_scan(number, size) time.sleep(1) login.clear_login() use_qcscan = DoExcel(testcases_dir, 'qxrku').do_excel('qcscan', 4, 1) login.login(use_qcscan['qcscan']) time.sleep(2) sca.qc_ng_scan(sku, '颜色',statu='入库待处理') # ~~~~~~~~~~~~~~~~~~切换账号~~~~~~~~~~~~~~~~~~~ login.clear_login() use_ckuzhuguan = DoExcel(testcases_dir, 'qxrku').do_excel('ckuzhuguan', 6, 1) login.login(use_ckuzhuguan['ckuzhuguan']) time.sleep(2) ng.get_rku_pending(sku, '废弃') time.sleep(1) qcno.feiqi_dispose(sku, xuhao) assert qcno.get_feiqi() == '已废弃' time.sleep(1) kucun_gei = KuCun(login_web).get_kucun(sku) assert int(kucun) == int(kucun_gei)
def test_permisva_rku_qx(self, login_web): logging.info("*********入库:开始执行周结入库权限的用例*********") number = random.randint(100000, 1000000) PutSto = PutStor(login_web) # 库存管理方法 GetOrder = GetOrdervalue(login_web) # 采购页面方法,包含BasePage listp = ListPu(login_web) login = LoginPage(login_web) sca = Scan(login_web) login.clear_login() use_zhuguan = DoExcel(testcases_dir, 'qxrku').do_excel('zhuguan', 1, 1) login.login(use_zhuguan['zhuguan']) time.sleep(2) # 点击库存管理按钮 PutSto.click_stocon() # 点击建议采购按钮 PutSto.click_suging() # 增加筛选订单条件 GetOrder.filtrate_order_qx() # 获取订单SKU try: sku = GetOrder.get_order_sku() except: assert GetOrder.get_no_text() == '没有记录' else: # 获取订单采购数量 size = int(GetOrder.get_order_size()) logging.info('采购的数量为{0}'.format(size)) time.sleep(1) # 获取库存 kucun = KuCun(login_web).get_kucun(sku) logging.info("库存为:{0}".format(kucun)) # 点击库存管理按钮 PutSto.click_stocon() # 点击建议采购按钮 PutSto.click_suging() # 输入SKU搜索 GetOrder.input_sku(sku) # 勾选订单并且生成采购订单 time.sleep(3) GetOrder.choose_order() time.sleep(3) # alert弹窗处理 GetOrder.get_alert() time.sleep(3) # ~~~~~~~~~~~~~~采购单列表 listp.bulk_operation(sku, number) time.sleep(2) login.clear_login() use_huihscan = DoExcel(testcases_dir, 'qxrku').do_excel('huihscan', 2, 1) login.login(use_huihscan['huihscan']) time.sleep(2) # # # ~~~~~~~~~扫描区~~~~~~~~~~~~ sca.back_to_scan(number) time.sleep(2) login.clear_login() use_kdiscan = DoExcel(testcases_dir, 'qxrku').do_excel('kdiscan', 3, 1) login.login(use_kdiscan['kdiscan']) time.sleep(2) sca.ex_to_scan(number, size) time.sleep(1) login.clear_login() use_qcscan = DoExcel(testcases_dir, 'qxrku').do_excel('qcscan', 4, 1) login.login(use_qcscan['qcscan']) time.sleep(2) input_qr_code=sca.qc_to_scan_qx(sku) # 扫描结束 time.sleep(1) login.clear_login() use_rkscan = DoExcel(testcases_dir, 'qxrku').do_excel('rkscan', 5, 1) login.login(use_rkscan['rkscan']) time.sleep(2) sca.rku_to_scan(input_qr_code) time.sleep(1) login.clear_login() use_zhuguan = DoExcel(testcases_dir, 'qxrku').do_excel('zhuguan', 1, 1) login.login(use_zhuguan['zhuguan']) time.sleep(2) kucun_gei = KuCun(login_web).get_kucun(sku) assert int(int(kucun) + int(size)) == int(kucun_gei)
def test_order_rkuqc(self, login_web): logging.info("*********入库:开始执行输入不通过原因,NG采购待处理用例*********") number = random.randint(100000, 1000000) PutSto = PutStor(login_web) # 库存管理方法 GetOrder = GetOrdervalue(login_web) # 采购页面方法,包含BasePage listp = ListPu(login_web) sca = Scan(login_web) ng = NgPending(login_web) qcno = NoGoodPage(login_web) time.sleep(4) # 点击库存管理按钮 PutSto.click_stocon() # 点击建议采购按钮 PutSto.click_suging() # 增加筛选订单条件 GetOrder.filtrate_order('阿里账期') # 获取订单SKU try: sku = GetOrder.get_order_sku() except: assert GetOrder.get_no_text() == '没有记录' else: # 获取订单采购数量 size = int(GetOrder.get_order_size()) logging.info('采购的数量为{0}'.format(size)) time.sleep(1) # 获取库存 kucun = KuCun(login_web).get_kucun(sku) logging.info("库存为:{0}".format(kucun)) # 点击库存管理按钮 PutSto.click_stocon() # 点击建议采购按钮 PutSto.click_suging() # 输入SKU搜索 GetOrder.input_sku(sku) # 勾选订单并且生成采购订单 time.sleep(3) GetOrder.choose_order() time.sleep(3) # alert弹窗处理 GetOrder.get_alert() time.sleep(3) # ~~~~~~~~~~~~~~采购单列表 # listp.input_SUK(sku) listp.bulk_operation(sku, number) xuhao = listp.get_xuhao() time.sleep(2) # ~~~~~~~~~扫描区~~~~~~~~~~~~ sca.back_to_scan(number) sca.ex_to_scan(number, size) # 不通过修改 sca.qc_ng_scan(sku, '颜色', statu='rku') ng.get_rku_pending(sku, 'passqc') qcno.wait_dispose(sku, xuhao) assert qcno.wait_order() == '等待QC' time.sleep(1) kucun_gei = KuCun(login_web).get_kucun(sku) assert int(kucun) == int(kucun_gei)