Example #1
0
 def delete_label_groups(self, *groups):
     """
     一键批量删除
     :param groups: 要删除的分组名称数组
     :return:
     """
     from pages import LableGroupDetailPage
     for name in groups:
         if isinstance(name, (list, tuple)) and len(name) > 0:
             name = name[0]
         if self.click_label_group(name):
             detail = LableGroupDetailPage()
             try:
                 self.click_element(['xpath', '//*[@text="知道了"]'], 1)
             except:
                 pass
             detail.open_setting_menu()
             detail.click_delete_label_menu()
             detail.click_delete()
             self.wait_for_page_load()
Example #2
0
 def delete_all_label(self):
     """
     一键删除全部分组
     :return:
     """
     from pages import LableGroupDetailPage
     groups = self.get_elements(self.__locators['分组根节点'])[1:]
     while groups:
         groups[0].click()
         # 删除标签
         detail = LableGroupDetailPage()
         try:
             self.click_element(['xpath', '//*[@text="我知道了"]'], 1)
         except:
             pass
         detail.open_setting_menu()
         detail.click_delete_label_menu()
         detail.click_delete()
         self.wait_for_page_load()
         # 刷新group
         groups = self.get_elements(self.__locators['分组根节点'])[1:]