Giter Site home page Giter Site logo

uitest-loader's Introduction

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

{
  "filename": "ui自动化测试demo3",
  "url": "http://xxx/auto-test/",
  "formId": "register2",
  "formItems": [
    {
    
      "name": "name",
      "label": "活动名称",
      "type": "文本框",
      "rules": [
        {
          "required": true,
          "message": "请输入活动名称~"
        }
      ]
    },
    {
      "name": "area",
      "label": "活动区域",
      "type": "下拉框",
      "rules":[
        {
          "required": true,
          "message": "请输入活动区域~"
        }
      ]
    }
  ]

}

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.

CONTRIBUTING

License

MIT


uitest-loader's People

Contributors

alan89757 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.