A comprehensive test automation framework for the SnipeIT asset management demo application using .NET and Microsoft Playwright.
This project demonstrates end-to-end automation testing of the SnipeIT demo application, specifically focusing on asset creation, validation, and history tracking workflows. The framework follows industry best practices including the Page Object Model (POM) pattern, separation of concerns, and maintainable test architecture.
The automation script performs the following comprehensive workflow:
- Authentication: Login to the SnipeIT demo application
- Asset Creation: Create a new Macbook Pro 13" asset with "Ready to Deploy" status and assigned to a random user
- Asset Discovery: Search and locate the newly created asset in the assets list
- Detail Validation: Navigate to the asset page and verify all creation details
- History Verification: Validate asset history and assignment information
The project implements a clean Page Object Model architecture:
├── Pages/
│ ├── LoginPage.cs # Login functionality
│ ├── DashboardPage.cs # Main dashboard interactions
│ ├── CreateAssetPage.cs # Asset creation workflow
│ ├── AssetDashboard.cs # Asset search and navigation
│ ├── AssetPage.cs # Asset details and history validation
│ └── Sections/
│ └── Navbar.cs # Reusable navigation component
├── Models/
│ └── Asset.cs # Asset data model (implied)
└── Tests/
└── UnitTest1.cs # Main test execution
- Separation of Concerns: Each page class handles only its specific UI interactions
- Reusable Components: Common elements like navigation are abstracted into section classes
- Data Models: Asset information is encapsulated in dedicated model classes
- Wait Strategies: Proper synchronization using Playwright's wait mechanisms
- Error Handling: Comprehensive validation and assertion strategies
- .NET 6.0 or later
- Microsoft Playwright
- Visual Studio 2022 or Visual Studio Code
- Internet connection (for accessing the demo application)
git clone <repository-url>
cd Global360Testdotnet restore# Install Playwright CLI globally
dotnet tool install --global Microsoft.Playwright.CLI
# Install required browsers
playwright installdotnet build# Run all tests
dotnet test
# Run with detailed output
dotnet test --logger "console;verbosity=detailed"
# Run specific test
dotnet test --filter "Test1"- Visual Studio: Use Test Explorer to run individual or all tests
- VS Code: Install the .NET Test Explorer extension
UnitTest1.cs: Main test orchestration and workflow executionLoginPage.cs: Handles authentication processesCreateAssetPage.cs: Manages complex asset creation workflow including dropdown selectionsAssetDashboard.cs: Provides search and navigation capabilitiesAssetPage.cs: Validates asset details and history informationNavbar.cs: Reusable navigation component for dropdown interactions
- Asset Model: Encapsulates asset properties including tag, model, status, and assignment information
- Target Application: https://demo.snipeitapp.com
- Test Credentials: admin / password
- Asset Type: Macbook Pro 13"
- Default Status: Ready to Deploy
- User Assignment: Random selection from available users
The framework implements comprehensive validation at multiple levels:
- Asset tag generation and capture
- Model selection verification
- Status assignment confirmation
- User assignment validation
- Search functionality verification
- Asset presence in listings
- Navigation accuracy
- Asset tag consistency
- Model information accuracy
- Status display correctness
- User assignment details
- Fork the repository
- Create a feature branch (
git checkout -b feature/enhancement) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/enhancement) - Create a Pull Request
- Clean Code: Readable, maintainable code structure
- SOLID Principles: Single responsibility and dependency inversion
- Test Organization: Logical grouping and clear test flow
- Resource Management: Proper page and locator lifecycle management
- Synchronization: Appropriate wait strategies for reliable execution
This project is created for demonstration purposes as part of a coding assessment.