From a21f2e27069878208717946a69c8e34acf9ae57d Mon Sep 17 00:00:00 2001 From: clarissarichard <107963214+clarissarichard@users.noreply.github.com> Date: Tue, 24 Oct 2023 09:15:19 -0400 Subject: [PATCH] SFR-1797: Remove clicks on header and footer links in Playwright tests (#449) * Removed clicks on header links * Updated changelog * Added my account link assertion * Corrected wording of pub year assertion * Temporarily removed advanced search page specificity on footer tests * Removed footer clicks * Added DRB pages and locators to check footer links * Updated page locators * Removed unneeded heading locators * item details and work details links were the same so only one will be used * Added DRB pages to cycle through and check header links * Grouped footer locators * Added advanced search page to headers and footers * Split element checks and searching into separate scenarios in advSearch * Beginning to organize locators * Reorganized locators * Removed comment * Fix lint errors * Fixed more lint errors --- CHANGELOG.md | 1 + playwright/features/ReadOnlineTargets.feature | 5 +- playwright/features/advSearch.feature | 24 +- playwright/features/drbFooters.feature | 42 ++-- playwright/features/headerLinks.feature | 70 +++--- playwright/features/homePageElements.feature | 5 +- .../features/itemDetailPageElements.feature | 8 +- playwright/features/pub_yearFilter.feature | 2 +- playwright/support/constants.ts | 4 +- playwright/support/mappings.ts | 228 +++++++++--------- playwright/tests/assertions.spec.ts | 2 +- 11 files changed, 193 insertions(+), 198 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f23454c4..b66f43ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Upgrade to NYPL Design System 1.7.3 - Replace fireEvent with userEvent - Feedback button test PW +- SFR-1797: Remove Playwright tests with clicks on header and footer links ## [0.17.4] diff --git a/playwright/features/ReadOnlineTargets.feature b/playwright/features/ReadOnlineTargets.feature index 5048d00c..67491038 100644 --- a/playwright/features/ReadOnlineTargets.feature +++ b/playwright/features/ReadOnlineTargets.feature @@ -1,10 +1,9 @@ Feature: Read Online Link Targets Scenario: As a user I click the Read Online button on the search results page and in the item detail page and their link targets navigate to the same website - Given I go to the "search result" page + Given I go to the "search results" page When I click the "first read online button" Then the "Hathi Trust website" should be displayed - Given I go to the "work details" page + Given I go to the "item details" page When I click the "first read online button" Then the "Hathi Trust website" should be displayed - diff --git a/playwright/features/advSearch.feature b/playwright/features/advSearch.feature index b7ab9a08..5286fe70 100644 --- a/playwright/features/advSearch.feature +++ b/playwright/features/advSearch.feature @@ -1,6 +1,6 @@ Feature: Advanced Search - Scenario: As a user I search for a keyword and author and the search results contain both the keyword and author + Scenario: As a user I navigate to the advanced search page and all page elements are displayed Given I go to the "home" page When I click the "advanced search link" Then the "advanced search heading" should be displayed @@ -18,7 +18,11 @@ Feature: Advanced Search And the "date filter to field" should be displayed And the "advanced search button" should be displayed And the "advanced search clear button" should be displayed - When I fill in the "keyword search box" with "IBM 1401" + + Scenario: As a user I search for a keyword and author and the search results contain both the keyword and author + Given I go to the "home" page + When I click the "advanced search link" + And I fill in the "keyword search box" with "IBM 1401" And I fill in the "author search box" with "Laurie, Edward J." And I click the "advanced search button" Then the "keyword heading" should be displayed @@ -34,19 +38,3 @@ Feature: Advanced Search Then the "Russian language subheader" should be displayed And the "Russian language checkbox" should be checked And the "first read online button" should be displayed - - Scenario: As as user I verify the headers and footers of Advanced Search Page - Given I go to the "home" page - When I click the "advanced search link" - And the "advanced search breadcrumb" should be displayed - And the "accessibility footer link" should be displayed - And the "press footer link" should be displayed - And the "careers footer link" should be displayed - And the "space rental footer link" should be displayed - And the "privacy footer link" should be displayed - And the "other policies footer link" should be displayed - And the "terms and conditions footer link" should be displayed - And the "governance footer link" should be displayed - And the "rules and regulations footer link" should be displayed - And the "about footer link" should be displayed - And the "language footer link" should be displayed diff --git a/playwright/features/drbFooters.feature b/playwright/features/drbFooters.feature index 9dc56d68..545c71cf 100644 --- a/playwright/features/drbFooters.feature +++ b/playwright/features/drbFooters.feature @@ -1,37 +1,27 @@ -Feature: As a user I want to verify all the footer links are displayed and working as expected +Feature: Footer Links - Scenario: As as user I verify the headers and footers of Advanced Search Page - Given I go to the "home" page - When I click the "advanced search link" - And the "advanced search breadcrumb" should be displayed - And the "accessibility footer link" should be displayed + Scenario: As a user I navigate to each Digital Research Books page and verify the footer links are displayed + Given I go to the page + Then the "accessibility footer link" should be displayed And the "press footer link" should be displayed And the "careers footer link" should be displayed And the "space rental footer link" should be displayed - And the "privacy footer link" should be displayed + And the "privacy policy footer link" should be displayed And the "other policies footer link" should be displayed And the "terms and conditions footer link" should be displayed And the "governance footer link" should be displayed And the "rules and regulations footer link" should be displayed - And the "about footer link" should be displayed + And the "about NYPL footer link" should be displayed And the "language footer link" should be displayed - - Scenario Outline: As a user when I click on footer links I should be navigated to respective landing page - Given I go to the "home" page - Then I click the