Skip to content

Commit

Permalink
tests: change queries for RT and make RT tests more robust (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
CachedaCodes authored Oct 17, 2023
1 parent 4326f6f commit b5bd3ff
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
Binary file added cypress/downloads/downloads.html
Binary file not shown.
6 changes: 3 additions & 3 deletions tests/e2e/cucumber/multiple-interactions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ Feature: Multiple interactions
Then related results have changed

Examples:
| query | view | nextQueryItem | filterNumber | facetName | queryWithRTs | relatedTagItem |
| tshirt | macbook-13 | 1 | 2 | brand | shorts | 1 |
| tshirt | iphone-x | 1 | 2 | brand | shorts | 1 |
| query | view | nextQueryItem | filterNumber | facetName | queryWithRTs | relatedTagItem |
| tshirt | macbook-13 | 1 | 2 | brand | tshirt | 1 |
| tshirt | iphone-x | 1 | 2 | brand | tshirt | 1 |
8 changes: 8 additions & 0 deletions tests/e2e/cucumber/multiple-interactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ When('related tag number {int} is clicked', (relatedTagItem: number) => {
.invoke('text')
.as('clickedRelatedTag');
});

When('clicked related tag is clicked again', function (this: { clickedRelatedTag: string }) {
cy.getByDataTest('related-tag')
.contains(this.clickedRelatedTag)
.click()
.invoke('text')
.as('clickedRelatedTag');
});
2 changes: 1 addition & 1 deletion tests/e2e/cucumber/predictive-components.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: Predictive components
When related tag <relatedTagIndex> is clicked
Then a search request from "related_tag" is done
And clicked related tag is shown in position 0 as selected
When related tag 0 is clicked
When clicked related tag is clicked again
Then a search request from "related_tag" is done
And related tag <relatedTagIndex> is displayed as not selected
Examples:
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/cucumber/scroll.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ Feature: Scroll
Then scroll position is at top

Examples:
| query | view | resultId |
| shirt | macbook-13 | result-12 |
| shirt | iphone-x | result-12 |
| query | view | resultId |
| tshirt | macbook-13 | result-12 |
| tshirt | iphone-x | result-12 |

Scenario Outline: 2. Scroll position is at end and toolbar is hidden
Given start page with "<view>" size view
Expand All @@ -35,5 +35,5 @@ Feature: Scroll
Then subheader is not visible

Examples:
| query | view |
| shirt | macbook-13 |
| query | view |
| tshirt | macbook-13 |
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', 10)
.should('have.length.at.least', 5)
.then(() => {
cy.getByDataTest('base-scroll').scrollTo('center', { duration: 1000 });
cy.getByDataTest('base-scroll').scrollTo('bottom', { duration: 500 });
Expand Down

0 comments on commit b5bd3ff

Please sign in to comment.