webdriverajax
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "webdriverajax", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Capture and assert HTTP ajax calls in webdriver.io", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/wdio" | ||
"test": "./node_modules/.bin/wdio && node_modules/.bin/mocha test/manual_init.js" | ||
}, | ||
@@ -32,6 +32,6 @@ "repository": { | ||
"node-static": "^0.7.7", | ||
"selenium-standalone": "^4.7.1", | ||
"webdriverio": "^3.2.5", | ||
"selenium-standalone": "^4.8.0", | ||
"webdriverio": "^3.4.0", | ||
"object-assign": "^4.0.1" | ||
} | ||
} |
@@ -58,3 +58,3 @@ # webdriverajax | ||
Once initialized, some related functions are added to you browser command chain (see [API](#api)). | ||
Once initialized, some related functions are added to your browser command chain (see [API](#api)). | ||
@@ -61,0 +61,0 @@ ## Quickstart |
@@ -7,2 +7,4 @@ 'use strict'; | ||
this.timeout(process.env.CI ? 100000 : 10000); | ||
it('sets up the interceptor', function () { | ||
@@ -9,0 +11,0 @@ |
'use strict'; | ||
var http = require('http'); | ||
var path = require('path'); | ||
var selenium = require('selenium-standalone'); | ||
var nodeStatic = require('node-static'); | ||
var assign = require('object-assign'); | ||
var utils = require('./test/utils'); | ||
var grid, staticServer, capabilities; | ||
var capabilities; | ||
@@ -75,31 +73,2 @@ if (process.env.CI === 'true') { | ||
function startStaticServer (cb) { | ||
return new Promise(function (resolve, reject) { | ||
var file = new nodeStatic.Server('./test/site'); | ||
var server = http.createServer(function (request, response) { | ||
request.addListener('end', function () { | ||
file.serve(request, response); | ||
}).resume(); | ||
}).listen(8080, function (err) { | ||
if (err) { | ||
return reject(err); | ||
} | ||
staticServer = server; | ||
resolve(server); | ||
}); | ||
}); | ||
} | ||
function startSelenium (cb) { | ||
return new Promise(function (resolve, reject) { | ||
selenium.start(function (err, sel) { | ||
if (err) { | ||
return reject(err); | ||
} | ||
grid = sel; | ||
resolve(sel); | ||
}); | ||
}); | ||
} | ||
var plugin = path.resolve(__dirname, 'index.js'); | ||
@@ -119,3 +88,3 @@ | ||
specs: [ | ||
'./test/spec/**/*.js' | ||
'./test/spec/plugin_test.js' | ||
], | ||
@@ -194,4 +163,3 @@ // Patterns to exclude. | ||
mochaOpts: { | ||
ui: 'bdd', | ||
timeout: process.env.CI ? 100000 : 10000 | ||
ui: 'bdd' | ||
}, | ||
@@ -209,6 +177,7 @@ | ||
onPrepare: function() { | ||
return Promise.all([ | ||
startSelenium(), | ||
startStaticServer() | ||
]); | ||
var jobs = [utils.startStaticServer()]; | ||
if (!process.env.CI) { | ||
jobs.push(utils.startSelenium()); | ||
} | ||
return Promise.all(jobs); | ||
}, | ||
@@ -224,4 +193,3 @@ // | ||
// the test. | ||
after: function(failures, pid) { | ||
}, | ||
after: function(failures, pid) {}, | ||
// | ||
@@ -231,4 +199,6 @@ // Gets executed after all workers got shut down and the process is about to exit. It is not | ||
onComplete: function() { | ||
grid.kill(); | ||
staticServer.close(); | ||
return Promise.all([ | ||
utils.stopStaticServer(), | ||
utils.stopSelenium() | ||
]); | ||
} | ||
@@ -235,0 +205,0 @@ }; |
Sorry, the diff of this file is not supported yet
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
31503
13
611
9