From 118c7e9002a966a4c1581fd17f37d6169c3bed5b Mon Sep 17 00:00:00 2001 From: Guillermo Date: Mon, 16 Oct 2023 13:53:34 +0200 Subject: [PATCH] tests: change queries for RT and make RT tests more robust EMP-2485 --- tests/e2e/cucumber/multiple-interactions.feature | 4 ++-- tests/e2e/cucumber/multiple-interactions.spec.ts | 8 ++++++++ tests/e2e/cucumber/predictive-components.feature | 2 +- tests/e2e/cucumber/scroll.feature | 10 +++++----- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/e2e/cucumber/multiple-interactions.feature b/tests/e2e/cucumber/multiple-interactions.feature index 80a15030..685cb136 100644 --- a/tests/e2e/cucumber/multiple-interactions.feature +++ b/tests/e2e/cucumber/multiple-interactions.feature @@ -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 | diff --git a/tests/e2e/cucumber/multiple-interactions.spec.ts b/tests/e2e/cucumber/multiple-interactions.spec.ts index d211d1e6..f518ade8 100644 --- a/tests/e2e/cucumber/multiple-interactions.spec.ts +++ b/tests/e2e/cucumber/multiple-interactions.spec.ts @@ -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'); +}); diff --git a/tests/e2e/cucumber/predictive-components.feature b/tests/e2e/cucumber/predictive-components.feature index 1a900fc1..3f883caf 100644 --- a/tests/e2e/cucumber/predictive-components.feature +++ b/tests/e2e/cucumber/predictive-components.feature @@ -28,7 +28,7 @@ Feature: Predictive components When related tag 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 is displayed as not selected Examples: diff --git a/tests/e2e/cucumber/scroll.feature b/tests/e2e/cucumber/scroll.feature index 6bc9717d..59b5f870 100644 --- a/tests/e2e/cucumber/scroll.feature +++ b/tests/e2e/cucumber/scroll.feature @@ -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 "" size view @@ -35,5 +35,5 @@ Feature: Scroll Then subheader is not visible Examples: - | query | view | - | shirt | macbook-13 | + | query | view | + | tshirt | macbook-13 |