Exemplo n.º 1
0
    def test_YYSC_0004(self):
        """搜索未添加个人应用进入应用介绍页添加"""

        # 确保不存在指定个人应用
        app_name = "同事圈"
        Preconditions.ensure_not_exists_personal_app_by_name(app_name)
        # 添加工作台里的应用
        wbp = WorkbenchPage()
        wbp.click_app_store()
        asp = AppStorePage()
        asp.wait_for_page_load()
        # 点击搜索应用
        asp.click_search_app()
        # 1.等待搜索页加载
        asp.wait_for_search_page_load()
        asp.input_store_name(app_name)
        time.sleep(1)
        # 2.搜索栏是否显示指定文本
        self.assertEquals(asp.get_search_box_text(), app_name)
        asp.click_search()
        time.sleep(5)
        # 解决工作台不稳定的问题
        if not asp.is_exist_join():
            asp.click_close()
            wbp.wait_for_workbench_page_load()
            wbp.click_app_store()
            asp.wait_for_page_load()
            asp.click_search_app()
            asp.wait_for_search_page_load()
            asp.input_store_name(app_name)
            asp.click_search()
            time.sleep(5)
        # 3.搜索关键词是否展示在搜索结果列表中
        self.assertEquals(asp.is_search_result_match(app_name), True)
        # 点击搜索结果,进入应用介绍页
        asp.click_search_result()
        # 4.等待应用介绍详情页加载
        asp.wait_for_app_details_page_load()
        time.sleep(2)
        # 5.点击添加
        asp.click_join()
        time.sleep(2)
        asp.click_add_app()
        time.sleep(2)
        asp.click_back()
        # 6.添加成功,返回搜索页,搜索栏内容保存
        asp.wait_for_search_page_load()
        self.assertEquals(asp.get_search_box_text(), app_name)
        asp.click_close()
        wbp.wait_for_workbench_page_load()
        wbp.click_workbench_manage()
        time.sleep(6)
        # 7.工作台新增个人应用分组,是否存在指定应用图标
        # self.assertEquals(wbp.is_exists_app_by_name("个人应用"), True)
        self.assertEquals(wbp.is_exists_app_by_name(app_name), True)
Exemplo n.º 2
0
    def ensure_not_exists_app_by_name(name):
        """确保不存在指定应用"""

        wbp = WorkbenchPage()
        if wbp.is_exists_app_by_name(name):
            wbp.click_workbench_manage()
            wmp = WorkbenchManagePage()
            wmp.wait_for_page_load()
            wmp.click_remove_icon_by_app_name(name)
            time.sleep(2)
            wmp.click_back()
            wbp.wait_for_workbench_page_load()