# uitest-loader

Latest version **2.0.1** (published 2021-10-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install uitest-loader
pnpm add uitest-loader
yarn add uitest-loader
bun add uitest-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2021-10-20 |
| First published | 2021-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | alan89757 |
| Maintainers | alan89757 |
| Keywords | ui, uitest, loader, webpack loader, uitest-loader |

## Links

- npm: https://www.npmjs.com/package/uitest-loader
- Repository: https://github.com/alan89757/uitest-loader
- Homepage: https://github.com/alan89757/uitest-loader#readme
- Issues: https://github.com/alan89757/uitest-loader/issues
- npm.io page: https://npm.io/package/uitest-loader

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2021-10-20
- 2.0.0 — 2021-10-20
- 1.0.12 — 2021-10-19
- 1.0.11 — 2021-10-19
- 1.0.10 — 2021-10-19
- 1.0.9 — 2021-10-19
- 1.0.8 — 2021-10-19
- 1.0.7 — 2021-10-19
- 1.0.6 — 2021-10-19
- 1.0.5 — 2021-10-19
- 1.0.4 — 2021-10-18
- 1.0.3 — 2021-10-18
- 1.0.2 — 2021-10-18
- 1.0.1 — 2021-10-18
- 1.0.0 — 2021-10-18

## README

<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>

# uitest-loader

A loader for webpack which test web page.

### Getting Started

To begin, you'll need to install `uitest-loader`:

### npm
```console
$ npm install uitest-loader --save-dev
```

### yarn
```console
$ yarn add uitest-loader --save-dev
```

`uitest-loader` works like
[`file-loader`](https://github.com/webpack-contrib/file-loader), but can return
a DataURL if the file is smaller than a byte limit.

**index.js**

```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**

```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`](#attr)**     | `{String}` |                            ""                             | custom-attribute.                                     |
|  **[`header`](#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**

```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](./.github/CONTRIBUTING.md)

## License

[MIT](./LICENSE)

---
_Source: https://npm.io/package/uitest-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
