Exemplo n.º 1
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()
Exemplo n.º 2
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()
Exemplo n.º 3
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()
    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)
        time.sleep(2)
        self.assertEquals(imp.is_text_present(comment), True)
        imp.click_back()
        # 等待重要事项首页加载
        imp.wait_for_page_load()
Exemplo n.º 5
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)
Exemplo n.º 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)
Exemplo n.º 7
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()
Exemplo n.º 8
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()
Exemplo n.º 9
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
Exemplo n.º 10
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()