def test_MRYX_ST_usr_012(self): """订单页面测试用例MRYX_ST_usr_012""" mp = MysPage(self.driver) mp.click_order_shipping() # 点击订单的配送中 sleep(1) mosp = MysOrderStatusPage(self.driver) mosp.to_right() # 向右滑动 sleep(5) self.assertTrue(mosp.if_to_be_paid_selected()) # 断言按钮select是true
def test_MRYX_ST_usr_004(self): """这是MRYX_ST_usr_004这一条测试用例""" mp = MysPage(self.driver) mp.click_customer_service() sleep(2) mcsp = MysCustomerServicePage(self.driver) mcsp.click_tv_question_3() # 点击第三个问题 text = mcsp.text_tv_answer_3() # 获取第三个问题的解答 self.assertIn(self.asserts,text) # 断言文本是否属于text文本中
def test_MRYX_ST_usr_005(self): """这是test_MRYX_ST_usr_005用例""" mp = MysPage(self.driver) mp.click_mys_news() # 点击铃铛图标 amp = ActivityMessagePage(self.driver) amp.click_activity_message() # 点击第一条消息框 sleep(2) text = amp.text_activity_page_title() # 获取活动界面的界面头文本 self.assertEqual(text, self.asserts)
def setUp(self) -> None: hp = HomePage(self.driver) hp.click_mine() sleep(2) hp.to_up(duration=3000) # 上滑出现设置 mp = MysPage(self.driver) # 实例化"我的"界面 mp.click_set() # 点击设置按钮 sleep(1) msp = MysSetPage(self.driver) # 实例化我的设置界面 msp.click_sign_out() # 点击退出登录
def test_MRYX_ST_usr_008(self): """MRYX_ST_usr_008收益不足一元提现""" sleep(2) mp = MysPage(self.driver) sleep(1) mp.click_income_withdrawal() # 点击收益按钮 sleep(2) miwp = MysIncomeWithdrawalPage(self.driver) miwp.click_to_withdrawal() # 点击去提现 sleep(2) self.assertTrue(miwp.if_have_one_yuan()) # 断言是否有不足一元的弹窗
def test_MRYX_ST_usr_001(self): """测试登录正确登录""" lorp = LoginOrRegisterPage(self.driver) lorp.send_phone_number(self.phone_number) # 输入手机号码 lorp.click_get_check_code() # 点击获取验证码 sleep(2) lorp.send_check_code(self.check_code_yes) # 输入验证码 lorp.click_protocol_radio() # 点击同意协议 lorp.click_login_button() # 点击登录 mp = MysPage(self.driver) text = mp.text_login_name() # 获取登录名的文本信息 self.assertEqual(self.asserts1, text)
def test_MRYX_ST_usr_002(self): """注销登录测试""" bp = BasePage(self.driver) sleep(5) bp.click((By.ID, "cn.missfresh.application:id/mineTab")) #点击我的 sleep(1) bp.to_up(duration=3000) # 上滑出现设置 mp = MysPage(self.driver) #实例化"我的"界面 mp.click_set() #点击设置按钮 sleep(1) msp = MysSetPage(self.driver) #实例化我的设置界面 msp.click_sign_out() # 点击退出登录
def test_MRYX_ST_usr_002(self): """注销登录测试""" hp = HomePage(self.driver) sleep(2) hp.to_up(duration=3000) # 上滑出现设置 mp = MysPage(self.driver) #实例化"我的"界面 mp.click_set() #点击设置按钮 sleep(1) msp = MysSetPage(self.driver) #实例化我的设置界面 msp.click_sign_out() # 点击退出登录 hp = HomePage(self.driver) sleep(3) text = hp.text_quest_login() # 获取立即登录的文本 self.assertEqual(text, self.asserts)
def test_MRYX_ST_usr_009(self): """MRYX_ST_usr_009优惠券跳转可购买商品界面""" mp = MysPage(self.driver) mp.click_good_ticket() # 点击优惠券 mgtp = MysGoodTicketPage(self.driver) mgtp.select_click_no_good_ticket(1) # 点击第一张优惠券进行购买商品 sleep(2) recpgp = RedEnvelopsCanPurchaseGoodsPage(self.driver) sleep(2) # text = recpgp.text_title() # 获取红包可购买商品界面头文本信息 text = self.driver.find_element(*(By.XPATH,"//android.widget.TextView[@resource-id=\"cn.missfresh.application:id/tv_title_bar_center_txt\"]")).text self.assertEqual(text,self.asserts) sleep(2)
def test_MRYX_ST_usr_002(self): """注销登录测试""" bp = BasePage(self.driver) sleep(5) bp.click((By.ID, "cn.missfresh.application:id/mineTab")) #点击我的 sleep(1) bp.to_up(duration=3000) # 上滑出现设置 mp = MysPage(self.driver) #实例化"我的"界面 mp.click_set() #点击设置按钮 sleep(1) msp = MysSetPage(self.driver) #实例化我的设置界面 msp.click_sign_out() # 点击退出登录 hp = HomePage(self.driver) sleep(3) text = hp.text_quest_login() # 获取立即登录的文本 self.assertEqual(text, self.asserts)
def test_MRYX_ST_usr_0011(self): """测试登录错误验证码登录""" lorp = LoginOrRegisterPage(self.driver) lorp.send_phone_number(self.phone_number) # 输入手机号码 lorp.click_get_check_code() # 点击获取验证码 sleep(2) lorp.send_check_code(self.check_code_yes) # 输入验证码 lorp.click_protocol_radio() # 点击同意协议 lorp.click_login_button() # 点击登录 mp = MysPage(self.driver)
def test_MRYX_ST_usr_003(self): sleep(2) mp = MysPage(self.driver) mp.to_up(2000) sleep(2) mp.click_shipping_address() # 点击收货地址 mss = MysShippingAddressPage(self.driver) mss.click_new_add_shipping_address() #点击新增地址 mssn = MysShippingAddressNewAddShippingAddressPage(self.driver) sleep(2) mssn.send_receiver(self.receiver) # 输入收货人名 sleep(2) mssn.click_sex(self.sex) # 点击性别 sleep(2) mssn.send_cellphone_number(self.phone) # 输入手机号码 sleep(2) mssn.click_shopping_address() # 点击收货地址输入框 ap = AddressPage(self.driver) sleep(2) ap.send_search_address_input(self.address) # 输入地址信息 ap.click_search_address_show_dfgc() # 点击显示为成都锦江区229号的结果 sleep(2) mssn.send_building_number(self.building_number) sleep(2) mssn.click_school_lable() # 点击学校标签 mssn.click_Save_the_shipping_address() #点击保存收货地址
def test_MRYX_ST_usr_010(self): """助力免费拿测试用例MRYX_ST_usr_010""" sleep(2) mp = MysPage(self.driver) mp.to_up() # 向上滑动 sleep(5) mp.click_help_get_free() # 点击助力免费拿 mhgfp = MysHelpGetFreePage(self.driver) mhgfp.to_up() # 向上滑动 sleep(5) mhgfp.click_help_get_free_good_no(5) # 点击第五个免费助力拿商品 sleep(3) self.assertTrue(mhgfp.if_have_ticket_text()) # 断言元素是否存在
def setUp(self) -> None: hp = HomePage(self.driver) hp.click_mine() mp = MysPage(self.driver) mp.click_loging_or_registered() # 点击登录或注册
def setUp(self) -> None: hp = HomePage(self.driver) hp.click_mine() # 点击我的 mp = MysPage(self.driver) mp.click_points_mall() # 点击积分商城