diff --git a/tests/e2e/cucumber/my-history.feature b/tests/e2e/cucumber/my-history.feature index 460101d6..321ec3ae 100644 --- a/tests/e2e/cucumber/my-history.feature +++ b/tests/e2e/cucumber/my-history.feature @@ -1,7 +1,5 @@ Feature: My History component - # TODO: Enable test after solving deprecated 'And' - @skip Scenario Outline: 1. Click on a history query closes the modal and searches that query Given start page with "" size view When search bar is clicked diff --git a/tests/e2e/cucumber/my-history.spec.ts b/tests/e2e/cucumber/my-history.spec.ts index 9197823a..821bfc2c 100644 --- a/tests/e2e/cucumber/my-history.spec.ts +++ b/tests/e2e/cucumber/my-history.spec.ts @@ -1,23 +1,23 @@ -import { Then } from '@badeball/cypress-cucumber-preprocessor'; +import { Then, When } from '@badeball/cypress-cucumber-preprocessor'; -// And('my history button is clicked', () => { -// cy.getByDataTest('my-history-button').click(); -// }); +When('my history button is clicked', () => { + cy.getByDataTest('my-history-button').click(); +}); -// And('my history queries are displayed', () => { -// cy.getByDataTest('my-history-query').should('have.length.at.least', 1); -// }); +Then('my history queries are displayed', () => { + cy.getByDataTest('my-history-query').should('have.length.at.least', 1); +}); -// And('my history query number {int} is clicked', (position: number) => { -// cy.getByDataTest('my-history-query').eq(position).getByDataTest('history-query').click(); -// }); +When('my history query number {int} is clicked', (position: number) => { + cy.getByDataTest('my-history-query').eq(position).getByDataTest('history-query').click(); +}); -// And('my history query number {int} delete button is clicked', (position: number) => { -// cy.getByDataTest('my-history-query') -// .eq(position) -// .getByDataTest('remove-history-query') -// .trigger('click'); -// }); +When('my history query number {int} delete button is clicked', (position: number) => { + cy.getByDataTest('my-history-query') + .eq(position) + .getByDataTest('remove-history-query') + .trigger('click'); +}); Then('my history is visible', () => { cy.getByDataTest('my-history-queries').should('be.visible'); diff --git a/tests/e2e/cucumber/no-results.feature b/tests/e2e/cucumber/no-results.feature index 6adbc001..25b965ff 100644 --- a/tests/e2e/cucumber/no-results.feature +++ b/tests/e2e/cucumber/no-results.feature @@ -1,7 +1,5 @@ Feature: No-results component - # TODO: Enable test after solving deprecated 'And' - @skip Scenario Outline: 1. No results message exists and contains the query Given start page with "" size view When search bar is clicked diff --git a/tests/e2e/cucumber/no-results.spec.ts b/tests/e2e/cucumber/no-results.spec.ts index d3afa9b2..3531564a 100644 --- a/tests/e2e/cucumber/no-results.spec.ts +++ b/tests/e2e/cucumber/no-results.spec.ts @@ -4,6 +4,6 @@ Then('no results message is displayed', () => { cy.getByDataTest('no-results-message').should('exist'); }); -// And('there are no results', () => { -// cy.getByDataTest('search-grid-result').should('not.exist'); -// }); +Then('there are no results', () => { + cy.getByDataTest('search-grid-result').should('not.exist'); +}); diff --git a/tests/e2e/cucumber/predictive-components.feature b/tests/e2e/cucumber/predictive-components.feature index dafa14d0..3f883caf 100644 --- a/tests/e2e/cucumber/predictive-components.feature +++ b/tests/e2e/cucumber/predictive-components.feature @@ -1,7 +1,5 @@ Feature: Predictive components - # TODO: Enable test after solving deprecated 'And' - @skip Scenario Outline: 1. Predictive components are displayed as expected Given start page with "" size view When search bar is clicked @@ -21,8 +19,6 @@ Feature: Predictive components | dress | macbook-13 | | dress | iphone-x | - # TODO: Enable test after solving deprecated 'And' - @skip Scenario Outline: 2. Related tags interaction Given start page with "" size view When search bar is clicked @@ -40,8 +36,6 @@ Feature: Predictive components | tshirt | 1 | macbook-13 | | tshirt | 1 | iphone-x | - # TODO: Enable test after solving deprecated 'And' - @skip Scenario Outline: 3. Clear a history query Given start page with "" size view When search bar is clicked @@ -56,8 +50,6 @@ Feature: Predictive components | shirt, shoe, skirt | 0 | macbook-13 | | shirt, shoe, skirt | 0 | iphone-x | - # TODO: Enable test after solving deprecated 'And' - @skip Scenario Outline: 4. Clear all history queries Given start page with "" size view When search bar is clicked diff --git a/tests/e2e/cucumber/predictive-components.spec.ts b/tests/e2e/cucumber/predictive-components.spec.ts index bfaa589e..e5f2f432 100644 --- a/tests/e2e/cucumber/predictive-components.spec.ts +++ b/tests/e2e/cucumber/predictive-components.spec.ts @@ -1,16 +1,16 @@ import { Then, When } from '@badeball/cypress-cucumber-preprocessor'; -// And('recommendations are displayed', () => { -// cy.getByDataTest('recommendation-item').should('have.length.at.least', 1); -// }); +Then('recommendations are displayed', () => { + cy.getByDataTest('recommendation-item').should('have.length.at.least', 1); +}); -// And('search input is focused', () => { -// cy.getByDataTest('search-input').should('be.focused'); -// }); +Then('search input is focused', () => { + cy.getByDataTest('search-input').should('be.focused'); +}); -// And('popular searches are displayed', () => { -// cy.getByDataTest('popular-search').should('have.length.at.least', 1); -// }); +Then('popular searches are displayed', () => { + cy.getByDataTest('popular-search').should('have.length.at.least', 1); +}); Then('query suggestions are displayed', () => { cy.getByDataTest('query-suggestion').should('have.length.at.least', 1); @@ -83,9 +83,9 @@ Then( ); // Scenario 4 -// And('an empty search-box', () => { -// cy.clearSearchInput(); -// }); +When('an empty search-box', () => { + cy.clearSearchInput(); +}); When('clear history queries button is clicked', () => { cy.getByDataTest('clear-history-queries').click();