def setUp_test_ZYSX_0001():
     Preconditions.select_mobile('Android-移动')
     mp = MessagePage()
     mp.wait_for_page_load()
     if mp.is_on_this_page():
         mp.click_workbench()
         wbp = WorkbenchPage()
         wbp.wait_for_workbench_page_load()
         # 查找并点击所有展开元素
         wbp.find_and_click_open_element()
         if wbp.is_text_present("ateam7272"):
             wbp.click_setting_icon()
             wbp.click_text_or_description("默认团队")
             wbp.click_text_or_description("测试团队1")
             wbp.click_text_or_description("确定")
             time.sleep(2)
             wbp.click_setting_back()
         wbp.click_message_icon()
         Preconditions.enter_important_matters_page()
         return
     imp = ImportantMattersPage()
     if imp.is_on_important_matters_page():
         current_mobile().hide_keyboard_if_display()
     else:
         current_mobile().launch_app()
         Preconditions.make_already_in_message_page()
         Preconditions.enter_important_matters_page()
Beispiel #2
0
    def default_setUp(self):
        """
        1、成功登录和飞信
        2、当前页面在重要事项首页
        """

        Preconditions.select_mobile('Android-移动')
        mp = MessagePage()
        if mp.is_on_this_page():
            Preconditions.enter_important_matters_page()
            return
        imp = ImportantMattersPage()
        if imp.is_on_important_matters_page():
            current_mobile().hide_keyboard_if_display()
        else:
            current_mobile().launch_app()
            Preconditions.make_already_in_message_page()
            Preconditions.enter_important_matters_page()
Beispiel #3
0
    def test_ZYSX_0001(self):
        """验证点击返回按钮是否正确"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 点击返回
        imp.click_back()
        wbp = WorkbenchPage()
        # 等待工作台页面加载
        wbp.wait_for_workbench_page_load()
        wbp.click_important_items()
        # 等待重要事项首页加载
        imp.wait_for_page_load()
Beispiel #4
0
    def enter_important_matters_page():
        """进入重要事项首页"""

        mp = MessagePage()
        mp.wait_for_page_load()
        mp.click_workbench()
        wbp = WorkbenchPage()
        wbp.wait_for_workbench_page_load()
        # 查找并点击所有展开元素
        wbp.find_and_click_open_element()
        wbp.click_add_important_matters()
        imp = ImportantMattersPage()
        # 解决工作台不稳定问题
        n = 1
        while not imp.page_should_contain_text2("新建事项"):
            imp.click_back()
            wbp.wait_for_workbench_page_load()
            wbp.click_important_items()
            n += 1
            if n > 20:
                break
Beispiel #5
0
    def test_ZYSX_0016(self):
        """删除子任务"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 创建新事项
        Preconditions.create_new_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        # 确保有子任务可修改
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        imp.click_add_subtasks()
        imp.wait_for_add_subtasks_page_load()
        title = "子任务标题0016"
        imp.input_subtasks_title(title)
        imp.input_subtasks_describe("子任务描述0016")
        imp.click_subtasks_add_icon()
        sccp = SelectCompanyContactsPage()
        sccp.wait_for_page_load()
        sccp.click_contacts_by_name("大佬1")
        sccp.click_sure_button()
        imp.wait_for_add_subtasks_page_load()
        imp.click_save()
        imp.wait_for_check_item_page_load()
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        # 2.打开查看子任务界面
        imp.click_text(title)
        imp.wait_for_check_subtasks_page_load()
        # 3.弹窗删除子任务按钮
        imp.click_three_points_icon()
        time.sleep(2)
        # 4.弹窗删除确认弹窗
        imp.click_delete_subtasks()
        time.sleep(1)
        imp.click_sure()
        # 5.子任务删除,返回事项列表首页,再次打开该事项详情,相关的子任务已经从子任务列表消失(由于元素没有ID,间接验证)
        self.assertEquals(imp.is_toast_exist("删除成功"), True)
        imp.wait_for_page_load()
        imp.click_first_item()
        imp.wait_for_check_item_page_load()
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        self.assertEquals(imp.is_text_present("没子任务"), True)
        imp.click_back()
        # 等待重要事项首页加载
        imp.wait_for_page_load()
