Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
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
4 changes: 3 additions & 1 deletion .azuredevops/pipelines/acr-image-promote-dev-to-nft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ce0f49a28a90aa60ac579db350dbd18971b0d5ed
ref: b27ec9f8be6e667ee4073c8436dadb55b9fe99c7
endpoint: NHSDigital

variables:
Expand Down Expand Up @@ -92,3 +92,5 @@ stages:
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
parameters:
serviceConnection: sc-cohort-manager-nft
testProjectDirectory: 'tests/smoke-tests/NHS.CohortManager.SmokeTests'
testProjectName: 'NHS.CohortManager.SmokeTests'
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ce0f49a28a90aa60ac579db350dbd18971b0d5ed
ref: b27ec9f8be6e667ee4073c8436dadb55b9fe99c7
endpoint: NHSDigital

variables:
Expand Down Expand Up @@ -92,3 +92,5 @@ stages:
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
parameters:
serviceConnection: sc-cohort-manager-int
testProjectDirectory: 'tests/smoke-tests/NHS.CohortManager.SmokeTests'
testProjectName: 'NHS.CohortManager.SmokeTests'
4 changes: 3 additions & 1 deletion .azuredevops/pipelines/acr-image-promote-to-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ce0f49a28a90aa60ac579db350dbd18971b0d5ed
ref: b27ec9f8be6e667ee4073c8436dadb55b9fe99c7
endpoint: NHSDigital

variables:
Expand Down Expand Up @@ -67,3 +67,5 @@ stages:
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
parameters:
serviceConnection: sc-cohort-manager-dev
testProjectDirectory: 'tests/smoke-tests/NHS.CohortManager.SmokeTests'
testProjectName: 'NHS.CohortManager.SmokeTests'
9 changes: 6 additions & 3 deletions .azuredevops/pipelines/post-deployment-tests-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: 0a1ae809e2b5f41a1974c5490595e08f591fb8c7
ref: b27ec9f8be6e667ee4073c8436dadb55b9fe99c7
endpoint: NHSDigital

variables:
Expand All @@ -32,8 +32,8 @@ stages:
value: ${{ parameters.destEnvironmentShortName }}

jobs:
- job: post_deployment_tests
displayName: Run post-deployment tests
- job: post_deployment_tests_smoke
displayName: Run post-deployment smoke tests
pool:
name: private-pool-dev-uks
variables:
Expand All @@ -45,3 +45,6 @@ stages:
- template: .azuredevops/templates/steps/run-post-deployment-tests.yaml@dtos-devops-templates
parameters:
serviceConnection: sc-cohort-manager-dev
testProjectDirectory: 'tests/smoke-tests/NHS.CohortManager.SmokeTests'
testProjectName: 'NHS.CohortManager.SmokeTests'

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ application/CohortManager/.vscode/

