This project demonstrates automated login tests using Playwright, with a structured approach using fixtures, Page Object Model (POM), and test data-driven testing.
- Node.js v18 or higher
- npm (comes with Node.js)
- Git (optional but useful)
Check versions:
node -v
npm -v- Clone the repository
git clone https://github.com/YOUR_USERNAME/playwright-login-test.git
cd playwright-login-test- Initialize the project
If package.json doesn’t exist yet:
npm init -y- Install Playwright
npm install -D @playwright/test
npx playwright install- (Optional) Add scripts to
package.json
"scripts": {
"test": "npx playwright test",
"test:ui": "npx playwright test --ui"
}Run all tests:
npx playwright testRun in interactive UI mode:
npx playwright test --uiRun specific test file:
npx playwright test tests/login.spec.ts- 🔁 Data-driven testing using arrays of test credentials
- 🔒 Login page automation with assertions for invalid credentials
- 🧱 Fixtures for reusable page objects
- 🧼 Clean project structure for scalability
Happy testing! 🧪✨