Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
76409a1
TD-2899 - New project accessibilty unit test
binon Feb 20, 2024
21d1a68
Refactored some of the code
binon Feb 27, 2024
bfc8d58
Td-2899 Minor updated chrome driver configuration
binon Feb 27, 2024
5642367
Merge branch 'release/accessibility' into Develop/Features/TD-2899-ad…
binon Feb 27, 2024
035056c
Merge pull request #156 from TechnologyEnhancedLearning/CI
binon Feb 28, 2024
7a40e5c
Merge pull request #157 from TechnologyEnhancedLearning/release/acces…
binon Feb 28, 2024
95d550f
TD-2899, Merged changes from CI, removed copyright and suppressed war…
binon Feb 28, 2024
1f24c67
Merge pull request #154 from TechnologyEnhancedLearning/Develop/Featu…
binon Feb 28, 2024
750f491
TD-5044: Implement changes for automated accessibility unit testing p…
ArunimaGeorge Nov 25, 2024
b0b4cde
Merge pull request #754 from TechnologyEnhancedLearning/Develop/Featu…
ArunimaGeorge Nov 28, 2024
34bbb27
P1 endpoints for TD-5118
OluwatobiAwe Jan 16, 2025
04bc1fe
Automated accessbility test latest changes
ArunimaGeorge Jan 27, 2025
31eaed0
Latest from RC
ArunimaGeorge Jan 31, 2025
ada4ae8
P1 P2 P3 endpoint expansion
OluwatobiAwe Feb 3, 2025
b38311a
Unit Test fix and reference fix
OluwatobiAwe Feb 4, 2025
684c3b5
reference ,DI and swagger documentation fix
OluwatobiAwe Feb 5, 2025
f7071db
Appeneded Authorization filters to some controllers
OluwatobiAwe Feb 5, 2025
e078d5a
unit test contructor fix
OluwatobiAwe Feb 5, 2025
2878945
merge RC
OluwatobiAwe Feb 5, 2025
b61a5f8
package fix
OluwatobiAwe Feb 5, 2025
a598b1b
latest changes
ArunimaGeorge Feb 17, 2025
9940164
TD-5133: Issue not showing the role on 'select for your current role'…
Swapnamol Feb 20, 2025
6b01042
TD-5012: Issue couldn't able to download File Audio/Video resources f…
Swapnamol Feb 21, 2025
687c8d8
Merge pull request #996 from TechnologyEnhancedLearning/Develop/Fixes…
swapnamol-abraham Feb 24, 2025
61464c8
Merge pull request #999 from TechnologyEnhancedLearning/Develop/Fixes…
swapnamol-abraham Feb 24, 2025
7d47e22
TD-3730: No Rate Limiting Enabled
Swapnamol Feb 25, 2025
5344942
Modified the settins values
Swapnamol Feb 25, 2025
caf02c2
Added Autosuggestion
OluwatobiAwe Feb 26, 2025
40a869b
latest changes
ArunimaGeorge Feb 26, 2025
71ce486
node package update
ArunimaGeorge Feb 26, 2025
5196a33
merge changes
ArunimaGeorge Feb 26, 2025
de3f22b
TD-4303: Adding automated accessibility tests for LH
ArunimaGeorge Feb 26, 2025
ee994b9
TD-4303: Updated search results test.
ArunimaGeorge Feb 27, 2025
0efabf8
Merge pull request #1005 from TechnologyEnhancedLearning/Develop/Feat…
OluwatobiAwe Feb 27, 2025
5dcd8b0
TD-3732: Missing Security Headers
Swapnamol Feb 28, 2025
ee5c721
Merge pull request #1010 from TechnologyEnhancedLearning/Develop/Fixe…
swapnamol-abraham Feb 28, 2025
3721852
TD-3730: error Screen modified
Swapnamol Mar 3, 2025
359dfa6
Merge pull request #1003 from TechnologyEnhancedLearning/Dev/Fixes/TD…
swapnamol-abraham Mar 4, 2025
e59c9d3
removal of unnecessary using references
OluwatobiAwe Mar 4, 2025
9a97957
Merge remote-tracking branch 'origin/Develop/Features/TD-5118-P1-P2-P…
OluwatobiAwe Mar 4, 2025
79c4f00
resolve conflict
OluwatobiAwe Mar 4, 2025
86c5183
Merge branch 'release-v1.3.0-EnglishlIvy' into Develop/Features/TD-51…
OluwatobiAwe Mar 4, 2025
8425a8b
addition of LearningHubTenantId value as it is in the API project
OluwatobiAwe Mar 4, 2025
dfd7ff2
package update
OluwatobiAwe Mar 4, 2025
e368fc9
TD-3731: Invalidated Current User Session on Password Change.
Swapnamol Mar 5, 2025
28901b4
Merge pull request #1017 from TechnologyEnhancedLearning/Develop/Fixe…
swapnamol-abraham Mar 5, 2025
a48fd1d
TD-3733-TD-3733:Information Disclosures
Swapnamol Mar 5, 2025
00b41bf
Merge pull request #1018 from TechnologyEnhancedLearning/Develop/Fixe…
swapnamol-abraham Mar 5, 2025
6a857ba
TD-5179: Fixed focus issue on My bookmarks screen
ArunimaGeorge Mar 11, 2025
5a0f49e
Td-3729: Remnoved unuinsed js
Swapnamol Mar 11, 2025
6fa7544
Merge pull request #1026 from TechnologyEnhancedLearning/Develop/Fixe…
swapnamol-abraham Mar 12, 2025
354f220
TD-3743: Concurrent Sessions Allowed
Swapnamol Mar 13, 2025
fc4c697
TD-5170: Fixed console errors on Notifications page.
ArunimaGeorge Mar 13, 2025
95f435c
Merge pull request #1030 from TechnologyEnhancedLearning/Develop/Fixe…
swapnamol-abraham Mar 13, 2025
e88ebe8
Merge pull request #1025 from TechnologyEnhancedLearning/Develop/Fixe…
ArunimaGeorge Mar 13, 2025
d2eae57
Merge pull request #961 from TechnologyEnhancedLearning/Develop/Featu…
AnjuJose011 Mar 18, 2025
f42a7a2
Merge pull request #1031 from TechnologyEnhancedLearning/Develop/Fixe…
AnjuJose011 Mar 18, 2025
b325fa3
Merge pull request #1007 from TechnologyEnhancedLearning/Develop/Feat…
ArunimaGeorge Mar 18, 2025
bd801af
Merge English Ivy Changes to RC
AnjuJose011 Mar 18, 2025
2fa10e4
Merge pull request #1037 from TechnologyEnhancedLearning/MergeRc-Engl…
AnjuJose011 Mar 18, 2025
4486daa
Merge pull request #1038 from TechnologyEnhancedLearning/Dev/Feature/…
AnjuJose011 Mar 18, 2025
354818b
CSP Changes reverted
Swapnamol Mar 18, 2025
655a467
Revert "CSP Changes reverted"
Swapnamol Mar 18, 2025
4f7aebb
Reverted CSP changes
Swapnamol Mar 18, 2025
1649f4c
Merging release/accessibility to English Ivy 1.3.1
ArunimaGeorge Mar 18, 2025
eaf3e21
Reverted CSP changes for testing
Swapnamol Mar 18, 2025
7dfaf18
Reverted Open API and report API CSP changes also.
Swapnamol Mar 19, 2025
6e6ca6d
Reverted IN memeory ticket store
Swapnamol Mar 19, 2025
6faaaa0
Revert "Reverted IN memeory ticket store"
Swapnamol Mar 19, 2025
537c1bf
Changes made on Automated UI Test project part of build error.
ArunimaGeorge Mar 19, 2025
91e17a7
Reverted in memmory ticket store
Swapnamol Mar 19, 2025
7c407a1
CSP - code added
Swapnamol Mar 19, 2025
62c054a
Removed Sandbox CSP
Swapnamol Mar 20, 2025
394baf8
Added in memory ticket store
Swapnamol Mar 20, 2025
b310ed4
Reverted in memory ticket store from RC
Swapnamol Mar 20, 2025
429d0d6
TD-5134: Fixed the issue to retain the input text even if error occurs
ArunimaGeorge Mar 20, 2025
3f030a9
TD-5134: removing unused namesapce
ArunimaGeorge Mar 20, 2025
2d4865e
Merge pull request #1039 from TechnologyEnhancedLearning/MergeAccessi…
AnjuJose011 Mar 21, 2025
251f6ef
Merge pull request #1044 from TechnologyEnhancedLearning/Develop/Fixe…
AnjuJose011 Mar 21, 2025
df79564
Merge pull request #1045 from TechnologyEnhancedLearning/release-v1.3…
AnjuJose011 Mar 21, 2025
ee85515
Update ProviderController.cs
AnjuJose011 Mar 25, 2025
97814e3
TD-3730: No Rate limit Enabled
Swapnamol Mar 27, 2025
12ebaaa
added to gitignore
Swapnamol Mar 27, 2025
f1875e1
Modified the script
Swapnamol Mar 27, 2025
d7c077d
Merge pull request #1048 from TechnologyEnhancedLearning/Develop/Fixe…
AnjuJose011 Mar 27, 2025
4e91daf
Fixed the issue with logout
Swapnamol Mar 31, 2025
973870d
Merge pull request #1054 from TechnologyEnhancedLearning/Develop/Fixe…
swapnamol-abraham Mar 31, 2025
9094291
TD-5170: Fixed console errors.
ArunimaGeorge Apr 1, 2025
07e9faa
Merge pull request #1056 from TechnologyEnhancedLearning/Develop/Fixe…
ArunimaGeorge Apr 1, 2025
be51b81
TD-5648-FIXES
AnjuJose011 Apr 1, 2025
5c1a150
Merge pull request #1058 from TechnologyEnhancedLearning/TD-5648-Erro…
AnjuJose011 Apr 1, 2025
cb88066
TD-5118
OluwatobiAwe Apr 2, 2025
36e8be6
fixes
AnjuJose011 Apr 2, 2025
b20fed6
fixes
AnjuJose011 Apr 2, 2025
ed0ee50
fixes
AnjuJose011 Apr 2, 2025
905f001
Merge pull request #1060 from TechnologyEnhancedLearning/fix-forBuild…
AnjuJose011 Apr 2, 2025
5ab6691
Merge pull request #1059 from TechnologyEnhancedLearning/Develop/Feat…
AnjuJose011 Apr 2, 2025
43e2ad8
TD-5170: Corrected the support team url.
ArunimaGeorge Apr 3, 2025
31e6f4f
Merge pull request #1063 from TechnologyEnhancedLearning/Develop/Fixe…
ArunimaGeorge Apr 3, 2025
532a6c4
TD-5509: Fixed the pagination width
ArunimaGeorge Apr 7, 2025
76178a2
TD-5407: Created new SP to fix the SQL exception
Swapnamol Apr 7, 2025
743ba20
Merge pull request #1069 from TechnologyEnhancedLearning/Develop/Fixe…
ArunimaGeorge Apr 8, 2025
851b623
Merge pull request #1072 from TechnologyEnhancedLearning/Develop/Fixe…
swapnamol-abraham Apr 8, 2025
c7b1c29
updated documentation based on the imported API
OluwatobiAwe Apr 9, 2025
7593c20
Merge pull request #1074 from TechnologyEnhancedLearning/Develop/Feat…
OluwatobiAwe Apr 9, 2025
ecb9350
Revert documentation model changes
OluwatobiAwe Apr 9, 2025
1f3026d
Merge pull request #1077 from TechnologyEnhancedLearning/Develop/Feat…
OluwatobiAwe Apr 9, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ obj
/OpenAPI/LearningHub.Nhs.OpenApi/web.config
/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj.user
/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj.user
/ReportAPI/LearningHub.Nhs.ReportApi/web.config
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<PackageReference Include="HtmlSanitizer" Version="6.0.453" />
<PackageReference Include="IdentityModel" Version="4.6.0" />
<PackageReference Include="LearningHub.Nhs.Caching" Version="2.0.2" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.47" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.48" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.19.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.36" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.36" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface PlayerConfig {
}

