Skip to content

Commit

Permalink
tests: change queries for RT and make RT tests more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
CachedaCodes committed Oct 16, 2023
1 parent 8567c40 commit 118c7e9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/cucumber/multiple-interactions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Feature: Multiple interactions

Examples:
| query | view | nextQueryItem | filterNumber | facetName | queryWithRTs | relatedTagItem |
| tshirt | macbook-13 | 1 | 2 | brand | shorts | 1 |
| tshirt | iphone-x | 1 | 2 | brand | shorts | 1 |
| 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 |

0 comments on commit 118c7e9

Please sign in to comment.