Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
31963b9
ISAICP-6577: Topic select to use SlimSelect.
saidatom Oct 1, 2021
bafdd62
ISAICP-6577: Remove post-install-cmd slim_select library.
saidatom Oct 1, 2021
d5b71a2
Merge branch 'EPIC-6572' into ISAICP-6577
saidatom Oct 13, 2021
1f4790e
ISAICP-6577: Update slim_select module.
saidatom Oct 13, 2021
372fdc2
ISAICP-6577: Fix tests and enable multiple field.
saidatom Oct 17, 2021
4496aa5
ISAICP-6577: Fix xpath find topic.
saidatom Oct 17, 2021
69e0fff
ISAICP-6577: Replace test xpath Slim Select.
saidatom Oct 18, 2021
d8250a2
ISAICP-6577: Try to ensure that the loading state is complete.
idimopoulos Oct 19, 2021
b947fa7
Ensure that slow animations also finish.
idimopoulos Oct 19, 2021
75647eb
ISAICP-6577: Modernize the way to wait for an element to be found.
idimopoulos Oct 20, 2021
c86dfce
ISAICP-6577: The find method might return NULL.
idimopoulos Oct 20, 2021
ecc9c87
Merge remote-tracking branch 'origin/EPIC-6572' into ISAICP-6577
saidatom Oct 21, 2021
fef702b
Merge remote-tracking branch 'origin/EPIC-6572' into ISAICP-6577
saidatom Oct 21, 2021
de65be7
ISAICP-6577: Fix remarks to improve tests.
saidatom Oct 21, 2021
7ed4b2c
ISAICP-6577: Fix homepage feature Slim Select test.
saidatom Oct 21, 2021
a9a1a8e
Merge remote-tracking branch 'origin/EPIC-6572' into ISAICP-6577
claudiu-cristea Oct 25, 2021
3313a22
ISAICP-6577: Add waitfor element to prevent error.
saidatom Oct 25, 2021
5850f34
ISAICP-6577: Add abstraction find Slim Select.
saidatom Oct 26, 2021
e7a263b
Merge remote-tracking branch 'origin/EPIC-6572' into ISAICP-6577
saidatom Oct 26, 2021
48657ac
ISAICP-6577: Fix abstraction.
saidatom Oct 27, 2021
b4e52ee
ISAICP-6577: Add waitfor element to prevent error.
saidatom Oct 27, 2021
66ba282
ISAICP-6577: Add waitfor element to prevent error.
saidatom Oct 27, 2021
1cc406e
ISAICP-6577: Remove findSlimSelect in options.
saidatom Oct 28, 2021
6c06981
ISAICP-6577: Add waitfor element to prevent error.
saidatom Oct 28, 2021
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 composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"drupal/simplenews": "^1.0-beta1",
"drupal/site_alert": "~1.2",
"drupal/site_verify": "1.x-dev",
"drupal/slim_select": "^1.0@alpha",
"drupal/smart_trim": "~1.3",
"drupal/social_media_links": "^2.7",
"drupal/spdx": "^1.0",
Expand Down
71 changes: 68 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ module:
simple_sitemap: 0
site_alert: 0
site_verify: 0
slim_select: 0
smart_trim: 0
social_media_links: 0
social_media_links_field: 0
Expand Down
14 changes: 1 addition & 13 deletions config/sync/facets.facet.topic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name: Topics
url_alias: topic
weight: -3
min_count: 1
show_only_one_result: true
show_only_one_result: false
field_identifier: topic
facet_source_id: 'search_api:views_page__search__page_1'
widget:
Expand All @@ -30,12 +30,6 @@ hard_limit: 0
exclude: false
only_visible_when_facet_source_is_visible: true
processor_configs:
active_widget_order:
processor_id: active_widget_order
weights:
sort: -8
settings:
sort: ASC
aggregated_entity_reference_label:
processor_id: aggregated_entity_reference_label
weights:
Expand All @@ -48,12 +42,6 @@ processor_configs:
settings:
minimum_items: 1
maximum_items: null
count_widget_order:
processor_id: count_widget_order
weights:
sort: -10
settings:
sort: ASC
display_value_widget_order:
processor_id: display_value_widget_order
weights:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
uuid: 9dac5cf8-020e-4f0a-8c0c-e8359168af17
langcode: en
status: true
dependencies: { }
id: search_api__views_page__search__page_1
name: 'search_api:views_page__search__page_1'
filter_key: null
url_processor: query_string
breadcrumb: { }
6 changes: 3 additions & 3 deletions tests/features/homepage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Feature: Homepage
# page instead.
When I click "Finance in EU"
Then I should be on the advanced search page
And the option with text "Finance in EU" from select facet form "topic" is selected
And the "Finance in EU" option from "topic" Slim Select is selected