interface SourceConfig {
enableLowLatency: boolean;
hls: string;
drm: {
clearkey: ClearKeyConfig;
Expand Down Expand Up @@ -57,6 +58,7 @@ function getSourceConfig(
authenticationToken: string
): SourceConfig {
return {
enableLowLatency: true,
hls: locatorUri,
drm: {
clearkey: {
Expand All @@ -81,6 +83,7 @@ function initializePlayer(videoContainer: HTMLElement, playerConfig: MKPlayerCon
};

const sourceConfig: SourceConfig = {
enableLowLatency: true,
hls: playBackUrl,
drm: {
clearkey: clearKeyConfig
Expand Down
22 changes: 12 additions & 10 deletions AdminUI/LearningHub.Nhs.AdminUI/Services/MKIOMediaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,21 @@ public async Task<string> CreateMediaInputAsset(IFormFile file)
/// <returns>.</returns>
public async Task<BlobDownloadResult> DownloadMediaInputAsset(string inputAssetName, string fileName)
{
IAzureMediaServicesClient client = await this.CreateMediaServicesClientAsync();
var client = this.GetMKIOServicesClientAsync();
var assets = client.Assets.Get(inputAssetName);

BlobServiceClient blobServiceClient = new BlobServiceClient(this.settings.MediaKindSettings.MediaKindStorageConnectionString);

AssetContainerSas assetContainerSas = await client.Assets.ListContainerSasAsync(
this.settings.AzureMediaResourceGroup,
this.settings.AzureMediaAccountName,
inputAssetName,
permissions: AssetContainerPermission.Read,
expiryTime: DateTime.UtcNow.AddHours(1).ToUniversalTime());
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(assets.Properties.Container);
if (!await containerClient.ExistsAsync().ConfigureAwait(false))
{
await containerClient.CreateIfNotExistsAsync().ConfigureAwait(false);
}

string sasUri = assetContainerSas.AssetContainerSasUrls.First();
var filename1 = Regex.Replace(fileName, "[^a-zA-Z0-9.]", string.Empty);
filename1 = string.IsNullOrEmpty(filename1) ? "file.txt" : filename1;

var blobServiceClient = new BlobContainerClient(new Uri(sasUri));
var blobClient = blobServiceClient.GetBlockBlobClient(fileName);
BlobClient blobClient = containerClient.GetBlobClient(filename1);
var fileContent = await blobClient.DownloadContentAsync();

return fileContent;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
namespace LearningHub.Nhs.WebUI.AutomatedUiTests.AccessibilityTests
{
using FluentAssertions;
using LearningHub.Nhs.WebUI.AutomatedUiTests.TestFixtures;
using LearningHub.Nhs.WebUI.Startup;
using OpenQA.Selenium;
using Selenium.Axe;
using Xunit;

/// <summary>
/// Accessibility Tests Base.
/// </summary>
[Collection("Selenium test collection")]
public class AccessibilityTestsBase
{
/// <summary>
/// Gets the base URL for the tests.
/// </summary>
internal readonly string BaseUrl;

/// <summary>
/// Gets the WebDriver used for the tests.
/// </summary>
internal readonly IWebDriver Driver;

/// <summary>
/// Initializes a new instance of the <see cref="AccessibilityTestsBase"/> class.
/// </summary>
/// <param name="fixture">fixture.</param>
public AccessibilityTestsBase(AccessibilityTestsFixture fixture)
{
this.BaseUrl = fixture.BaseUrl;
this.Driver = fixture.Driver;
}

/// <summary>
/// Analyze Page Heading And Accessibility.
/// </summary>
/// <param name="pageTitle">Page Title.</param>
public void AnalyzePageHeadingAndAccessibility(string pageTitle)
{
this.ValidatePageHeading(pageTitle);

// then
// Exclude conditional radios, see: https://github.com/alphagov/govuk-frontend/issues/979#issuecomment-872300557
var axeResult = new AxeBuilder(this.Driver).Exclude("div.nhsuk-radios--conditional div.nhsuk-radios__item input.nhsuk-radios__input").Analyze();
axeResult.Violations.Where(v => !v.Tags.Contains("best-practice")).Should().BeEmpty();
}

/// <summary>
/// ValidatePageHeading.
/// </summary>
/// <param name="pageTitle">Page Title.</param>
public void ValidatePageHeading(string pageTitle)
{
var h1Element = this.Driver.FindElement(By.TagName("h1"));
h1Element.Text.Should().BeEquivalentTo(pageTitle);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
namespace LearningHub.Nhs.WebUI.AutomatedUiTests.AccessibilityTests
{
using FluentAssertions;
using LearningHub.Nhs.WebUI.AutomatedUiTests.TestFixtures;
using Selenium.Axe;
using Xunit;

/// <summary>
/// BasicAccessibilityTests.
/// </summary>
public class BasicAccessibilityTests : AccessibilityTestsBase, IClassFixture<AccessibilityTestsFixture>
{
/// <summary>
/// Initializes a new instance of the <see cref="BasicAccessibilityTests"/> class.
/// BasicAccessibilityTests.
/// </summary>
/// <param name="fixture">fixture.</param>
public BasicAccessibilityTests(AccessibilityTestsFixture fixture)
: base(fixture)
{
}

/// <summary>
/// PageHasNoAccessibilityErrors.
/// </summary>
/// <param name="url">url to the page.</param>
/// <param name="pageTitle">title of the page.</param>
[Theory]
[InlineData("/forgotten-password", "Forgotten your username or password")]
[InlineData("/Login", "Access your Learning Hub account")]
[InlineData("/Home/Contactus", "Contact us")]
[InlineData("/Home/Aboutus", "About us")]
[InlineData("/Updates", "Service updates and releases")]
[InlineData("/Policies", "Our policies")]
[InlineData("/Home/Accessibility", "Accessibility Statement for the NHS England Learning Hub")]
[InlineData("/Home/NHSsites", "NHS sites")]
[InlineData("/policies/terms-and-conditions", "NHS England Learning Hub Terms and Conditions of Use (‘Terms’)")]
[InlineData("/policies/content-policy", "NHS England Learning Hub Content Policy")]
[InlineData("/policies/privacy-policy", "PRIVACY NOTICE")]
[InlineData("/policies/cookie-policy", "Cookie policy")]
[InlineData("/policies/acceptable-use-policy", "ACCEPTABLE USE POLICY")]

public void PageHasNoAccessibilityErrors(string url, string pageTitle)
{
// when
this.Driver.Navigate().GoToUrl(this.BaseUrl + url);

// then
this.AnalyzePageHeadingAndAccessibility(pageTitle);

////this.Driver.Dispose();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace LearningHub.Nhs.WebUI.AutomatedUiTests.AccessibilityTests
{
using LearningHub.Nhs.WebUI.AutomatedUiTests.TestFixtures;
using LearningHub.Nhs.WebUI.AutomatedUiTests.TestHelpers;
using Microsoft.Azure.Management.Media.Models;
using OpenQA.Selenium;
using Xunit;

/// <summary>
/// BasicAuthenticatedAccessibilityTests.
/// </summary>
public class BasicAuthenticatedAccessibilityTests : AccessibilityTestsBase,
IClassFixture<AuthenticatedAccessibilityTestsFixture>
{
/// <summary>
/// Initializes a new instance of the <see cref="BasicAuthenticatedAccessibilityTests"/> class.
/// BasicAuthenticatedAccessibilityTests.
/// </summary>
/// <param name="fixture">fixture.</param>
public BasicAuthenticatedAccessibilityTests(AuthenticatedAccessibilityTestsFixture fixture)
: base(fixture)
{
}

/// <summary>
/// Authenticated Page Has no Accessibility Errors.
/// </summary>
/// <param name="url">url.</param>
/// <param name="pageTitle">pageTitle.</param>
[Theory]
[InlineData("/myaccount", "My account details")]
[InlineData("/MyLearning", "My learning")]
[InlineData("/allcatalogue", "A-Z of catalogues")]
[InlineData("/allcataloguesearch?term=primary#searchTab", "Search results for primary")]
public void AuthenticatedPageHasNoAccessibilityErrors(string url, string pageTitle)
{
// when
this.Driver.Navigate().GoToUrl(this.BaseUrl + url);

// then
this.AnalyzePageHeadingAndAccessibility(pageTitle);

// Dispose driver
////this.Driver.LogOutUser(this.BaseUrl);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
namespace LearningHub.Nhs.WebUI.AutomatedUiTests.AccessibilityTests
{
using FluentAssertions;
using LearningHub.Nhs.WebUI.AutomatedUiTests.TestFixtures;
using LearningHub.Nhs.WebUI.AutomatedUiTests.TestHelpers;
using Microsoft.AspNetCore.Components.Web;
using OpenQA.Selenium;
using Selenium.Axe;
using Xunit;

/// <summary>
/// Bookmarks Tests.
/// </summary>
public class BookmarksTests : AccessibilityTestsBase,
IClassFixture<AuthenticatedAccessibilityTestsFixture>
{
/// <summary>
/// Initializes a new instance of the <see cref="BookmarksTests"/> class.
/// </summary>
/// <param name="fixture">fixture.</param>
public BookmarksTests(AuthenticatedAccessibilityTestsFixture fixture)
: base(fixture)
{
}

/// <summary>
/// BookmarksPageHasNoAccessibilityErrors.
/// </summary>
[Fact]
public void BookmarksPageHasNoAccessibilityErrors()
{
// given
const string resourceUrl = "/Resource/17844/Item";
const string resourceProdUrl = "/Resource/48180/Item";
const string addBookmarkPageUrl = "/bookmark/resource?bookmarked=False&title=Understanding%20and%20managing%20conflict%20in%20children%27s%20healthcare&rri=16593&returnUrl=%2FResource%2F16593%2FItem";
const string myBookmarksPage = "/bookmark";
const string bookmarkname = "Primary care clinicians";
IWebElement renameBookmarkElement = null;
IWebElement addBookmarkElement = null;
IWebElement moveBookmarkElement = null;
AxeResult addBookmarkPageResult = null;

// when
this.Driver.Navigate().GoToUrl(this.BaseUrl + resourceProdUrl);

var h1Element = this.Driver.FindElement(By.TagName("h1"));
if (h1Element.Text == "Unknown error" || h1Element.Text != bookmarkname)
{
this.Driver.Navigate().GoToUrl(this.BaseUrl + resourceUrl);
}

try
{
addBookmarkElement = this.Driver.FindElement(By.XPath("//a[contains(text(),'Add to my bookmarks')]"));
if (addBookmarkElement.Displayed)
{
this.Driver.ClickLinkContainingText("Add to my bookmarks");
this.ValidatePageHeading("Add bookmark");
addBookmarkPageResult = new AxeBuilder(this.Driver).Exclude("div.nhsuk-radios--conditional div.nhsuk-radios__item input.nhsuk-radios__input").Analyze();
this.Driver.ClickButtonByText("Continue");
}
}
catch (NoSuchElementException)
{
this.Driver.Navigate().GoToUrl(this.BaseUrl + addBookmarkPageUrl);
this.ValidatePageHeading("Add bookmark");
addBookmarkPageResult = new AxeBuilder(this.Driver).Exclude("div.nhsuk-radios--conditional div.nhsuk-radios__item input.nhsuk-radios__input").Analyze();
this.Driver.ClickLinkContainingText("Cancel");
}

this.Driver.Navigate().GoToUrl(this.BaseUrl + myBookmarksPage);
this.ValidatePageHeading("Bookmarked learning");
var myBookmarksPageResult = new AxeBuilder(this.Driver).Exclude("div.nhsuk-radios--conditional div.nhsuk-radios__item input.nhsuk-radios__input").Analyze();

this.Driver.ClickLinkContainingText("Add a folder");
this.ValidatePageHeading("Add a folder");
var addBookmarkFolderPageResult = new AxeBuilder(this.Driver).Exclude("div.nhsuk-radios--conditional div.nhsuk-radios__item input.nhsuk-radios__input").Analyze();
this.Driver.ClickLinkContainingText("Cancel");

renameBookmarkElement = this.Driver.FindElement(By.XPath($"//tr[td//span[contains(text(), '{bookmarkname}')]]//td//div//form//span//button[contains(text(), 'Rename')]"));
renameBookmarkElement.Click();
this.ValidatePageHeading("Rename bookmark");
var renameBookmarkPageResult = new AxeBuilder(this.Driver).Exclude("div.nhsuk-radios--conditional div.nhsuk-radios__item input.nhsuk-radios__input").Analyze();
this.Driver.ClickLinkContainingText("Cancel");

moveBookmarkElement = this.Driver.FindElement(By.XPath($"//tr[td//span[contains(text(), '{bookmarkname}')]]//td//div//form//span//button[contains(text(), 'Move')]"));
moveBookmarkElement.Click();
this.ValidatePageHeading("Move your bookmark");
var moveBookmarkPageResult = new AxeBuilder(this.Driver).Exclude("div.nhsuk-radios--conditional div.nhsuk-radios__item input.nhsuk-radios__input").Analyze();
this.Driver.ClickLinkContainingText("Cancel");

// then
addBookmarkPageResult.Violations.Where(v => !v.Tags.Contains("best-practice")).Should().BeEmpty();
myBookmarksPageResult.Violations.Where(v => !v.Tags.Contains("best-practice")).Should().BeEmpty();
addBookmarkFolderPageResult.Violations.Where(v => !v.Tags.Contains("best-practice")).Should().BeEmpty();
renameBookmarkPageResult.Violations.Where(v => !v.Tags.Contains("best-practice")).Should().BeEmpty();
moveBookmarkPageResult.Violations.Where(v => !v.Tags.Contains("best-practice")).Should().BeEmpty();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
namespace LearningHub.Nhs.WebUI.AutomatedUiTests.AccessibilityTests
{
using FluentAssertions;
using LearningHub.Nhs.WebUI.AutomatedUiTests.TestFixtures;
using LearningHub.Nhs.WebUI.AutomatedUiTests.TestHelpers;
using Selenium.Axe;
using Xunit;

/// <summary>
/// Catalogue Folder Content Tests.
/// </summary>
public class CatalogueFolderContentTests : AccessibilityTestsBase,
IClassFixture<AuthenticatedAccessibilityTestsFixture>
{
/// <summary>
/// Initializes a new instance of the <see cref="CatalogueFolderContentTests"/> class.
/// </summary>
/// <param name="fixture">fixture.</param>
public CatalogueFolderContentTests(AuthenticatedAccessibilityTestsFixture fixture)
: base(fixture)
{
}

/// <summary>
/// DashboardPageHasNoAccessibilityErrors.
/// </summary>
[Fact]
public void CatalogueFolderContentPageHasNoAccessibilityErrors()
{
// given
const string catalogueUrl = "/catalogue/Neonatal-AHP";

// when
this.Driver.Navigate().GoToUrl(this.BaseUrl + catalogueUrl);
this.ValidatePageHeading("Enhanced Modules for Allied Health Professionals Working in Neonatal Care");
var cataloguePageResult = new AxeBuilder(this.Driver).Exclude("div.nhsuk-radios--conditional div.nhsuk-radios__item input.nhsuk-radios__input").Analyze();

////this.Driver.ClickLinkContainingText("Manage this catalogue");
////this.ValidatePageHeading("Catalogue Management");
////var catalogueManagementPageResult = new AxeBuilder(this.Driver).Exclude("div.nhsuk-radios--conditional div.nhsuk-radios__item input.nhsuk-radios__input").Analyze();

// then
cataloguePageResult.Violations.Where(v => !v.Tags.Contains("best-practice")).Should().BeEmpty();
}
}
}
Loading
Loading