本文整理匯總了TypeScript中puppeteer.Page.type方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Page.type方法的具體用法?TypeScript Page.type怎麽用?TypeScript Page.type使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類puppeteer.Page
的用法示例。
在下文中一共展示了Page.type方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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');
};
示例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: it
it('changes password of jmattheis', async () => {
await page.click($table.cell(3, Col.EditDelete, '.edit'));
await page.waitForSelector($dialog.selector());
await page.type($dialog.input('.password'), 'unicorn');
await page.click($dialog.button('.save-create'));
await waitToDisappear(page, $dialog.selector());
});
示例5: async
return async () => {
await page.click('#create-client');
await page.waitForSelector($dialog.selector());
await page.type($dialog.input('.name'), name);
await page.click($dialog.button('.create'));
};