Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6944789
Add GitHub Actions workflow for .NET Reqnroll tests
Oct 26, 2025
fbd9374
Add GitHub Actions workflow for .NET testing
srmiljus Oct 26, 2025
7c839f3
Modify Allure report upload configuration
srmiljus Oct 26, 2025
bfc3b46
Update GitHub Actions workflow to be triggered on push
srmiljus Oct 26, 2025
bc71f15
Refactor GitHub Actions workflow for report generation
srmiljus Oct 26, 2025
ddd87ec
Add Allure report generation and upload report generation
srmiljus Oct 26, 2025
4c80ca4
Update GitHub Actions workflow for Allure reports
srmiljus Oct 26, 2025
c7e3ba0
Update GitHub Actions workflow for .NET and Allure
srmiljus Oct 26, 2025
dc3a71d
Refactor comments and remove Allure logger installation
srmiljus Oct 26, 2025
c871021
Refactor GitHub Actions workflow for Allure reports
srmiljus Oct 26, 2025
bd11e57
Add README with project overview and setup instructions
srmiljus Oct 26, 2025
f0dc1eb
Revise README for clarity and structure
srmiljus Oct 26, 2025
c62fc2d
Delete README.md
srmiljus Oct 26, 2025
204bb00
added Readme.md file
Oct 26, 2025
80126c5
Merge branch 'master' of https://github.com/srmiljus/Csharp_Automatio…
Oct 26, 2025
98cf659
Update test categorization in README
srmiljus Oct 26, 2025
0014c83
Remove emoji from README title
srmiljus Oct 26, 2025
d846acb
Refactor: remove unused models and redundant code
Oct 26, 2025
3ec277c
Merge branch 'master' of https://github.com/srmiljus/Csharp_Automatio…
Oct 26, 2025
42adec9
added #region for locators and actions
Oct 26, 2025
5077974
Correct author title in README.md
srmiljus Oct 27, 2025
e26eb6c
refactoring
Feb 9, 2026
a16987b
Merge branch 'master' of https://github.com/srmiljus/Csharp_Automatio…
Feb 9, 2026
0aebbdc
refactoring
Feb 9, 2026
96552a6
Merge branch 'empty-branch' into master
srmiljus Feb 9, 2026
c91312e
yaml changed to new allure report
Feb 9, 2026
f0eceb4
Merge branch 'master' of https://github.com/srmiljus/Csharp_Automatio…
Feb 9, 2026
59cb51a
changed yaml
Feb 9, 2026
4e15647
commented parallism
Feb 9, 2026
6cf8a25
fixed failed tests
Feb 9, 2026
10de783
title changed
Feb 9, 2026
519a107
changed title
Feb 9, 2026
3fe6085
fixed copy test
Feb 10, 2026
c655da4
fixed title and time
Feb 10, 2026
6325247
updated yaml
Feb 10, 2026
d8e47d2
added jenkins, docker, selenium grid
Feb 17, 2026
369f9c8
yaml updated to slnx
Feb 17, 2026
9619bb8
yaml fix
Feb 17, 2026
2abea72
added new sln
Feb 17, 2026
2f8b0cb
refactoring
Mar 13, 2026
ae0284b
added more js actions
Mar 13, 2026
e37d47c
added more info for allure reports
Mar 29, 2026
576ea5b
Merge pull request #3 from srmiljus/test-branch
srmiljus Mar 29, 2026
6da3e73
Update author title from Senior QA Automation Architect
srmiljus Jun 11, 2026
0462fff
Revise README title and project description
srmiljus Jun 11, 2026
f712dd8
Fix project structure and solution file name
srmiljus Jun 11, 2026
55c91eb
Rename solution file to Csharp_Automation.sln
srmiljus Jun 11, 2026
2fae6c0
Rename Csharp_Automation_Task.slnx to Csharp_Automation.slnx
srmiljus Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: .NET Reqnroll Automation Tests

on:
push:
branches: [ "master" ]
workflow_dispatch:
inputs:
test_type:
description: "Select which tests to run"
required: true
default: "All"
type: choice
options: [ "UI", "API", "All" ]
browser:
description: "Select browser"
required: true
default: "Chrome"
type: choice
options: [ "Chrome", "Edge", "Both" ]

jobs:
build-and-test:
runs-on: windows-latest

