本文整理匯總了TypeScript中protractor.browser.driver.executeAsyncScript方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser.driver.executeAsyncScript方法的具體用法?TypeScript browser.driver.executeAsyncScript怎麽用?TypeScript browser.driver.executeAsyncScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類protractor.browser.driver
的用法示例。
在下文中一共展示了browser.driver.executeAsyncScript方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('times out with a list of tasks', done => {
browser.get(URL);
browser.ignoreSynchronization = true;
// Script that runs in the browser and calls whenStable with a timeout.
let waitWithResultScript = function(done: any) {
let rootEl = document.querySelector('example-app');
let testability = window.getAngularTestability(rootEl);
testability.whenStable((didWork: boolean, tasks: any) => { done(tasks); }, 1000);
};
element(by.css('.start-button')).click();
browser.driver.executeAsyncScript(waitWithResultScript).then((result: any[]) => {
let pendingTask = result[0];
expect(pendingTask.data.delay).toEqual(5000);
expect(pendingTask.source).toEqual('setTimeout');
expect(element(by.css('.status')).getText()).not.toContain('done');
done();
});
});