From 05df3e3f10466de46119a0fdf468ade6b71ea9c9 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 17 Feb 2025 15:22:11 +0100 Subject: [PATCH] test: refs #8484 rollback --- .../integration/item/ItemFixedPrice.spec.js | 95 +++++++++++-------- 1 file changed, 57 insertions(+), 38 deletions(-) diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js index 3b6691c86..2cf9c2caf 100644 --- a/test/cypress/integration/item/ItemFixedPrice.spec.js +++ b/test/cypress/integration/item/ItemFixedPrice.spec.js @@ -1,44 +1,63 @@ -describe('EntryDms', () => { - const entryId = 1; - +/// +function goTo(n = 1) { + return `.q-virtual-scroll__content > :nth-child(${n})`; +} +const firstRow = goTo(); +`.q-virtual-scroll__content > :nth-child(2)`; +describe('Handle Items FixedPrice', () => { beforeEach(() => { - cy.viewport(1920, 1080); + cy.viewport(1280, 720); cy.login('developer'); - cy.visit(`/#/entry/${entryId}/dms`); + cy.visit('/#/item/fixed-price', { timeout: 5000 }); + cy.waitForElement('.q-table'); + cy.get( + '.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon', + ).click(); + }); + it.skip('filter', function () { + cy.get('.category-filter > :nth-child(1) > .q-btn__content > .q-icon').click(); + cy.selectOption('.list > :nth-child(2)', 'Alstroemeria'); + cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); + + cy.addBtnClick(); + cy.selectOption(`${firstRow} > :nth-child(2)`, '#13'); + cy.get(`${firstRow} > :nth-child(4)`).find('input').type(1); + cy.get(`${firstRow} > :nth-child(5)`).find('input').type('2'); + cy.selectOption(`${firstRow} > :nth-child(9)`, 'Warehouse One'); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + /* ==== End Cypress Studio ==== */ + }); + it.skip('Create and delete ', function () { + cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); + cy.addBtnClick(); + cy.selectOption(`${firstRow} > :nth-child(2)`, '#11'); + cy.get(`${firstRow} > :nth-child(4)`).type('1'); + cy.get(`${firstRow} > :nth-child(5)`).type('2'); + cy.selectOption(`${firstRow} > :nth-child(9)`, 'Warehouse One'); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); + cy.get(`${firstRow} > .text-right > .q-btn > .q-btn__content > .q-icon`).click(); + cy.get( + '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block', + ).click(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); }); - it.skip('should create edit and remove new dms', () => { - cy.addRow(); - cy.get('.icon-attach').click(); - cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', { - force: true, - }); - - cy.get('tbody > tr').then((value) => { - const u = undefined; - - //Create and check if exist new row - let newFileTd = Cypress.$(value).length; - cy.get('.q-btn--standard > .q-btn__content > .block').click(); - expect(value).to.have.length(newFileTd++); - const newRowSelector = `tbody > :nth-child(${newFileTd})`; - cy.waitForElement(newRowSelector); - cy.validateRow(newRowSelector, [u, u, u, u, u, 'ENTRADA ID 1']); - - //Edit new dms - const newDescription = 'entry id 1 modified'; - const textAreaSelector = - '.q-textarea > .q-field__inner > .q-field__control > .q-field__control-container'; - cy.get( - `tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`, - ).click(); - - cy.get(textAreaSelector).clear(); - cy.get(textAreaSelector).type(newDescription); - cy.saveCard(); - cy.reload(); - - cy.validateRow(newRowSelector, [u, u, u, u, u, newDescription]); - }); + it.skip('Massive edit', function () { + cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click(); + cy.get('#subToolbar > .q-btn--standard').click(); + cy.selectOption("[data-cy='field-to-edit']", 'Min price'); + cy.dataCy('value-to-edit').find('input').type('1'); + cy.get('.countLines').should('have.text', ' 1 '); + cy.get('.q-mt-lg > .q-btn--standard').click(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + }); + it.skip('Massive remove', function () { + cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click(); + cy.get('#subToolbar > .q-btn--flat').click(); + cy.get( + '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block', + ).click(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); }); });