mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
add waitUntilElementIsLocated
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
import { browser, by, element, ElementFinder, protractor, until } from 'protractor';
|
||||
import { Logger } from './logger';
|
||||
|
||||
export class BrowserVisibility {
|
||||
@@ -35,6 +35,12 @@ export class BrowserVisibility {
|
||||
}
|
||||
}
|
||||
|
||||
static async waitUntilElementIsLocated(elementToCheck: ElementFinder, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise<any> {
|
||||
Logger.info(`Wait Until Element Is Located ${elementToCheck.locator().toString()} for ${waitTimeout}`);
|
||||
|
||||
return browser.wait(until.elementLocated(by.css(css)), waitTimeout, 'Element is not located ' + elementToCheck.locator());
|
||||
}
|
||||
|
||||
static async waitUntilElementIsPresent(elementToCheck: ElementFinder, waitTimeout: number = BrowserVisibility.DEFAULT_TIMEOUT): Promise<any> {
|
||||
Logger.info(`Wait Until Element Is Present ${elementToCheck.locator().toString()} for ${waitTimeout}`);
|
||||
|
||||
|
Reference in New Issue
Block a user