def test_001(self, drivers): """滚动计划,添加配件""" PchsPage = pchspage(drivers) LoginPage = Loginpage(drivers) LoginPage.input_username("zw1") LoginPage.input_password("123456") LoginPage.click_loginButton() a = LoginPage.get_title() log.info(a) assert ("极配OMS系统" in a) PchsPage.click_pchsguanli() PchsPage.click_pchsgundong() PchsPage.click_gdadd() PchsPage.click_gdselectsp() PchsPage.input_gdsupplier("上海测试有限公司") PchsPage.click_gdsearch() PchsPage.doubleclick_gdgys() PchsPage.click_gdaddsku() PchsPage.input_gdsku("04006664") PchsPage.click_gdskusearch() PchsPage.doubleclick_gdsku() PchsPage.input_gdnum("5") PchsPage.input_gdprice("10") PchsPage.click_gdskusure() PchsPage.click_gdskuclose() PchsPage.click_gdsave() PchsPage.click_gdcommit() gdstatus = PchsPage.gdpchs_status() gdorderno = PchsPage.gdpchs_orderno() assert ('已审批' in gdstatus) if '已审批' in gdstatus: print('1,滚动计划单' + gdorderno, "已成功提交") else: print('1.滚动计划单,提交失败', )
def test_004(self, drivers): """销售退货,添加配件,销退入库""" SellPage = Sellpage(drivers) LoginPage = Loginpage(drivers) # LoginPage.input_username("h1") # LoginPage.input_password("123456") # LoginPage.click_loginButton() a = LoginPage.get_title() log.info(a) assert ("极配OMS系统" in a) if a != "XXX": StockPage = stockpage(drivers) 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_salesReturns() SellPage.salesReturnsAdd() SellPage.input_salesReturnsGuest("一号协议客户") SellPage.enter_salesReturnsGuest() SellPage.click_salesReturnsGuest() SellPage.click_salesReturnsReason() SellPage.click_salesReturnsChooseReason() SellPage.click_salesReturnsAddSku() SellPage.input_salesReturnsInputPartId("05001221") SellPage.click_salesReturnsSearch() SellPage.click_salesReturnsSku1() SellPage.click_salesReturnsSku2() SellPage.click_salesReturnsSku3() SellPage.click_click_salesReturnsChoose() SellPage.click_click_salesReturnsClose() SellPage.click_click_salesReturnsSave() SellPage.click_click_salesReturnsCommit() SellPage.click_click_salesReturnsCommitSure() salesReturns_Status = SellPage.salesReturns_Status() salesReturns_orderNo = SellPage.salesReturns_orderNo() StockPage.click_stcoksearch() StockPage.click_stcoksearch1() stock_qty_after = StockPage.stock_qty() stock_outQty_after = StockPage.stock_outQty() qty = int(stock_qty_after) - int(stock_qty_before) outQty = int(stock_outQty_after) - int(stock_outQty_before) assert ('已入库' in salesReturns_Status and qty == 15 and outQty == 15) if ('已入库' in salesReturns_Status and qty == 15 and outQty == 15): print('1,销售退货单号' + salesReturns_orderNo, '已成功入库,入库数量5') else: print('1.销售退货,入库失败', )
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_003(self, drivers): """门店销售订单,选择入库单,保存占用可售数量以及批次的可售库存,出库减库存数量""" SellPage = Sellpage(drivers) LoginPage = Loginpage(drivers) # LoginPage.input_username("h1") # LoginPage.input_password("123456") # LoginPage.click_loginButton() a = LoginPage.get_title() log.info(a) assert ("极配OMS系统" in a) if a != "XXX": StockPage = stockpage(drivers) 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() StockPage.click_batchSku() StockPage.input_stockCode("05001221") StockPage.click_batchSkuSearch() batchStock_qty_before = StockPage.batchStock_qty() batchStock_outQty_before = StockPage.batchStock_outQty() SellPage.click_sellManager() SellPage.click_sellOrder() SellPage.click_sellAdd() SellPage.input_sellGuest("一号协议客户") SellPage.enter_guest() SellPage.click_sellSelectGuest() SellPage.click_enterOrder() SellPage.click_outEnterOrder() SellPage.click_selectEnterOrder() SellPage.click_enterOrderCost() # SellPage.click_outNum() # SellPage.input_outNum("1") SellPage.click_sellSave() StockPage.click_stcoksearch() StockPage.click_batchSkuSearch() batchStock_outQty_after = StockPage.batchStock_outQty() StockPage.click_stockSku() 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() StockPage.click_batchSku() StockPage.click_batchSkuZero() StockPage.click_batchSkuSearch() batchStock_qty_after = StockPage.batchStock_qty() stock_outQty = int(stock_outQty_before) - int(stock_outQty_after) batchStock_outQty = int(batchStock_outQty_before) - int( batchStock_outQty_after) stock_qty = int(stock_qty_before) - int(stock_qty_after) batchStock_qty = int(batchStock_qty_before) - int( batchStock_qty_after) assert ('已出库' in sell_Status and stock_outQty == 5 and batchStock_outQty == 5 and stock_qty == 5 and batchStock_qty == 5) if ('已出库' in sell_Status and stock_outQty == 5 and batchStock_outQty == 5 and stock_qty == 5 and batchStock_qty == 5): print('1,销售订单' + sell_orderNo, '已成功出库,出库数量5') else: print('1.销售订单,出库失败', )
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("异常")