Skip to content

Commit

Permalink
SFR-1917: Fix failing Playwright tests (#490)
Browse files Browse the repository at this point in the history
* Fixed a few locators

* Updated item details page URL to one that has multiple read online editions

* Fixed remaining item details locators for new page

* Updated page URLs to a title with multiple online editions and can be read via Hathi Trust

* Updated changelog

* Fixed lint error
  • Loading branch information
clarissarichard authored Mar 22, 2024
1 parent 4160e4b commit 8f1af72
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGE LOG

## [Pre-release]

- SFR-1917: Fixed failing Playwright tests

## [0.18.0]

- Add Physical Edition badge and Scan and Deliver blurb to EDD editions
Expand Down
21 changes: 10 additions & 11 deletions playwright/support/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export const pages: { [name: string]: Pages } = {
route: "/",
},
"search results": {
route: "/search?query=subject%3ASub-saharan+Africa",
route: "search?query=subject%3Awashington+dc",
},
"item details": {
route: "/work/01a28167-8c8d-4141-a32f-718539d5c8a4?featured=949699",
route: "work/01ca64fb-31cc-4451-b8b2-7fc0d9c4f1a8?featured=6428716",
},
collection: {
route: "/collection/297da3a0-bcdb-4eb3-a520-a330fd8fa370",
Expand Down Expand Up @@ -103,18 +103,18 @@ export const elements = {

/** item details page locators */
"item title": "#work-title",
"item author": "div:text('By') > a:text('Library of Congress')",
"item featured edition heading": "#featured-edition",
"item author": "div:text('By') > a[href*='display=author'] >> nth=0",
"item featured edition heading": "div:text('Featured Edition')",
"item featured edition cover": "[alt='Placeholder Cover'] >> nth=0",
"item featured edition year": "a:text('Edition') >> nth=0",
"item featured edition year": "a:has-text('Edition') >> nth=0",
"item featured edition publisher": "div:text('Published by') >> nth=0",
"item featured edition language": "div:text('Languages') >> nth=0",
"item featured edition license": "[href='/license'] >> nth=0",
"item details heading": "#details-list-heading",
"item details authors heading": "dt:text('Authors')",
"item details authors": "dd > a:text('Library of Congress')",
"item details authors": "dd > a[href*='display=author'] >> nth=0",
"item details subjects heading": "dt:text('Subjects')",
"item details subjects": "a:text('Africa, Sub-Saharan')",
"item details subjects": "li > a[href*='/search?query=subject'] >> nth=0",
"item details languages heading": "dt:text('Languages')",
"item details languages": "li:text('English')",
"item all editions heading": "#all-editions",
Expand All @@ -131,19 +131,18 @@ export const elements = {
"back to search results button": "a:text('Back to search results')",

/** log in page locators */
"first login for options button": "text=Log in for options >> nth=0",
"username field": "#code",
"password field": "#pin",
"login button": "[value='Submit']",

/** read online page locators */
"first read online button": "a:text('Read Online') >> nth=0",
"Hathi Trust website":
"iframe[src='https://babel.hathitrust.org/cgi/pt?id=mdp.39015034622749']",
"iframe[src='https://babel.hathitrust.org/cgi/pt?id=hvd.32044079201976']",

/** request page locators */
"first request button":
"[href='https://www.nypl.org/research/collections/shared-collection-catalog/hold/request/b10715506-i13895605']",
"first login for options button": "a:text('Log in to request scan') >> nth=0",
"first request button": "a:text('Request scan') >> nth=0",
"delivery location heading": "h2:text('Choose a delivery location')",

/** ereader locators */
Expand Down

0 comments on commit 8f1af72

Please sign in to comment.