Example #1
0
    def click_portrait_database_by_name(self, name, type='白名单'):
        """ 点击指定名称人像库

        参数:
            name: 人像库名称
            type: 人像库类型,默认为白名单,可选重点人员

        """
        PortraitPage.expend_portrait_database_by_type(self, type)
        GroupTree.click_group_by_name(self, name)
Example #2
0
 def rename_group_by_parent_name(self,
                                 old_name,
                                 new_name,
                                 parent_name='Default',
                                 confirm=True):
     GroupTree.click_group_by_name(self, parent_name)
     GroupTree.click_group_menu_by_name(self, old_name, '重命名')
     self.menu = '编辑'
     GROUP_NAME_INPUT = f'div[aria-label="{self.menu}"] > .el-dialog__body > div > div > .el-form > div > div > div > input '
     CONFIRM_BUTTON = f'div[aria-label="{self.menu}"] > .el-dialog__footer > .dialog-footer > .el-button--primary'
     CANCEL_BUTTON = f'div[aria-label="{self.menu}"] > .el-dialog__footer > .dialog-footer > .el-button--info'
     self.update_text(GROUP_NAME_INPUT, new_name)
     if confirm:
         self.click_visible_elements(CONFIRM_BUTTON)
     else:
         self.slow_click(CANCEL_BUTTON)
Example #3
0
    def rename_floor_by_parent_name(self,
                                    old_name,
                                    new_name,
                                    parent_name='Default',
                                    confirm=True):
        """ 重命名子楼层名称

        参数:
            old_name: 原楼层名称
            new_name: 新楼层名称
            parent_name: 父楼层名称,默认为Default
            confirm: 是否确认,默认为确认

        """
        GroupTree.click_group_by_name(self, parent_name)
        GroupTree.click_group_menu_by_name(self, old_name, '重命名')
        GROUP_NAME_INPUT = f'div[aria-label="{self.menu}"] > .el-dialog__body > .el-form > div > div > div > input '
        CONFIRM_BUTTON = f'div[aria-label="{self.menu}"] > .el-dialog__footer > .dialog-footer > .el-button--primary'
        CANCEL_BUTTON = f'div[aria-label="{self.menu}"] > .el-dialog__footer > .dialog-footer > .el-button--info'
        self.update_text(GROUP_NAME_INPUT, new_name)
        if confirm:
            self.slow_click(CONFIRM_BUTTON)
        else:
            self.slow_click(CANCEL_BUTTON)