Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFR-2077: Language Filter Validation #519

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: let's add a new line so github stops complaining!

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
Loading