{"id":28713812,"url":"https://github.com/abra1193/playwright-csharp-nunit-framework","last_synced_at":"2025-06-15T00:37:51.845Z","repository":{"id":298673057,"uuid":"999813617","full_name":"abra1193/playwright-csharp-nunit-framework","owner":"abra1193","description":"A sample framework created with CSharp on Playwright with Nunit","archived":false,"fork":false,"pushed_at":"2025-06-12T08:22:07.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-12T09:27:11.094Z","etag":null,"topics":["allure","allure-report","csharp","nunit","nunit-tests","playwright","playwright-csharp"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abra1193.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-10T20:34:36.000Z","updated_at":"2025-06-12T08:22:11.000Z","dependencies_parsed_at":"2025-06-12T09:28:07.806Z","dependency_job_id":"39ae4663-83ec-4fab-98f5-f7f881ae3e21","html_url":"https://github.com/abra1193/playwright-csharp-nunit-framework","commit_stats":null,"previous_names":["abra1193/playwright-csharp-nunit-framework"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abra1193/playwright-csharp-nunit-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abra1193%2Fplaywright-csharp-nunit-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abra1193%2Fplaywright-csharp-nunit-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abra1193%2Fplaywright-csharp-nunit-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abra1193%2Fplaywright-csharp-nunit-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abra1193","download_url":"https://codeload.github.com/abra1193/playwright-csharp-nunit-framework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abra1193%2Fplaywright-csharp-nunit-framework/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259905447,"owners_count":22929924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allure","allure-report","csharp","nunit","nunit-tests","playwright","playwright-csharp"],"created_at":"2025-06-15T00:37:46.943Z","updated_at":"2025-06-15T00:37:51.837Z","avatar_url":"https://github.com/abra1193.png","language":"C#","readme":"# Playwright - Csharp - NUnit Framework\n[![Pipeline workflow](https://github.com/abra1193/playwright-csharp-nunit-framework/actions/workflows/dotnet.yml/badge.svg)](https://github.com/abra1193/playwright-csharp-nunit-framework/actions/workflows/dotnet.yml)\n\nThis repository contains a QA automation framework for web pages and API endpoints. The framework is organized for both UI and API automated testing using .NET, NUnit, and Playwright.\n\n---\n\n## Project Structure\n\n```\nqa-automation-exercise--mejiabritoabraham-1.sln         # Solution file\nqa-automation-exercise--mejiabritoabraham.csproj        # Project file\nREADME.md                                               # Project documentation\n\n.github/\n  workflows/\n    dotnet.yml                                          # GitHub Actions CI workflow\n\nBase/\n  API/                                                  # Base classes/utilities for API tests\n  UI/                                                   # Base classes/utilities for UI tests\n\nFramework/\n  API/                                                  # API framework (helpers, clients, etc.)\n  UI/                                                   # UI framework (pages, components, etc.)\n\nShared/\n  Constants.cs                                          # Shared constants\n  Randomizer.cs                                         # Shared randomization utilities\n\nTests/\n  API/                                                  # API test cases\n  UI/                                                   # UI test cases\n\nbin/, obj/                                              # Build output and intermediate files\n```\n---\n## Getting Started\n\n### Prerequisites\n\n- [.NET 6 SDK](https://dotnet.microsoft.com/download)\n- [Node.js](https://nodejs.org/) (for Playwright installation)\n- Chrome/Edge/Firefox browsers (Playwright will install them automatically)\n\n### Setup\n\n1. **Restore dependencies:**\n   ```sh\n   dotnet restore\n   ```\n\n2. **Install Playwright browsers:**\n   ```sh\n   npx playwright install\n   ```\n\n---\n\n## Tests\n\n### Test Organization\n\n- **UI Tests:**  \n  Located in `Tests/UI/`. These tests use Playwright to automate browser interactions and validate the product page’s UI and analytics events.\n\n  **UI Test Classes \u0026 Methods:**\n\n    - `ProductPageTests`\n        - `ShouldLoadPageMenu`  \n          *Verifies that the page menu loads and displays correctly.*\n        - `ShouldLoadPageTitle`  \n          *Checks that the page title is present and correct.*\n        - `ShouldDisplayNewsletterSubConfirmationMessage`  \n          *Ensures the newsletter subscription confirmation message appears after subscribing.*\n        - `ShouldContainAmazonLinksOnTagParameter`  \n          *Checks that Amazon links include the required `tag` query parameter.*\n        - `ShouldTriggerGoogleAnalyticsEvents`  \n          *Validates that Google Analytics events are triggered as expected (e.g., page view, promotion view, promotion select).*\n        - `ShouldContainPromotionIdOnTagParameter`  \n          *Ensures that the promotion ID is included in the `tag` parameter of Amazon links.*\n\n- **API Tests:**  \n  Located in `Tests/API/`. These tests validate the product management API endpoints, including product creation, retrieval, and partner access control.\n\n  **API Test Classes \u0026 Methods:**\n\n    - `ProductApiTests`\n        - `ShouldCreateProduct`  \n          *Verifies that a product can be created successfully with valid data.*\n        - `ShouldRetrieveProduct`  \n          *Checks that a created product can be retrieved and its data is correct.*\n        - `ShouldNotAccessOtherPartnerProducts`  \n          *Ensures that a partner cannot access products belonging to another partner.*\n        - `ShouldReturnsBadRequestOnInvalidProductId`  \n          *Checks that the API returns a bad request response when the product ID is invalid.*\n        - `ShouldCreateProductWithoutDescription`  \n          *Verifies that a product can be created without providing a description.*\n        - `ShouldReturnUnauthorizedWhenPartnerHeaderIsMissing`  \n          *Ensures the API returns an unauthorized response if the `X-Partner-ID` header is missing.*\n\n### Running Tests\n\n- **All tests:**\n  ```sh\n  dotnet test\n  ```\n\n- **UI tests only:**\n  ```sh\n  dotnet test --filter Category=UI\n  ```\n\n- **API tests only:**\n  ```sh\n  dotnet test --filter Category=API\n  ```\n\n### Test Results\n\n- Test results are displayed in the terminal after execution.\n- For more detailed output or to generate test reports, you can use:\n  ```sh\n  dotnet test --logger \"console;verbosity=detailed\"\n  ```\n- In CI, results are available in the GitHub Actions workflow summary.\n\n---\n\n### Allure Reports\n\nAllure is used to generate rich, interactive test reports.\n\n#### How to Configure Allure\n\n1. **Install Allure CLI**  \n   You can install Allure globally using Homebrew (recommended for Mac):\n   ```sh\n   brew install allure\n   ```\n   Or download from [Allure Releases](https://github.com/allure-framework/allure2/releases).\n\n2. **Add Allure NUnit Adapter**  \n   Add the Allure adapter NuGet package to your project:\n   ```sh\n   dotnet add package Allure.NUnit\n   ```\n\n3. **Run Tests with Allure Output**  \n   Run your tests with the Allure logger:\n   ```sh\n   dotnet test --logger:\"allure\"\n   ```\n   This will generate results in the `allure-results` directory.\n\n4. **Generate and View the Report Locally**\n   ```sh\n   allure generate allure-results --clean -o allure-report\n   allure open allure-report\n   ```\n   This will open the Allure report in your browser.\n\n#### Allure Reports in CI\n\n- Allure results are collected as artifacts in the CI pipeline (see `.github/workflows/dotnet.yml`).\n- After each CI run, you can download the Allure report artifacts from the GitHub Actions summary page.\n- To view the report locally:\n    1. Download the `allure-results` artifact from the workflow run.\n    2. Extract it and run:\n       ```sh\n       allure generate allure-results --clean -o allure-report\n       allure open allure-report\n       ```\n\n---\n\n## Continuous Integration\n\nGitHub Actions is configured via [.github/workflows/dotnet.yml](.github/workflows/dotnet.yml) to run tests on push and pull requests.\n\n---\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Open a pull request\n\n---\n\n## License\n\nThis project is for educational and evaluation purposes only.\n\n---\n\n## Authors\n\n- Abraham Mejía Brito\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabra1193%2Fplaywright-csharp-nunit-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabra1193%2Fplaywright-csharp-nunit-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabra1193%2Fplaywright-csharp-nunit-framework/lists"}