Skip to content

Commit

Permalink
SFR-2077: Language Filter Validation (#519)
Browse files Browse the repository at this point in the history
* SFR-2077/validate_langiage_filter

* SFR-2077-Languag-Filter

* adding an extra line for github to stop complainig
  • Loading branch information
ayan1229 authored Aug 12, 2024
1 parent b8b5898 commit 48c3788
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fix error when collections are empty
- Fix error when a collection is empty
- SFR-2077: Validate top 5 language filters for Frontend DRB search results

## [0.18.2]

Expand Down
33 changes: 31 additions & 2 deletions playwright/features/languageFilter.feature
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
Feature: Language Filter

Scenario: As a user I filter search results by a particular language and the first search result contains that language
Scenario: As a user I filter search results by a Latin language and the first search result contains that language
Given I go to the "home" page
When I fill in the "homepage search box" with "New York"
And I click the "search button"
And I click the "Latin language checkbox"
Then the "first search result language" should be displayed
Then the "first search result Latin language" should be displayed


Scenario: As a user I filter search results by a Spanish language and the first search result contains that language
Given I go to the "home" page
When I fill in the "homepage search box" with "New York"
And I click the "search button"
And I click the "Spanish language checkbox"
Then the "first search result Spanish language" should be displayed

Scenario: As a user I filter search results by a Japanese language and the first search result contains that language
Given I go to the "home" page
When I fill in the "homepage search box" with "New York"
And I click the "search button"
And I click the "Japanese language checkbox"
Then the "first search result Japanese language" should be displayed

Scenario: As a user I filter search results by a Polish language and the first search result contains that language
Given I go to the "home" page
When I fill in the "homepage search box" with "Poland"
And I click the "search button"
And I click the "Polish language checkbox"
Then the "first search result Polish language" should be displayed

Scenario: As a user I filter search results by a Portuguese language and the first search result contains that language
Given I go to the "home" page
When I fill in the "homepage search box" with "Lisbon"
And I click the "search button"
And I click the "Portuguese language checkbox"
Then the "first search result Portuguese language" should be displayed
12 changes: 11 additions & 1 deletion playwright/support/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ export const elements = {
"span:text('Show only US government documents')",
"first government document author": "a:text('United States') >> nth=0",
"Latin language checkbox": "span:text('Latin')",
"first search result language": "div:text('Latin') >> nth=0",
"Portuguese language checkbox": "span:text('Portuguese')",
"Spanish language checkbox": "span:text('Spanish')",
"Japanese language checkbox": "span:text('Japanese')",
"Polish language checkbox": "span:text('Polish')",
"first search result Latin language": "div:text('Latin') >> nth=0",
"first search result Portuguese language": "div:text('Portuguese') >> nth=0",
"first search result Spanish language": "div:text('Spanish') >> nth=0",
"first search result Japanese language": "div:text('Japanese') >> nth=0",
"first search result Polish language": "div:text('Polish') >> nth=0",
"publication year from filter": "#date-filter-from",
"publication year to filter": "#date-filter-to",
"publication year apply button": "#year-filter-button",
Expand Down Expand Up @@ -235,6 +243,8 @@ export const inputs = {
"catalog password": process.env.CATALOG_USER_PIN,
swimming: "swimming",
"New York": "New York",
Poland: "Poland",
Lisbon: "Lisbon",
"1900": "1900",
"1800": "1800",
"1835": "1835",
Expand Down

0 comments on commit 48c3788

Please sign in to comment.