login-flows
This skill provides battle-tested login automation patterns designed for Playwright end-to-end tests. Access curated code examples and authentication strategies that reduce hallucination and improve test reliability across sessions. Contribute and benefit from community-maintained patterns that evolve with real-world testing needs.
login-flows provides battle-tested code patterns for automating login flows in Playwright end-to-end tests. The skill focuses on reusable authentication strategies that reduce hallucination and improve test reliability across sessions. You'll find curated examples covering standard username/password flows, OAuth and SSO integrations, multi-factor authentication handling, and techniques for persisting browser state to avoid repeated login steps in your test suites.
AI-generated summary based on this skill's SKILL.md
Install
andrewyng/context-hub/login-flows · repository language: JavaScript
git clone https://github.com/andrewyng/context-hub
cp -r context-hub/content/playwright-community/skills/login-flows ~/.claude/skills/login-flowsFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What are the main playwright login automation patterns this skill covers?
login-flows provides battle-tested code patterns for automating login flows in Playwright end-to-end tests. The skill focuses on reusable authentication strategies that reduce hallucination and improve test reliability across sessions. You'll find curated examples covering standard username/password flows, OAuth and SSO integrations, multi-factor authentication handling, and techniques for persisting browser state to avoid repeated login steps in your test suites.
How to automate login in playwright tests using this skill's patterns?
login-flows offers community-maintained patterns that show you how to automate login in playwright tests through multiple approaches. The skill includes examples for direct credential-based login, OAuth redirect handling, and SSO flows. You can also learn how to configure global setup and storageState in Playwright to persist authentication state between test runs, which speeds up your test suites by eliminating redundant login steps for each test.
Can login-flows help with OAuth, SSO, and multi-factor authentication in test automation?
Yes, login-flows is specifically designed to help you learn how to handle OAuth, SSO, and multi-factor authentication in test automation. The skill provides best practices for managing these complex authentication flows, including examples for automating Google sign-in, handling OAuth redirects, and implementing TOTP/2FA code generation within your Playwright tests. These patterns help you test login without repeating authentication across your entire test suite.
What's the best way to speed up test suites by persisting and reusing browser authentication state?
login-flows teaches you how to speed up test suites by persisting and reusing browser authentication state through Playwright's storageState feature and global setup configuration. Rather than logging in for every test, you can authenticate once in a setup phase, save the browser state, and reuse it across multiple tests. This approach dramatically reduces test execution time while maintaining security best practices for managing test credentials and avoiding repeated login steps.
How does login-flows help with managing test credentials and avoiding repeated login steps?
login-flows provides best practices for managing test credentials and avoiding repeated login steps in your Playwright test suites. The skill covers secure credential handling patterns, configuration of global setup workflows, and techniques for storing and retrieving authentication state. By implementing these reusable login patterns from login-flows, you can design end-to-end testing workflows that authenticate once and share that state across all tests, significantly improving both speed and maintainability.
What does login-flows teach about configuring global setup and storageState in Playwright?
login-flows explains how to understand and configure global setup and storageState in Playwright to create persistent login state for your test automation. The skill provides code examples showing how to set up a global authentication phase that runs once before your test suite, capture the resulting browser state, and inject that state into subsequent tests. This configuration pattern is central to reusable login patterns in e2e testing and eliminates the need to automate web app login testing repeatedly for every single test case.
SKILL.md
rendered from the published skill — quoted content, verbatim
Login Flow Patterns for Playwright
Reusable patterns for automating login flows in end-to-end tests.
Basic Username/Password Login
import { Page } from '@playwright/test';
async function login(page: Page, username: string, password: string) {
await page.goto('/login');
await page.fill('[name="username"]', username);
await page.fill('[name="password"]', password);
await page.click('button[type="submit"]');
await page.waitForURL('/dashboard');
}
OAuth / SSO Login
For OAuth flows that redirect to an external provider:
```typescript async function loginWithOAuth(page: Page) { await page.goto('/login'); await page.click('text=Sign in with Google');
// Handle the OAuth popup or redirect await page.fill('input[type="email"]', process.env.TEST_EMAIL!); await page.click('text=Next'); await page.fill('input[type="password"]', process.env.TEST_PASSWORD!); await page.click('text=Next');
// Wait for redirect back to app
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
content/playwright-community/skills/login-flows/SKILL.md