fix: refs #8583 workerE2E

This commit is contained in:
Carlos Satorres 2025-03-07 07:15:41 +01:00
parent cbc907a54b
commit 2b3308bde7
5 changed files with 25 additions and 39 deletions

View File

@ -68,8 +68,14 @@ const deleteRelative = async (id) => {
:label="t('familySituation')"
clearable
v-model="data.familySituation"
data-cy="familySituation"
/>
<VnInput
:label="t('spouseNif')"
clearable
v-model="data.spouseNif"
data-cy="spouseNif"
/>
<VnInput :label="t('spouseNif')" clearable v-model="data.spouseNif" />
</VnRow>
<VnRow>
<VnSelect
@ -93,11 +99,13 @@ const deleteRelative = async (id) => {
clearable
v-model="data.childPension"
:label="t(`childPension`)"
data-cy="childPension"
/>
<VnInput
clearable
v-model="data.spousePension"
:label="t(`spousePension`)"
data-cy="spousePension"
/>
</VnRow>
<VnRow wrap>
@ -190,12 +198,14 @@ const deleteRelative = async (id) => {
type="number"
v-model="row.birthed"
:label="t(`birthed`)"
data-cy="birthed"
/>
<VnInput
type="number"
v-model="row.adoptionYear"
:label="t(`adoptionYear`)"
data-cy="adoptionYear"
/>
<QCheckbox
v-model="row.isDependend"

View File

@ -1,9 +1,4 @@
describe('WorkerBasicData', () => {
const maritalStatusSelect = '[data-cy="MaritalStatus"]';
const countrySelect = '[data-cy="country"]';
const country = 'Alemania';
const nif = '42572374H';
const fi = '[data-cy="fi"]';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@ -11,9 +6,9 @@ describe('WorkerBasicData', () => {
});
it('should modify worker summary', () => {
cy.get(maritalStatusSelect).type('Married');
cy.get(fi).type(nif);
cy.get(countrySelect).type(country);
cy.dataCy('MaritalStatus').type('Married');
cy.dataCy('fi').type('42572374H');
cy.dataCy('country').type('Alemania');
cy.saveCard();
cy.checkNotification('Data saved');
});

View File

@ -1,11 +1,6 @@
/// <reference types="cypress" />
describe('WorkerNotes', () => {
const userId = 1106;
const addNote = '[data-cy="addNote"]';
const numberOfWagons = '[data-cy="numberOfWagons"]';
const linesLimit = '[data-cy="linesLimit"]';
const volumeLimit = '[data-cy="volumeLimit"]';
const sizeLimit = '[data-cy="sizeLimit"]';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');

View File

@ -13,10 +13,10 @@ describe('WorkerOperator', () => {
});
it('should fill the operator form', () => {
cy.get(numberOfWagons).type(nWagons);
cy.get(linesLimit).type('6');
cy.get(volumeLimit).type('3');
cy.get(sizeLimit).type('3');
cy.dataCy('numberOfWagons').type(nWagons);
cy.dataCy('linesLimit').type('6');
cy.get('volumeLimit').type('3');
cy.get('sizeLimit').type('3');
cy.saveCard();
cy.checkNotification('Data saved');

View File

@ -1,19 +1,5 @@
describe('WorkerPit', () => {
const familySituationInput = '[data-cy="Family Situation_input"]';
const familySituation = '1';
const childPensionInput = '[data-cy="Child Pension_input"]';
const childPension = '120';
const spouseNifInput = '[data-cy="Spouse Pension_input"]';
const spouseNif = '65117125P';
const spousePensionInput = '[data-cy="Spouse Pension_input"]';
const spousePension = '120';
const addRelative = '[data-cy="addRelative"]';
const isDescendantSelect = '[data-cy="Descendant/Ascendant"]';
const Descendant = 'Descendiente';
const birthedInput = '[data-cy="Birth Year_input"]';
const birthed = '2002';
const adoptionYearInput = '[data-cy="Adoption Year_input"]';
const adoptionYear = '2004';
const saveRelative = '[data-cy="workerPitRelativeSaveBtn"]';
const savePIT = '#st-actions > .q-btn-group > .q-btn--standard';
@ -24,15 +10,15 @@ describe('WorkerPit', () => {
});
it('complete PIT', () => {
cy.get(familySituationInput).type(familySituation);
cy.get(childPensionInput).type(childPension);
cy.get(spouseNifInput).type(spouseNif);
cy.get(spousePensionInput).type(spousePension);
cy.dataCy('familySituation').type('1');
cy.dataCy('childPension').type('120');
cy.dataCy('spouseNif').type('65117125P');
cy.dataCy('spousePension').type('120');
cy.get(savePIT).click();
cy.get(addRelative).click();
cy.get(isDescendantSelect).type(Descendant);
cy.get(birthedInput).type(birthed);
cy.get(adoptionYearInput).type(adoptionYear);
cy.dataCy('Descendant/Ascendant').type('Descendiente');
cy.dataCy('birthed').type('2002');
cy.dataCy('adoptionYear').type('2004');
cy.get(saveRelative).click();
});
});