Exemplo n.º 1
0
 def delete_user_info():
     delete_user_info_payload = {
         "userId":
         str(
             db.system_sql("get_group_id",
                           SystemManageParamsValue.update_username)[0][0])
     }
     return delete_user_info_payload
Exemplo n.º 2
0
 def update_user_group():
     groupType = random.choice(["2", "3"])
     SystemManageParamsValue.user_group_id = \
     db.system_sql("get_group_id_with_group_name", SystemManageParamsValue.user_group_name)[0][0]
     update_user_group_payload = {
         "name": SystemManageParamsValue.update_user_group_name,
         "ext": SystemManageParamsValue.update_user_group_description,
         "id": SystemManageParamsValue.user_group_id,
         "groupType": groupType
     }
     return update_user_group_payload
Exemplo n.º 3
0
 def update_user_info():
     update_user_info_payload = {
         "userName":
         SystemManageParamsValue.update_username,
         "phone":
         SystemManageParamsValue.update_phone,
         "nickName":
         SystemManageParamsValue.update_nickname,
         "groupId":
         SystemManageParamsValue.update_group_id,
         "states":
         SystemManageParamsValue.update_states,
         "companyName":
         SystemManageParamsValue.update_company_name,
         "id":
         db.system_sql("get_group_id",
                       SystemManageParamsValue.username)[0][0]
     }
     return update_user_info_payload
Exemplo n.º 4
0
class SystemManageParamsValue(object):
    # 角色管理--新增角色
    user_group_name = u"自动化组" + time.strftime('%Y-%m-%d_%H:%M:%S',
                                              time.localtime(time.time()))
    user_group_description = u"这是自动化测试使用角色描述。这里有很多时间戳" + time.strftime(
        '%Y-%m-%d_%H:%M:%S', time.localtime(time.time()))
    # 角色管理--更新角色
    update_user_group_name = u"更新!!更新!!自动化组" + time.strftime(
        '%Y-%m-%d_%H:%M:%S', time.localtime(time.time()))
    update_user_group_description = u"更新!!!!更新!!!更新!!!!这是自动化测试使用角色描述。这里有很多时间戳" + time.strftime(
        '%Y-%m-%d_%H:%M:%S', time.localtime(time.time()))
    # 后面为group 添加权限是用到
    user_group_id = ""

    # 用户管理--添加账户
    phone_prefix_list = [
        "130", "131", "132", "133", "134", "135", "136", "137", "138", "139",
        "147", "150", "151", "152", "153", "155", "156", "157", "158", "159",
        "186", "187", "188"
    ]
    first_name = ['张', '金', '李', '王', '赵', '陈', '郭', '宋', '周', '秦', '何', '刘']
    middle_name = ['玉', '明', '龙', '芳', '军', '玲', '才', '伟', '娜', '敏', '静', '杰']
    last_name = ['', '立', '玲', '', '国', '', '玉', '', '秀', '', '桂', '勇']
    username = "******" + time.strftime('%Y-%m-%d_%H:%M:%S',
                                             time.localtime(time.time()))
    phone = random.choice(phone_prefix_list) + "".join(
        random.choice("0123456789") for i in range(8))
    nickname = random.choice(first_name) + random.choice(
        middle_name) + random.choice(last_name) + time.strftime(
            '%Y-%m-%d_%H:%M:%S', time.localtime(time.time()))
    group_name_and_id = db.system_sql("get_group_id_and_name")
    group_name = group_name_and_id[random.randint(0,
                                                  len(group_name_and_id) -
                                                  1)][1]
    group_id = group_name_and_id[random.randint(0,
                                                len(group_name_and_id) - 1)][0]
    states = "0"
    company_name = "auto自动化公司" + time.strftime('%Y-%m-%d_%H:%M:%S',
                                               time.localtime(time.time()))

    # 用户管理--更新账户
    update_username = "******" + time.strftime('%Y-%m-%d_%H:%M:%S',
                                                   time.localtime(time.time()))
    update_phone = random.choice(phone_prefix_list) + "".join(
        random.choice("0123456789") for i in range(8))
    update_nickname = "更新" + random.choice(first_name) + random.choice(
        middle_name) + random.choice(last_name) + time.strftime(
            '%Y-%m-%d_%H:%M:%S', time.localtime(time.time()))
    update_group_name_and_id = db.system_sql("get_group_id_and_name")
    update_group_name = update_group_name_and_id[random.randint(
        0,
        len(update_group_name_and_id) - 1)][1]
    update_group_id = update_group_name_and_id[random.randint(
        0,
        len(update_group_name_and_id) - 1)][0]
    update_states = "1"
    update_company_name = "更新auto自动化公司" + time.strftime(
        '%Y-%m-%d_%H:%M:%S', time.localtime(time.time()))

    # 角色权限配置项

    @staticmethod
    def add_user_info():
        add_user_info_payload = {
            "userName": SystemManageParamsValue.username,
            "phone": SystemManageParamsValue.phone,
            "nickName": SystemManageParamsValue.nickname,
            "groupId": SystemManageParamsValue.group_id,
            "states": SystemManageParamsValue.states,
            "companyName": SystemManageParamsValue.company_name
        }
        return add_user_info_payload

    @staticmethod
    def update_user_info():
        update_user_info_payload = {
            "userName":
            SystemManageParamsValue.update_username,
            "phone":
            SystemManageParamsValue.update_phone,
            "nickName":
            SystemManageParamsValue.update_nickname,
            "groupId":
            SystemManageParamsValue.update_group_id,
            "states":
            SystemManageParamsValue.update_states,
            "companyName":
            SystemManageParamsValue.update_company_name,
            "id":
            db.system_sql("get_group_id",
                          SystemManageParamsValue.username)[0][0]
        }
        return update_user_info_payload

    @staticmethod
    def delete_user_info():
        delete_user_info_payload = {
            "userId":
            str(
                db.system_sql("get_group_id",
                              SystemManageParamsValue.update_username)[0][0])
        }
        return delete_user_info_payload

    @staticmethod
    def add_user_group():
        groupType = random.choice(["2", "3"])
        add_user_group_payload = {
            "name": SystemManageParamsValue.user_group_name,
            "groupType": groupType,
            "ext": SystemManageParamsValue.user_group_description
        }
        return add_user_group_payload

    @staticmethod
    def update_user_group():
        groupType = random.choice(["2", "3"])
        SystemManageParamsValue.user_group_id = \
        db.system_sql("get_group_id_with_group_name", SystemManageParamsValue.user_group_name)[0][0]
        update_user_group_payload = {
            "name": SystemManageParamsValue.update_user_group_name,
            "ext": SystemManageParamsValue.update_user_group_description,
            "id": SystemManageParamsValue.user_group_id,
            "groupType": groupType
        }
        return update_user_group_payload

    # @staticmethod
    # def update_user_group_setting(self):
    #     #更新角色权限配置项
    #     update_user_group_setting_payload={
    #         "groupId":SystemManageParamsValue.user_group_id,
    #         "modifyPowerSettingDtoList":modifyPowerSettingDtoList
    #     }
    @staticmethod
    def delete_user_group():
        delete_user_group_payload = {
            # "groupId": db.system_sql("get_group_id_with_group_name", SystemManageParamsValue.update_group_name)[0][0]
            "groupId": SystemManageParamsValue.user_group_id
        }
        return delete_user_group_payload