本文整理汇总了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());
};