def enter_single_chat_page(name): """进入单聊聊天会话页面""" mp = MessagePage() mp.wait_for_page_load() # 点击 + mp.click_add_icon() # 点击“新建消息” mp.click_new_message() # 提示对话框-start cbp = CalllogBannerPage() if cbp.is_exist_feixin_call_tip(): cbp.click_feixin_call_tip() time.sleep(3) cts = CallTypeSelectPage() if cts.is_text_present("知道了"): cts.click_i_know() # 提示对话框-end slc = SelectLocalContactsPage() slc.wait_for_page_load() # 进入单聊会话页面 slc.selecting_local_contacts_by_name(name) bcp = BaseChatPage() if bcp.is_exist_dialog(): # 点击我已阅读 bcp.click_i_have_read() scp = SingleChatPage() # 等待单聊会话页面加载 scp.wait_for_page_load()
def test_msg_xiaoliping_C_0044(self): """单聊会话页面,转发自己发送的图片给手机联系人""" # 确保当前聊天页面已有图片 Preconditions.make_already_have_my_picture() scp = SingleChatPage() # 等待单聊会话页面加载 scp.wait_for_page_load() # 1.长按自己发送的图片并转发 scp.forward_pic() scg = SelectContactsPage() # 2.等待选择联系人页面加载 scg.wait_for_page_load() # 点击“选择本地联系人”菜单 scg.select_local_contacts() slc = SelectLocalContactsPage() # 等待选择联系人->本地联系人 页面加载 slc.wait_for_page_load() name = "大佬2" # 3.选择一个手机联系人 slc.selecting_local_contacts_by_name(name) # 确定转发 slc.click_sure_forward() # 4.是否提示已转发,等待单聊页面加载 self.assertEquals(scp.is_exist_forward(), True) scp.wait_for_page_load() # 返回到消息页 scp.click_back() time.sleep(2) mp = MessagePage() if not mp.is_on_this_page(): cdp = ContactDetailsPage() cdp.click_back_icon() cp = ContactsPage() cp.wait_for_page_load() cp.open_message_page() # 等待消息页面加载 mp.wait_for_page_load() # 选择刚发送消息的聊天页 mp.choose_chat_by_name(name) time.sleep(2) bcp = BaseChatPage() if bcp.is_exist_dialog(): # 点击我已阅读 bcp.click_i_have_read() # 5.验证是否发送成功 cwp = ChatWindowPage() cwp.wait_for_msg_send_status_become_to('发送成功', 30) # 返回消息页 scp.click_back()
def test_msg_xiaoliping_C_0047(self): """单聊会话页面,转发自己发送的图片给团队联系人""" scp = SingleChatPage() # 等待单聊会话页面加载 scp.wait_for_page_load() # 确保当前聊天页面已有图片 Preconditions.make_already_have_my_picture() # 1.长按自己发送的图片并转发 scp.forward_pic() scg = SelectContactsPage() # 2.等待选择联系人页面加载 scg.wait_for_page_load() # 点击“选择和通讯录联系人”菜单 scg.click_he_contacts() shc = SelectHeContactsDetailPage() # 等待选择联系人->和通讯录联系人 页面加载 shc.wait_for_he_contacts_page_load() # 3.选择一个团队联系人 # 需要考虑测试号码存在多个团队的情况 Preconditions.if_exists_multiple_enterprises_enter_single_chat() name = "大佬3" shc.selecting_he_contacts_by_name(name) # 确定转发 scg.click_sure_forward() # 4.是否提示已转发,等待单聊页面加载 self.assertEquals(scp.is_exist_forward(), True) scp.wait_for_page_load() # 返回到消息页 scp.click_back() mp = MessagePage() # 等待消息页面加载 mp.wait_for_page_load() # 选择刚发送消息的聊天页 mp.choose_chat_by_name(name) time.sleep(2) chat = BaseChatPage() if chat.is_exist_dialog(): # 点击我已阅读 chat.click_i_have_read() # 5.验证是否发送成功 cwp = ChatWindowPage() cwp.wait_for_msg_send_status_become_to('发送成功', 30) # 返回消息页 scp.click_back()
def enter_single_chat_page(name): """进入单聊聊天会话页面""" mp = MessagePage() mp.wait_for_page_load() # 点击 + mp.click_add_icon() # 点击“新建消息” mp.click_new_message() slc = SelectLocalContactsPage() slc.wait_for_page_load() # 进入单聊会话页面 slc.selecting_local_contacts_by_name(name) bcp = BaseChatPage() if bcp.is_exist_dialog(): # 点击我已阅读 bcp.click_i_have_read() scp = SingleChatPage() # 等待单聊会话页面加载 scp.wait_for_page_load()
def test_msg_xiaoliping_C_0050(self): """单聊会话页面,转发自己发送的图片给陌生人""" # 确保当前聊天页面已有图片 Preconditions.make_already_have_my_picture() scp = SingleChatPage() # 等待单聊会话页面加载 scp.wait_for_page_load() # 1.长按自己发送的图片并转发 scp.forward_pic() scg = SelectContactsPage() # 2.等待选择联系人页面加载 scg.wait_for_page_load() number = "13855558888" # 输入陌生手机号码 scg.input_search_keyword(number) time.sleep(2) current_mobile().hide_keyboard_if_display() # 3.选择陌生号码转发 scg.click_unknown_member() # 确定转发 scg.click_sure_forward() # 4.是否提示已转发,等待单聊页面加载 self.assertEquals(scp.is_exist_forward(), True) scp.wait_for_page_load() # 返回到消息页 scp.click_back() mp = MessagePage() # 等待消息页面加载 mp.wait_for_page_load() # 选择刚发送消息的陌生联系人 mp.choose_chat_by_name(number) time.sleep(2) bcp = BaseChatPage() if bcp.is_exist_dialog(): # 点击我已阅读 bcp.click_i_have_read() # 5.验证是否发送成功 cwp = ChatWindowPage() cwp.wait_for_msg_send_status_become_to('发送成功', 30) # 返回消息页 scp.click_back()
def test_QYTXL_0016(self): """点击搜索结果未保存到本地的RCS用户进入Profile页""" # 进入企业通讯录首页 Preconditions.enter_enterprise_contacts_page() ecp = EnterpriseContactsPage() # 点击搜索框 ecp.click_search_box() search_name = "陈丹丹" ecp.input_search_message(search_name) time.sleep(2) ecp.click_contacts_by_name(search_name) cdp = ContactDetailsPage() cdp.wait_for_page_load() # 1.是否显示用户的详情信息(副号拨打没做验证,需要提供满足条件的测试号码) self.assertEquals(cdp.is_exists_contacts_name(), True) self.assertEquals(cdp.is_exists_contacts_number(), True) self.assertEquals(cdp.is_exists_contacts_image(), True) self.assertEquals(cdp.is_exists_value_by_name("公司"), True) self.assertEquals(cdp.is_exists_value_by_name("职位"), True) self.assertEquals(cdp.is_exists_value_by_name("邮箱"), True) self.assertEquals(cdp.is_exists_message_icon(), True) self.assertEquals(cdp.is_exists_call_icon(), True) self.assertEquals(cdp.is_exists_voice_call_icon(), True) self.assertEquals(cdp.is_exists_video_call_icon(), True) self.assertEquals(cdp.is_exists_dial_hefeixin_icon(), True) self.assertEquals(cdp.is_exists_save_contacts_icon(), True) # 2.点击各个按钮验证(副号拨打没做验证,需要提供满足条件的测试号码) # 点击联系人头像 cdp.click_contacts_image() time.sleep(5) # 验证是否显示大图 self.assertEquals(cdp.is_exists_big_avatar(), True) # 返回 cdp.click_big_avatar() time.sleep(2) # 点击消息图标 cdp.click_message_icon() bcp = BaseChatPage() if bcp.is_exist_dialog(): bcp.click_i_have_read() scp = SingleChatPage() # 等待单聊会话页面加载 scp.wait_for_page_load() scp.click_back() time.sleep(2) # 点击电话图标 cdp.click_call_icon() time.sleep(5) # 验证是否在通话界面 self.assertEquals(cdp.is_phone_in_calling_state(), True) cp = CallPage() # 挂断电话 cp.hang_up_the_call() time.sleep(2) # 点击语音通话图标 cdp.click_voice_call_icon() time.sleep(4) if cdp.is_text_present("继续拨打"): cdp.click_text("继续拨打") time.sleep(4) if cdp.is_text_present("始终允许"): cdp.click_text("始终允许") time.sleep(4) if cdp.is_text_present("暂不开启"): cdp.click_text("暂不开启") time.sleep(2) # 验证是否弹出语音会话弹窗 self.assertEquals(cdp.is_text_present("正在呼叫"), True) # 挂断语音通话 cp.hang_up_voice_call() time.sleep(2) # 点击视频通话图标 cdp.click_video_call_icon() time.sleep(4) if cdp.is_text_present("继续拨打"): cdp.click_text("继续拨打") time.sleep(4) if cdp.is_text_present("暂不开启"): cdp.click_text("暂不开启") time.sleep(2) # 验证是否弹出视频会话弹窗 self.assertEquals(cdp.is_text_present("视频通话呼叫中"), True) # 挂断视频通话 cp.hang_up_video_call() # 点击和飞信电话 cdp.click_hefeixin_call_menu() time.sleep(2) if cdp.is_text_present("我知道了"): cdp.click_text("我知道了") time.sleep(4) if cdp.is_text_present("始终允许"): cdp.click_text("始终允许") time.sleep(4) if cdp.is_text_present("和飞信电话"): cp.hang_up_the_call() time.sleep(4) if cdp.is_text_present("暂不开启"): cdp.click_text("暂不开启") time.sleep(2) # 验证是否拨打和飞信电话 self.assertEquals(cdp.is_text_present("请先接听来电,随后将自动呼叫对方"), True) # 挂断和飞信电话 cp.hang_up_hefeixin_call() time.sleep(2) # 3.点击保存到通讯录按钮,进入编辑联系人页面,验证每个字段都可以编辑并保存成功 cdp.click_save_contacts_icon() ccp = CreateContactPage() ccp.wait_for_page_load() ccp.create_contact("陈丹丹", "13800137004", "test_work", "员工", "*****@*****.**") time.sleep(2) # 是否保存成功 self.assertEquals(cdp.is_exists_share_card_icon(), True) self.assertEquals(cdp.is_exists_save_contacts_icon(), False)