From 829c5439197cbecf4df4068a4a5fd6074aba19a9 Mon Sep 17 00:00:00 2001 From: beatrizmaselli Date: Mon, 6 Nov 2023 16:25:50 -0300 Subject: [PATCH 1/5] Enable tests --- CHANGELOG.md | 3 +++ cy-runner.yml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25ff1ca..0f5ac76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Enable and fix cypress tests + ## [0.11.0] - 2023-11-06 + ### Fixed + - removing the added holiday day, and included the locale sent in the intl. diff --git a/cy-runner.yml b/cy-runner.yml index 132b0a2..55573fb 100644 --- a/cy-runner.yml +++ b/cy-runner.yml @@ -87,7 +87,7 @@ strategy: - cypress/integration/2.2.2-add_multiple_pickup_points_via_csv.spec.js # add pickup points and order the product verifyPickupPoints: - enabled: false + enabled: true sendDashboard: true hardTries: 4 stopOnFail: false @@ -101,7 +101,7 @@ strategy: - cypress/integration/2.2.2-add_multiple_pickup_points_via_csv.spec.js # inactive pickup points should not be shown inactivePickupPoints: - enabled: false + enabled: true sendDashboard: true hardTries: 3 stopOnFail: false From bfc0063e1fb97113ae312528606dda348b709bfc Mon Sep 17 00:00:00 2001 From: beatrizmaselli Date: Mon, 6 Nov 2023 18:49:57 -0300 Subject: [PATCH 2/5] add search product --- ....4-order_product_via_pick_up_store.spec.js | 3 ++- cypress/support/commands.js | 2 +- cypress/support/search_product.js | 27 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 cypress/support/search_product.js diff --git a/cypress/integration/2.4-order_product_via_pick_up_store.spec.js b/cypress/integration/2.4-order_product_via_pick_up_store.spec.js index b42187f..59a07f4 100644 --- a/cypress/integration/2.4-order_product_via_pick_up_store.spec.js +++ b/cypress/integration/2.4-order_product_via_pick_up_store.spec.js @@ -1,5 +1,6 @@ import { testSetup, updateRetry } from '../support/common/support' import { pickupTestCase } from '../support/outputvalidation.js' +import { searchProduct } from '../support/search_product.js' describe('Test pickup in checkout with one of the pickup points created in 2.2 testcase', () => { // Load test setup @@ -10,7 +11,7 @@ describe('Test pickup in checkout with one of the pickup points created in 2.2 t it(`${prefix} - Adding product to cart`, updateRetry(2), () => { // Search the product - cy.searchProduct(productName) + searchProduct(productName) // Add product to cart cy.addProduct(productName) }) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 5b611e9..0ae1005 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -24,7 +24,7 @@ Cypress.Commands.add('getPickupPointItem', () => { }) Cypress.Commands.add('visitStore', () => { - cy.intercept('**/event-api/v1/productusqa/event').as('events') + cy.intercept('**/event-api/v1/*/event').as('events') cy.visit('/api/io/stores') cy.wait('@events') diff --git a/cypress/support/search_product.js b/cypress/support/search_product.js new file mode 100644 index 0000000..923466c --- /dev/null +++ b/cypress/support/search_product.js @@ -0,0 +1,27 @@ +export function searchProduct(searchKey) { + cy.qe( + `Adding intercept to wait for the events API to be completed before visting home page` + ) + cy.intercept('**/event-api/v1/*/event').as('events') + cy.visit('/') + cy.wait('@events') + cy.qe("Verify the store front page should contain 'Hello'") + cy.get('body').should('contain', 'Hello') + cy.qe('Verifying the search bar should be visible in the store front') + cy.qe(`searching product - ${searchKey} in the store front search bar`) + // Search product in search bar + cy.get(selectors.Search) + .should('be.visible') + .clear() + .type(searchKey) + .type('{enter}') + // Page should load successfully now searchResult & Filter should be visible + cy.qe( + `Verfiying the search result is visible and having the text ${searchKey} in lowercase` + ) + cy.get(selectors.searchResult) + .should('be.visible') + .should('have.text', searchKey.toLowerCase()) + cy.qe(`Verifying the filterHeading should be visible`) + cy.get(selectors.FilterHeading).should('be.visible') +} From 60e9d0d84d4bd8789b7a4326692f965bee14e7c9 Mon Sep 17 00:00:00 2001 From: beatrizmaselli Date: Mon, 6 Nov 2023 18:57:58 -0300 Subject: [PATCH 3/5] add cy.searchProduct --- ....4-order_product_via_pick_up_store.spec.js | 3 +-- cypress/support/search_product.js | 27 ------------------- 2 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 cypress/support/search_product.js diff --git a/cypress/integration/2.4-order_product_via_pick_up_store.spec.js b/cypress/integration/2.4-order_product_via_pick_up_store.spec.js index 59a07f4..b42187f 100644 --- a/cypress/integration/2.4-order_product_via_pick_up_store.spec.js +++ b/cypress/integration/2.4-order_product_via_pick_up_store.spec.js @@ -1,6 +1,5 @@ import { testSetup, updateRetry } from '../support/common/support' import { pickupTestCase } from '../support/outputvalidation.js' -import { searchProduct } from '../support/search_product.js' describe('Test pickup in checkout with one of the pickup points created in 2.2 testcase', () => { // Load test setup @@ -11,7 +10,7 @@ describe('Test pickup in checkout with one of the pickup points created in 2.2 t it(`${prefix} - Adding product to cart`, updateRetry(2), () => { // Search the product - searchProduct(productName) + cy.searchProduct(productName) // Add product to cart cy.addProduct(productName) }) diff --git a/cypress/support/search_product.js b/cypress/support/search_product.js deleted file mode 100644 index 923466c..0000000 --- a/cypress/support/search_product.js +++ /dev/null @@ -1,27 +0,0 @@ -export function searchProduct(searchKey) { - cy.qe( - `Adding intercept to wait for the events API to be completed before visting home page` - ) - cy.intercept('**/event-api/v1/*/event').as('events') - cy.visit('/') - cy.wait('@events') - cy.qe("Verify the store front page should contain 'Hello'") - cy.get('body').should('contain', 'Hello') - cy.qe('Verifying the search bar should be visible in the store front') - cy.qe(`searching product - ${searchKey} in the store front search bar`) - // Search product in search bar - cy.get(selectors.Search) - .should('be.visible') - .clear() - .type(searchKey) - .type('{enter}') - // Page should load successfully now searchResult & Filter should be visible - cy.qe( - `Verfiying the search result is visible and having the text ${searchKey} in lowercase` - ) - cy.get(selectors.searchResult) - .should('be.visible') - .should('have.text', searchKey.toLowerCase()) - cy.qe(`Verifying the filterHeading should be visible`) - cy.get(selectors.FilterHeading).should('be.visible') -} From 2b752ff5ad6983be3f7e0e427b31818eb004155e Mon Sep 17 00:00:00 2001 From: beatrizmaselli Date: Mon, 6 Nov 2023 19:47:21 -0300 Subject: [PATCH 4/5] update branch from cy-runner --- .github/workflows/qe-dispatch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qe-dispatch.yml b/.github/workflows/qe-dispatch.yml index 6656b3f..9587396 100644 --- a/.github/workflows/qe-dispatch.yml +++ b/.github/workflows/qe-dispatch.yml @@ -5,7 +5,7 @@ on: inputs: cyRunnerBranch: description: 'Which branch to use on Cy-Runner?' - default: 'main' + default: 'fix/rc-events' cyRunnerTimeOut: description: 'Wait how much time (in minutes) for the job to complete?' default: '30' From 95828d5af10636c5cf1afa017e0dcc54039a0f82 Mon Sep 17 00:00:00 2001 From: beatrizmaselli Date: Tue, 7 Nov 2023 11:00:07 -0300 Subject: [PATCH 5/5] change default branch --- .github/workflows/qe-dispatch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qe-dispatch.yml b/.github/workflows/qe-dispatch.yml index 9587396..6656b3f 100644 --- a/.github/workflows/qe-dispatch.yml +++ b/.github/workflows/qe-dispatch.yml @@ -5,7 +5,7 @@ on: inputs: cyRunnerBranch: description: 'Which branch to use on Cy-Runner?' - default: 'fix/rc-events' + default: 'main' cyRunnerTimeOut: description: 'Wait how much time (in minutes) for the job to complete?' default: '30'