Back to Library
UI

Robust Login with Assertions

Prompt

Generate a Playwright test that performs login with proper waits, handles loading states, avoids hard waits, and validates dashboard visibility using expect assertions.

Example Code

await page.goto('/login'); await page.fill('#username','admin'); await page.fill('#password','password'); await page.click('#login'); await page.waitForURL('**/dashboard'); await expect(page.locator('#dashboard')).toBeVisible();

Quick Actions

PRO TIP

Paste this prompt as a comment in your .spec.ts file and let Copilot generate the test.

Next Steps
Browse Prompts