# There is a "More news" link that for the moment leads to the search page
# pre-filtered on news articles. In the future this will become a dedicated
Expand Down Expand Up @@ -203,7 +203,7 @@ Feature: Homepage
And I should see the link "E-justice" in the "Discover topics block"
When I click "E-justice"
Then I should be on the advanced search page
And the option with text "E-justice" from select facet form "topic" is selected
And the option with text "E-justice" from select facet "topic" is selected

# See more topics modal.
When I am on the homepage
Expand Down Expand Up @@ -231,7 +231,7 @@ Feature: Homepage
| Social and Political |
When I click "E-health Dpt." in the "Modal content"
Then I should be on the advanced search page
And the option with text "E-health Dpt." from select facet form "topic" is selected
And the option with text "E-health Dpt." from select facet "topic" is selected
And the page should show the tiles "Internet medicine"

Examples:
Expand Down
115 changes: 58 additions & 57 deletions tests/features/joinup_search/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,22 @@ Feature: Global search
| Dummy news 4 | Dummy body | Molecular cooking collection | E-inclusion | Luxembourg | validated |

Given I am logged in as a user with the "authenticated" role
# @todo The search page cache should be cleared when new content is added.
# @see https://citnet.tech.ec.europa.eu/CITnet/jira/browse/ISAICP-3428
And the cache has been cleared
And I am on the homepage
Comment thread
claudiu-cristea marked this conversation as resolved.
When I visit the search page
# All content is visible.
Then I should see the "Molecular cooking collection" tile
And I should see the "El Celler de Can Roca" tile
And I should see the "Spherification" tile
And I should see the "Foam" tile

# Terms are sorted alphabetically
And the "topic" select facet form should contain the following options:
| Any topic |
And the Slim Select "topic" should contain the following options:
# Parent term.
| Info |
| Info |
# Child term.
| - Statistics and Analysis |
# Parent term.
| Social and Political |
| Social and Political |
# Child terms.
| - Demography |
| - E-inclusion |
Expand All @@ -69,11 +67,10 @@ Feature: Global search
# Joinup there were two search fields, but this was confusing users.
And there should be exactly 1 "search field" on the page

When I select "Social and Political" from the "topic" select facet form
When I select "Social and Political" option from the "topic" Slim Select
And I click Search in facets form
Then the option with text "Social and Political" from select facet form "topic" is selected
And the "topic" select facet form should contain the following options:
| Any topic |
Then the "Social and Political" option from "topic" Slim Select is selected
And the Slim Select "topic" should contain the following options:
| Info |
| - Statistics and Analysis |
| Social and Political |
Expand All @@ -84,14 +81,20 @@ Feature: Global search
And I should see the "Dummy news 2" tile
And I should see the "Dummy news 3" tile
And I should see the "Dummy news 4" tile
Then I unselect "Social and Political" option from the "topic" Slim Select

#Test multiple topics.
When I select "E-inclusion,Demography" options from the "topic" Slim Select
And I click Search in facets form
And the "- Demography,- E-inclusion" options from "topic" Slim Select are selected
Then I unselect "E-inclusion,Demography" options from the "topic" Slim Select

# Test the topic facet. The space prefixing "Demography" is due to the hierarchy.
When I select " Demography" from the "topic" select facet form
When I select "Demography" option from the "topic" Slim Select
And I click Search in facets form
Then the option with text "- Demography" from select facet form "topic" is selected
Then the "- Demography" option from "topic" Slim Select is selected
# The selected option moves to the last position by default.
And the "topic" select facet form should contain the following options:
| Any topic |
And the Slim Select "topic" should contain the following options:
| Info |
| - Statistics and Analysis |
| Social and Political |
Expand All @@ -116,9 +119,8 @@ Feature: Global search
| Any location |
| Belgium (1) |
| European Union (1) |
Then the option with text "- Demography" from select facet form "topic" is selected
And the "topic" select facet form should contain the following options:
| Any topic |
Then the "- Demography" option from "topic" Slim Select is selected
And the Slim Select "topic" should contain the following options:
| Social and Political |
| - Demography |
And I should see the "Molecular cooking collection" tile
Expand All @@ -132,19 +134,18 @@ Feature: Global search
And I click Search in facets form
Then the option with text "News (5)" from select facet form "Content types" is selected
And the "Content types" select facet form should contain the following options:
| Collection (1) |
| News (5) |
| Solutions (2) |
| Collection (1) |
| News (5) |
| Solutions (2) |

