Skip to content

Latest commit

Β 

History

History
307 lines (242 loc) Β· 7.96 KB

File metadata and controls

307 lines (242 loc) Β· 7.96 KB

Playwright Testing Project Overview

Angular .NET Tutorial - E2E & API Testing


🎯 Project Goals

Implement comprehensive automated testing for the AngularNetTutorial full-stack application using Playwright, covering:

  1. End-to-End Testing - Complete user workflows through the browser
  2. API Integration Testing - Direct API endpoint validation
  3. Authentication Testing - OIDC/OAuth 2.0 flows
  4. Role-Based Access Control - Permission testing for all roles
  5. Cross-Browser Testing - Chrome, Firefox, Safari compatibility

πŸ“Š Application Under Test

Architecture: CAT Pattern (Client, API Resource, Token Service)

Frontend

  • Technology: Angular 20 + Material Design
  • Location: C:\apps\AngularNetTutotial\Clients\TalentManagement-Angular-Material
  • URL: http://localhost:4200

Backend API

  • Technology: .NET 10 Web API (Clean Architecture)
  • Location: C:\apps\AngularNetTutotial\ApiResources\TalentManagement-API
  • URL: https://localhost:44378

Identity Server

  • Technology: Duende IdentityServer 7.0
  • Location: C:\apps\AngularNetTutotial\TokenService\Duende-IdentityServer
  • URL: https://sts.skoruba.local

πŸ‘₯ User Roles

Employee

  • Permissions: Read-only access
  • Can: View employees, departments, positions, salary ranges
  • Cannot: Create, edit, or delete records

Manager

  • Permissions: Create and manage employees/departments
  • Can: All Employee permissions + create/edit employees and departments
  • Cannot: Access positions or salary ranges

HRAdmin

  • Permissions: Full administrative access
  • Can: All Manager permissions + manage positions and salary ranges
  • Cannot: Nothing (full access)

Test Credentials

{
  "employee": {
    "username": "employee1",
    "password": "Pa$$word123"
  },
  "manager": {
    "username": "ashtyn1",
    "password": "Pa$$word123"
  },
  "hradmin": {
    "username": "admin1",
    "password": "Pa$$word123"
  }
}

πŸ§ͺ Testing Strategy

Test Pyramid

       E2E Tests (10%)
      ─────────────────
     Integration (30%)
    ─────────────────────
      Unit Tests (60%)

Coverage Areas

1. Authentication & Authorization (15 tests)

  • OIDC login flow
  • Token management
  • Role-based access control
  • Session handling

2. Employee Management (25 tests)

  • List, create, edit, delete
  • Search and filtering
  • Pagination
  • Form validation

3. Department Management (15 tests)

  • Full CRUD operations
  • Validation
  • Relationships

4. Position Management (12 tests)

  • HRAdmin-only access
  • CRUD operations
  • Authorization tests

5. Salary Ranges (12 tests)

  • HRAdmin-only access
  • Min/max validation
  • Relationships

6. Dashboard (8 tests)

  • Metrics display
  • Charts
  • Navigation

7. API Integration (20 tests)

  • Direct API calls
  • Authentication
  • Error handling
  • Performance

8. Workflows (10 tests)

  • Multi-step scenarios
  • Real-world usage patterns

9. Error Handling (15 tests)

  • Network errors
  • Validation errors
  • Edge cases

10. Visual & Accessibility (10 tests)

  • Visual regression
  • Keyboard navigation
  • ARIA compliance
  • Responsive design

Total: ~142 tests planned


πŸ“ Project Structure

C:\apps\playwright\
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ PROJECT_OVERVIEW.md          # This file
β”‚   β”œβ”€β”€ IMPLEMENTATION_PLAN.md       # Detailed task breakdown
β”‚   └── QUICK_START.md               # Getting started guide
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ auth/                        # Authentication tests
β”‚   β”œβ”€β”€ employee-management/         # Employee CRUD tests
β”‚   β”œβ”€β”€ department-management/       # Department tests
β”‚   β”œβ”€β”€ position-management/         # Position tests
β”‚   β”œβ”€β”€ salary-ranges/               # Salary range tests
β”‚   β”œβ”€β”€ dashboard/                   # Dashboard tests
β”‚   β”œβ”€β”€ api/                         # API integration tests
β”‚   β”œβ”€β”€ workflows/                   # End-to-end workflows
β”‚   β”œβ”€β”€ error-handling/              # Error scenarios
β”‚   β”œβ”€β”€ visual/                      # Visual regression
β”‚   └── accessibility/               # Accessibility tests
β”‚
β”œβ”€β”€ fixtures/
β”‚   β”œβ”€β”€ auth.fixtures.ts             # Login helpers
β”‚   β”œβ”€β”€ data.fixtures.ts             # Test data factories
β”‚   β”œβ”€β”€ api.fixtures.ts              # API helpers
β”‚   └── user-roles.fixtures.ts       # Role management
β”‚
β”œβ”€β”€ page-objects/
β”‚   β”œβ”€β”€ auth/                        # Login pages
β”‚   β”œβ”€β”€ dashboard.page.ts            # Dashboard POM
β”‚   β”œβ”€β”€ employee-list.page.ts        # Employee list POM
β”‚   β”œβ”€β”€ employee-form.page.ts        # Employee form POM
β”‚   └── navigation.page.ts           # Navigation POM
β”‚
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ token-manager.ts             # JWT utilities
β”‚   β”œβ”€β”€ test-data-generator.ts       # Data generation
β”‚   └── api-helpers.ts               # API utilities
β”‚
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ test-users.json              # Test accounts
β”‚   └── environments.json            # Environment URLs
β”‚
β”œβ”€β”€ playwright.config.ts             # Playwright configuration
β”œβ”€β”€ package.json                     # Dependencies
└── README.md                        # Setup instructions

πŸš€ Implementation Timeline

Phase 1: Foundation (Weeks 1-2)

  • Project setup
  • Directory structure
  • Authentication fixtures
  • Critical path tests
  • CI/CD integration

Phase 2: Core Features (Weeks 3-4)

  • Employee management tests
  • Department management tests
  • API integration tests
  • Page Object Models

Phase 3: Advanced Features (Weeks 5-6)

  • Position & salary range tests
  • Dashboard tests
  • Role-based access tests
  • End-to-end workflows

Phase 4: Polish & Edge Cases (Weeks 7-8)

  • Error handling
  • Performance tests
  • Visual regression
  • Accessibility tests
  • Cross-browser validation

Total Duration: 8 weeks


πŸ“ˆ Success Metrics

Coverage

  • βœ… 100% of critical user paths tested
  • βœ… All CRUD operations verified
  • βœ… All 3 roles tested
  • βœ… Authentication flows covered
  • βœ… API endpoints validated

Quality

  • βœ… Test execution time < 10 minutes
  • βœ… Flaky test rate < 5%
  • βœ… Pass rate > 95% on main branch
  • βœ… Zero P0 bugs in production

Process

  • βœ… Tests run on every PR
  • βœ… Automated test reports
  • βœ… Test coverage visible
  • βœ… Fast feedback loop

πŸ› οΈ Technology Stack

Testing Framework

  • Playwright 1.58.2 - E2E testing
  • TypeScript - Type safety
  • Node.js - Runtime

Reporting

  • HTML Reporter (built-in)
  • JUnit Reporter (CI/CD)
  • JSON Reporter (custom parsing)

CI/CD

  • GitHub Actions (or Azure DevOps)
  • Automated test execution
  • Artifact storage

πŸ“š Key Documentation

For Developers

For QA Engineers

For DevOps


πŸ”— Related Links


πŸ“ž Contact & Support

Project Owner: [Your Name] QA Lead: [QA Lead Name] Questions: [Contact Email/Slack]


Last Updated: [Current Date] Version: 1.0