本文整理匯總了TypeScript中puppeteer.Page.waitForSelector方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Page.waitForSelector方法的具體用法?TypeScript Page.waitForSelector怎麽用?TypeScript Page.waitForSelector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類puppeteer.Page
的用法示例。
在下文中一共展示了Page.waitForSelector方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: async
return async () => {
await page.click('#create-app');
await page.waitForSelector($dialog.selector());
await page.type($dialog.input('.name'), name);
await page.type($dialog.textarea('.description'), description);
await page.click($dialog.button('.create'));
};
示例2: it
it('changes password of current user', async () => {
const $changepw = selector.form('#changepw-dialog');
await page.click('#changepw');
await page.waitForSelector($changepw.selector());
await page.type($changepw.input('.newpass'), 'changed');
await page.click($changepw.button('.change'));
});
示例3: it
it('deletes own client', async () => {
await page.click($table.cell(1, Col.Delete, '.delete'));
// confirm delete
await page.waitForSelector(selector.$confirmDialog.selector());
await page.click(selector.$confirmDialog.button('.confirm'));
});
示例4: inDetailPage
await inDetailPage(1, async () => {
expect(
await (await (await page.$('.config-save'))!.getProperty(
'disabled'
)).jsonValue()
).toBe(true);
await page.waitForSelector('.CodeMirror .CodeMirror-code > div');
await page.waitForFunction(
'document.querySelector(".CodeMirror .CodeMirror-code > div").innerText.toLowerCase().indexOf("loading")<0'
);
expect(await innerText(page, '.CodeMirror .CodeMirror-code > div')).toMatch(
/x$/
);
});
示例5: async
const inDetailPage = async (id: number, callback: (() => Promise<void>)) => {
const name = await innerText(page, $table.cell(id, Col.Name));
await page.click($table.cell(id, Col.Details));
await waitForExists(page, '.plugin-info .name > span', name);
await callback();
await page.click('#navigate-plugins');
await waitForExists(page, selector.heading(), 'Plugins');
await page.waitForSelector($table.selector());
};
示例6: async
return async () => {
await page.click('#create-user');
await page.waitForSelector($dialog.selector());
await page.type($dialog.input('.name'), name);
await page.type($dialog.input('.password'), password);
if (isAdmin) {
await page.click($dialog.input('.admin-rights'));
}
await page.click($dialog.button('.save-create'));
await waitToDisappear(page, $dialog.selector());
};