def test_UnionLotto_Machine_choose_five_button_case(self): '''提交订单页“机选5注”按钮测试''' hp = HomePage_lexiu(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() hp.UnionLotto_link() # 点击双色球链接 ####选择机选一注并确认选号#### ulcn = UnionLottoChooseNumber_lexiu(self.driver) ulcn.machine_choose_button() # 点击机选 ulcn.machine_choose_one_button() # 机选1注 ulcn.Confirm_button() # 确认选号 cl = ConfirmLottery_lexiu(self.driver) cl.machine_choose_five_button() # 点击机选5注 lottery_number_text = cl.lottery_number_text() #获取投注注数文本 self.assertIn("6", lottery_number_text) #检查投注注数为6倍 cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 #####用户登录###### l = Login_lexiu(self.driver) l.login_lexiu() cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 cl.confirm_and_pay_button() # 确认支付 '''断言验证提交订单成功''' sos = SubmitOrderSuccess_lexiu(self.driver) hp.Moveable_float_close() # 关闭弹窗 text = sos.submit_order_success() self.assertEqual("订单提交成功", text, "提交订单失败") trade_text = sos.trade_name_text() # 获取商品名称 self.assertIn("商品名称:乐秀赢球-双色球", trade_text) # 检查商品名称正确 sos.check_order_details() # 查看订单详情 od = OrderDetails_lexiu(self.driver) od.order_details_check() # 检查订单详情页
def test_Lottery_Machine_choose_five_button_case(self): '''提交订单页"机选5注"测试''' hp = HomePage_lexiu(self.driver) hp.open() hp.Moveable_float_close() # 关闭悬浮窗口 hp.Lottery_link() # 点击大乐透链接 ulcn = UnionLottoChooseNumber_lexiu(self.driver) ulcn.machine_choose_button() # 点击机选按钮 ulcn.machine_choose_one_button() # 点击机选一注 ulcn.Confirm_button() # 点击确认选号按钮 cl = ConfirmLottery_lexiu(self.driver) cl.machine_choose_five_button() # 点击机选五注 cl.submit_order_to_station_owner_button() # 提交订单给站主 l = Login_lexiu(self.driver) #l.new_user_login_tab() # 切换到新用户登录 l.login_lexiu() cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 cl.confirm_and_pay_button() # 点击“确认并支付”按钮 '''断言验证提交订单成功''' sos = SubmitOrderSuccess_lexiu(self.driver) hp.Moveable_float_close() # 关闭悬浮窗口 text = sos.submit_order_success() self.assertEqual("订单提交成功", text, "提交订单失败")
def test_Lottery_information_buy_pause_five_case(self): """进入开奖公告,打开双色球开奖详情,点击投注双色球,进入双色球投注页面,选1注号码,在投注确认页,机选5注,修改倍数,期数""" ha = HomePage_lexiu(self.driver) hl = Login_lexiu(self.driver) hb = UnionLottoChooseNumber_lexiu(self.driver) hc = ConfirmLottery_lexiu(self.driver) hd = PaymetMode_lexiu(self.driver) he = BaofooPayment_lexiu(self.driver) hf = ChooseBank_lexiu(self.driver) hf1 = SubmitOrderSuccess_lexiu(self.driver) hf2 = LessPaySucess_lexiu(self.driver) ha.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 ha.Moveable_float_close() ha.Lottery_information() ##点击开奖信息 hb.Lottery_information_unionlotto() ##点击开奖信息中的双色球 hc.Unionlotto_History_buy() ###点击双色球最近的开奖信息 hc.Buy_unionlotto() ##点击投注双色球 hb.u_red_label6() # 任意选择6个红球 hb.u_bule_label1() # 任意选择1个蓝球 hb.Confirm_button() # 点击确认选号按钮 hc.machine_choose_five_button() ##点击机选5注 hc.chase_ticket_input("4") # 输入追4期 hc.throw_times_input("3") #输入投注倍数为3倍 lottery_number_text = hc.lottery_number_text() # 获取投注注数文本 self.assertIn("6", lottery_number_text) # 检查投注注数为1注 chase_time_text = hc.chase_time_text() # 获取追号期数 self.assertIn("4", chase_time_text) # 检查追号期数为4期 throw_times = hc.throw_time_text() # 获取投注倍数定位 self.assertIn("3", throw_times) # 检查投注倍数为3倍 hc.submit_order_to_station_owner_button() # 点击提交给站主 hl.login_lexiu() # 输入账号,密码 hc.submit_order_to_station_owner_button() # 点击提交给站主 hc.confirm_and_pay_button() # 点击确认支付 text1 = hf1.submit_order_success() # 获取提交订单成功文本 self.assertEqual('订单提交成功', text1)