def test_Lottery_Machine_Choose_chase50_case(self): '''机选一注追加50期测试''' hp = HomePage(self.driver) hp.open() hp.Moveable_float_close() # 关闭悬浮窗口 hp.Lottery_link() # 点击大乐透链接 ulcn = UnionLottoChooseNumber(self.driver) ulcn.machine_choose_button() # 点击机选按钮 ulcn.machine_choose_one_button() # 点击机选一注 ulcn.Confirm_button() # 点击确认选号按钮 cl = ConfirmLottery(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl.chase_ticket_button() # 点击追xx期 blcl.additional_radio_button() # 点击追加单选按钮 cl.chase_ticket_button_fifty() # 点击追加50期单选按钮 cl.throw_times_input(2) # 输入投注倍数 cl.submit_order_to_station_owner_button() # 点击提交订单给站主 l = Login(self.driver) l.new_user_login_tab() # 切换到新用户登录 l.login() cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 cl.confirm_and_pay_button() # 点击“确认并支付”按钮 '''断言验证提交订单成功''' sos = SubmitOrderSuccess(self.driver) hp.Moveable_float_close() # 关闭悬浮窗口 text = sos.submit_order_success() self.assertEqual("订单提交成功", text, "提交订单失败") hp.Moveable_float_close() # 关闭悬浮窗口 # 返回首页 sos.return_home()
def test_Lottery_Dantuo_1_5_1_2_chase_throws_case(self): '''胆拖投注,在投注确认页面增加倍数和期数,提交订单''' ###点击进入大乐透选号页面### hp = HomePage(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() hp.Lottery_link() # 点击大乐透链接 blcn = BigLotteryChooseNum(self.driver) ulcn = UnionLottoChooseNumber(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl = ConfirmLottery(self.driver) ulcn.DanTuo_mode() # 选择胆拖模式 blcn.l_red_one_five() # 红球选取1个胆码5个拖码 blcn.l_bule_one_two() # 后区选择1个胆码2个拖码 ulcn.Confirm_button() # 点击确认选号 cl.chase_ticket_button() #点击追xx期 blcl.additional_radio_button() # 点击追加单选按钮 cl.chase_ticket_button_two() # 点击追加2期单选按钮 cl.throw_times_input(2) # 输入投注倍数 cl.submit_order_to_station_owner_button() #点击提交订单给站主 l = Login(self.driver) l.new_user_login_tab() # 切换到新用户登录 l.login() # 点击登录 cl.submit_order_to_station_owner_button() # 点击提交订单给站主 cl.confirm_and_pay_button() # 点击确认并支付 sos = SubmitOrderSuccess(self.driver) hp.Moveable_float_close() text = sos.submit_order_success() self.assertEqual("订单提交成功", text, "提交订单失败")
def test_many_lottery_ckick_x_once_case(self): '''在投注确认页面,多注号码,点击左边X按钮,投注号码减少一注''' ###点击进入大乐透进入大乐透选号页面### hp = HomePage(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() l = Login(self.driver) hp.My_lottery_ticket() # 点击我的彩票 l.login() # 点击登录 sos = SubmitOrderSuccess(self.driver) hp.homepage_link() # 点击首页 hp.Moveable_float_close() hp.Lottery_link() # 点击大乐透链接 blcn = BigLotteryChooseNum(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl = ConfirmLottery(self.driver) od = OrderDetails(self.driver) ulcn = UnionLottoChooseNumber(self.driver) ulcn.machine_choose_button()#点击机选按钮 ulcn.machine_choose_five_button()#点击机选5注 sleep(5) num = cl.event_count() # 获取总共有多少注 cl.Del_x() #点击单个删除x num1 = cl.lottery_number_text() # 获取注数 self.assertIn("4", num1) cl.submit_order_to_station_owner_button() # 点击提交订单给站主 cl.confirm_and_pay_button() # 点击确认并支付 hp.Moveable_float_close() # 如果出现浮层弹框,关闭 text = sos.submit_order_success() # 获取页面“订单提交成功”文本 self.assertEqual("订单提交成功", text) hp.Moveable_float_close() # 如果出现浮层弹框,关闭 trade_name = sos.trade_name_text() # 获取页面商品名称文本 self.assertIn("商品名称:乐米彩票-大乐透", trade_name)
def test_SuccessPage_continue_buy_case(self): '''订单详情页,点击【点击投注大乐透】,页面跳转至选号页面,选择一注,提交订单''' ###点击进入大乐透进入大乐透选号页面### hp = HomePage(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() l = Login(self.driver) hp.My_lottery_ticket() # 点击我的彩票 l.login() # 点击登录 sos = SubmitOrderSuccess(self.driver) hp.homepage_link() # 点击首页 hp.Moveable_float_close() hp.Lottery_link() # 点击大乐透链接 blcn = BigLotteryChooseNum(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl = ConfirmLottery(self.driver) od = OrderDetails(self.driver) ulcn = UnionLottoChooseNumber(self.driver) blcn.l_red_label5() # 选择5个红球 blcn.l_bule_label2() # 选择2个蓝球 ulcn.Confirm_button() # 点击确认选号按钮 mu1 = cl.Select_number() # 读取投注确认页所选号码 cl.submit_order_to_station_owner_button() # 提交订单给站主按钮 cl.confirm_and_pay_button() # 点击确认支付 hp.Moveable_float_close() sos.Continue_buy()#点击继续购买此彩种 blcn.l_red_label5() # 选择5个红球 blcn.l_bule_label2() # 选择2个蓝球 ulcn.Confirm_button() # 点击确认选号按钮
def test_LotteryOderDetails_continue_buy_case(self): '''提交订单成功页,点击【继续购买该方案】,页面跳转至投注确认页''' ###点击进入大乐透进入大乐透选号页面### hp = HomePage(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() l = Login(self.driver) hp.My_lottery_ticket() # 点击我的彩票 l.login() # 点击登录 sos = SubmitOrderSuccess(self.driver) hp.homepage_link() # 点击首页 hp.Moveable_float_close() hp.Lottery_link() # 点击大乐透链接 blcn = BigLotteryChooseNum(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl = ConfirmLottery(self.driver) od = OrderDetails(self.driver) ulcn = UnionLottoChooseNumber(self.driver) blcn.l_red_label5()#选择5个红球 blcn.l_bule_label2()#选择2个蓝球 ulcn.Confirm_button() # 点击确认选号按钮 mu1=cl.Select_number()#读取投注确认页所选号码 cl.submit_order_to_station_owner_button()#提交订单给站主按钮 cl.confirm_and_pay_button()#点击确认支付 hp.Moveable_float_close() sos.check_order_details()#点击查看订单详情 mu2=od.Betting_nu()#读取订单详情页号码 self.assertEqual(mu1,mu2,'订单详情页显示有误') od.Scheme()#点击继续购买此方案 mur = cl.confirm_num_page_text() self.assertEqual('提交订单给站主', mur)
def test_Lottery_multiphase_machine_single_radio_case(self): """选号页面,右上方隐藏的多期机选,点击追加单选按钮,提交订单""" ###点击进入大乐透进入大乐透选号页面### hp = HomePage(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() l = Login(self.driver) hp.My_lottery_ticket() # 点击我的彩票 l.login() # 点击登录 hp.homepage_link() # 点击首页 hp.Moveable_float_close() hp.Lottery_link()#点击大乐透链接 blcn = BigLotteryChooseNum(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl = ConfirmLottery(self.driver) od = OrderDetails(self.driver) ulcn=UnionLottoChooseNumber(self.driver) ulcn.There_clock()#点击。。。 ulcn.Many_pause()#点击多期机选 ulcn.many_chase_radio()#点击多期机选的单选按钮 text1=ulcn.many_machine_choose_text() ulcn.Many_pause_confirm()#点击多期机选页的【提交订单】 cl.confirm_and_pay_button() # 点击“确认并支付”按钮 '''断言验证提交订单成功''' sos = SubmitOrderSuccess(self.driver) hp.Moveable_float_close() text = sos.submit_order_success() self.assertEqual("订单提交成功", text, "提交订单失败")
def test_Lottery_multiphase_machine_choose5_case(self): """选号页面,右上方隐藏的多期机选,5期提交订单""" ###点击进入大乐透进入大乐透选号页面### hp = HomePage(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() hp.Lottery_link()#点击大乐透链接 blcn = BigLotteryChooseNum(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl = ConfirmLottery(self.driver) od = OrderDetails(self.driver) ulcn=UnionLottoChooseNumber(self.driver) ulcn.There_clock()#点击。。。 ulcn.Many_pause()#点击多期机选 ulcn.many_machine_choose(5)#点击5期 text1=ulcn.many_machine_choose_text() self.assertIn("1注 5期 1倍",text1,'多期机选有误') ulcn.Many_pause_confirm()#点击多期机选页的【提交订单】 #####用户登录###### l = Login(self.driver) l.login() ulcn.There_clock() # 点击。。。 ulcn.Many_pause() # 点击多期机选 ulcn.many_machine_choose(5) # 点击5期 ulcn.Many_pause_confirm() # 点击多期机选页的【提交订单】 cl.confirm_and_pay_button() # 点击“确认并支付”按钮 '''断言验证提交订单成功''' sos = SubmitOrderSuccess(self.driver) hp.Moveable_float_close() text = sos.submit_order_success() self.assertEqual("订单提交成功", text, "提交订单失败")
def test_Lottery_Hand_history_double_bet_double_times_case(self): """选号页面,右上方隐藏的历史走势历史走势,多注多倍,提交订单""" ###点击进入大乐透进入大乐透选号页面### hp = HomePage(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() hp.Lottery_link()#点击大乐透链接 blcn = BigLotteryChooseNum(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl = ConfirmLottery(self.driver) od = OrderDetails(self.driver) ulcn=UnionLottoChooseNumber(self.driver) ulcn.There_clock()#点击。。。 ulcn.History_movements()#点击历史走势 ulcn.Red_movements()#点击红球走势 ulcn.History_red(7)#点击7个红球 ulcn.Bule_movements()#点击蓝球走势 blcn.bule_history_choose(3)#点击3个蓝球 ulcn.Recommended_number()#点击【使用已选号码】 ulcn.Confirm_button() # 点击确认选号按钮 blcl.additional_radio_button() # 点击追加单选按钮 cl.chase_ticket_input(2) # 输入追2期 cl.throw_times_input(3) # 输入投注倍数 num1 = cl.lottery_number_text() # 获取注数 chase = cl.chase_time_text() # 获取追号期数 times = cl.throw_time_text() # 获取倍数 self.assertEqual("6323", num1 + chase + times) mul1 = cl.Select_number()#获取投注确认页投注的号码 cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 #####用户登录###### l = Login(self.driver) l.new_user_login_tab() # 切换到新用户登录 l.login() cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 cl.confirm_and_pay_button() # 点击“确认并支付”按钮 '''断言验证提交订单成功''' sos = SubmitOrderSuccess(self.driver) hp.Moveable_float_close() text = sos.submit_order_success() self.assertEqual("订单提交成功", text, "提交订单失败") sos.check_order_details() ##点击查看订单详情 lottery2 = od.Betting_after() ##读取显示的投注号码 self.assertEqual(mul1, lottery2)
def test_Lottery_Hand_choose_single_chase_throws_case(self): """手动选号,单式,多注多倍,提交订单""" ###点击进入大乐透进入大乐透选号页面### hp = HomePage(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() hp.Lottery_link()#点击大乐透链接 blcn = BigLotteryChooseNum(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl = ConfirmLottery(self.driver) blcn.l_red_label5()#任意选择5个红球 blcn.l_bule_label2()#任意选择2个蓝球 ulcn = UnionLottoChooseNumber(self.driver) ulcn.Confirm_button()#点击确认选号按钮 cl.chase_ticket_button() # 点击追xx期 blcl.additional_radio_button() # 点击追加单选按钮 cl.chase_ticket_button_two() # 点击追加2期单选按钮 cl.throw_times_input(3) # 输入投注倍数 num1=cl.lottery_number_text()#获取注数 chase = cl.chase_time_text()#获取追号期数 times = cl.throw_time_text()#获取倍数 self.assertEqual("123",num1+chase+times) cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 #####用户登录###### l = Login(self.driver) l.new_user_login_tab() # 切换到新用户登录 l.login() cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 cl.confirm_and_pay_button() # 点击“确认并支付”按钮 '''断言验证提交订单成功''' sos = SubmitOrderSuccess(self.driver) hp.Moveable_float_close() text = sos.submit_order_success() self.assertEqual("订单提交成功", text, "提交订单失败") '''######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作
def test_Lottery_Hand_history_Recommended_number_case(self): """选号页历史开奖,使用推荐号码,提交订单""" ###点击进入大乐透进入大乐透选号页面### hp = HomePage(self.driver) hp.open() ######判断是否出现浮层弹框,如果出现浮层点击X,然后执行下一步操作 hp.Moveable_float_close() hp.Lottery_link()#点击大乐透链接 blcn = BigLotteryChooseNum(self.driver) blcl = BigLotteryConfirmLottery(self.driver) cl = ConfirmLottery(self.driver) ulcn=UnionLottoChooseNumber(self.driver) od = OrderDetails(self.driver) ulcn.History()#点击历史开奖 ulcn.click_history()#点击展开了的历史开奖 lottery1 = ulcn.Recommended_nu() # 读取推荐号码 ulcn.Recommended_number()#点击使用推荐号码 ulcn.Confirm_button() # 点击确认选号按钮 num1 = cl.lottery_number_text() # 获取注数 chase = cl.chase_time_text() # 获取追号期数 times = cl.throw_time_text() # 获取倍数 self.assertEqual("111", num1 + chase + times) cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 #####用户登录###### l = Login(self.driver) l.new_user_login_tab() # 切换到新用户登录 l.login() cl.submit_order_to_station_owner_button() # 点击“提交订单给站主”按钮 cl.confirm_and_pay_button() # 点击“确认并支付”按钮 '''断言验证提交订单成功''' sos = SubmitOrderSuccess(self.driver) hp.Moveable_float_close() text = sos.submit_order_success() self.assertEqual("订单提交成功", text, "提交订单失败") sos.check_order_details() ##点击查看订单详情 lottery2 = od.Betting_number() ##读取显示的投注号码 self.assertEqual(lottery1, lottery2)