Selenium webdriver extensions for Nemo automation framework. Adapts JSON-formatted locator objects to common selenium-webdriver operations.
Unless you plan to get your hands dirty and author your own 'view' plugin (see nemo-view), you probably won't be interacting with nemo-drivex directly, besides adding it as a dependency and adding it to your nemo-plugins.json config. If you are planning to use nemo-view, just start with the docs there.
Register as "drivex" (see below)
- Please install nemo to your project as described here: https://github.com/paypal/nemo/blob/master/README.md
- Add this plugin to your package.json dev dependencies ("nemo-drivex": "^0.3.0")
- npm install
- add nemo-drivex to your config/nemo-plugins.json file
{
"plugins": {
"drivex": {
"module": "nemo-drivex",
"register": true
}
}
}The JSON locators expected by nemo-drivex would look like this:
{
"locator": "#result .result",
"type": "id"
}type would be any of the accepted locator strategies of the current version of selenium-webdriver: e.g. id, name, css, className, linkText, partialLinkText
locator would be the string which would locate the element(s) via the selected strategy
##Example usage
var resultEl = nemo.drivex.find({'locator': '#result .result', 'type': 'css'});
//resultEl will be a selenium-webdriver promise, which will resolve to a found element or nullnemo-drivex uses the debug module. For detailed debug messages, set DEBUG=nemo-drivex to the running process.
-
Determine if all WebElements in elements array are disabled
Name Type Description elementsArray
array of WebElements promise resolves to true or Error- Type
-
Promise
-
Determine if all WebElements in elements array are visible
Name Type Description elementsArray
array of WebElements promise resolves to true or Error- Type
-
Promise
-
Determine if all WebElements in elements array are enabled
Name Type Description elementsArray
array of WebElements promise resolves to true or Error- Type
-
Promise
-
allHidden(elements) → {Promise}
-
Determine if all WebElements in elements array are hidden
Name Type Description elementsArray
array of WebElements promise resolves to true or Error- Type
-
Promise
-
wraps Selenium WebDriver/WebElement.findElement
Name Type Description locatorelWebElement
resolves to WebElement or rejected- Type
-
Promise
-
wraps Selenium WebDriver/WebElement.findElements
Name Type Description locatorelWebElement
resolves to an array of WebElements or rejected- Type
-
Promise
-
determine if only one of the WebElements in the elements array is visible
Name Type Description elementsArray
array of WebElements promise resolves to single visible element from "elements" or Error- Type
-
Promise
-
wraps Selenium WebDriver/WebElement.isElementPresent
Name Type Description locatorelWebElement
resolves to true or rejected- Type
-
Promise
-
Wait for timeout milliseconds for the WebElement to be present
Name Type Description locatortimeoutNumber
resolves to true or throw error- Type
-
Promise
| Name | Type | Description |
|---|---|---|
locator |
||
timeout |
Number |
- Type
-
Promise
-
-
object
Name Type Description locatorstring
a locator string, such as "[value='US']" or "#countrySelect" typestring
corresponds to one of the Selenium Locator strategies (id, name, xpath, css) -