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

[R20-1736] update results key for interop, collection 'theme' improvements #1022

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Feature: Custom Collection
As an editor I want to be able to add a view of results in a search index to a landing page.

Background:
Given the page endpoint for path "/custom-collection" returns fixture "/landingpage/custom-collection" with status 200
Given the site endpoint returns fixture "/site/reference" with status 200
And the search autocomplete request is stubbed with "/search-listing/suggestions/none" fixture
Given I am using a "macbook-16" device

@mockserver
Scenario: Custom collection
Given the page endpoint for path "/custom-collection" returns fixture "/landingpage/custom-collection" with status 200
Given the "/api/tide/elasticsearch/sdp_data_pipelines_scl/_search" network request is stubbed with fixture "/landingpage/custom-collection/response" and status 200 as alias "cslReq"
Given I visit the page "/custom-collection"
Then the landing page component "TideCustomCollection" should exist
Expand All @@ -18,19 +18,74 @@ Feature: Custom Collection
And the "cslReq" network request should be made to the elasticsearch endpoint
And the search listing layout should be "table"

@mockserver
Scenario: Default page - default form theme
Given the page endpoint for path "/custom-collection-theme-default" returns fixture "/landingpage/custom-collection/form-theme-default" with status 200
Given the "/api/tide/elasticsearch/sdp_data_pipelines_scl/_search" network request is stubbed with fixture "/landingpage/custom-collection/response" and status 200 as alias "cslReq"
Given I visit the page "/custom-collection-theme-default"
Then the landing page component "TideCustomCollection" should exist
And I toggle the content collection filters
Then the custom collection component should not have the "neutral" form theme applied
Then the custom collection search bar field should have the "default" variant applied
Then the custom collection checkbox field labelled "Show archived content" should have the "default" variant applied
Then the custom collection dropdown field labelled "Term filter example" should have the "default" variant applied
Then the custom collection dropdown field labelled "Terms dependent example" should have the "default" variant applied
Then the custom collection dropdown field labelled "Terms dependent child example" should have the "default" variant applied

@mockserver
Scenario: Default page - reverse form theme
Given the page endpoint for path "/custom-collection-theme-reverse" returns fixture "/landingpage/custom-collection/form-theme-reverse" with status 200
Given the "/api/tide/elasticsearch/sdp_data_pipelines_scl/_search" network request is stubbed with fixture "/landingpage/custom-collection/response" and status 200 as alias "cslReq"
Given I visit the page "/custom-collection-theme-reverse"
Then the landing page component "TideCustomCollection" should exist
And I toggle the content collection filters
Then the custom collection component should have the "neutral" form theme applied
Then the custom collection search bar field should have the "reverse" variant applied
Then the custom collection checkbox field labelled "Show archived content" should have the "reverse" variant applied
Then the custom collection dropdown field labelled "Term filter example" should have the "reverse" variant applied
Then the custom collection dropdown field labelled "Terms dependent example" should have the "reverse" variant applied
Then the custom collection dropdown field labelled "Terms dependent child example" should have the "reverse" variant applied

@mockserver
Scenario: Alt page - default form theme
Given the page endpoint for path "/custom-collection-alt-theme-default" returns fixture "/landingpage/custom-collection/alt-form-theme-default" with status 200
Given the "/api/tide/elasticsearch/sdp_data_pipelines_scl/_search" network request is stubbed with fixture "/landingpage/custom-collection/response" and status 200 as alias "cslReq"
Given I visit the page "/custom-collection-alt-theme-default"
Then the landing page component "TideCustomCollection" should exist
And I toggle the content collection filters
Then the custom collection component should not have the "light" form theme applied
Then the custom collection search bar field should have the "reverse" variant applied
Then the custom collection checkbox field labelled "Show archived content" should have the "reverse" variant applied
Then the custom collection dropdown field labelled "Term filter example" should have the "reverse" variant applied
Then the custom collection dropdown field labelled "Terms dependent example" should have the "reverse" variant applied
Then the custom collection dropdown field labelled "Terms dependent child example" should have the "reverse" variant applied

@mockserver
Scenario: Alt page - reverse form theme
Given the page endpoint for path "/custom-collection-alt-theme-reverse" returns fixture "/landingpage/custom-collection/alt-form-theme-reverse" with status 200
Given the "/api/tide/elasticsearch/sdp_data_pipelines_scl/_search" network request is stubbed with fixture "/landingpage/custom-collection/response" and status 200 as alias "cslReq"
Given I visit the page "/custom-collection-alt-theme-reverse"
Then the landing page component "TideCustomCollection" should exist
And I toggle the content collection filters
Then the custom collection component should have the "light" form theme applied
Then the custom collection search bar field should have the "default" variant applied
Then the custom collection checkbox field labelled "Show archived content" should have the "default" variant applied
Then the custom collection dropdown field labelled "Term filter example" should have the "default" variant applied
Then the custom collection dropdown field labelled "Terms dependent example" should have the "default" variant applied
Then the custom collection dropdown field labelled "Terms dependent child example" should have the "default" variant applied

@mockserver
Scenario: Error
Given the page endpoint for path "/custom-collection" returns fixture "/landingpage/custom-collection" with status 200
Given the "/api/tide/elasticsearch/sdp_data_pipelines_scl/_search" network request is stubbed with fixture "/landingpage/custom-collection/response" and status 400 as alias "cslReq"
Given I visit the page "/custom-collection"
Then the landing page component "TideCustomCollection" should exist
And the custom collection component should display the error "Sorry! Something went wrong. Please try again later."

