本文整理匯總了TypeScript中testcafe.ClientFunction函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript ClientFunction函數的具體用法?TypeScript ClientFunction怎麽用?TypeScript ClientFunction使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ClientFunction函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('Showing and hiding with buttons and window history', async t => {
const goBack = ClientFunction(() => window.history.back());
const goForward = ClientFunction(() => window.history.forward());
// Ensures that the page loads before we start messing with history. Otherwise
// Edge will click "back" right off of the page.
await map.root();
await t.click(Selector('a.btn'));
await t.expect(map.leafletMap.exists).ok();
await goBack();
await t.expect(map.leafletMap.exists).notOk();
await goForward();
await t.expect(map.leafletMap.exists).ok();
await t.click(map.modalCloseButton);
await t.expect(map.leafletMap.exists).notOk();
// Regression to ensure that the close button clears out the hash, otherwise
// pressing the button won't cause a hashchange event.
await t.click(Selector('a.btn'));
await t.expect(map.leafletMap.exists).ok();
});
示例2: test
test('Error in code', async() => {
var fn = ClientFunction(() => {
throw new Error('Hey ya!');
});
await fn();
});