33 using FluentAssertions ;
44 using LearningHub . Nhs . WebUI . AutomatedUiTests . TestFixtures ;
55 using LearningHub . Nhs . WebUI . AutomatedUiTests . TestHelpers ;
6+ using Microsoft . AspNetCore . Components . Web ;
67 using OpenQA . Selenium ;
78 using Selenium . Axe ;
89 using Xunit ;
@@ -29,17 +30,25 @@ public BookmarksTests(AuthenticatedAccessibilityTestsFixture fixture)
2930 public void BookmarksPageHasNoAccessibilityErrors ( )
3031 {
3132 // given
32- const string resourceUrl = "/Resource/91/Item" ;
33+ const string resourceUrl = "/Resource/17844/Item" ;
34+ const string resourceProdUrl = "/Resource/48180/Item" ;
3335 const string addBookmarkPageUrl = "/bookmark/resource?bookmarked=False&title=Understanding%20and%20managing%20conflict%20in%20children%27s%20healthcare&rri=16593&returnUrl=%2FResource%2F16593%2FItem" ;
3436 const string myBookmarksPage = "/bookmark" ;
35- const string bookmarkname = "Removal and disposal of Personal Protective Equipment (PPE) " ;
37+ const string bookmarkname = "Primary care clinicians " ;
3638 IWebElement renameBookmarkElement = null ;
3739 IWebElement addBookmarkElement = null ;
3840 IWebElement moveBookmarkElement = null ;
3941 AxeResult addBookmarkPageResult = null ;
4042
4143 // when
42- this . Driver . Navigate ( ) . GoToUrl ( this . BaseUrl + resourceUrl ) ;
44+ this . Driver . Navigate ( ) . GoToUrl ( this . BaseUrl + resourceProdUrl ) ;
45+
46+ var h1Element = this . Driver . FindElement ( By . TagName ( "h1" ) ) ;
47+ if ( h1Element . Text == "Unknown error" || h1Element . Text != bookmarkname )
48+ {
49+ this . Driver . Navigate ( ) . GoToUrl ( this . BaseUrl + resourceUrl ) ;
50+ }
51+
4352 try
4453 {
4554 addBookmarkElement = this . Driver . FindElement ( By . XPath ( "//a[contains(text(),'Add to my bookmarks')]" ) ) ;
0 commit comments