test: add e2e

This commit is contained in:
Javier Segarra 2024-11-22 10:16:56 +01:00
parent c6b547bc55
commit 8a4a6061e7
2 changed files with 10 additions and 3 deletions

View File

@ -94,6 +94,7 @@ const exprBuilder = (param, value) => {
:rules="validate('client.phone')" :rules="validate('client.phone')"
clearable clearable
v-model="data.phone" v-model="data.phone"
data-cy="customerPhone"
/> />
<VnInput <VnInput
:label="t('customer.basicData.mobile')" :label="t('customer.basicData.mobile')"

View File

@ -3,11 +3,17 @@ describe('Client basic data', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1280, 720); cy.viewport(1280, 720);
cy.login('developer'); cy.login('developer');
cy.visit('#/customer/1110/basic-data', { cy.visit('#/customer/1102/basic-data');
timeout: 5000,
});
}); });
it('Should load layout', () => { it('Should load layout', () => {
cy.get('.q-card').should('be.visible'); 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');
}); });
}); });