* Creates a condition that will loop until an element is * ./webdriver.WebDriver#findElement found with the given locator. * * @param {!(By|Function)} locator The locator to use. * @return {!WebElementCondition} The new condition.
(locator)
| 226 | * @return {!WebElementCondition} The new condition. |
| 227 | */ |
| 228 | function elementLocated(locator) { |
| 229 | locator = by.checkedLocator(locator) |
| 230 | let locatorStr = typeof locator === 'function' ? 'by function()' : locator + '' |
| 231 | return new WebElementCondition('for element to be located ' + locatorStr, function (driver) { |
| 232 | return driver.findElements(locator).then(function (elements) { |
| 233 | return elements[0] |
| 234 | }) |
| 235 | }) |
| 236 | } |
| 237 | |
| 238 | /** |
| 239 | * Creates a condition that will loop until at least one element is |
nothing calls this directly
no test coverage detected