* Creates a condition that will loop until at least one element is * ./webdriver.WebDriver#findElement found with the given locator. * * @param {!(By|Function)} locator The locator to use. * @return {!Condition<!Array<!./webdriver.WebElement>>} The new * condition.
(locator)
| 244 | * condition. |
| 245 | */ |
| 246 | function elementsLocated(locator) { |
| 247 | locator = by.checkedLocator(locator) |
| 248 | let locatorStr = typeof locator === 'function' ? 'by function()' : locator + '' |
| 249 | return new Condition('for at least one element to be located ' + locatorStr, function (driver) { |
| 250 | return driver.findElements(locator).then(function (elements) { |
| 251 | return elements.length > 0 ? elements : null |
| 252 | }) |
| 253 | }) |
| 254 | } |
| 255 | |
| 256 | /** |
| 257 | * Creates a condition that will wait for the given element to become stale. An |
nothing calls this directly
no test coverage detected