-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(@dpc-sdp/ripple-tide-search): added tests for map search banner
- Loading branch information
1 parent
20c2925
commit 339a312
Showing
7 changed files
with
89 additions
and
448 deletions.
There are no files selected for viewing
54 changes: 45 additions & 9 deletions
54
examples/nuxt-app/test/features/maps/map-search-banner.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,54 @@ | ||
Feature: Map search banner | ||
|
||
Build test | ||
|
||
Background: | ||
Given the site endpoint returns fixture "/site/reference" with status 200 | ||
|
||
@mockserver | ||
Example: Map search banner (desktop) | ||
Given the page endpoint for path "/map" returns fixture "/maps/example-map-search-banner" with status 200 | ||
Example: Map search banner - Content | ||
Given the page endpoint for path "/search-bar-example" returns fixture "/maps/example-map-search-banner" with status 200 | ||
And I am using a "macbook-16" device | ||
Then I visit the page "/map" | ||
Then I visit the page "/search-bar-example" | ||
Then the location search banner should have the following content | ||
| title | description | inputLabel | placeholder | image | | ||
| Test search heading | Test introduction text | Test label | Test placeholder | /placeholders/mapbg.png | | ||
|
||
@mockserver | ||
Scenario: Map search banner - Custom suggestions | ||
Given I load the page fixture with "/maps/example-map-search-banner" | ||
Given the page endpoint for path "/search-bar-example" returns the loaded fixture | ||
Given the "/api/tide/elasticsearch/elasticsearch_index_develop_node/_search" network request is stubbed with fixture "/maps/simple-map-results" and status 200 as alias "searchReq" | ||
Given I visit the page "/search-bar-example" | ||
And I wait 2 seconds | ||
And I type "bays" into the location search bar | ||
And I wait 2 seconds | ||
And the search suggestions displayed should include | ||
| Test location - testValue - 1 | | ||
| Test location - testValue - 2 | | ||
| With magic key | | ||
And I click the search suggestion labelled "Test location - testValue - 1" | ||
Then the current path should be "/test/target/url" | ||
Then the URL should reflect that the location has the following: | ||
| key | value | | ||
| id | 1 | | ||
| name | Test location - testValue - 1 | | ||
|
||
@mockserver | ||
Example: Map search banner (mobile) | ||
Given the page endpoint for path "/map" returns fixture "/maps/example-map-search-banner" with status 200 | ||
And I am using a "iphone-x" device | ||
Then I visit the page "/map" | ||
Scenario: Map search banner - Suggestions with ArcGIS magic keys | ||
Given the ArcGIS findAddressCandidates endpoint returns "/maps/arcgis-address-candidates" fixture | ||
Given I load the page fixture with "/maps/example-map-search-banner" | ||
Given the page endpoint for path "/search-bar-example" returns the loaded fixture | ||
Given the "/api/tide/elasticsearch/elasticsearch_index_develop_node/_search" network request is stubbed with fixture "/maps/simple-map-results" and status 200 as alias "searchReq" | ||
Given I visit the page "/search-bar-example" | ||
And I wait 2 seconds | ||
And I type "bays" into the location search bar | ||
And I wait 2 seconds | ||
And the search suggestions displayed should include | ||
| Test location - testValue - 1 | | ||
| Test location - testValue - 2 | | ||
| With magic key | | ||
And I click the search suggestion labelled "With magic key" | ||
Then the current path should be "/test/target/url" | ||
Then the URL should reflect that the location has the following: | ||
| key | value | | ||
| id | fake1234 | | ||
| name | 1234 Fake St Fakeville Vic 3000 | |
Oops, something went wrong.