# Ignore generated feature bindings
*.feature.cs
tests/smoke-tests/dtos-cohort-manager-smoke-tests/Config/appsettings-local.json
tests/smoke-tests/NHS.CohortManager.SmokeTests/Config/appsettings-local.json
tests/e2e-tests/NHS.CohortManager.EndToEndTests/Config/appsettings-local.json
*.crt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using dtos_cohort_manager_specflow.Config;
using NHS.CohortManager.SmokeTests.Config;
public class AzureSettings
{
public bool IsCloudEnvironment { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace dtos_cohort_manager_specflow.Config;
namespace NHS.CohortManager.SmokeTests.Config;

public class FilePaths
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CsvHelper;
using dtos_cohort_manager_specflow.Models;
using NHS.CohortManager.SmokeTests.Models;

namespace dtos_cohort_manager_specflow.Contexts;
namespace NHS.CohortManager.SmokeTests.Contexts;

public class SmokeTestsContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Azure.Storage.Blobs;
using Microsoft.Extensions.Logging;

namespace dtos_cohort_manager_specflow.Helpers;
namespace NHS.CohortManager.SmokeTests.Helpers;

public class BlobStorageHelper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using CsvHelper;
using CsvHelper.Configuration;

namespace dtos_cohort_manager_specflow.Helpers
namespace NHS.CohortManager.SmokeTests.Helpers
{
public static class CsvHelperService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.Data.SqlClient;
using System.Threading.Tasks;

namespace dtos_cohort_manager_specflow.Helpers;
namespace NHS.CohortManager.SmokeTests.Helpers;

public static class DatabaseHelper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Azure.Identity;
using Azure.Core;

namespace dtos_cohort_manager_specflow.Helpers;
namespace NHS.CohortManager.SmokeTests.Helpers;

public static class DatabaseValidationHelper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using ChoETL;

namespace dtos_cohort_manager_specflow.Helpers
namespace NHS.CohortManager.SmokeTests.Helpers
{
public static class ParquetHelperService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.Data.SqlClient;
using System.Threading.Tasks;

namespace dtos_cohort_manager_specflow.Helpers;
namespace NHS.CohortManager.SmokeTests.Helpers;

public class SqlConnectionWithAuthentication
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using dtos_cohort_manager_specflow.Config;
using dtos_cohort_manager_specflow.Helpers;
using NHS.CohortManager.SmokeTests.Config;
using NHS.CohortManager.SmokeTests.Helpers;
using Microsoft.Extensions.Options;
using FluentAssertions;
using TechTalk.SpecFlow;
using Reqnroll;

namespace dtos_cohort_manager_specflow.Hook
namespace NHS.CohortManager.SmokeTests.Hook
{
[Binding]
public class IntegrationTestHooks(ScenarioContext scenarioContext)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace dtos_cohort_manager_specflow.Models;
namespace NHS.CohortManager.SmokeTests.Models;

public class FieldsTable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace dtos_cohort_manager_specflow.Models;
namespace NHS.CohortManager.SmokeTests.Models;

public class NhsNumbers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace dtos_cohort_manager_specflow.Models;
namespace NHS.CohortManager.SmokeTests.Models;

public enum RecordTypesEnum
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace dtos_cohort_manager_specflow.Models;
namespace NHS.CohortManager.SmokeTests.Models;

public class TestRecords
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>dtos_cohort_manager_specflow</RootNamespace>
<RootNamespace>NHS.CohortManager.EndToEndTests</RootNamespace>
Comment thread
andrewmorris43 marked this conversation as resolved.
Outdated
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down Expand Up @@ -47,10 +47,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="SolidToken.SpecFlow.DependencyInjection" Version="3.9.3" />
<PackageReference Include="SpecFlow" Version="3.9.74" />
<PackageReference Include="SpecFlow.NUnit" Version="3.9.74" />
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.9.74" />
<PackageReference Include="Reqnroll" Version="2.4.0" />
<PackageReference Include="Reqnroll.Microsoft.Extensions.DependencyInjection" Version="2.4.0" />
<PackageReference Include="Reqnroll.NUnit" Version="2.4.0" />
<PackageReference Include="Reqnroll.Tools.MsBuild.Generation" Version="2.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -86,11 +86,4 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<SpecFlowFeatureFiles Update="Features\SmokeTests\FileUploadAndCohortDistribution.feature">
<Generator Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">SpecFlowSingleFileGenerator</Generator>
<LastGenOutput>FileUploadAndCohortDistribution.feature.cs</LastGenOutput>
</SpecFlowFeatureFiles>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dtos-cohort-manager-smoke-tests", "dtos-cohort-manager-smoke-tests\dtos-cohort-manager-smoke-tests.csproj", "{B0014134-D3E5-496A-941E-DE76EF985E4F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NHS.CohortManager.SmokeTests", "NHS.CohortManager.SmokeTests.csproj", "{B0014134-D3E5-496A-941E-DE76EF985E4F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# SpecFlow Test Automation Framework
# NHS CohortManager SmokeTests Automation Framework

## Overview

This test automation framework utilizes SpecFlow, a behavior-driven development (BDD) tool, to create and execute smoke tests for the Cohort Manager application. SpecFlow allows defining test scenarios using a natural language syntax, making tests more readable and maintainable.
This test automation framework utilises ReqnRoll, a behavior-driven development (BDD) tool, to create and execute smoke tests for the Cohort Manager application. ReqnRoll allows defining test scenarios using a natural language syntax, making tests more readable and maintainable.

## Table of Contents

- [SpecFlow Test Automation Framework](#specflow-test-automation-framework)
- [NHS CohortManager SmokeTests Automation Framework](#nhs-cohortmanager-smoketests-automation-framework)
- [Overview](#overview)
- [Table of Contents](#table-of-contents)
- [Prerequisites](#prerequisites)
Expand All @@ -23,7 +23,7 @@ To set up and run this test automation framework, ensure you have the following

- . NET Core SDK (version X. X or higher)
- Visual Studio 2022 or Visual Studio Code
- SpecFlow Visual Studio Extension
- ReqnRoll Visual Studio Extension
- SQL Server (for database testing)
- Azure Storage Explorer (for blob storage tests)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using dtos_cohort_manager_specflow.Config;
using dtos_cohort_manager_specflow.Contexts;
using dtos_cohort_manager_specflow.Helpers;
using dtos_cohort_manager_specflow.TestServices;
using NHS.CohortManager.SmokeTests.Config;
using NHS.CohortManager.SmokeTests.Contexts;
using NHS.CohortManager.SmokeTests.Helpers;
using NHS.CohortManager.SmokeTests.TestServices;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using SolidToken.SpecFlow.DependencyInjection;
using Reqnroll.Microsoft.Extensions.DependencyInjection;

namespace dtos_cohort_manager_specflow;
namespace NHS.CohortManager.SmokeTests;

internal static class Startup
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using dtos_cohort_manager_specflow.TestServices;
using TechTalk.SpecFlow;
using NHS.CohortManager.SmokeTests.TestServices;
using Reqnroll;
using Microsoft.Extensions.DependencyInjection;
using FluentAssertions;
using dtos_cohort_manager_specflow.Config;
using dtos_cohort_manager_specflow.Contexts;
using dtos_cohort_manager_specflow.Models;
using NHS.CohortManager.SmokeTests.Config;
using NHS.CohortManager.SmokeTests.Contexts;
using NHS.CohortManager.SmokeTests.Models;

namespace dtos_cohort_manager_specflow.Steps.SmokeTests;
namespace NHS.CohortManager.SmokeTests.Steps.SmokeTests;

[Binding]
public class FileUploadAndCohortDistributionSteps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using dtos_cohort_manager_specflow.Config;
using dtos_cohort_manager_specflow.Helpers;
using NHS.CohortManager.SmokeTests.Config;
using NHS.CohortManager.SmokeTests.Helpers;
using FluentAssertions;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Logging;

namespace dtos_cohort_manager_specflow.TestServices;
namespace NHS.CohortManager.SmokeTests.TestServices;

public class EndToEndFileUploadService
{
Expand Down

This file was deleted.