webdriverajax
Advanced tools
Comparing version 2.1.0 to 2.1.1
## webdriverajax changelog | ||
### [ [>](https://github.com/chmanie/webdriverajax/tree/v2.1.1) ] 2.1.1 / 15.12.2017 | ||
* Fix problems with newer versions of selenium | ||
### [ [>](https://github.com/chmanie/webdriverajax/tree/v2.1.0) ] 2.1.0 / 31.10.2017 | ||
@@ -4,0 +7,0 @@ * Add possibility to assess the requests payload using `request.body` |
11
index.js
@@ -22,10 +22,3 @@ 'use strict'; | ||
wdInstance.__wdajaxExpectations = []; | ||
wdInstance.execute(interceptor.setup); | ||
return wdInstance.waitUntil(function waitForSetup() { | ||
var ret = wdInstance.execute(function checkSetup () { | ||
return window.__webdriverajax; | ||
}); | ||
var isSetup = !!(ret.value && ret.value.requests); | ||
return Promise.resolve(isSetup); | ||
}, 5000); | ||
return wdInstance.executeAsync(interceptor.setup); | ||
} | ||
@@ -149,3 +142,3 @@ | ||
arr.forEach(function (header) { | ||
var match = header.match(/^(.+)?\:\s?(.+)$/); | ||
var match = header.match(/^(.+)?:\s?(.+)$/); | ||
if (match) { | ||
@@ -152,0 +145,0 @@ headers[match[1].toLowerCase()] = match[2]; |
'use strict'; | ||
var interceptor = { | ||
setup: function setup () { | ||
setup: function setup (done) { | ||
@@ -69,2 +69,4 @@ var NAMESPACE = '__webdriverajax'; | ||
done(window[NAMESPACE]); | ||
function pushToSessionStorage (req) { | ||
@@ -71,0 +73,0 @@ var rawData = window.sessionStorage.getItem(NAMESPACE); |
{ | ||
"name": "webdriverajax", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Capture and assert HTTP ajax calls in webdriver.io 🕸", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "./node_modules/.bin/wdio" | ||
"test": "eslint lib test index.js && wdio", | ||
"pretest": "selenium-standalone install" | ||
}, | ||
@@ -30,11 +31,9 @@ "repository": { | ||
"devDependencies": { | ||
"eslint": "^3.19.0", | ||
"mocha": "^3.2.0", | ||
"node-static": "^0.7.9", | ||
"object-assign": "^4.1.1", | ||
"selenium-standalone": "^6.2.0", | ||
"wdio-mocha-framework": "^0.5.9", | ||
"wdio-sauce-service": "^0.3.1", | ||
"webdriverio": "^4.6.2" | ||
"eslint": "^4.13.1", | ||
"mocha": "^4.0.1", | ||
"node-static": "^0.7.10", | ||
"selenium-standalone": "^6.12.0", | ||
"wdio-mocha-framework": "^0.5.12", | ||
"webdriverio": "^4.9.11" | ||
} | ||
} |
# webdriverajax | ||
[![Build Status](https://travis-ci.org/chmanie/webdriverajax.svg?branch=master)](https://travis-ci.org/chmanie/webdriverajax) [![Join the chat at https://gitter.im/chmanie/webdriverajax](https://badges.gitter.im/chmanie/webdriverajax.svg)](https://gitter.im/chmanie/webdriverajax?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
Capture and assert HTTP ajax calls in [webdriver.io](http://webdriver.io/) | ||
🕸 Capture and assert HTTP ajax calls in [webdriver.io](http://webdriver.io/) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/chmanie/webdriverajax.svg)](https://greenkeeper.io/) [![Build Status](https://travis-ci.org/chmanie/webdriverajax.svg?branch=master)](https://travis-ci.org/chmanie/webdriverajax) [![Join the chat at https://gitter.im/chmanie/webdriverajax](https://badges.gitter.im/chmanie/webdriverajax.svg)](https://gitter.im/chmanie/webdriverajax?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
This is a plugin for [webdriver.io](http://webdriver.io/). If you don't know it yet, check it out, it's pretty cool. | ||
@@ -78,7 +79,4 @@ | ||
It should work with somewhat newer versions of all browsers. | ||
It should work with somewhat newer versions of all browsers. Please report an issue if it doesn't seem to work with yours. | ||
[![Sauce Test Status](https://saucelabs.com/browser-matrix/webdriverajax.svg)](https://saucelabs.com/u/webdriverajax) | ||
## API | ||
@@ -85,0 +83,0 @@ |
109
wdio.conf.js
@@ -5,85 +5,4 @@ 'use strict'; | ||
var assign = require('object-assign'); | ||
var utils = require('./test/utils'); | ||
var capabilities; | ||
if (process.env.CI === 'true') { | ||
capabilities = [{ | ||
browserName: 'firefox', | ||
version: '52.0', | ||
platform: 'macOS 10.12' | ||
}, { | ||
browserName: 'chrome', | ||
version: '57.0', | ||
platform: 'macOS 10.12' | ||
}, { | ||
browserName: 'safari', | ||
version: '10.0', | ||
platform: 'macOS 10.12' | ||
}, { | ||
browserName: 'safari', | ||
version: '9.0', | ||
platform: 'OS X 10.11' | ||
}, { | ||
browserName: 'safari', | ||
version: '8.0', | ||
platform: 'OS X 10.10' | ||
}, { | ||
browserName: 'MicrosoftEdge', | ||
version: '14.14393', | ||
platform: 'Windows 10' | ||
}, { | ||
browserName: 'MicrosoftEdge', | ||
version: '13.10586', | ||
platform: 'Windows 10' | ||
}, { | ||
browserName: 'internet explorer', | ||
version: '11.0', | ||
platform: 'Windows 10' | ||
}, { | ||
browserName: 'internet explorer', | ||
version: '10.0', | ||
platform: 'Windows 8' | ||
}, { | ||
browserName: 'internet explorer', | ||
version: '9.0', | ||
platform: 'Windows 7' | ||
}, { | ||
browserName: 'Safari', | ||
appiumVersion: '1.6.4', | ||
platformName: 'iOS', | ||
platformVersion: '10.2', | ||
deviceName: 'iPhone 7 Plus Simulator', | ||
deviceOrientation: 'portrait' | ||
}, { | ||
browserName: 'Safari', | ||
appiumVersion: '1.6.4', | ||
platformName: 'iOS', | ||
platformVersion: '9.3', | ||
deviceName: 'iPhone 6s Plus Simulator', | ||
deviceOrientation: 'portrait' | ||
}, { | ||
browserName: 'Safari', | ||
appiumVersion: '1.6.4', | ||
platformName: 'iOS', | ||
platformVersion: '8.4', | ||
deviceName: 'iPhone 6 Plus Simulator', | ||
deviceOrientation: 'portrait' | ||
}].map(function (capability) { | ||
return assign(capability, { | ||
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, | ||
name: 'integration', | ||
build: process.env.TRAVIS_BUILD_NUMBER, | ||
public: true | ||
}); | ||
}); | ||
} else { | ||
capabilities = [{ | ||
browserName: 'chrome' | ||
}]; | ||
} | ||
var plugin = path.resolve(__dirname, 'index.js'); | ||
@@ -122,6 +41,8 @@ | ||
// | ||
capabilities: capabilities, | ||
services: ['sauce'], | ||
user: process.env.SAUCE_USERNAME, | ||
key: process.env.SAUCE_ACCESS_KEY, | ||
capabilities: [{ | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
args: ['headless'] | ||
} | ||
}], | ||
// | ||
@@ -173,3 +94,3 @@ // =================== | ||
// see also: http://webdriver.io/guide/testrunner/reporters.html | ||
reporter: process.env.CI ? 'dot' : 'spec', | ||
reporter: 'spec', | ||
@@ -193,6 +114,6 @@ // | ||
onPrepare: function() { | ||
var jobs = [utils.startStaticServer()]; | ||
if (!process.env.CI) { | ||
jobs.push(utils.startSelenium()); | ||
} | ||
var jobs = [ | ||
utils.startStaticServer(), | ||
utils.startSelenium() | ||
]; | ||
return Promise.all(jobs); | ||
@@ -214,6 +135,6 @@ }, | ||
onComplete: function() { | ||
var jobs = [utils.stopStaticServer()]; | ||
if (!process.env.CI) { | ||
jobs.push(utils.stopSelenium()); | ||
} | ||
var jobs = [ | ||
utils.stopStaticServer(), | ||
utils.stopSelenium(), | ||
]; | ||
return Promise.all(jobs); | ||
@@ -220,0 +141,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
97150
6
2
579
153