@jessezzhang/motion-core
v0.0.17
Published
Automated testing framework
Downloads
8
Readme
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
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(" "),
};
Add babel plugin config
babel-plugin-istanbul
;Execute a single/multiple feature test
npm run test --feature=features/test.feature --feature=features/xxx.feature
- Revert DB
npm run test --needResetDB
- only run error features
npm run test --onlyError
- 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}条数据' ]