当前位置: 首页>>代码示例>>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;未经允许,请勿转载。