def test_msg_huangcaizui_A_0022(self): mess = MessagePage() # 点击+号 mess.click_add_icon() # 点击免费短信 mess.click_free_sms() mess_call_page = CallPage() freemsg = FreeMsgPage() chatdialog = ChatNoticeDialog() # 若存在欢迎页面 if freemsg.is_exist_welcomepage(): # 点击确定按钮 freemsg.click_sure_btn() time.sleep(2) # 若存在权限控制 if mess_call_page.is_exist_allow_button(): # 存在提示点击允许 mess_call_page.wait_for_freemsg_load() mess.click_element((MobileBy.XPATH, '//*[@text ="测试短信1"]')) # 判断存在?标志 chatdialog.page_should_contain_element( (MobileBy.ID, 'com.chinasofti.rcs:id/sms_direction')) # 判断存在退出短信按钮 chatdialog.page_should_contain_element( (MobileBy.ID, 'com.chinasofti.rcs:id/tv_exitsms'))
def test_msg_huangcaizui_B_0012(self): """从+号首次点击“发送短信”是否有资费弹框出来""" # 1.正常联网 # 2.客户端在线 # Step: 1.进入消息模块页面 mp = MessagePage() # Step: 2.点击右上角“+” mp.click_add_icon() time.sleep(1) # CheckPoint: 2.弹出多功能列表 mp.page_should_contain_text("新建消息") mp.page_should_contain_text("免费短信") mp.page_should_contain_text("发起群聊") mp.page_should_contain_text("群发助手") mp.page_should_contain_text("扫一扫") # Step: 3.点击免费短信 mp.click_free_sms() # CheckPoint: 3.触发短信资费介绍页“欢迎使用免费短信!” time.sleep(1) mp.page_should_contain_text("欢迎使用免费短信") # Step: 4.点击“以后再说” fmp = FreeMsgPage() if fmp.is_text_present("以后再说"): fmp.click_cancle_btn() time.sleep(1) # CheckPoint: 4.自动退回消息列表 mp.is_on_this_page()
def make_already_have_used_free_sms2(): """确保非首次使用免费短信功能""" mp = MessagePage() mp.click_add_icon() mp.click_free_sms() time.sleep(1) if FreeMsgPage().is_exist_cancle_btn(): FreeMsgPage().click_sure_btn() time.sleep(1) SelectContactsPage().click_search_contact() current_mobile().hide_keyboard_if_display()
def make_already_have_used_free_sms(): """确保非首次使用免费短信功能""" preconditions.connect_mobile(REQUIRED_MOBILES['Android-移动']) current_mobile().hide_keyboard_if_display() Preconditions.make_already_in_message_page() mp = MessagePage() mp.click_add_icon() mp.click_free_sms() time.sleep(1) if FreeMsgPage().is_exist_cancle_btn(): FreeMsgPage().click_sure_btn() time.sleep(1) SelectContactsPage().click_search_contact() current_mobile().hide_keyboard_if_display() mp.click_back_by_android() return
def test_msg_huangcaizui_B_0011(self): """点击确实时候会进入联系人选择器""" # 1.正常联网 # 2.客户端在线 # 3.大陆本网用户 # Step: 1.进入消息模块页面 mp = MessagePage() # Step: 2.点击右上角“+” mp.click_add_icon() time.sleep(1) # CheckPoint: 2.弹出多功能列表 mp.page_should_contain_text("新建消息") mp.page_should_contain_text("免费短信") mp.page_should_contain_text("发起群聊") mp.page_should_contain_text("群发助手") mp.page_should_contain_text("扫一扫") # Step: 3.点击免费短信 mp.click_free_sms() # CheckPoint: 3.触发短信资费介绍页“欢迎使用免费短信!” time.sleep(1) mp.page_should_contain_text("欢迎使用免费短信") # Step: 4.点击“确定” FreeMsgPage().click_sure_btn() time.sleep(1) SelectContactsPage().click_search_contact() # CheckPoint: 4.进入联系人选择界面 mp.page_should_contain_text("选择联系人")
def test_msg_huangcaizui_B_0010(self): """点击以后再说时候会返回消息列表""" # 1.正常联网 # 2.客户端在线 # 3.大陆本网用户 # Step: 1.进入消息模块页面 mp = MessagePage() # Step: 2.点击右上角“+” mp.click_add_icon() time.sleep(1) # CheckPoint: 2.弹出多功能列表 mp.page_should_contain_text("新建消息") mp.page_should_contain_text("免费短信") mp.page_should_contain_text("发起群聊") mp.page_should_contain_text("群发助手") mp.page_should_contain_text("扫一扫") # Step: 3.点击免费短信 mp.click_free_sms() # CheckPoint: 3.触发短信资费介绍页“欢迎使用免费短信!” time.sleep(1) mp.page_should_contain_text("欢迎使用免费短信") # Step: 4.点击“以后再说” FreeMsgPage().click_cancle_btn() time.sleep(1) # CheckPoint: 4.自动退回消息列表 mp.is_on_this_page()
def test_msg_huangcaizui_A_0022(self): """免费/发送短信—选择手机联系人""" mess = MessagePage() # 点击+号 mess.click_add_icon() # 点击免费短信 mess.click_free_sms() mess_call_page = CallPage() freemsg = FreeMsgPage() # 若存在欢迎页面 if freemsg.is_exist_welcomepage(): # 点击确定按钮 freemsg.click_sure_btn() time.sleep(2) # 若存在权限控制 if mess_call_page.is_exist_allow_button(): # 存在提示点击允许 mess_call_page.wait_for_freemsg_load() mess.click_element((MobileBy.XPATH, '//*[@text ="测试短信1"]')) # 判断存在?标志 FreeMsgPage().wait_is_exist_wenhao() # 判断存在退出短信按钮 FreeMsgPage().wait_is_exist_exit()