From d913eba277e1dfd136ceff037fa074e553259a40 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 9 Dec 2024 15:18:45 -0300 Subject: [PATCH 1/3] Tests adjustments --- .../integration/admin/PhotosView.spec.js | 1 + .../checkout/CheckoutStepper.commands.js | 2 +- .../integration/config/AccountConfig.spec.js | 1 + src/test/cypress/reports/index.html | 17 +++++++++++++++++ src/test/cypress/support/commands.js | 2 +- 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/test/cypress/reports/index.html diff --git a/src/test/cypress/integration/admin/PhotosView.spec.js b/src/test/cypress/integration/admin/PhotosView.spec.js index 3df15fb6..f5253b4e 100644 --- a/src/test/cypress/integration/admin/PhotosView.spec.js +++ b/src/test/cypress/integration/admin/PhotosView.spec.js @@ -15,6 +15,7 @@ describe('Photo Uploader Component', () => { it('should allow selecting a photo collection', () => { // Simular la selección de una colección de fotos + cy.wait(500); cy.selectOption('[data-testid="photoCollectionSelect"]', 'Enlace'); cy.getValue('[data-testid="photoCollectionSelect"]').should( 'equal', diff --git a/src/test/cypress/integration/checkout/CheckoutStepper.commands.js b/src/test/cypress/integration/checkout/CheckoutStepper.commands.js index f9ae426c..827bab94 100644 --- a/src/test/cypress/integration/checkout/CheckoutStepper.commands.js +++ b/src/test/cypress/integration/checkout/CheckoutStepper.commands.js @@ -1,5 +1,5 @@ const checkoutNextStep = () => { - cy.dataCy('checkoutStepperRightButton').should('be.visible').click(); + cy.dataCy('checkoutStepperRightButton').last().should('be.visible').click(); }; Cypress.Commands.add('createOrderReceive', () => { diff --git a/src/test/cypress/integration/config/AccountConfig.spec.js b/src/test/cypress/integration/config/AccountConfig.spec.js index 97cd10dc..c2309589 100644 --- a/src/test/cypress/integration/config/AccountConfig.spec.js +++ b/src/test/cypress/integration/config/AccountConfig.spec.js @@ -11,6 +11,7 @@ describe('Changes user nickname', () => { it('changes site lang when changing user lang', () => { cy.dataCy('configViewLang').should('exist'); + cy.wait(500); cy.selectOption('[data-testid="configViewLang"]', 'Español'); cy.dataCy('headerTitle').should('contain', 'Configuración'); cy.selectOption('[data-testid="configViewLang"]', 'English'); diff --git a/src/test/cypress/reports/index.html b/src/test/cypress/reports/index.html new file mode 100644 index 00000000..785bb0d1 --- /dev/null +++ b/src/test/cypress/reports/index.html @@ -0,0 +1,17 @@ + +Hedera-Web E2E Reporter
\ No newline at end of file diff --git a/src/test/cypress/support/commands.js b/src/test/cypress/support/commands.js index b4ec3d42..b5befaf4 100644 --- a/src/test/cypress/support/commands.js +++ b/src/test/cypress/support/commands.js @@ -80,7 +80,7 @@ Cypress.Commands.add('setSessionStorage', (key, value) => { }); Cypress.Commands.add('resetDB', () => { - cy.exec('npm run resetDatabase'); + cy.exec('pnpm run db'); }); Cypress.Commands.add('setConfirmDialog', () => { -- 2.40.1 From 99c13866275529b44c5d081fc6fe25214f9be44a Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 9 Dec 2024 15:30:51 -0300 Subject: [PATCH 2/3] Small changes --- src/test/cypress/integration/admin/PhotosView.spec.js | 1 - src/test/cypress/integration/config/AccountConfig.spec.js | 1 - src/test/cypress/support/commands.js | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/cypress/integration/admin/PhotosView.spec.js b/src/test/cypress/integration/admin/PhotosView.spec.js index f5253b4e..3df15fb6 100644 --- a/src/test/cypress/integration/admin/PhotosView.spec.js +++ b/src/test/cypress/integration/admin/PhotosView.spec.js @@ -15,7 +15,6 @@ describe('Photo Uploader Component', () => { it('should allow selecting a photo collection', () => { // Simular la selección de una colección de fotos - cy.wait(500); cy.selectOption('[data-testid="photoCollectionSelect"]', 'Enlace'); cy.getValue('[data-testid="photoCollectionSelect"]').should( 'equal', diff --git a/src/test/cypress/integration/config/AccountConfig.spec.js b/src/test/cypress/integration/config/AccountConfig.spec.js index c2309589..97cd10dc 100644 --- a/src/test/cypress/integration/config/AccountConfig.spec.js +++ b/src/test/cypress/integration/config/AccountConfig.spec.js @@ -11,7 +11,6 @@ describe('Changes user nickname', () => { it('changes site lang when changing user lang', () => { cy.dataCy('configViewLang').should('exist'); - cy.wait(500); cy.selectOption('[data-testid="configViewLang"]', 'Español'); cy.dataCy('headerTitle').should('contain', 'Configuración'); cy.selectOption('[data-testid="configViewLang"]', 'English'); diff --git a/src/test/cypress/support/commands.js b/src/test/cypress/support/commands.js index b5befaf4..2f182661 100644 --- a/src/test/cypress/support/commands.js +++ b/src/test/cypress/support/commands.js @@ -36,6 +36,7 @@ requireCommands.keys().forEach(requireCommands); // Common commands Cypress.Commands.add('selectOption', (selector, option) => { cy.waitForElement(selector); + cy.wait(400); cy.get(selector).click(); cy.get('.q-menu .q-item').contains(option).click(); }); -- 2.40.1 From 3aad2eaeec5010bee7b618ebc8aad7909dae72f3 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 10 Dec 2024 08:57:57 -0300 Subject: [PATCH 3/3] Fix tests and add new test to Catalog --- src/pages/Ecomerce/CatalogCard.vue | 2 ++ src/pages/Ecomerce/CatalogView.vue | 1 + .../cypress/integration/catalog/CatalogView.spec.js | 10 ++++++++++ src/test/cypress/reports/index.html | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/pages/Ecomerce/CatalogCard.vue b/src/pages/Ecomerce/CatalogCard.vue index 611ad1a2..66287664 100644 --- a/src/pages/Ecomerce/CatalogCard.vue +++ b/src/pages/Ecomerce/CatalogCard.vue @@ -28,6 +28,7 @@ const { t } = useI18n(); height="190px" rounded="bottom" zoom-size="1600x900" + data-testid="catalogCardImage" />