Beispiel #6
0
    def test_ZYSX_0015(self):
        """修改子任务-修改截止时间"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 解决工作台不稳定的问题
        imp.click_back()
        wbp = WorkbenchPage()
        wbp.wait_for_workbench_page_load()
        wbp.click_important_items()
        n = 1
        while not imp.page_should_contain_text2("新建事项"):
            imp.click_back()
            wbp.wait_for_workbench_page_load()
            wbp.click_important_items()
            n += 1
            if n > 20:
                break
        # 创建新事项
        Preconditions.create_new_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        # 确保有子任务可修改
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        imp.click_add_subtasks()
        imp.wait_for_add_subtasks_page_load()
        title = "子任务标题0015"
        imp.input_subtasks_title(title)
        imp.input_subtasks_describe("子任务描述0015")
        imp.click_subtasks_add_icon()
        sccp = SelectCompanyContactsPage()
        sccp.wait_for_page_load()
        sccp.click_contacts_by_name("大佬1")
        sccp.click_sure_button()
        imp.wait_for_add_subtasks_page_load()
        imp.click_save()
        imp.wait_for_check_item_page_load()
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        # 2.打开查看子任务界面
        imp.click_text(title)
        time.sleep(2)
        # 3.打开时间选择弹窗
        imp.click_modify()
        time.sleep(2)
        imp.swipe_time_by_minute()
        time.sleep(2)
        # 获取子任务当前滚动条时间(由于滚动条的时间xpath会随滑动变化,验证时间有局限性)
        current_time = imp.get_time_text()
        imp.click_sure()
        # 4.修改成功,返回查看子任务详情界面,界面截止时间显示为刚刚修改的时间信息
        self.assertEquals(imp.is_toast_exist("修改成功"), True)
        imp.wait_for_check_subtasks_page_load()
        self.assertEquals(imp.is_text_present(current_time), True)
Beispiel #7
0
    def test_ZYSX_0014(self):
        """修改子任务-修改负责人"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 创建新事项
        Preconditions.create_new_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        # 确保有子任务可修改
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        imp.click_add_subtasks()
        imp.wait_for_add_subtasks_page_load()
        title = "子任务标题0014"
        imp.input_subtasks_title(title)
        imp.input_subtasks_describe("子任务描述0014")
        imp.click_subtasks_add_icon()
        sccp = SelectCompanyContactsPage()
        sccp.wait_for_page_load()
        sccp.click_contacts_by_name("大佬1")
        sccp.click_sure_button()
        imp.wait_for_add_subtasks_page_load()
        imp.click_save()
        imp.wait_for_check_item_page_load()
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        # 2.打开查看子任务界面
        imp.click_text(title)
        time.sleep(2)
        imp.click_text("佬1")
        # 3.等待选择联系人页面加载
        sccp.wait_for_page_load()
        search_name = "大佬2"
        sccp.input_search_message(search_name)
        time.sleep(2)
        sccp.click_contacts_by_name(search_name)
        sccp.click_sure_button()
        # 4.修改成功,返回查看子任务详情界面,界面负责人显示为刚刚修改的联系人
        imp.wait_for_check_subtasks_page_load()
        self.assertEquals(imp.is_text_present("佬2"), True)
Beispiel #8
0
    def test_ZYSX_0013(self):
        """修改子任务-修改标题"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 创建新事项
        Preconditions.create_new_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        # 确保有子任务可修改
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        imp.click_add_subtasks()
        imp.wait_for_add_subtasks_page_load()
        title = "子任务标题0013"
        imp.input_subtasks_title(title)
        imp.input_subtasks_describe("子任务描述0013")
        imp.click_subtasks_add_icon()
        sccp = SelectCompanyContactsPage()
        sccp.wait_for_page_load()
        sccp.click_contacts_by_name("大佬1")
        sccp.click_sure_button()
        imp.wait_for_add_subtasks_page_load()
        imp.click_save()
        imp.wait_for_check_item_page_load()
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        # 2.打开查看子任务界面
        imp.click_text(title)
        time.sleep(2)
        # 3.打开子任务标题编辑界面
        imp.click_text(title)
        time.sleep(2)
        modify_title = "修改后的子任务标题0013"
        imp.input_modify_content(modify_title)
        imp.click_save()
        # 4.修改成功,返回查看子任务详情界面,界面任务标题显示为刚刚修改的标题
        self.assertEquals(imp.is_toast_exist("修改成功"), True)
        imp.wait_for_check_subtasks_page_load()
        self.assertEquals(imp.is_text_present(modify_title), True)
Beispiel #9
0
    def test_ZYSX_0020(self):
        """进行中事项列表和归档事项列表切换"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        imp.click_filed_item()
        # 1.切换到已归档事项列表
        imp.wait_for_filed_list_page_load()
        imp.click_check_having_item()
        # 2.切换到进行中的事项列表
        imp.wait_for_page_load()
