def test_checkTraderAccount(self, userLogin, send_data, expect): """查找商家""" re = Trader(userLogin).getTraderListData(send_data['parkName'], send_data['traderName']) result = re self.save_data('traderAccount', result[0]['account']) Assertions().assert_in_text(result, expect["traderAccountMsg"])
def test_traderSell(self, userLogin, send_data, expect): """商家售卖""" re = Trader(userLogin).addSell(send_data['parkName'], send_data['traderName'], send_data['couponName']) result = re Assertions().assert_in_text(result, expect["traderSellMsg"])
def test_editTraderPwd(self, userLogin, send_data, expect): """修改密码""" re = Trader(userLogin).editTrader(send_data['name'], send_data['name'], send_data['parkName'], send_data['editPwd']) result = re self.save_data('editPwd', send_data['editPwd']) Assertions().assert_in_text(result, expect["editTraderPwdMsg"])
def test_editTrader(self, userLogin, send_data, expect): """商户编辑""" re = Trader(userLogin).editTrader(send_data['name'], send_data["editName"], send_data['parkName']) result = re self.save_data('editName', send_data["editName"]) Assertions().assert_in_text(result, expect["editTraderMessage"])
def test_addTrader(self, userLogin, send_data, expect): """新增商户""" re = Trader(userLogin).addTrader(send_data["traderName"], send_data["parkName"], send_data['account'], send_data['couponName']) result = re self.save_data('account', send_data['account']) Assertions().assert_in_text(result, expect["addTraderMessage"])
def test_deleteTrader(self, userLogin, send_data, expect): """商户删除""" re = Trader(userLogin).deleteTrader(send_data['parkName'], send_data["name"]) result = re Assertions().assert_in_text(result, expect["deleteTraderMessage"])
def test_checkDeleteTrader(self, userLogin, send_data, expect): """查看已删除商户是否存在""" re = Trader(userLogin).getTraderListData(send_data['parkName'], send_data["editName"]) result = re Assertions().assert_not_in_text(result, expect["checkDeleteTraderMsg"])
def test_checkEditTrader(self, userLogin, send_data, expect): """查看修改后商户""" re = Trader(userLogin).getTraderListData(send_data["parkName"], send_data["editName"]) result = re Assertions().assert_in_text(result, expect["checkEditTraderMessage"])