Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created September 11, 2018 13:22
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
import { browser, element } from 'protractor';
import { protractor } from 'protractor/built/ptor';
import { By } from 'selenium-webdriver';
const EC = protractor.ExpectedConditions;
const defaultTimeout = 30000;
export class ElementHelper {
public static getElementOrWait(by: By) {
return browser.wait(EC.visibilityOf(element(by)), defaultTimeout)
.then(() => element(by));
}
public static getElementsOrWait(by: By) {
return browser.wait(EC.visibilityOf(element(by)), defaultTimeout)
.then(() => element.all(by));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment