A comprehensive test automation framework for web application testing using C#/.NET, NUnit, and Playwright🎭.
A comprehensive test automation framework for web application testing using C#/.NET, NUnit, and Playwright. This framework implements Page Object Model (POM) pattern and supports both UI and API testing.
- .NET 7.0 or higher
- Visual Studio 2022 or higher
- Allure Report Generator
- Clone the repository:
git clone <repository-url>- Install dependencies:
dotnet restore-
Install Allure CLI:
dotnet test --filter "Category=UI"dotnet test --filter "Category=API"allure serve Results/Allure###Project Structure:
AutomationFramework/
├── AutomationFramework.Tests/
│ ├── Pages/
│ │ ├── HomePage.cs
│ │ ├── LoginPage.cs
│ │ ├── SignupPage.cs
│ │ └── ProductsPage.cs
│ ├── Tests/
BaseTest.cs
│ │ ├── LoginTests.cs
│ │ └── SignupTests.cs
│ ├── ApiTests/
│ │ ├── ApiTestBase.cs
│ │ └── ProductApiTests.cs
│ ├── Configuration/
│ │ └── TestConfig.cs
│ ├── appsettings.json
│ └── AutomationFramework.Tests.csproj
│ ├── utils/
│ └── TestDataGenerator.cs
├── run-tests.ps1
└── README.mdPage Object Model (POM):
- Created page classes for all required pages
- Each page class contains its own elements and methods
- BasePage class provides common functionality
Test Cases:
-
UI Tests:
- Login functionality tests
- Signup functionality tests
-
API Tests:
- Product list API tests
- Product category API tests
- Product search API tests
Configuration:
- Test settings in appsettings.json
- TestConfig class for configuration management
- Browser settings, timeouts, and credentials
Reporting:
- Allure report integration
- Test results stored in Results/Allure directory
Best Practices:
- Clean architecture with separation of concerns
- Parallel test execution support
- Proper error handling and assertions
- Configuration-driven testing
- Code coverage collection
To run the tests, you can use the PowerShell script:
.\run-tests.ps1- C#/.NET
- NUnit
- Playwright
- Allure Report
This project is licensed under the MIT License - see the LICENSE file for details.