Comparing version 0.33.0 to 0.33.1
@@ -7,3 +7,3 @@ var WebDriver = require('webdriverio') | ||
this.host = options.host || 'localhost' | ||
this.port = options.port || 9515 | ||
this.port = parseInt(options.port, 10) || 9515 | ||
this.quitTimeout = parseInt(options.quitTimeout, 10) || 1000 | ||
@@ -109,5 +109,4 @@ | ||
this.client.addCommand('waitUntilTextExists', function (selector, text, timeout) { | ||
if (timeout == null) { | ||
timeout = 5000 | ||
} | ||
if (timeout == null) timeout = 5000 | ||
return this.waitUntil(function () { | ||
@@ -125,4 +124,41 @@ return this.isExisting(selector).getText(selector).then(function (selectorText) { | ||
}) | ||
this.client.addCommand('waitUntilWindowLoaded', function (timeout) { | ||
if (timeout == null) timeout = 5000 | ||
return this.waitUntil(function () { | ||
return this.isWindowLoading().then(function (loading) { | ||
return !loading | ||
}) | ||
}, timeout).then(function () { }) | ||
}) | ||
this.addCurrentWindowGetter('isDevToolsOpened', 'isWindowDevToolsOpened') | ||
this.addCurrentWindowGetter('isFocused', 'isWindowFocused') | ||
this.addCurrentWindowGetter('isFullScreen', 'isWindowFullScreen') | ||
this.addCurrentWindowGetter('isMaximized', 'isWindowMaximized') | ||
this.addCurrentWindowGetter('isMinimized', 'isWindowMinimized') | ||
this.addCurrentWindowGetter('isLoading', 'isWindowLoading') | ||
this.addCurrentWindowGetter('isVisible', 'isWindowVisible') | ||
this.addCurrentWindowGetter('hide', 'hideWindow') | ||
this.addCurrentWindowGetter('maximize', 'maximizeWindow') | ||
this.addCurrentWindowGetter('minimize', 'minimizeWindow') | ||
this.addCurrentWindowGetter('show', 'showWindow') | ||
} | ||
Application.prototype.addCurrentWindowGetter = function (methodName, commandName) { | ||
if (!commandName) commandName = methodName | ||
var currentWindowGetter = function (methodName) { | ||
return require('remote').getCurrentWindow()[methodName]() | ||
} | ||
this.client.addCommand(commandName, function () { | ||
return this.execute(currentWindowGetter, methodName).then(function (response) { | ||
return response.value | ||
}) | ||
}) | ||
} | ||
module.exports = Application |
{ | ||
"name": "spectron", | ||
"version": "0.33.0", | ||
"version": "0.33.1", | ||
"description": "Easy ChromeDriver tests for Electron apps", | ||
@@ -9,2 +9,5 @@ "main": "index.js", | ||
}, | ||
"engines": { | ||
"node": ">=0.12.4" | ||
}, | ||
"repository": { | ||
@@ -28,3 +31,2 @@ "type": "git", | ||
"electron-chromedriver": "^0.33.4", | ||
"temp": "^0.8.3", | ||
"webdriverio": "^3.2.5" | ||
@@ -35,4 +37,5 @@ }, | ||
"mocha": "^2.3.3", | ||
"standard": "^5.3.1" | ||
"standard": "^5.3.1", | ||
"temp": "^0.8.3" | ||
} | ||
} |
@@ -7,3 +7,3 @@ # spectron | ||
Easily test your [Electron](http://electron.atom.io) apps using [ChromeDriver](https://code.google.com/p/selenium/wiki/ChromeDriver) | ||
and [webdriverio](http://webdriver.io) | ||
and [webdriverio](http://webdriver.io). | ||
@@ -22,3 +22,2 @@ ## Using | ||
var assert = require('assert') | ||
var path = require('path') | ||
@@ -57,3 +56,3 @@ describe('application loading', function () { | ||
* `path` - String path to the application executable to launch. **Required** | ||
* `args` - Chrome arguments to pass to the executable. | ||
* `args` - Array of Chrome arguments to pass to the executable. | ||
See [here](https://sites.google.com/a/chromium.org/chromedriver/capabilities) for more details. | ||
@@ -73,3 +72,3 @@ * `host` - String host name of the launched `chromedriver` process. | ||
#### stop(callback) | ||
#### stop() | ||
@@ -81,3 +80,3 @@ Stops the application. Returns a `Promise` that will be resolved once the | ||
spectron uses [webdriverio](http://webdriver.io) and exposes the managed | ||
Spectron uses [webdriverio](http://webdriver.io) and exposes the managed | ||
`client` property on the created `Application` instances. | ||
@@ -84,0 +83,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9840
2
176
4
104
+ Addedrimraf@2.7.1(transitive)
- Removedtemp@^0.8.3
- Removedrimraf@2.6.3(transitive)
- Removedtemp@0.8.4(transitive)