diff --git a/src/components/common/VnSelectDialog.vue b/src/components/common/VnSelectDialog.vue
index 37397c4c3..12322c3fa 100644
--- a/src/components/common/VnSelectDialog.vue
+++ b/src/components/common/VnSelectDialog.vue
@@ -51,7 +51,6 @@ const isAllowedToCreate = computed(() => {
:style="{
'font-variation-settings': `'FILL' ${1}`,
}"
- :data-cy="`SelectDialogAddIcon-${$attrs.label || 'default'}`"
>
{{ tooltip }}
diff --git a/src/pages/Item/Card/CreateGenusForm.vue b/src/pages/Item/Card/CreateGenusForm.vue
index 66f5130d4..7f8f47729 100644
--- a/src/pages/Item/Card/CreateGenusForm.vue
+++ b/src/pages/Item/Card/CreateGenusForm.vue
@@ -37,6 +37,7 @@ onMounted(async () => {
:label="t('Latin genus name')"
v-model="data.name"
:required="true"
+ data-cy="AddGenusInput"
/>
diff --git a/src/pages/Item/Card/CreateSpecieForm.vue b/src/pages/Item/Card/CreateSpecieForm.vue
index 120544fd9..a68e7688a 100644
--- a/src/pages/Item/Card/CreateSpecieForm.vue
+++ b/src/pages/Item/Card/CreateSpecieForm.vue
@@ -37,6 +37,7 @@ onMounted(async () => {
:label="t('Latin species name')"
v-model="data.name"
:required="true"
+ data-cy="AddSpeciesInput"
/>
diff --git a/src/pages/Item/Card/ItemBotanical.vue b/src/pages/Item/Card/ItemBotanical.vue
index 57774f75e..4894d94fc 100644
--- a/src/pages/Item/Card/ItemBotanical.vue
+++ b/src/pages/Item/Card/ItemBotanical.vue
@@ -52,6 +52,7 @@ const entityId = computed(() => {
:fields="['id', 'name']"
sort-by="name ASC"
hide-selected
+ data-cy="AddGenusSelectDialog"
>
{
:fields="['id', 'name']"
sort-by="name ASC"
hide-selected
+ data-cy="AddSpeciesSelectDialog"
>
[
align: 'left',
label: t('worker'),
name: 'workerFk',
- name: 'workerFk',
create: true,
component: 'select',
attrs: {
diff --git a/test/cypress/integration/item/itemBotanical.spec.js b/test/cypress/integration/item/itemBotanical.spec.js
index 4d7e40f76..e726fb8c3 100644
--- a/test/cypress/integration/item/itemBotanical.spec.js
+++ b/test/cypress/integration/item/itemBotanical.spec.js
@@ -9,9 +9,9 @@ describe('Item botanical', () => {
it('should modify the botanical', () => {
cy.get('[href="#/item/1/botanical"]').click();
- cy.get('[data-cy="Genus_select"]').type('Abies');
+ cy.dataCy('AddGenusSelectDialog').type('Abies');
cy.get('.q-menu .q-item').contains('Abies').click();
- cy.get('[data-cy="Species_select"]').type('dealbata');
+ cy.dataCy('AddSpeciesSelectDialog').type('dealbata');
cy.get('.q-menu .q-item').contains('dealbata').click();
cy.get('.q-btn-group > .q-btn--standard').click();
cy.checkNotification('Data saved');
@@ -19,17 +19,17 @@ describe('Item botanical', () => {
it('should create a new Genus', () => {
cy.get('[href="#/item/1/botanical"]').click();
- cy.get('[data-cy="SelectDialogAddIcon-Genus"]').click();
- cy.get('[data-cy="Latin genus name_input"]').type('Test');
- cy.get('[data-cy="FormModelPopup_save"]').click();
+ cy.dataCy('Genus_icon').click();
+ cy.dataCy('AddGenusInput').type('Test');
+ cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
});
it('should create a new specie', () => {
cy.get('[href="#/item/1/botanical"]').click();
- cy.get('[data-cy="SelectDialogAddIcon-Species"]').click();
- cy.get('[data-cy="Latin species name_input"]').type('Test specie');
- cy.get('[data-cy="FormModelPopup_save"]').click();
+ cy.dataCy('Species_icon').click();
+ cy.dataCy('AddSpeciesInput').type('Test specie');
+ cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
});
});
diff --git a/test/cypress/integration/item/itemSummary.spec.js b/test/cypress/integration/item/itemSummary.spec.js
index e7c1ec1ab..24b689686 100644
--- a/test/cypress/integration/item/itemSummary.spec.js
+++ b/test/cypress/integration/item/itemSummary.spec.js
@@ -8,18 +8,18 @@ describe('Item summary', () => {
});
it('should clone the item', () => {
- cy.get('[data-cy="descriptor-more-opts"] > .q-btn__content').click();
+ cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(2) > .q-item__section').click();
- cy.get('[data-cy="VnConfirm_confirm"]').click();
+ cy.dataCy('VnConfirm_confirm').click();
cy.waitForElement('[data-cy="itemTags"]');
- cy.get('[data-cy="itemTags"]').should('be.visible');
+ cy.dataCy('itemTags').should('be.visible');
});
it('should regularize stock', () => {
- cy.get('[data-cy="descriptor-more-opts"] > .q-btn__content').click();
+ cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(1) > .q-item__section').click();
- cy.get('[data-cy="regularizeStockInput"]').type('10');
- cy.get('[data-cy="Warehouse_select"]').type('Warehouse One{enter}');
+ cy.dataCy('regularizeStockInput').type('10');
+ cy.dataCy('Warehouse_select').type('Warehouse One{enter}');
cy.checkNotification('Data created');
});
});
diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js
index 2fc54b122..07cd21aef 100644
--- a/test/cypress/integration/item/itemTag.spec.js
+++ b/test/cypress/integration/item/itemTag.spec.js
@@ -7,6 +7,7 @@ describe('Item tag', () => {
cy.get('#searchbar input').type('1{enter}');
});
+ // falla la notificacion
it('should throw an error adding an existent tag', () => {
cy.get('[href="#/item/1/tags"]').click();
cy.get('.q-page-sticky > div').click();
@@ -17,7 +18,7 @@ describe('Item tag', () => {
cy.get(
':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]'
).type('1');
- cy.get('[data-cy="crudModelDefaultSaveBtn"]').click();
+ cy.dataCy('crudModelDefaultSaveBtn').click();
cy.checkNotification("The tag or priority can't be repeated for an item");
});
@@ -31,7 +32,7 @@ describe('Item tag', () => {
cy.get(
':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]'
).type('50');
- cy.get('[data-cy="crudModelDefaultSaveBtn"]').click();
+ cy.dataCy('crudModelDefaultSaveBtn').click();
cy.checkNotification('Data saved');
});
});
diff --git a/test/cypress/integration/item/itemTax.spec.js b/test/cypress/integration/item/itemTax.spec.js
index b0d67ab5a..1de0183d7 100644
--- a/test/cypress/integration/item/itemTax.spec.js
+++ b/test/cypress/integration/item/itemTax.spec.js
@@ -12,7 +12,7 @@ describe('Item tax', () => {
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.get('[data-cy="crudModelDefaultSaveBtn"]').click();
+ cy.dataCy('crudModelDefaultSaveBtn').click();
cy.checkNotification('Data saved');
});
});
diff --git a/test/cypress/integration/item/itemType.spec.js b/test/cypress/integration/item/itemType.spec.js
index 211ab8492..b0a7b0ca9 100644
--- a/test/cypress/integration/item/itemType.spec.js
+++ b/test/cypress/integration/item/itemType.spec.js
@@ -1,5 +1,5 @@
///
-describe('Item shelving', () => {
+describe('Item type', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
@@ -7,34 +7,34 @@ describe('Item shelving', () => {
});
it('should throw an error if the code already exists', () => {
- cy.get('[data-cy="vnTableCreateBtn"]').click();
+ cy.dataCy('vnTableCreateBtn').click();
cy.get(
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]'
).type('ALS');
cy.get(
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]'
).type('Alstroemeria');
- cy.get('[data-cy="Worker_select"]').type('employeeNick');
+ cy.dataCy('Worker_select').type('employeeNick');
cy.get('.q-menu .q-item').contains('employeeNick').click();
- cy.get('[data-cy="ItemCategory_select"]').type('Artificial');
+ cy.dataCy('ItemCategory_select').type('Artificial');
cy.get('.q-menu .q-item').contains('Artificial').click();
- cy.get('[data-cy="FormModelPopup_save"]').click();
+ cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('An item type with the same code already exists');
});
it('should create a new type', () => {
- cy.get('[data-cy="vnTableCreateBtn"]').click();
+ cy.dataCy('vnTableCreateBtn').click();
cy.get(
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Code_input"]'
).type('LIL');
cy.get(
'div.fit > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Name_input"]'
).type('Lilium');
- cy.get('[data-cy="Worker_select"]').type('buyerNick');
+ cy.dataCy('Worker_select').type('buyerNick');
cy.get('.q-menu .q-item').contains('buyerNick').click();
- cy.get('[data-cy="ItemCategory_select"]').type('Flower');
+ cy.dataCy('ItemCategory_select').type('Flower');
cy.get('.q-menu .q-item').contains('Flower').click();
- cy.get('[data-cy="FormModelPopup_save"]').click();
+ cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
});
});