From 8a4a6061e7d0e9faa4af5be0f30f1d77ed67a303 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 22 Nov 2024 10:16:56 +0100 Subject: [PATCH] test: add e2e --- src/pages/Customer/Card/CustomerBasicData.vue | 1 + .../integration/client/clientBasicData.spec.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index d31669b43..e32507c7d 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -94,6 +94,7 @@ const exprBuilder = (param, value) => { :rules="validate('client.phone')" clearable v-model="data.phone" + data-cy="customerPhone" /> { beforeEach(() => { cy.viewport(1280, 720); cy.login('developer'); - cy.visit('#/customer/1110/basic-data', { - timeout: 5000, - }); + cy.visit('#/customer/1102/basic-data'); }); it('Should load layout', () => { cy.get('.q-card').should('be.visible'); + cy.get('[data-cy="customerPhone"]').filter('input').should('be.visible'); + cy.get('[data-cy="customerPhone"]').filter('input').type('123456789'); + cy.get('.q-btn-group > .q-btn--standard').click(); + cy.intercept('PATCH', '/api/Clients/1102', (req) => { + const { body } = req; + cy.wrap(body).should('have.property', 'phone', '123456789'); + }); + cy.get('.q-notification__message').should('have.text', 'Data saved'); }); });