diff --git a/src/components/common/VnSelectWorker.vue b/src/components/common/VnSelectWorker.vue index 8d60eb014..961804be1 100644 --- a/src/components/common/VnSelectWorker.vue +++ b/src/components/common/VnSelectWorker.vue @@ -53,6 +53,7 @@ const url = computed(() => { :fields="['id', 'name', 'nickname', 'code']" :filter-options="['id', 'name', 'nickname', 'code']" sort-by="nickname ASC" + data-cy="vnWorkerSelect" > + diff --git a/test/cypress/integration/item/itemBarcodes.spec.js b/test/cypress/integration/item/itemBarcodes.spec.js index 4d17fa260..844768d9e 100644 --- a/test/cypress/integration/item/itemBarcodes.spec.js +++ b/test/cypress/integration/item/itemBarcodes.spec.js @@ -1,5 +1,5 @@ /// -describe('Item shelving', () => { +describe('ItemBarcodes', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); diff --git a/test/cypress/integration/item/itemType.spec.js b/test/cypress/integration/item/itemType.spec.js index b0a7b0ca9..466a49708 100644 --- a/test/cypress/integration/item/itemType.spec.js +++ b/test/cypress/integration/item/itemType.spec.js @@ -1,5 +1,10 @@ /// describe('Item type', () => { + const workerError = 'employeeNick'; + const worker = 'buyerNick'; + const category = 'Artificial'; + const type = 'Flower'; + beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); @@ -8,32 +13,24 @@ describe('Item type', () => { it('should throw an error if the code already exists', () => { 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.dataCy('Worker_select').type('employeeNick'); - cy.get('.q-menu .q-item').contains('employeeNick').click(); - cy.dataCy('ItemCategory_select').type('Artificial'); - cy.get('.q-menu .q-item').contains('Artificial').click(); + cy.dataCy('codeInput').type('ALS'); + cy.dataCy('nameInput').type('Alstroemeria'); + cy.dataCy('vnWorkerSelect').type(workerError); + cy.get('.q-menu .q-item').contains(workerError).click(); + cy.dataCy('itemCategorySelect').type(category); + cy.get('.q-menu .q-item').contains(category).click(); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('An item type with the same code already exists'); }); it('should create a new type', () => { 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.dataCy('Worker_select').type('buyerNick'); - cy.get('.q-menu .q-item').contains('buyerNick').click(); - cy.dataCy('ItemCategory_select').type('Flower'); - cy.get('.q-menu .q-item').contains('Flower').click(); + cy.dataCy('codeInput').type('LIL'); + cy.dataCy('nameInput').type('Lilium'); + cy.dataCy('vnWorkerSelect').type(worker); + cy.get('.q-menu .q-item').contains(worker).click(); + cy.dataCy('itemCategorySelect').type(type); + cy.get('.q-menu .q-item').contains(type).click(); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data created'); });