Exemple #1
0
    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)
Exemple #2
0
    def test_order_ng_week(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)

        time.sleep(4)
        # 点击库存管理按钮
        PutSto.click_stocon()
        # 点击建议采购按钮
        PutSto.click_suging()
        # 增加筛选订单条件
        GetOrder.filtrate_order('周结')
        # 获取订单SKU
        sku = GetOrder.get_order_sku()
        # 获取订单采购数量
        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)
        # 不通过修改
        sca.qc_ng_scan(sku, '颜色', statu='ssss')
        ng.get_pending(sku, 'pass')
        # sca.rku_to_scan(qr)
        time.sleep(1)
        kucun_gei = KuCun(login_web).get_kucun(sku)
        assert int(kucun) == int(kucun_gei)
Exemple #3
0
    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)