uitest-loader
v2.0.1
Published
<div align="center"> <a href="https://github.com/webpack/webpack"> <img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg"> </a> </div>
Downloads
6
Maintainers
Readme
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
| Name | Type | Default | Description |
| :---------------------------: | :-------------------------: | :-----------------------------------------------------------: | :---------------------------------------------------------------------------------- |
| 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.