When I select "Solutions (2)" option in the "Content types" select facet form
And I click Search in facets form
And I should see the following facet summary "News, Solutions"
And the "Content types" select facet form should contain the following options:
| Collection (1) |
| News (5) |
| Solutions (2) |
And the "topic" select facet form should contain the following options:
| Any topic |
| Collection (1) |
| News (5) |
| Solutions (2) |
And the Slim Select "topic" should contain the following options:
| Info |
| - Statistics and Analysis |
| Social and Political |
Expand Down Expand Up @@ -189,18 +190,18 @@ Feature: Global search

When I visit the search page
And the "spatial coverage" select facet form should contain the following options:
| Any location |
| Greece (1) |
| Luxembourg (2) |
| Any location |
| Greece (1) |
| Luxembourg (2) |
When I select "Luxembourg" from the "spatial coverage" select facet form
And I click Search in facets form
Then the option with text "Luxembourg (2)" from select facet form "spatial coverage" is selected
And I should see the text "Search Results (2)"
# The countries are still sorted alphabetically even though the Luxembourg value is selected and has more results.
And the "spatial coverage" select facet form should contain the following options:
| Any location |
| Greece (1) |
| Luxembourg (2) |
| Any location |
| Greece (1) |
| Luxembourg (2) |

Scenario: Content can be found with a full-text search.
Given the following owner:
Expand Down Expand Up @@ -251,16 +252,16 @@ Feature: Global search

When I visit the search page
And the "Content types" select facet form should contain the following options:
| Collections (2) |
| Custom page (1) |
| Discussion (1) |
| Document (1) |
| Events (2) |
| Licence (1) |
| News (1) |
| Release (1) |
| Solution (1) |
| Video (1) |
| Collections (2) |
| Custom page (1) |
| Discussion (1) |
| Document (1) |
| Events (2) |
| Licence (1) |
| News (1) |
| Release (1) |
| Solution (1) |
| Video (1) |

# "Alpha" is used in all the rdf entities titles.
When I enter "Alpha" in the search bar and press enter
Expand Down Expand Up @@ -613,23 +614,23 @@ Feature: Global search
@javascript
Scenario: Anonymous user can find facets summary
Given the following collection:
| title | Radio cooking collection |
| logo | logo.png |
| moderation | no |
| topic | Demography |
| spatial coverage | Belgium |
| state | validated |
| title | Radio cooking collection |
| logo | logo.png |
| moderation | no |
| topic | Demography |
| spatial coverage | Belgium |
| state | validated |
And the following solutions:
| title | collection | description | topic | spatial coverage | state |
| Spheres | Radio cooking collection | Spherification is the culinary process of shaping a liquid into spheres | Demography | European Union | validated |
| Movistar | Radio cooking collection | "The use of foam in cuisine has been used in many forms in the history of cooking:whipped cream, meringue, and mousse are all foams" | | | validated |
| title | collection | description | topic | spatial coverage | state |
| Spheres | Radio cooking collection | Spherification is the culinary process of shaping a liquid into spheres | Demography | European Union | validated |
| Movistar | Radio cooking collection | "The use of foam in cuisine has been used in many forms in the history of cooking:whipped cream, meringue, and mousse are all foams" | | | validated |
And news content:
| title | body | collection | topic | spatial coverage | state |
| El Cabo da Roca | The best in town | Radio cooking collection | Statistics and Analysis | Luxembourg | validated |
| Funny news 1 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated |
| Funny news 2 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated |
| Funny news 3 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated |
| Funny news 4 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated |
| title | body | collection | topic | spatial coverage | state |
| El Cabo da Roca | The best in town | Radio cooking collection | Statistics and Analysis | Luxembourg | validated |
| Funny news 1 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated |
| Funny news 2 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated |
| Funny news 3 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated |
| Funny news 4 | Dummy body | Radio cooking collection | E-inclusion | Luxembourg | validated |

Given I am logged in as a user with the "authenticated" role
When I visit the search page
Expand Down
2 changes: 1 addition & 1 deletion tests/features/solution/homepage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,5 @@ Feature: Solution homepage
And I should not see the link "Supplier exchange"
When I click "HR"
Then the url should match "/search"
Then the option with text "- HR" from select facet form "topic" is selected
Then the "- HR" option from "topic" Slim Select is selected
Then I should see the following facet summary "HR, Solution"
Loading