NUnitPlaywrightFramework is a test automation framework that leverages NUnit for test management and Playwright for browser automation. This framework is designed to facilitate the creation and execution of end-to-end tests for web applications.
- Parallel test execution using NUnit
- Browser automation with Playwright
- Configuration management using User Secrets
- Utility methods for common actions and string manipulations
- .NET 8 SDK
- Visual Studio 2022 or later
git clone https://github.com/chinmaymudholkar/NUnitPlaywrightFramework.git
cd NUnitPlaywrightFramework
pwsh .\NUnitPlaywrightFramework\bin\Debug\net8.0\playwright.ps1 --install-deps
Open the solution in Visual Studio, build the project to restore the NuGet packages, and compile the code.
You can run the tests using the Test Explorer in Visual Studio or by using the .NET CLI:
dotnet test
- NUnitPlaywrightFramework/Tests/Tests.cs: Contains the test cases for the application.
- NUnitPlaywrightFramework/Libs/Wrappers.cs: Contains utility methods for common actions and string manipulations.
- NUnitPlaywrightFramework/Libs/FrameworkActions.cs: Contains methods to perform actions on web elements.
- NUnitPlaywrightFramework/Libs/GetAttributes.cs: Contains methods to retrieve attributes and text content from web elements.
Verifies that the homepage title contains "Swag Labs".
Tests login functionality with various invalid credentials and verifies the error message.
Tests login functionality with valid credentials and verifies the successful login by checking the page heading.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or issues, please open an issue on GitHub or contact the repository owner.