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


TypeScript Page.click方法代碼示例

本文整理匯總了TypeScript中puppeteer.Page.click方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Page.click方法的具體用法?TypeScript Page.click怎麽用?TypeScript Page.click使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在puppeteer.Page的用法示例。


在下文中一共展示了Page.click方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: async

const hasReceivedMessage = async (title: RegExp, content: RegExp) => {
    await page.click('#message-navigation a');
    await waitForExists(page, selector.heading(), 'All Messages');

    expect(await innerText(page, '.title')).toMatch(title);
    expect(await innerText(page, '.content')).toMatch(content);

    await page.click('#navigate-plugins');
    await waitForExists(page, selector.heading(), 'Plugins');
};
開發者ID:bradparks,項目名稱:server,代碼行數:10,代碼來源:plugin.test.ts

示例2: it

        it('makes dude admin', async () => {
            await page.click($table.cell(4, Col.EditDelete, '.edit'));

            await page.waitForSelector($dialog.selector());

            await page.click($dialog.input('.admin-rights'));
            await page.click($dialog.button('.save-create'));
            await waitToDisappear(page, $dialog.selector());

            await waitForExists(page, $table.cell(4, Col.Admin), 'Yes');
        });
開發者ID:bradparks,項目名稱:server,代碼行數:11,代碼來源:user.test.ts

示例3: 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

示例4: async

 return async () => {
     await page.click($table.cell(id, Col.EditUpdate, '.edit'));
     await page.waitForSelector($dialog.selector());
     if (data.name) {
         const nameSelector = $dialog.input('.name');
         await clearField(page, nameSelector);
         await page.type(nameSelector, data.name);
     }
     if (data.description) {
         const descSelector = $dialog.textarea('.description');
         await clearField(page, descSelector);
         await page.type(descSelector, data.description);
     }
     await page.click($dialog.button('.update'));
     await waitToDisappear(page, $dialog.selector());
 };
開發者ID:bradparks,項目名稱:server,代碼行數:16,代碼來源:application.test.ts

示例5: it

 it('deletes all backup messages and navigates to all messages', async () => {
     await navigate('Backup');
     await page.click('#delete-all');
     await navigate('All Messages');
     await createMessage(backup3, backupServerToken);
     await waitForExists(page, '.message .title', backup3.title);
     expect(await extractMessages(1)).toEqual([backup3]);
 });
開發者ID:bradparks,項目名稱:server,代碼行數:8,代碼來源:message.test.ts

示例6: inDetailPage

 await inDetailPage(1, async () => {
     expect(
         await (await (await page.$('.config-save'))!.getProperty(
             'disabled'
         )).jsonValue()
     ).toBe(true);
     await page.waitForSelector('.CodeMirror .CodeMirror-code');
     await page.waitForFunction(
         'document.querySelector(".CodeMirror .CodeMirror-code").innerText.toLowerCase().indexOf("loading")<0'
     );
     await page.click('.CodeMirror .CodeMirror-code > div');
     await page.keyboard.press('x');
     await page.waitForFunction(
         'document.querySelector(".config-save") && !document.querySelector(".config-save").disabled'
     );
     await page.click('.config-save');
     await page.waitForFunction('document.querySelector(".config-save").disabled');
 });
開發者ID:bradparks,項目名稱:server,代碼行數:18,代碼來源:plugin.test.ts

示例7: async

export const login = async (page: Page, user = 'admin', pass = 'admin'): Promise<void> => {
    await waitForExists(page, selector.heading(), 'Login');
    expect(page.url()).toContain('/login');
    await page.type($loginForm.input('.name'), user);
    await page.type($loginForm.input('.password'), pass);
    await page.click($loginForm.button('.login'));
    await waitForExists(page, selector.heading(), 'All Messages');
    await waitForExists(page, 'button', 'logout');
};
開發者ID:bradparks,項目名稱:server,代碼行數:9,代碼來源:authentication.ts


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