From eea2ad79847ead3e251cc047760fac534a294f10 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Thu, 24 Oct 2024 14:04:07 -0300 Subject: [PATCH] Adjustments --- .../cypress/integration/UserFlows.spec.js | 5 +++- .../integration/admin/UsersView.spec.js | 5 +++- .../integration/catalog/CatalogView.spec.js | 24 +++++++------------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/test/cypress/integration/UserFlows.spec.js b/src/test/cypress/integration/UserFlows.spec.js index fd6502ee..0f328170 100644 --- a/src/test/cypress/integration/UserFlows.spec.js +++ b/src/test/cypress/integration/UserFlows.spec.js @@ -1,4 +1,8 @@ describe('User flow: Login, create a new order, add item to basket and go to confirm view', () => { + before(() => { + cy.resetDB(); + }); + it('success', () => { // 1- Loguear como empleado cy.login('employee'); @@ -17,6 +21,5 @@ describe('User flow: Login, create a new order, add item to basket and go to con cy.dataCy('basketToConfirmBtn').should('exist'); cy.dataCy('basketToConfirmBtn').click(); cy.url().should('contain', '/#/ecomerce/confirm'); - cy.resetDB(); }); }); diff --git a/src/test/cypress/integration/admin/UsersView.spec.js b/src/test/cypress/integration/admin/UsersView.spec.js index 420fa3c5..6e244e39 100644 --- a/src/test/cypress/integration/admin/UsersView.spec.js +++ b/src/test/cypress/integration/admin/UsersView.spec.js @@ -1,4 +1,8 @@ describe('UsersView', () => { + before(() => { + cy.resetDB(); + }); + beforeEach(() => { cy.login('adminboss'); cy.visit('/#/admin/users'); @@ -23,6 +27,5 @@ describe('UsersView', () => { 'contain', 'New test nickname' ); - cy.resetDB(); }); }); diff --git a/src/test/cypress/integration/catalog/CatalogView.spec.js b/src/test/cypress/integration/catalog/CatalogView.spec.js index d7e90a96..5969db9d 100644 --- a/src/test/cypress/integration/catalog/CatalogView.spec.js +++ b/src/test/cypress/integration/catalog/CatalogView.spec.js @@ -1,17 +1,11 @@ describe('CatalogView', () => { - // beforeEach(() => { - // // 1- Loguear usuario - // cy.login('developer'); - // // 2- Crear una orden - // cy.resetDB(); - // cy.createOrderReceiveFlow(); - // }); - // it('Adds item to basket', () => { - // cy.addItemToBasketFlow(); - // }); - // it('Goes to basket', () => { - // cy.dataCy('catalogGoToBasketButton').should('exist'); - // cy.dataCy('catalogGoToBasketButton').click(); - // cy.url().should('contain', '/#/ecomerce/basket'); - // }); + it('Adds item to basket and goes to basket', () => { + cy.resetDB(); + cy.login('developer'); + cy.createOrderReceiveFlow(); + cy.addItemToBasketFlow(); + cy.dataCy('catalogGoToBasketButton').should('exist'); + cy.dataCy('catalogGoToBasketButton').click(); + cy.url().should('contain', '/#/ecomerce/basket'); + }); });