@jessezzhang/motion-core

0.0.17 • Public • Published
  1. Need your project to conform to the following structure. . ├── node_modules ├── reports └── screenshots ├── steps └── sample ├── test └──xxx.feature ├── cucumber.js ├── package-lock.json └── package.json

  2. Config your cucumber.js.

    module.exports = {
        default: [
            "--require-module ts-node/register",
            "--require node_modules/@smart/test/lib/steps/**/*.js",
            "--require steps/**/*.ts",
            "--publish-quiet",
        ].join(" "),
        };
  1. Add babel plugin config babel-plugin-istanbul;

  2. Execute a single/multiple feature test

    npm run test --feature=features/test.feature --feature=features/xxx.feature
  1. Revert DB
    npm run test --needResetDB
  1. only run error features
    npm run test --onlyError
  1. Support command:
    'wait {int} seconds': [ '等待{int}秒' ],
    'screenshot {string}': [ '全屏截图{string}', '截图{string}' ],
    'click menu {string}': [ '点击菜单{string}', '访问菜单{string}' ],
    'input {string} equals {string}': [ '输入{string}等于{string}' ],
    'select date {string} equals {string}': [ '选择时间{string}等于{string}' ],
    'input number {string} equals {float}': [ '输入数字{string}等于{float}' ],
    'select {string} equals {string}': [ '选择{string}等于{string}' ],
    'click {string} button': [ '点击{string}按钮' ],
    'login url {string} username {string} password {string}': [ '登录{string}用户名{string}密码{string}' ],
    'select the number of {int} data, click {string} button': [ '选择第{int}条数据,点击{string}按钮' ],
    '{string} upload file {string}': [ '{string}上传文件{string}' ],
    'url should be equals {string}': [ '地址应该等于[{string}]' ],
    'the page exist {string}': [
      '页面显示{string}',
      '弹出框显示{string}',
      '页面应该显示{string}',
      '弹出框应该显示{string}'
    ],
    'check screenshot {string}': [ '检测图像{string}', '检测截图{string}' ],
    '{string} should be equals {string}': [ '{string}应该等于{string}' ],
    'table {string} contains {int} pieces of data': [ '表格{string}包含{int}条数据' ]

Readme

Keywords

Package Sidebar

Install

npm i @jessezzhang/motion-core

Weekly Downloads

0

Version

0.0.17

License

ISC

Unpacked Size

179 kB

Total Files

58

Last publish

Collaborators

  • jessezzhang