testarmada-nightwatch-extra
Advanced tools
Comparing version 1.1.6 to 1.1.7
@@ -11,3 +11,2 @@ var fs = require("fs"); | ||
executeSizzlejs: function (sel, injectedJsCommand, sizzleSource) { | ||
/* In context of browser, ask if the selector is :visible according to sizzle */ | ||
var result = { | ||
@@ -19,3 +18,2 @@ isVisibleStrict: null, | ||
value: { | ||
// for `clickEl`, need to check if it is still needed | ||
sel: sel, | ||
@@ -31,3 +29,2 @@ value: null | ||
} else if (window.jQuery) { | ||
// if we have jquery, we'll use jquery's native sizzle | ||
sizzleRef = window.jQuery.find; | ||
@@ -41,3 +38,2 @@ } else { | ||
if (!sizzleRef) { | ||
// there might be error eval() here. we eat the error here and return result as nothing found on page | ||
return result; | ||
@@ -60,6 +56,2 @@ } | ||
if ($el.length > 0 && sizzleRef.matchesSelector($el[0], "area")) { | ||
/* Note: this is the only case in which we return a boolean for isVisibleStrict | ||
In all other cases, we return null because we effectively "do not know yet". | ||
This helps cases like waitForElNotPresent that cannot have "false" returned | ||
unless we have successfully checked if it is not visible. */ | ||
result.isVisible = result.isVisibleStrict = true; | ||
@@ -75,7 +67,3 @@ result.selectorVisibleLength = $el.length; | ||
/* If selector:visible and we have been told to click then signal back that it is okay to click(), | ||
unless we see a selector that is ambiguous (i.e number of results | ||
is greater than 1). */ | ||
if (result.isVisible) { | ||
/* We avoid using data-automation-id so that we do not accidentally blow away existing attributes. */ | ||
var seleniumClickSelectorValue = "magellan_selector_" + Math.round(Math.random() * 999999999).toString(16); | ||
@@ -87,4 +75,2 @@ $el[0].setAttribute("data-magellan-temp-automation-id", seleniumClickSelectorValue); | ||
} finally { | ||
/* if for whatever reason we fail here, we do not want Selenium returning | ||
a null result value back to Magellan. For now, we eat this exception. */ | ||
return result; | ||
@@ -91,0 +77,0 @@ } |
{ | ||
"name": "testarmada-nightwatch-extra", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "extra useful nightwatch command and assertion", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
90584
1717