@mockserver
Scenario: No results
Given the page endpoint for path "/custom-collection" returns fixture "/landingpage/custom-collection" with status 200
Given the "/api/tide/elasticsearch/sdp_data_pipelines_scl/_search" network request is stubbed with fixture "/landingpage/custom-collection/response-no-items" and status 200 as alias "cslReq"
Given I visit the page "/custom-collection"
Then the landing page component "TideCustomCollection" should exist
And the custom collection component should display the error "Sorry, no results match your search. Try again with different search options or check back later."



Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"title": "Custom collection - Form theme",
"changed": "2022-11-02T12:47:29+11:00",
"created": "2022-11-02T12:47:29+11:00",
"type": "landing_page",
"nid": "11dede11-10c0-111e1-1100-000000000330",
"summary": "Page summary",
"showInPageNav": true,
"inPageNavHeadingLevel": "h3",
"background": "alt",
"header": {
"title": "Custom collection form theme test",
"summary": "Test landing page title introduction text",
"theme": "default",
"backgroundImage": null
},
"sidebar": {},
"headerComponents": [],
"bodyComponents": [
{
"uuid": "55555555-5555-5555-5555-555555555555",
"component": "TideCustomCollection",
"id": "123",
"title": "Cameras save lives",
"props": {
"searchListingConfig": {
"searchProvider": "elasticsearch",
"index": "sdp_data_pipelines_scl",
"resultsPerPage": 10,
"labels": {
"submit": "Search",
"placeholder": "Enter suburb, postcode, streetname or offence location"
},
"customSort": [
{
"suburb": "asc"
}
],
"formTheme": "default"
},
"queryConfig": {
"multi_match": {
"query": "{{query}}",
"fields": ["suburb^3", "street^2", "offence_location"]
}
},
"globalFilters": [],
"userFilters": [
{
"id": "termFilter",
"component": "TideSearchFilterDropdown",
"filter": {
"type": "term",
"value": "termFilter.keyword"
},
"aggregations": {
"field": "termFilter",
"source": "taxonomy"
},
"props": {
"id": "termFilter",
"label": "Term filter example",
"placeholder": "Select a colour",
"multiple": true,
"options": [
{
"id": "1",
"label": "Red",
"value": "Red"
},
{
"id": "2",
"label": "Green",
"value": "Green"
}
]
}
},
{
"id": "checkboxFilter",
"component": "TideSearchFilterCheckbox",
"filter": {
"type": "terms",
"value": "checkboxFilter.keyword",
"multiple": false
},
"props": {
"id": "checkboxFilter",
"label": "Checkbox example",
"checkboxLabel": "Show archived content",
"onValue": "Archived"
}
},
{
"id": "dependentFilter",
"component": "TideSearchFilterDependent",
"columns": "rpl-grid",
"filter": {
"type": "dependent",
"multiple": false,
"value": "field_species_name"
},
"aggregations": {
"field": "topic",
"source": "taxonomy"
},
"props": {
"id": "dependentFilter",
"label": "Terms dependent example",
"placeholder": "Select a species",
"dependantLabel": "Terms dependent child example",
"dependantPlaceholder": "All sub species",
"multiple": true,
"options": [
{
"id": "1",
"label": "Mammals",
"value": "Mammals"
},
{
"id": "2",
"label": "Dogs",
"value": "Dogs",
"parent": "1"
},
{
"id": "3",
"label": "Birds",
"value": "Birds"
},
{
"id": "4",
"label": "Cats",
"value": "Cats",
"parent": "1"
},
{
"id": "5",
"label": "Parrot",
"value": "Parrot",
"parent": "3"
},
{
"id": "6",
"label": "Cockatoo",
"value": "Cockatoo",
"parent": "3"
}
]
}
}
],
"resultsConfig": {
"layout": {
"component": "TideSearchResultsTable",
"props": {
"columns": [
{
"label": "Suburb",
"objectKey": "suburb"
},
{
"label": "Location",
"objectKey": "street"
},
{
"label": "Last annual test",
"objectKey": "last_annual_test"
}
]
}
}
}
}
}
],
"meta": {
"url": "/demo-landing-page",
"langcode": "en",
"description": "Nulla ultricies dignissim leo, posuere vestibulum erat cursus vitae",
"additional": [
{
"tag": "link",
"attributes": {
"rel": "canonical",
"href": "https://develop.content.reference.sdp.vic.gov.au/demo-landing-page"
}
},
{
"tag": "meta",
"attributes": {
"name": "title",
"content": "Demo Landing Page | Single Digital Presence Content Management System"
}
},
{
"tag": "meta",
"attributes": {
"property": "og:image",
"content": "https://develop.content.reference.sdp.vic.gov.au/sites/default/files/tide_demo_content/Melbourne-tram.jpg"
}
}
],
"keywords": "",
"image": {
"src": "https://develop.content.reference.sdp.vic.gov.au/sites/default/files/tide_demo_content/Melbourne-tram.jpg",
"alt": "Demo: Melbourne tram",
"title": "Demo: Melbourne tram",
"width": 1413,
"height": 785,
"drupal_internal__target_id": 46
}
}
}
Loading
Loading