Skip to content

Commit

Permalink
test: adapting tests to current api response
Browse files Browse the repository at this point in the history
  • Loading branch information
albertjcuac committed Jan 22, 2024
1 parent b1b8043 commit 2335f85
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion public/snippet-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ window.initX = {
{
query: 'dress',
title: 'Autumn dresses by Marni',
filters: ['brand:marni', 'collection:autumn - 2022']
filters: ['brand:marni']
},
{
query: 'belted legging',
Expand Down
56 changes: 28 additions & 28 deletions tests/e2e/cucumber/facets.feature
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,31 @@ Feature: Facets component
| query | filterNumber | facetName | filterNumber2 | facetName2 | view |
| shirt | 2 | brand | 1 | fit | macbook-13 |
| shirt | 2 | brand | 1 | fit | iphone-x |

@skip
# TODO: Resume once the response returns hierarchical filters
Scenario Outline: 5. Hierarchical filters selection
Given start page with "<view>" size view
When search bar is clicked
And "<query>" is searched
Then related results are displayed
When sort and filter button is clicked on "<view>"
Then facets are displayed is true
When facet "<facetName>" is unfolded
And filter <hierarchicalFilter> from facet "<facetName>" is clicked
Then selection status of filter number <hierarchicalFilter> in facet "<facetName>" is true
When child filter <childFilter> from parent filter <hierarchicalFilter> in "<facetName>" is clicked
Then selection status of child filter <childFilter> from parent filter <hierarchicalFilter> in facet "<facetName>" is true
And selection status of filter number <hierarchicalFilter> in facet "<facetName>" is true
When child filter <childFilter> from parent filter <hierarchicalFilter> in "<facetName>" is clicked
Then selection status of child filter <childFilter> from parent filter <hierarchicalFilter> in facet "<facetName>" is false
And selection status of filter number <hierarchicalFilter> in facet "<facetName>" is true
When child filter <childFilter> from parent filter <hierarchicalFilter> in "<facetName>" is clicked
Then selection status of child filter <childFilter> from parent filter <hierarchicalFilter> in facet "<facetName>" is true
When filter <hierarchicalFilter> from facet "<facetName>" is clicked
Then selection status of child filter <childFilter> from parent filter <hierarchicalFilter> in facet "<facetName>" is false
And selection status of filter number <hierarchicalFilter> in facet "<facetName>" is false
Examples:
| query | hierarchicalFilter | childFilter | facetName | view |
| shirt | 0 | 0 | categoryPaths | macbook-13 |
| shirt | 0 | 0 | categoryPaths | iphone-x |
# Scenario commented because skip tag is not working
# @skip
# # TODO: Resume once the response returns hierarchical filters
# Scenario Outline: 5. Hierarchical filters selection
# Given start page with "<view>" size view
# When search bar is clicked
# And "<query>" is searched
# Then related results are displayed
# When sort and filter button is clicked on "<view>"
# Then facets are displayed is true
# When facet "<facetName>" is unfolded
# And filter <hierarchicalFilter> from facet "<facetName>" is clicked
# Then selection status of filter number <hierarchicalFilter> in facet "<facetName>" is true
# When child filter <childFilter> from parent filter <hierarchicalFilter> in "<facetName>" is clicked
# Then selection status of child filter <childFilter> from parent filter <hierarchicalFilter> in facet "<facetName>" is true
# And selection status of filter number <hierarchicalFilter> in facet "<facetName>" is true
# When child filter <childFilter> from parent filter <hierarchicalFilter> in "<facetName>" is clicked
# Then selection status of child filter <childFilter> from parent filter <hierarchicalFilter> in facet "<facetName>" is false
# And selection status of filter number <hierarchicalFilter> in facet "<facetName>" is true
# When child filter <childFilter> from parent filter <hierarchicalFilter> in "<facetName>" is clicked
# Then selection status of child filter <childFilter> from parent filter <hierarchicalFilter> in facet "<facetName>" is true
# When filter <hierarchicalFilter> from facet "<facetName>" is clicked
# Then selection status of child filter <childFilter> from parent filter <hierarchicalFilter> in facet "<facetName>" is false
# And selection status of filter number <hierarchicalFilter> in facet "<facetName>" is false
# Examples:
# | query | hierarchicalFilter | childFilter | facetName | view |
# | shirt | 0 | 0 | categoryPaths | macbook-13 |
# | shirt | 0 | 0 | categoryPaths | iphone-x |
2 changes: 1 addition & 1 deletion tests/e2e/cucumber/scroll.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Then('scroll position is at top', () => {
*/
When('scrolling down to the bottom', () => {
cy.getByDataTest('query-preview-item')
.should('have.length.at.least', 5)
.should('have.length.at.least', 2)
.then(() => {
cy.getByDataTest('base-scroll').scrollTo('center', { duration: 1000 });
cy.getByDataTest('base-scroll').scrollTo('bottom', { duration: 500 });
Expand Down

0 comments on commit 2335f85

Please sign in to comment.