2.0.1 • Published 3 years ago

uitest-loader v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

uitest-loader

A loader for webpack which test web page.

Getting Started

To begin, you'll need to install uitest-loader:

npm

$ npm install uitest-loader --save-dev

yarn

$ yarn add uitest-loader --save-dev

uitest-loader works like file-loader, but can return a DataURL if the file is smaller than a byte limit.

index.js

const formConfig = {
  "filename": "useForm自动化测试用例",
  "url": "http://172.18.25.72/auto-test2/",
  "formId": "register2",
  "formItems": [
    {
      label: '活动名称',
      field: {
          name: 'name',
          type: 'input',
          placeholder: '请输入活动名称'
      },
    },
    {
      label: '活动区域',
      field: {
          name: 'area',
          type: 'select',
          placeholder: '请选择活动区域'
      },
    },
    {
      label: '活动时间',
      field: {
          name: 'date',
          type: 'date',
          placeholder: '请选择活动时间'
      },
    },
    {
      label: '即时配送',
      field: {
          name: 'express',
          type: 'switch'
      },
    },
    {
      label: '活动性质',
      field: {
          name: 'nature',
          type: 'checkbox'
      },
    },
    {
      label: '特殊资源',
      field: {
          name: 'resource',
          type: 'radio',
          placeholder: '请选择特殊资源'
      },
    },
    {
      label: '活动形式',
      field: {
          name: 'content',
          type: 'textarea',
          placeholder: '请输入活动形式'
      },
    }
  ]
}
module.exports = {
  formConfig
}

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.uitest\.json$/,
        use: {
            loader: "uitest-loader",  // 会生成excel
            options: {
                attr: "auto-test2",  // 测试属性
                header: ["预期事件", "预期内容", "实际事件", "实际内容", "对比结果", "访问地址", "填充位置", "属性名称", "输入类型", "输入内容"]
            }
        }
      },
    ],
  },
};

And run webpack via your preferred method.

Options

NameTypeDefaultDescription
attr{String}""custom-attribute.
header{Array}[]set excel header.

attr

Type: String Default:

The attr can be specified via loader options and defaults to empty.

header

The header can be specified via loader options and defaults to [].

Examples

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.uitest\.json$/,
        use: {
            loader: "uitest-loader",  // 会生成excel
            options: {
                attr: "auto-test2",  // 测试属性
                header: ["预期事件", "预期内容", "实际事件", "实际内容", "对比结果", "访问地址", "填充位置", "属性名称", "输入类型", "输入内容"]
            }
        }
      },
    ],
  },
};

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

CONTRIBUTING

License

MIT

2.0.1

3 years ago

2.0.0

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago