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