Slide 11
Slide 11 text
Playwright のパスキーの自動テストコード例
test('パスキーを登録してログインできる', async ({ page, context }) => {
await context.credentials.install(); // 仮想認証器を有効化
await page.goto('https://*****.com/passkey/register');
await page.getByRole('button', { name: 'パスキーの作成をする' }).click();
await expect(page.getByRole('list', { name: 'パスキー一覧' }))
.toContainText('登録したパスキー名');
await page.getByRole('button', { name: 'ログアウト' }).click();
await page.goto('https://*****.com/login');
await page.getByRole('button', { name: 'パスキーでログイン' }).click();
await expect(page.getByRole('button', { name: 'ログアウト' }))
.toBeVisible();
});
© teamLab Inc.
11