env:
DOTNET_VERSION: "8.0.x"
# Defaults for push (because push has no inputs)
TEST_TYPE: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.test_type || 'All' }}
BROWSER: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.browser || 'Chrome' }}
HEADLESS: "true"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: dotnet --info
run: dotnet --info

- name: Restore
run: dotnet restore

- name: Build (Release)
run: dotnet build --configuration Release --no-restore

- name: Run tests (Release)
shell: pwsh
run: |
Write-Host "Running tests for: $env:TEST_TYPE"
Write-Host "Browser: $env:BROWSER"

# If your framework reads browser from ENV, this will work.
# If not, you can later map this to -- TestRunParameters or appsettings.
$env:BROWSER = "$env:BROWSER"

if ($env:TEST_TYPE -eq "UI") {
dotnet test .\UI_Automation\UI_Automation.csproj --configuration Release --no-build `
--logger "trx;LogFileName=ui-tests.trx"
}
elseif ($env:TEST_TYPE -eq "API") {
dotnet test .\API_Automation\API_Automation.csproj --configuration Release --no-build `
--logger "trx;LogFileName=api-tests.trx"
}
else {
dotnet test --configuration Release --no-build `
--logger "trx;LogFileName=all-tests.trx"
}

# Upload TRX files always (success or fail)
- name: Upload TRX test results
if: always()
uses: actions/upload-artifact@v4
with:
name: dotnet-trx-results
path: |
**/*.trx
if-no-files-found: warn

# Collect allure-results from anywhere into one folder
- name: Collect Allure results
if: always()
shell: pwsh
run: |
Write-Host "Collecting allure-results..."
if (Test-Path "allure-results") { Remove-Item "allure-results" -Recurse -Force }
New-Item -ItemType Directory -Path "allure-results" | Out-Null

$dirs = Get-ChildItem -Path . -Recurse -Directory -Filter "allure-results" |
Where-Object { $_.FullName -notmatch "\\allure-results$" }

Write-Host "Found allure-results dirs:"
$dirs | ForEach-Object { Write-Host $_.FullName }

foreach ($d in $dirs) {
Copy-Item -Path (Join-Path $d.FullName "*") -Destination "allure-results" -Recurse -Force -ErrorAction SilentlyContinue
}

if ((Get-ChildItem "allure-results" -ErrorAction SilentlyContinue | Measure-Object).Count -gt 0) {
"HAS_ALLURE_RESULTS=true" | Out-File -FilePath $env:GITHUB_ENV -Append
Write-Host "HAS_ALLURE_RESULTS=true"
} else {
"HAS_ALLURE_RESULTS=false" | Out-File -FilePath $env:GITHUB_ENV -Append
Write-Host "HAS_ALLURE_RESULTS=false"
}

# Generate Allure HTML report (no Docker) using Node + allure-commandline
- name: Setup Node
if: always()
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install Allure CLI
if: always()
run: npm i -g allure-commandline

- name: Download previous Allure history
if: always()
uses: dawidd6/action-download-artifact@v3
continue-on-error: true
with:
workflow: main.yml
name: allure-history
path: allure-results/history
if_no_artifact_found: warn


- name: Generate Allure HTML report
if: always()
shell: pwsh
run: |
if ($env:HAS_ALLURE_RESULTS -eq "true") {
if (Test-Path "allure-report") { Remove-Item "allure-report" -Recurse -Force }
allure generate allure-results -o allure-report --clean
Write-Host "Allure report generated."
}
else {
Write-Host "No allure-results found. Skipping report generation."
}

- name: Upload Allure HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-html-report
path: allure-report/**
if-no-files-found: warn

- name: Upload Allure results
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-results
path: allure-results/**
if-no-files-found: warn

- name: Save Allure history for next run
if: always()
uses: actions/upload-artifact@v4
with:
name: allure-history
path: allure-report/history
if-no-files-found: warn
131 changes: 115 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,125 @@
# Build folders
bin/
obj/
##################################
# .NET build artifacts
##################################
**/bin/
**/obj/
**/out/
artifacts/
publish/

# Allure outputs
allure-results/
allure-report/
##################################
# Test results
##################################
**/TestResults/
**/*.trx
**/*.coverage
**/*.coveragexml
coverage.opencover.xml
coverage.xml

##################################
# Allure
##################################
**/allure-results/
**/allure-report/
**/allure-history/

##################################
# Selenium / Playwright artifacts
##################################
**/Screenshots/
**/screenshots/
**/Videos/
**/videos/
**/Downloads/
**/downloads/
**/*.png
**/*.jpg
**/*.jpeg

##################################
# Logs
##################################
**/*.log
**/logs/

# Visual Studio
##################################
# Environment / secrets
##################################
**/.env
**/.env.*
**/appsettings.Local.json
**/appsettings.*.Local.json
**/secrets.json
**/appsettings.Secret.json

##################################
# IDE / OS
##################################
.vs/
.idea/
.vscode/
*.user
*.suo
*.cache
*.userprefs
*.rsuser
*.swp
.DS_Store
Thumbs.db

##################################
# NuGet
##################################
*.nupkg
.nuget/
packages/

# Test results
TestResult*/
*.trx
##################################
# Rider
##################################
.idea/
*.sln.iml

# OS junk
Thumbs.db
.DS_Store
##################################
# Resharper
##################################
_ReSharper*/
*.DotSettings.user

# Logs
##################################
# Node (ako koristiš npx / allure-commandline)
##################################
node_modules/
npm-debug.log*
yarn-error.log*
package-lock.json

##################################
# CI / temp
##################################
**/temp/
**/tmp/

##################################
# Misc build files
##################################
project.lock.json
project.fragment.lock.json
project.assets.json
*.log
*.tmp
*.vsix

##################################
# Coverage and profiling
##################################
*.coverage
*.coveragexml
coverage/

##################################
# Visual Studio Code workspace settings
##################################
.vscode/*
!.vscode/extensions.json

# End of file
21 changes: 12 additions & 9 deletions API_Automation/API_Automation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsTestProject>true</IsTestProject>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Allure.Net.Commons" Version="2.14.1" />
<PackageReference Include="Allure.Reqnroll" Version="2.14.1" />
<PackageReference Include="Bogus" Version="35.6.4" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="Reqnroll" Version="3.2.0" />
<PackageReference Include="Reqnroll.NUnit" Version="3.2.0" />
<PackageReference Include="Bogus" Version="35.6.5" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Reqnroll" Version="3.3.3" />
<PackageReference Include="Reqnroll.NUnit" Version="3.3.3" />
<PackageReference Include="Reqnroll.Tools.MSBuild.Generation" Version="3.3.3" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
<PackageReference Include="RestSharp" Version="112.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="RestSharp" Version="113.1.0" />
</ItemGroup>


Expand Down Expand Up @@ -50,7 +53,7 @@


<ItemGroup>
<Content Update="C:\Users\srmil\.nuget\packages\allure.net.commons\2.14.1\contentFiles\any\netstandard2.0\allureConfig.Template.json">
<Content Update="$(NuGetPackageRoot)allure.net.commons\2.14.1\contentFiles\any\netstandard2.0\allureConfig.Template.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions API_Automation/Client/RestApiClient.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Newtonsoft.Json;
using RestSharp;
using API_Automation.Constants;
using API_Automation.Constants;
using API_Automation.Helpers;
using API_Automation.Models.Response;
using API_Automation.Utils;
using Newtonsoft.Json;
using RestSharp;

namespace API_Automation.Client
{
Expand All @@ -13,19 +13,19 @@

public RestApiClient(string baseUrl)
{

var timeoutSeconds = ConfigReader.GetTimeout();

var options = new RestClientOptions(baseUrl)
{
ThrowOnAnyError = false,
MaxTimeout = timeoutSeconds * 1000 // Convert seconds to milliseconds
Timeout = TimeSpan.FromSeconds(timeoutSeconds)
};

_client = new RestClient(options);
}

// GET
public async Task<RestResponse> GetAsync(string endpoint, string token = null)

Check warning on line 28 in API_Automation/Client/RestApiClient.cs

View workflow job for this annotation

GitHub Actions / build-and-test

Cannot convert null literal to non-nullable reference type.
{
var request = new RestRequest(endpoint, Method.Get);

Expand Down
6 changes: 5 additions & 1 deletion API_Automation/Features/ReplaceABook.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
@api
@api @smoke
Feature: Replace a book via Bookstore API

As a registered user
I want to search for available books and manage my book list
So that I can replace a book in my collection with another one using the Bookstore API

Scenario: Verify that a user can replace a book
Given A user is created and authorized
When I get all books
Expand Down
Loading
Loading