mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
e41a52286f
This reverts commit 9bc15994ce.
PR Close #55326
20 lines
550 B
TypeScript
20 lines
550 B
TypeScript
import { Locator, ElementFinder, browser, by, element } from 'protractor';
|
|
|
|
/**
|
|
*
|
|
* locate(finder1, finder2) => element(finder1).element(finder2).element(finderN);
|
|
*/
|
|
export function locate(locator: Locator, ...locators: Locator[]) {
|
|
return locators.reduce(
|
|
(current: ElementFinder, next: Locator) => current.element(next),
|
|
element(locator)) as ElementFinder;
|
|
}
|
|
|
|
export async function sleepFor(time = 1000) {
|
|
return await browser.sleep(time);
|
|
}
|
|
|
|
export function getLinkById(id: string) {
|
|
return element(by.css(`a[id=${id}]`));
|
|
}
|