def test_001(self, drivers): """门店销售订单,添加配件,保存占用可售数量,出库减库存数量""" StockPage = stockpage(drivers) LoginPage = Loginpage(drivers) a = LoginPage.login_name() SellPage = Sellpage(drivers) if a != "XXX": LoginPage.mouse_stop1() LoginPage.click_loginOut() LoginPage.input_username("h1") LoginPage.input_password("123456") LoginPage.click_loginButton() a = LoginPage.get_title() log.info(a) assert ("极配OMS系统" in a) StockPage.click_stcok() StockPage.click_stcoksearch() StockPage.input_stockpartid('05001221') StockPage.click_stcokzero() StockPage.click_stcoksearch1() stock_qty_before = StockPage.stock_qty() stock_outQty_before = StockPage.stock_outQty() SellPage.click_sellManager() SellPage.click_sellOrder() SellPage.click_sellAdd() SellPage.input_sellGuest("一号协议客户") SellPage.enter_guest() SellPage.click_sellSelectGuest() SellPage.click_sellAddSku() SellPage.input_sellInputPartId("05001221") SellPage.click_sellSkusearch() SellPage.doubleClick_sellSKu() SellPage.input_sellNum("10") SellPage.input_sellPrice("11") SellPage.click_sellSkuSure() SellPage.click_sellCancel() SellPage.click_sellSave() StockPage.click_stcoksearch() StockPage.click_stcoksearch1() stock_outQty_after = StockPage.stock_outQty() SellPage.click_sellOrder() SellPage.click_sellCommit() SellPage.click_sellCommitSure() SellPage.click_sellOut() SellPage.click_sellOutSure() sell_Status = SellPage.sell_Status() sell_orderNo = SellPage.sell_orderNo() StockPage.click_stcoksearch() StockPage.click_stcoksearch1() stock_qty_after = StockPage.stock_qty() outQty = int(stock_outQty_before) - int(stock_outQty_after) qty = int(stock_qty_before) - int(stock_qty_after) assert ('已出库' in sell_Status and outQty == 10 and qty == 10) if '已出库' in sell_Status and outQty == 10 and qty == 10: print('1,销售订单' + sell_orderNo, '已成功出库,出库数量10') else: print('1.销售订单,出库失败', )
def test_002(self, drivers): """门店采购退货,添加配件,提交退货""" PchsPage = pchspage(drivers) StockPage = stockpage(drivers) LoginPage = Loginpage(drivers) # LoginPage.input_username("h1") # LoginPage.input_password("123456") # LoginPage.click_loginButton() a = LoginPage.login_name() if a != "XXX": LoginPage.mouse_stop1() LoginPage.click_loginOut() LoginPage.input_username("h1") LoginPage.input_password("123456") LoginPage.click_loginButton() StockPage.click_stcok() StockPage.click_stcoksearch() StockPage.input_stockpartid('05001221') StockPage.click_stcokzero() StockPage.click_stcoksearch1() stock_qty_before = StockPage.stock_qty() stock_outQty_before = StockPage.stock_outQty() PchsPage.click_pchsguanli() PchsPage.click_pchsReturn() PchsPage.click_pchsReturnAdd() PchsPage.input_pchsReturnInputSupplier("上海测试有限公司") PchsPage.enter_pchsReturnInputSupplier() PchsPage.click_pchsReturnChooseSupplier() PchsPage.click_pchsReturnReason() PchsPage.click_pchsReturnSelectReason() PchsPage.click_pchsReturnSku() PchsPage.input_pchsReturnInputPartId("05001221") PchsPage.click_pchsReturnSkuSearch() PchsPage.click_pchsReturnEnterOrder() PchsPage.click_pchsReturnSelectButton() PchsPage.click_pchsReturnCloseButton() PchsPage.click_pchsReturnSave() PchsPage.click_pchsReturnCommit() PchsPage.click_pchsReturnCommitSure() PchsPage.click_pchsReturnButton() PchsPage.click_pchsReturnSure() pchsReturn_returnNum = PchsPage.pchsReturn_returnNum() pchsReturn_status = PchsPage.pchsReturn_status() pchsReturn_orderno = PchsPage.pchsReturn_orderno() StockPage.click_stcoksearch() StockPage.click_stcoksearch1() stock_qty_after = StockPage.stock_qty() stock_outQty_after = StockPage.stock_outQty() qty = int(stock_qty_before) - int(stock_qty_after) outQty = int(stock_outQty_before) - int(stock_outQty_after) assert ('已退货' in pchsReturn_status and qty == int(pchsReturn_returnNum)) if '已退货' in pchsReturn_status and outQty == int( pchsReturn_returnNum): print('1,外采订单' + pchsReturn_orderno, '已成功入库,入库数量5') else: print('1.外采订单,提交失败', )
def test_001(self, drivers): """调拨申请,门店向总部调拨,非紧俏品,提交后,总部自动受理""" AllotPage = allotpage(drivers) StockPage = stockpage(drivers) LoginPage = Loginpage(drivers) a = LoginPage.login_name() if a != "XXX": LoginPage.mouse_stop1() LoginPage.click_loginOut() LoginPage.input_username("h1") LoginPage.input_password("123456") LoginPage.click_loginButton() a = LoginPage.get_title() log.info(a) assert ("极配OMS系统" in a) AllotPage.click_allotmanager() AllotPage.click_allotdan() AllotPage.click_alloapply() AllotPage.click_alloadd() AllotPage.click_allotguest() AllotPage.input_allotguest('测试公司(总部)') AllotPage.click_allotguestsearch() AllotPage.doubleclick_wcgys() AllotPage.click_allotSkuadd() AllotPage.input_allotSku('02000034') AllotPage.click_allotSkusearch() AllotPage.doubleclick_allotsku() AllotPage.input_allotNum("5") AllotPage.click_allotSkusure() AllotPage.click_allotSkuclose() AllotPage.click_allotsave() AllotPage.click_allotadress() AllotPage.click_allotadressf() AllotPage.click_allotadressfzp() AllotPage.click_allotadresssave() allotorderno = AllotPage.allot_orderno() LoginPage.click_shopName() LoginPage.input_shopName("测试公司(总部)") LoginPage.click_loginSearch() LoginPage.click_selectShop() LoginPage.click_shopSure() StockPage.click_stcok() StockPage.click_stcoksearch() StockPage.input_stockpartid('02000034') StockPage.click_stcokzero() StockPage.click_stcoksearch1() stock_outQty_before = StockPage.stock_outQty() LoginPage.click_shopName() LoginPage.input_shopName1("虹梅") LoginPage.click_loginSearch1() LoginPage.click_selectShop1() LoginPage.click_shopSure1() AllotPage.click_allotmanager() AllotPage.click_allotdan() AllotPage.click_alloapply() AllotPage.click_allotcommit() AllotPage.click_allotcommitsure() status = AllotPage.allot_status() LoginPage.click_shopName() LoginPage.input_shopName1("测试公司(总部)") LoginPage.click_loginSearch1() LoginPage.click_selectShop1() LoginPage.click_shopSure1() StockPage.click_stcok() StockPage.click_stcoksearch() StockPage.input_stockpartid('02000034') StockPage.click_stcokzero() StockPage.click_stcoksearch1() stock_outQty_after = StockPage.stock_outQty() outQty = int(stock_outQty_before) - int(stock_outQty_after) assert ('已受理' in status and outQty == 5) if '已受理' in status: print('1,调拨申请单' + allotorderno, '提交成功') else: print('1.调拨申请单,提交失败') else: print("异常")
def test_001(self, drivers): """外采订单,添加配件""" PchsPage = pchspage(drivers) StockPage = stockpage(drivers) LoginPage = Loginpage(drivers) a = LoginPage.login_name() if a != "XXX": LoginPage.mouse_stop1() LoginPage.click_loginOut() LoginPage.input_username("h1") LoginPage.input_password("123456") LoginPage.click_loginButton() a = LoginPage.get_title() log.info(a) assert ("极配OMS系统" in a) PchsPage.click_pchsguanli() PchsPage.click_pchswaicai() PchsPage.click_wcadd() PchsPage.click_wcselectsp() PchsPage.input_supplier('上海测试有限公司') PchsPage.click_wcsearch() PchsPage.doubleclick_wcgys() PchsPage.click_waaddsku() PchsPage.input_wcsku('05001221') PchsPage.click_wcskusearch() PchsPage.doubleclick_wcsku() PchsPage.input_wcnum('5') PchsPage.input_wcprice('10') PchsPage.click_wcskusure() PchsPage.click_wcskuclose() PchsPage.click_wcsave() # 检查库存 StockPage.click_stcok() StockPage.click_stcoksearch() StockPage.input_stockpartid('05001221') StockPage.click_stcokzero() StockPage.click_stcoksearch1() stock_qty_before = StockPage.stock_qty() stock_outQty_before = StockPage.stock_outQty() PchsPage.click_pchswaicai() PchsPage.click_wccommit() PchsPage.click_wccommitsure() stastus = PchsPage.wcpchs_status() pchswcno = PchsPage.wcpchs_orderno() StockPage.click_stcoksearch() StockPage.click_stcoksearch1() stock_qty_after = StockPage.stock_qty() stock_outQty_after = StockPage.stock_outQty() a = int(stock_qty_after) - int(stock_qty_before) b = int(stock_outQty_after) - int(stock_outQty_before) # try: # assert ('全部入库1' in stastus and a == 5 and b == 5) # print('1,外采订单' + pchswcno, '已成功入库,入库数量5') # except Exception as e: # print('1.外采订单,提交失败', format(e)) assert ('全部入库' in stastus and a == 5 and b == 5) if '全部入库' in stastus and a == 5 and b == 5: print('1,外采订单' + pchswcno, '已成功入库,入库数量5') else: print('1.外采订单,提交失败', ) else: print("异常")