Beispiel #10
0
    def test_ZYSX_0007(self):
        """添加评论"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 创建新事项
        Preconditions.create_new_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        # 2.打开评论编辑页
        imp.click_comment()
        time.sleep(2)
        comment = "测试评论0007"
        # 输入评论内容
        imp.input_modify_content(comment)
        imp.click_submit_comments()
        # 3.等待查看事项页面加载,界面底部显示刚刚的评论内容
        imp.wait_for_check_item_page_load()
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        self.assertEquals(imp.is_text_present(comment), True)
        imp.click_back()
        # 等待重要事项首页加载
        imp.wait_for_page_load()
Beispiel #11
0
    def test_ZYSX_0006(self):
        """修改删除事项参与人"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 确保已有事项
        Preconditions.ensure_have_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        imp.click_personnel_status()
        # 2.等待人员状态页面加载
        imp.wait_for_personnel_status_page_load()
        # 确保有人员可移除
        imp.click_add_personnel()
        sccp = SelectCompanyContactsPage()
        # 等待选择联系人页面加载
        sccp.wait_for_page_load()
        add_name = "大佬3"
        sccp.click_contacts_by_name(add_name)
        sccp.click_sure_button()
        imp.wait_for_personnel_status_page_load()
        imp.click_delete_personnel()
        # 3.界面未读人员显示可删除按钮
        self.assertEquals(imp.is_exists_delete_icon_by_name("佬3"), True)
        imp.click_delete_icon_by_name("佬3")
        # 4.删除的联系人从界面消失
        self.assertEquals(imp.is_text_present("佬3"), False)
        # 5.退出删除状态
        imp.click_delete_personnel()
        imp.click_back()
        imp.wait_for_check_item_page_load()
        imp.click_back()
        # 等待重要事项首页加载
        imp.wait_for_page_load()
Beispiel #12
0
    def test_ZYSX_0005(self):
        """修改增加事项参与人"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 确保已有事项
        Preconditions.ensure_have_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        imp.click_personnel_status()
        # 2.等待人员状态页面加载
        imp.wait_for_personnel_status_page_load()
        imp.click_add_personnel()
        sccp = SelectCompanyContactsPage()
        # 3.等待选择联系人页面加载
        sccp.wait_for_page_load()
        search_name = "大佬2"
        sccp.input_search_message(search_name)
        time.sleep(2)
        # 4.显示搜索结果
        self.assertEquals(sccp.is_search_contacts_name_full_match(search_name), True)
        sccp.click_contacts_by_name(search_name)
        sccp.click_sure_button()
        # 5.添加成功,等待人员状态页面加载,界面显示刚刚添加的联系人信息
        self.assertEquals(imp.is_toast_exist("添加成功"), True)
        imp.wait_for_personnel_status_page_load()
        self.assertEquals(imp.is_text_present("佬2"), True)
        imp.click_back()
        imp.wait_for_check_item_page_load()
        imp.click_back()
        # 等待重要事项首页加载
        imp.wait_for_page_load()
Beispiel #13
0
    def test_ZYSX_0004(self):
        """修改事项描述"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 确保已有事项
        Preconditions.ensure_have_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        # 2.点击查看事项页面描述
        imp.click_check_item_describe()
        time.sleep(2)
        modify_describe = "事项描述0004"
        imp.input_modify_content(modify_describe)
        imp.click_save()
        # 3.等待查看事项页面加载,界面事项描述显示为修改后的内容
        imp.wait_for_check_item_page_load()
        self.assertEquals(imp.is_text_present(modify_describe), True)
        imp.click_back()
        # 等待重要事项首页加载
        imp.wait_for_page_load()
Beispiel #14
0
    def test_ZYSX_0002(self):
        """新建事项"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 清空进行中的事项,确保不影响验证
        imp.clear_item()
        imp.click_new_item()
        # 1.等待创建事项页面加载
        imp.wait_for_create_item_page_load()
        # 输入创建事项标题
        title = "测试事项0002"
        imp.input_create_item_title(title)
        # 输入创建事项描述
        imp.input_create_item_describe("描述内容0002")
        imp.click_add_icon()
        sccp = SelectCompanyContactsPage()
        sccp.wait_for_page_load()
        # 选择参与人
        sccp.click_contacts_by_name("大佬1")
        sccp.click_sure_button()
        imp.wait_for_create_item_page_load()
        imp.click_create_item()
        imp.wait_for_page_load()
        # 2.显示刚刚创建的事项
        self.assertEquals(imp.is_text_present(title), True)
Beispiel #15
0
    def test_ZYSX_0018(self):
        """事项归档"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 确保已有事项
        Preconditions.ensure_have_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        # 2.弹出是否归档提示弹窗
        imp.click_file_matters()
        time.sleep(1)
        imp.click_sure()
        # 3.事项归档成功,显示已归档事项列表
        self.assertEquals(imp.is_toast_exist("归档成功"), True)
        imp.wait_for_filed_list_page_load()
        imp.click_check_having_item()
        # 等待重要事项首页加载
        imp.wait_for_page_load()
