Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huanghaiyang/grunt-webdriver-stage
扩展grunt-webdriver,添加阶段性测试功能
https://github.com/huanghaiyang/grunt-webdriver-stage
grunt grunt-plugin grunt-webdriver test-driven-development testing-tools
Last synced: 16 days ago
JSON representation
扩展grunt-webdriver,添加阶段性测试功能
- Host: GitHub
- URL: https://github.com/huanghaiyang/grunt-webdriver-stage
- Owner: huanghaiyang
- License: mit
- Created: 2016-07-26T03:15:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-02T06:59:05.000Z (over 8 years ago)
- Last Synced: 2024-09-23T20:48:30.263Z (about 2 months ago)
- Topics: grunt, grunt-plugin, grunt-webdriver, test-driven-development, testing-tools
- Language: JavaScript
- Size: 23.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# grunt-webdriver-stage
扩展grunt-webdriver,添加阶段性测试功能,grunt-webdriver使用方式请参见[grunt-webdriver](https://github.com/webdriverio/grunt-webdriver)# 安装
```
npm install grunt-webdriver-stage --save-dev
```# 使用方法
首先在wdio.conf.js 中配置需要测试的内容
```
specs: ['./test/specs/**/*.js'],
```
我们指定测试```./test/specs```下的所有js文件
此文件夹下共有如下几个文件:
+ ./test/specs/test_1.js
+ ./test/specs/test_2.js
+ ./test/specs/test_3.js
+ ./test/specs/test_5.js
+ ./test/specs/foo/test_4.js继续配置Gruntfile.js
```
webdriver_stage: {
options: {
logLevel: 'command',
waitforTimeout: 12345,
framework: 'mocha',
coloredLogs: true
},
testTargetConfigFile: {
configFile: './test/wdio.conf.js',
stages: ['./test/specs/test_1.js' , ['./test/specs/test_2.js' , './test/specs/test_3.js'] , './test/specs/foo/*.js' /*the last test file is ./test/specs/test_5.js*/], // webdriver test with 4 stages
foo: 'bar'
}
}
```stages属性配置了webdriver需要阶段性测试的内容,以上共分为4个阶段
+ 第一阶段测试
```
./test/specs/test_1.js
```+ 第二阶段测试
```
./test/specs/test_2.js
./test/specs/test_3.js
```+ 第三阶段测试
```
./test/specs/foo/*.js
```+ 第四阶段属于隐式声明,测试的内容是除去以上测试所剩下的所有未测内容
```
./test/specs/test_5.js
```# note
it will be generate tmp files in folder ./tmp , please add the folder in your .gitignore