當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Page.waitForSelector方法代碼示例

本文整理匯總了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'));
 };
開發者ID:bradparks,項目名稱:server,代碼行數:7,代碼來源:application.test.ts

示例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'));
 });
開發者ID:bradparks,項目名稱:server,代碼行數:7,代碼來源:user.test.ts

示例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'));
    });
開發者ID:bradparks,項目名稱:server,代碼行數:7,代碼來源:client.test.ts

示例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$/
     );
 });
開發者ID:bradparks,項目名稱:server,代碼行數:14,代碼來源:plugin.test.ts

示例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());
};
開發者ID:bradparks,項目名稱:server,代碼行數:11,代碼來源:plugin.test.ts

示例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());
 };
開發者ID:bradparks,項目名稱:server,代碼行數:11,代碼來源:user.test.ts


注:本文中的puppeteer.Page.waitForSelector方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。