def test_member_0016(self): """ 1、联网正常 2、已登陆客户端 3、在通讯录-不限时长详情页面 点击不限时长成员头像 弹出拨打电话提示 """ contact_page = ContactsPage() # 确保在通讯录界面 self.assertEqual(contact_page.is_element_already_exist_c('通讯录_标题'), True) time.sleep(2) self.assertEqual( contact_page.get_elements_count_c('不限时长_联系人组') > 0, True) contact_page.get_elements_list_c('不限时长_联系人组')[0].click() time.sleep(1) if contact_page.is_element_already_exist_c('回呼_提示文本'): contact_page.click_locator_key_c('回呼_我知道了') n = 20 flag = False while n > 0: if (contact_page.is_text_present_c('飞信电话', default_timeout=0.1) and contact_page.is_text_present_c('12560', default_timeout=0.1)) \ or contact_page.is_text_present_c('对方已振铃', default_timeout=0.1): flag = True break n -= 1 try: self.assertEqual(flag, True) finally: try: contact_page.hang_up_the_call() except Exception: pass
def test_member_0011(self): """ 1、联网正常 2、已登陆客户端 3、在家庭网详情-编辑资料页面 1、点击通话入口; 2、在家庭网列表点成员电话icon" 呼叫页面显示成员短号 """ contact_page = ContactsPage() # 确保在通讯录界面 self.assertEqual(contact_page.is_element_already_exist_c('通讯录_标题'), True) # 展开家庭网 # if not contact_page.if_home_net_expand(): contact_page.click_locator_key_c('家庭网_展开_收起') time.sleep(1) # 点击家庭网第一个联系人 contact_page.get_elements_list_c('联系人号码')[0].click() time.sleep(3) # 拨打电话 contact_page.click_locator_key_c('联系人_电话') contact_page.is_element_already_exist_c('电话页面_状态', default_timeout=10) try: self.assertEqual( len(contact_page.get_element_text_c('电话页面_备注')) < 11, True) finally: try: contact_page.hang_up_the_call() except Exception: pass
def test_member_0012(self): """ 1、联网正常 2、已登陆客户端 3、在家庭网详情-编辑资料页面 1、点击通话入口; 2、在家庭网列表点成员电话icon" 呼叫页面显示成员短号 """ contact_page = ContactsPage() # 确保在通讯录界面 self.assertEqual(contact_page.is_element_already_exist_c('通讯录_标题'), True) # 展开家庭网 # if not contact_page.if_home_net_expand(): contact_page.click_locator_key_c('家庭网_展开_收起') time.sleep(1) # 点击家庭网第一个联系人 contact_page.get_elements_list_c('联系人号码')[0].click() time.sleep(3) # 修改备注 contact_page.click_locator_key_c('联系人_备注修改') time.sleep(0.5) self.assertEqual(contact_page.is_text_present_c('修改备注名'), True) # 清空输入框内容 contact_page.edit_clear_c('编辑备注_输入框') name = '修改的备注' time.sleep(0.5) contact_page.input_text_c('编辑备注_输入框', name) contact_page.click_locator_key_c('编辑备注_保存') time.sleep(0.5) self.assertEqual( contact_page.is_element_already_exist_c('联系人_备注内容', default_timeout=30), True) # 拨打电话 time.sleep(0.5) contact_page.click_locator_key_c('联系人_电话') contact_page.is_element_already_exist_c('视频页面_状态', default_timeout=10) if contact_page.is_element_already_exist_c('流量_提示内容'): contact_page.click_locator_key_c('流量_继续拨打') if contact_page.is_element_already_exist_c('无密友圈_提示文本'): contact_page.click_locator_key_c('无密友圈_取消') try: self.assertEqual( len(contact_page.get_element_text_c('电话页面_备注')) < 11, True) finally: try: contact_page.hang_up_the_call() except Exception: pass
def test_member_00117_01(self): """ "1、联网正常 2、已登陆客户端(已打开通讯录权限) 3、当前在通讯录模块页面,已开通家庭网 " "1、查看联系人列表展示 2、点击联系人后的电话icon 3、点击通讯录页中各列表内的成员; 1、联系人获逻辑取复用福利电话页面,显示在家庭网下方,列表展开显示; 联系人后方带有电话icon; 2、 点击电话icon,发起电话流程(回拨或者CS电话),打电话逻辑不变; 3、跳转至对应的联系人详情页(密友详情页、家庭网成员详情页、陌生人详情页)" """ contact_page = ContactsPage() contact_page.is_element_already_exist_c('通讯录_标题') # 初始化被叫手机 Preconditions.initialize_class('Android-移动-N') # 获取手机号码 cards = contact_page.get_cards_c(CardType.CHINA_MOBILE)[0] # 切换主叫手机 Preconditions.select_mobile('Android-移动') # 确保在通讯录界面 self.assertEqual(contact_page.is_element_already_exist_c('通讯录_标题'), True) time.sleep(1) # 展开家庭网 # if contact_page.if_home_net_expand(): # contact_page.click_locator_key_c('家庭网_展开_收起') # time.sleep(1) # 点击联系人 n = 0 flag = False while n < 8: for contact in contact_page.get_elements_list_c('联系人号码'): if cards == contact.text: contact_page.click_to_call(cards) flag = True break if flag: break contact_page.page_up() n += 1 time.sleep(1) contact_page.hang_up_the_call() time.sleep(2)
def test_member_0107_01(self): """ 1、查看密友圈(不限时长) 2、点击成员电话icon 3、点击“管理” 1、列表为横向可滑动显示查看:成员半透明底头像+电话icon,底部为不限时长联系人名称(名称显示优先级:备注名(存在服务端)>个人中心昵称>本地通讯录>家庭网名>短号); 2、点击icon发起电话流程(回拨或者CS电话),打电话逻辑不变; 3、进入不限时长成员管理页面,成员管理页面、添加成员页面以及功能逻辑与现网标准版一致;" """ contact_page = ContactsPage() # 确保在通讯录界面 self.assertEqual(contact_page.is_element_already_exist_c('通讯录_标题'), True) time.sleep(2) self.assertEqual( contact_page.get_elements_count_c('不限时长_联系人组') > 0, True) contact_page.get_elements_list_c('不限时长_联系人组')[0].click() time.sleep(1) if contact_page.is_element_already_exist_c('回呼_提示文本'): contact_page.click_locator_key_c('回呼_我知道了') n = 20 flag = False while n > 0: if (contact_page.is_text_present_c('飞信电话', default_timeout=0.1) and contact_page.is_text_present_c('12560', default_timeout=0.1)) \ or contact_page.is_text_present_c('对方已振铃', default_timeout=0.1): flag = True break n -= 1 try: self.assertEqual(flag, True) finally: try: contact_page.hang_up_the_call() except Exception: pass