Skip to content

Commit

Permalink
Sfr 1757/automate feedback button (#448)
Browse files Browse the repository at this point in the history
* SFR-1757/feedback-button

* small change on changelog.md
  • Loading branch information
ayan1229 authored Oct 16, 2023
1 parent 7cc523c commit 675a54a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Replace Template components with TemplateAppContainer and DrbBreakout to reduce repeat components
- Upgrade to NYPL Design System 1.7.3
- Replace fireEvent with userEvent
- Feedback button test PW

## [0.17.4]

Expand Down
2 changes: 1 addition & 1 deletion playwright/features/advSearch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ Feature: Advanced Search
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
And the "language footer link" should be displayed
6 changes: 5 additions & 1 deletion playwright/features/homePageElements.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ Feature: Home Page Elements
And the "collections heading" should be displayed
And the "first collection card link" should be displayed
And the "footer" should be displayed
And the "feedback button" should be displayed
And the "feedback button" should be displayed

Scenario: As a user I verify feedback button is displayed on homepage
Given I go to the "home" page
Then the "feedback and help button" should be displayed
11 changes: 10 additions & 1 deletion playwright/features/pub_yearFilter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@ Feature: Publication Year Filter
And I fill in the "publication year from filter" with "1900"
And I fill in the "publication year to filter" with "1900"
And I click the "publication year apply button"
Then the "first search result edition" should be displayed
Then the "first search result edition" should be displayed

Scenario: As a user I filter by publication years and verify the search results
Given I go to the "home" page
When I fill in the "homepage search box" with "Jane Austen"
And I click the "search button"
And I fill in the "publication year from filter" with "1800"
And I fill in the "publication year to filter" with "1835"
And I click the "publication year apply button"
Then only published between year "1800" and "1835" should be displayed
3 changes: 3 additions & 0 deletions playwright/support/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const elements = {
"advanced search link": "[href='/advanced-search']",
"advanced search button": "#submit-button",
"search button": "#searchbar-button-search-bar",
"feedback and help button": "//button[@id='open']",
"requestable checkbox": "text=Requestable",
"login button": "[value='Submit']",
"first login for options button": "text=Log in for options >> nth=0",
Expand Down Expand Up @@ -210,6 +211,8 @@ export const inputs = {
swimming: "swimming",
"New York": "New York",
"1900": "1900",
"1800": "1800",
"1835": "1835",
petroleum: "petroleum",
"Robot Soccer": "Robot Soccer",
"Jane Austen": "Jane Austen",
Expand Down
10 changes: 10 additions & 0 deletions playwright/tests/assertions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ Then(
return expect(this.page.locator(element).isChecked()).toBeTruthy();
}
);

Then(
/^Then only editions published between year "([^"]*)" and ""([^"]*)" should be displayed$/,
async function (this: CustomWorld, elementKey: keyof typeof elements) {
const element = elements[elementKey];
return expect(this.page.locator(element)).toBeVisible({
timeout: 50000,
});
}
);

1 comment on commit 675a54a

@vercel
Copy link

@vercel vercel bot commented on 675a54a Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.