Beispiel #16
0
    def test_ZYSX_0019(self):
        """事项删除"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 清空进行中的事项,确保不影响验证
        imp.clear_item()
        # 确保有事项删除
        imp.click_new_item()
        imp.wait_for_create_item_page_load()
        title = "测试事项0019"
        imp.input_create_item_title(title)
        imp.input_create_item_describe("描述内容0019")
        imp.click_add_icon()
        sccp = SelectCompanyContactsPage()
        sccp.wait_for_page_load()
        sccp.click_contacts_by_name("大佬1")
        sccp.click_sure_button()
        imp.wait_for_create_item_page_load()
        imp.click_create_item()
        imp.wait_for_page_load()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        # 2.弹出删除事项弹窗
        imp.click_three_points_icon()
        time.sleep(2)
        # 3.弹出删除事项确认弹窗
        imp.click_delete_item()
        time.sleep(1)
        imp.click_sure()
        # 4.事项删除成功,事项从进行中事项列表清除
        self.assertEquals(imp.is_toast_exist("删除成功"), True)
        imp.wait_for_page_load()
        self.assertEquals(imp.is_text_present(title), False)
Beispiel #17
0
    def test_ZYSX_0008(self):
        """删除评论"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 创建新事项
        Preconditions.create_new_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        # 确保有评论可删除
        imp.click_comment()
        time.sleep(2)
        comment = "测试评论0008"
        imp.input_modify_content(comment)
        imp.click_submit_comments()
        imp.wait_for_check_item_page_load()
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        # 2.收起事项信息,显示事项动态栏信息
        imp.click_text("收起详情")
        # 点击指定评论后的删除图标
        imp.click_delete_icon_by_comment(comment)
        time.sleep(1)
        # 3.弹出删除评论确认弹窗
        imp.click_sure()
        # 4.评论删除成功,评论从界面消失
        self.assertEquals(imp.is_toast_exist("删除成功"), True)
        imp.wait_for_check_item_page_load()
        self.assertEquals(imp.is_text_present(comment), False)
        imp.click_back()
        # 等待重要事项首页加载
        imp.wait_for_page_load()
Beispiel #18
0
    def ensure_have_item():
        """确保已有事项"""

        imp = ImportantMattersPage()
        if not imp.is_exists_item():
            imp.click_new_item()
            # 等待创建事项页面加载
            imp.wait_for_create_item_page_load()
            # 输入创建事项标题
            title = "测试事项"
            imp.input_create_item_title(title)
            # 输入创建事项描述
            imp.input_create_item_describe("描述内容12345")
            imp.click_add_icon()
            sccp = SelectCompanyContactsPage()
            sccp.wait_for_page_load()
            # 选择参与人
            sccp.click_contacts_by_name("大佬1")
            sccp.click_sure_button()
            imp.wait_for_create_item_page_load()
            imp.click_create_item()
            imp.wait_for_page_load()
Beispiel #19
0
    def test_ZYSX_0010(self):
        """添加子任务"""

        imp = ImportantMattersPage()
        imp.wait_for_page_load()
        # 解决工作台不稳定的问题
        imp.click_back()
        wbp = WorkbenchPage()
        wbp.wait_for_workbench_page_load()
        wbp.click_important_items()
        n = 1
        while not imp.page_should_contain_text2("新建事项"):
            imp.click_back()
            wbp.wait_for_workbench_page_load()
            wbp.click_important_items()
            n += 1
            if n > 20:
                break
        # 创建新事项
        Preconditions.create_new_item()
        imp.click_first_item()
        # 1.等待查看事项页面加载
        imp.wait_for_check_item_page_load()
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        imp.click_add_subtasks()
        # 2.等待添加子任务页面加载
        imp.wait_for_add_subtasks_page_load()
        # 输入子任务标题
        title = "子任务标题0010"
        imp.input_subtasks_title(title)
        # 输入子任务描述
        imp.input_subtasks_describe("子任务描述0010")
        imp.click_subtasks_add_icon()
        sccp = SelectCompanyContactsPage()
        # 3.等待选择联系人页面加载
        sccp.wait_for_page_load()
        search_name = "大佬1"
        sccp.input_search_message(search_name)
        time.sleep(2)
        sccp.click_contacts_by_name(search_name)
        sccp.click_sure_button()
        # 4.返回添加子任务编辑界面,界面底部显示添加的联系人
        imp.wait_for_add_subtasks_page_load()
        self.assertEquals(imp.is_text_present("佬1"), True)
        # 选择截止时间
        imp.click_modify()
        time.sleep(2)
        imp.swipe_time_by_hour()
        imp.click_sure()
        time.sleep(1)
        imp.click_save()
        imp.wait_for_check_item_page_load()
        imp.swipe_by_percent_on_screen(50, 70, 50, 30, 700)
        # 5.中间子任务栏,显示刚刚添加的子任务
        self.assertEquals(imp.is_text_present(title), True)