diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js index 21e141a6a..3a40ea57b 100644 --- a/test/cypress/integration/item/ItemFixedPrice.spec.js +++ b/test/cypress/integration/item/ItemFixedPrice.spec.js @@ -1,32 +1,60 @@ /// +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(1280, 720); cy.login('developer'); cy.visit('/#/item/fixed-price', { timeout: 5000 }); cy.waitForElement('.q-table'); - }); - it('Create and delete', function () { cy.get( '.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon' ).click(); + }); + it('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.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); + cy.selectOption(`${firstRow} > :nth-child(2)`, '#13'); + 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'); + /* ==== End Cypress Studio ==== */ + }); + it('Create and delete ', function () { cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); - cy.selectOption( - '.q-virtual-scroll__content > :nth-child(2) > :nth-child(1)', - '#15' - ); - cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(3)').type('1'); - cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(4)').type('2'); - cy.selectOption( - '.q-virtual-scroll__content > :nth-child(2) > :nth-child(8)', - 'Warehouse One' - ); + 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-virtual-scroll__content > :nth-child(2) > .text-right > .q-btn > .q-btn__content > .q-icon' + '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block' ).click(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + }); + + it('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('.vn-row > :nth-child(2)', 'Min price'); + cy.get('.vn-row > :nth-child(3)').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('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();