diff --git a/src/pages/Item/Card/CreateGenusForm.vue b/src/pages/Item/Card/CreateGenusForm.vue index 7f8f47729f0..66f5130d4d7 100644 --- a/src/pages/Item/Card/CreateGenusForm.vue +++ b/src/pages/Item/Card/CreateGenusForm.vue @@ -37,7 +37,6 @@ onMounted(async () => { :label="t('Latin genus name')" v-model="data.name" :required="true" - data-cy="AddGenusInput" /> </VnRow> </template> diff --git a/src/pages/Item/Card/CreateSpecieForm.vue b/src/pages/Item/Card/CreateSpecieForm.vue index a68e7688aae..120544fd932 100644 --- a/src/pages/Item/Card/CreateSpecieForm.vue +++ b/src/pages/Item/Card/CreateSpecieForm.vue @@ -37,7 +37,6 @@ onMounted(async () => { :label="t('Latin species name')" v-model="data.name" :required="true" - data-cy="AddSpeciesInput" /> </VnRow> </template> diff --git a/src/pages/Item/ItemListFilter.vue b/src/pages/Item/ItemListFilter.vue index 27914413b19..484265b497b 100644 --- a/src/pages/Item/ItemListFilter.vue +++ b/src/pages/Item/ItemListFilter.vue @@ -199,7 +199,6 @@ onMounted(async () => { dense outlined rounded - data-cy="ItemFilterCategorySelect" > <template #option="scope"> <QItem v-bind="scope.itemProps"> @@ -226,7 +225,6 @@ onMounted(async () => { dense outlined rounded - data-cy="ItemFilterTypeSelect" > <template #option="scope"> <QItem v-bind="scope.itemProps"> diff --git a/test/cypress/integration/item/itemBarcodes.spec.js b/test/cypress/integration/item/itemBarcodes.spec.js index a3fadfa1615..4d17fa260e0 100644 --- a/test/cypress/integration/item/itemBarcodes.spec.js +++ b/test/cypress/integration/item/itemBarcodes.spec.js @@ -10,9 +10,7 @@ describe('Item shelving', () => { it('should throw an error if the barcode exists', () => { cy.get('[href="#/item/1/barcode"]').click(); cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click(); - cy.get( - ':nth-child(4) > div.full-width > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]' - ).type('1111111111'); + cy.dataCy('Code_input').eq(3).type('1111111111'); cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification('Codes can not be repeated'); }); @@ -20,9 +18,7 @@ describe('Item shelving', () => { it('should create a new barcode', () => { cy.get('[href="#/item/1/barcode"]').click(); cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click(); - cy.get( - ':nth-child(4) > div.full-width > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]' - ).type('1231231231'); + cy.dataCy('Code_input').eq(3).type('1231231231'); cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification('Data saved'); }); diff --git a/test/cypress/integration/item/itemBotanical.spec.js b/test/cypress/integration/item/itemBotanical.spec.js index a98040f88a4..e5083609f3e 100644 --- a/test/cypress/integration/item/itemBotanical.spec.js +++ b/test/cypress/integration/item/itemBotanical.spec.js @@ -20,7 +20,7 @@ describe('Item botanical', () => { it('should create a new Genus', () => { cy.get('[href="#/item/1/botanical"]').click(); cy.dataCy('Genus_icon').click(); - cy.dataCy('AddGenusInput').type('Test'); + cy.dataCy('Latin genus name_input').type('Test'); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data created'); }); @@ -28,7 +28,7 @@ describe('Item botanical', () => { it('should create a new specie', () => { cy.get('[href="#/item/1/botanical"]').click(); cy.dataCy('Species_icon').click(); - cy.dataCy('AddSpeciesInput').type('Test specie'); + cy.dataCy('Latin species name_input').type('Test specie'); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data created'); }); diff --git a/test/cypress/integration/item/itemList.spec.js b/test/cypress/integration/item/itemList.spec.js index 4706093e6ef..49e3934513b 100644 --- a/test/cypress/integration/item/itemList.spec.js +++ b/test/cypress/integration/item/itemList.spec.js @@ -9,9 +9,9 @@ describe('Item list', () => { }); it('should filter the items and redirect to the summary', () => { - cy.dataCy('ItemFilterCategorySelect').type('Plant'); + cy.dataCy('Category_select').type('Plant'); cy.get('.q-menu .q-item').contains('Plant').click(); - cy.dataCy('ItemFilterTypeSelect').type('Anthurium'); + cy.dataCy('Type_select').type('Anthurium'); cy.get('.q-menu .q-item').contains('Anthurium').click(); cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click(); }); diff --git a/test/cypress/integration/item/itemTax.spec.js b/test/cypress/integration/item/itemTax.spec.js index 9bb79f40f68..5de8256eab8 100644 --- a/test/cypress/integration/item/itemTax.spec.js +++ b/test/cypress/integration/item/itemTax.spec.js @@ -9,9 +9,7 @@ describe('Item tax', () => { it('should modify the tax for Spain', () => { cy.get('[href="#/item/1/tax"]').click(); - cy.get( - ':nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > [data-cy="Class_select"]' - ).type('General VAT{enter}'); + cy.dataCy('Class_select').eq(1).type('General VAT{enter}'); cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification('Data saved'); }); diff --git a/test/cypress/integration/vnComponent/VnSearchBar.spec.js b/test/cypress/integration/vnComponent/VnSearchBar.spec.js index 885e5d6b3b0..c6a33ab4df4 100644 --- a/test/cypress/integration/vnComponent/VnSearchBar.spec.js +++ b/test/cypress/integration/vnComponent/VnSearchBar.spec.js @@ -16,17 +16,17 @@ describe('VnSearchBar', () => { }); it('should stay on the list page if there are several results or none', () => { - cy.writeSearchbar('salesA{enter}'); + cy.typeSearchbar('salesA{enter}'); checkTableLength(2); cy.clearSearchbar(); - cy.writeSearchbar('0{enter}'); + cy.typeSearchbar('0{enter}'); checkTableLength(0); }); const searchAndCheck = (searchTerm, expectedText) => { cy.clearSearchbar(); - cy.writeSearchbar(`${searchTerm}{enter}`); + cy.typeSearchbar(`${searchTerm}{enter}`); cy.get(idGap).should('have.text', expectedText); }; diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index df2c00e03dd..9acc08c5d70 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -280,7 +280,7 @@ Cypress.Commands.add('clearSearchbar', (element) => { ).clear(); }); -Cypress.Commands.add('writeSearchbar', (value) => { +Cypress.Commands.add('typeSearchbar', (value) => { cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').type( value );