def test_cancel_tactics_order(self): """批量作废订单促销""" ord = PromotionManage(self.driver) ord.open_promotion_manage() ord.click_order_promotion() if len(ord.checkbox) > 1: ord.select_all() ord.cancel_all() self.assertNotIn("促销中", ord.gro_status) logger.info("批量作废订单促销成功") else: print("订单促销列表为空") logger.warning("订单促销列表为空")
def test_cancel_tactics_gro(self): """批量作废组合促销""" gro = PromotionManage(self.driver) gro.open_promotion_manage() gro.click_combine_promotion() if len(gro.checkbox) > 1: gro.select_all() gro.cancel_all() self.assertNotIn("促销中", gro.gro_status) logger.info("批量作废组合促销成功") else: print("组合促销列表为空") logger.warning("组合促销列表为空")
def test_cancel_tactics_pro(self): """批量作废商品促销""" pro = PromotionManage(self.driver) pro.open_promotion_manage() pro.click_pro_promotion() if len(pro.checkbox) > 1: pro.select_all() pro.cancel_all() self.assertNotIn("促销中", pro.pro_status) logger.info("批量作废商品促销成功") else: print("商品促销列表为空") logger.warning("商品促销列表为空")
def test_satisfy_discount_ord(self): """新增订单促销满折""" ord = PromotionManage(self.driver) ord.open_promotion_manage() ord.click_order_promotion() before_add = ord.total_strip() if len(ord.checkbox) != 1 else 0 ord.add() ord.discount() ord.condition_num() ord.discount_num() ord.customer_level() ord.save() after_add = ord.total_strip() self.assertEqual(after_add, before_add + 1) logger.info("成功新增订单促销——满折")
def test_sale_with_present(self): """新增商品促销买赠""" product_pro = PromotionManage(self.driver) product_pro.open_promotion_manage() product_pro.click_pro_promotion() before_add = len(product_pro.checkbox) product_pro.add() product_pro.open_product_list() product_pro.select_product_01() product_pro.confirm() product_pro.condition_num() product_pro.discount_num() product_pro.select_gift() product_pro.customer_level() product_pro.save() after_add = len(product_pro.checkbox) self.assertEqual(after_add, before_add + 1) logger.info("成功新增商品促销——买赠")
def test_straight_down(self): """新增商品促销直降""" product_pro = PromotionManage(self.driver) product_pro.open_promotion_manage() product_pro.click_pro_promotion() before_add = len(product_pro.checkbox) product_pro.add() product_pro.open_product_list() product_pro.select_product_01() product_pro.confirm() product_pro.straight_down() product_pro.discount_price() product_pro.customer_level() product_pro.save() after_add = len(product_pro.checkbox) self.assertEqual(after_add, before_add + 1) logger.info("成功新增商品促销——直降")
def test_product_discount_c(self): """新增组合促销打折""" gro = PromotionManage(self.driver) gro.open_promotion_manage() gro.click_combine_promotion() before_add = gro.total_strip() if len(gro.checkbox) != 1 else 0 gro.add() gro.promotion_title() gro.open_product_list() gro.select_product_0607() gro.confirm() gro.gro_discount() gro.condition_num() gro.discount_num() gro.customer_level() gro.save() after_add = gro.total_strip() self.assertEqual(after_add, before_add + 1) logger.info("成功新增组合促销——打折")
def test_del_tactics_order(self): """批量删除订单促销""" ord = PromotionManage(self.driver) ord.open_promotion_manage() ord.click_order_promotion() if len(ord.checkbox) > 1: ord.select_all() ord.del_all() self.assertTrue(ord.in_pages("暂无数据")) logger.info("批量删除订单促销成功") else: print("订单促销列表为空") logger.warning("订单促销列表为空")
def test_del_tactics_gro(self): """批量删除组合促销""" gro = PromotionManage(self.driver) gro.open_promotion_manage() gro.click_combine_promotion() if len(gro.checkbox) > 1: gro.select_all() gro.del_all() self.assertTrue(gro.in_pages("暂无数据")) logger.info("批量删除组合促销成功") else: print("组合促销列表为空") logger.warning("组合促销列表为空")
def test_del_tactics_pro(self): """批量删除商品促销""" pro = PromotionManage(self.driver) pro.open_promotion_manage() pro.click_pro_promotion() if len(pro.checkbox) > 1: pro.select_all() pro.del_all() self.assertTrue(pro.in_pages("暂无数据")) logger.info("批量删除商品促销成功") else: print("商品促销列表为空") logger.warning("商品促销列表为空")