Comparing version 1.1.4 to 1.1.5
{ | ||
"name": "uitest", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "uitest", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -22,3 +22,3 @@ # uitest | ||
## Installment | ||
## Installation | ||
@@ -29,4 +29,10 @@ ```shell | ||
## Sample | ||
[uitest-sample](//github.com/xudafeng/uitest-sample) | ||
## Usage | ||
You should configure your entry HTML by including `uitest-mocha-shim.js`. | ||
Here is an example `test.html` | ||
@@ -73,6 +79,21 @@ | ||
### Screenshots | ||
### Node.js | ||
Your can start uitest using Node API: | ||
```javascript | ||
_macaca_uitest.screenshot(name[String], cb[Function]); | ||
const uitest = require('uitest'); | ||
uitest({ | ||
url: 'file:///Users/name/path/index.html', | ||
width: 600, | ||
height: 480, | ||
hidpi: false, | ||
useContentSize: true, | ||
show: false, | ||
}).then(() => { | ||
console.log('uitest success') | ||
}).catch(() => { | ||
console.log('uitest error') | ||
}); | ||
``` | ||
@@ -82,2 +103,4 @@ | ||
Or with Gulp: | ||
```shell | ||
@@ -87,4 +110,33 @@ $ npm i gulp-uitest --save-dev | ||
```javascript | ||
const uitest = require('gulp-uitest'); | ||
//test | ||
gulp.task('test', function() { | ||
return gulp | ||
.src('test/html/index.html') | ||
.pipe(uitest({ | ||
width: 600, | ||
height: 480, | ||
hidpi: false, | ||
useContentSize: true, | ||
show: false, | ||
})); | ||
}); | ||
``` | ||
### Screenshots | ||
```javascript | ||
_macaca_uitest.screenshot(name[String], cb[Function]); | ||
``` | ||
### Advanced | ||
If you do not want the page to display in retina mode, set `hidpi` to false. | ||
For more options, see [Electron BrowserWindow options](http://electron.atom.io/docs/api/browser-window/#new-browserwindowoptions) | ||
## License | ||
The MIT License (MIT) |
;(function() { | ||
'use strict'; | ||
@@ -18,4 +19,4 @@ var isElectron = /Electron/i.test(navigator.userAgent); | ||
remoteConsole.log.apply(remoteConsole, arguments) | ||
} | ||
remoteConsole.log.apply(remoteConsole, arguments); | ||
}; | ||
} | ||
@@ -28,3 +29,2 @@ | ||
} | ||
var mochaElem = document.getElementById('mocha'); | ||
@@ -56,3 +56,3 @@ if (typeof process === 'undefined') { | ||
useColors: true | ||
}) | ||
}); | ||
} | ||
@@ -59,0 +59,0 @@ |
17725
138