Comparing version 1.6.7 to 1.6.8
{ | ||
"name": "leadfoot", | ||
"version": "1.6.7", | ||
"version": "1.6.8", | ||
"description": "Leadfoot. A JavaScript client library that brings cross-platform consistency to the Selenium WebDriver API.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -143,2 +143,9 @@ /* global document:false */ | ||
// At least BrowserStack in May 2016 responds with HTTP 500 and a message value of "Invalid Command" for | ||
// at least some unknown commands. These errors are more properly represented to end-users using the | ||
// Selenium status UnknownCommand, so we make the appropriate coercion here | ||
if (response.statusCode === 500 && data.value && data.value.message === 'Invalid Command') { | ||
data.status = 9; | ||
} | ||
// At least FirefoxDriver 2.40.0 responds with HTTP status codes other than Not Implemented and a | ||
@@ -586,2 +593,3 @@ // Selenium status UnknownError for commands that are not implemented; however, it provides a | ||
// SafariDriver-specific | ||
brokenActiveElement: true, | ||
brokenNavigation: true, | ||
@@ -602,6 +610,15 @@ brokenMouseEvents: true, | ||
// At least ChromeDriver 2.9 and MS Edge 10240 does not implement /element/active | ||
testedCapabilities.brokenActiveElement = session.getActiveElement().then(works, function (error) { | ||
return error.name === 'UnknownCommand'; | ||
}); | ||
// At least IE 10 and 11 on Sauce Labs will stop responding if /element/active is called | ||
if ( | ||
capabilities.browserName === 'internet explorer' && | ||
(capabilities.version === '10' || capabilities.version === '11') | ||
) { | ||
testedCapabilities.brokenActiveElement = true; | ||
} | ||
else { | ||
// At least ChromeDriver 2.9 and MS Edge 10240 does not implement /element/active | ||
testedCapabilities.brokenActiveElement = session.getActiveElement().then(works, function (error) { | ||
return error.name === 'UnknownCommand'; | ||
}); | ||
} | ||
@@ -710,20 +727,28 @@ // At least Selendroid 0.9.0 has broken cookie deletion; nobody else has broken cookie deletion but | ||
// At least MS Edge Driver 14316 doesn't allow typing into file inputs | ||
testedCapabilities.brokenFileSendKeys = function () { | ||
return get('<!DOCTYPE html><input type="file" id="i1">').then(function () { | ||
var element; | ||
return session.findById('i1') | ||
.then(function (element) { | ||
return element.type('./Server.js'); | ||
}).then(function () { | ||
return session.execute(function () { | ||
return document.getElementById('i1').value; | ||
}); | ||
}).then(function (text) { | ||
if (!/Server.js$/.test(text)) { | ||
throw new Error('mismatch'); | ||
} | ||
}); | ||
}).then(works, broken); | ||
}; | ||
if ( | ||
capabilities.browserName === 'MicrosoftEdge' && | ||
parseFloat(capabilities.browserVersion) <= 37.14316 | ||
) { | ||
testedCapabilities.brokenFileSendKeys = true; | ||
} | ||
// TODO: Re-enable this after further testing | ||
// testedCapabilities.brokenFileSendKeys = function () { | ||
// return get('<!DOCTYPE html><input type="file" id="i1">').then(function () { | ||
// var element; | ||
// return session.findById('i1') | ||
// .then(function (element) { | ||
// return element.type('./Server.js'); | ||
// }).then(function () { | ||
// return session.execute(function () { | ||
// return document.getElementById('i1').value; | ||
// }); | ||
// }).then(function (text) { | ||
// if (!/Server.js$/.test(text)) { | ||
// throw new Error('mismatch'); | ||
// } | ||
// }); | ||
// }).then(works, broken); | ||
// }; | ||
// At least MS Edge Driver 14316 doesn't normalize whitespace properly when retrieving text. Text may contain | ||
@@ -894,2 +919,24 @@ // "\r\n" pairs rather than "\n", and there may be extraneous whitespace adjacent to "\r\n" pairs and at the | ||
if (capabilities.mouseEnabled) { | ||
// At least IE 10 and 11 on SauceLabs don't fire native mouse events consistently even though they | ||
// support moveMouseTo | ||
testedCapabilities.brokenMouseEvents = function () { | ||
return get( | ||
'<!DOCTYPE html><div id="foo">foo</div>' + | ||
'<script>counter = 0; var d = document; d.onmousemove = function () { counter++; };</script>' | ||
).then(function () { | ||
return session.findById('foo'); | ||
}).then(function (element) { | ||
return session.moveMouseTo(element, 20, 20); | ||
}).then(function () { | ||
return util.sleep(100); | ||
}).then(function () { | ||
return session.execute('return counter;'); | ||
}).then( | ||
function (counter) { | ||
return counter > 0 ? works() : broken(); | ||
}, | ||
broken | ||
); | ||
}; | ||
// At least ChromeDriver 2.12 through 2.19 will throw an error if mouse movement relative to the <html> | ||
@@ -1031,3 +1078,3 @@ // element is attempted | ||
// The W3C WebDriver standard does not support the session-level /keys command, but JsonWireProtocol does. | ||
testedCapabilities.supportsSessionKeys = session.pressKeys('a').then(supported, unsupported); | ||
testedCapabilities.supportsSessionKeys = session._post('keys', { value: 'a' }).then(supported, unsupported); | ||
@@ -1068,3 +1115,8 @@ return Promise.all(testedCapabilities); | ||
getSessions: function () { | ||
return this._get('sessions').then(returnValue).then(function (sessions) { | ||
return this._get('sessions').then(function (sessions) { | ||
// At least BrowserStack is now returning an array for the sessions response | ||
if (sessions && !Array.isArray(sessions)) { | ||
sessions = returnValue(sessions); | ||
} | ||
// At least ChromeDriver 2.19 uses the wrong keys | ||
@@ -1071,0 +1123,0 @@ // https://code.google.com/p/chromedriver/issues/detail?id=1229 |
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
239296
6088