test: refs #8484 rollback
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2025-02-17 15:22:11 +01:00
parent 663e0c8e8e
commit 05df3e3f10
1 changed files with 57 additions and 38 deletions

View File

@ -1,44 +1,63 @@
describe('EntryDms', () => { /// <reference types="cypress" />
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(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1280, 720);
cy.login('developer'); 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', () => { it.skip('Massive edit', function () {
cy.addRow(); cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click();
cy.get('.icon-attach').click(); cy.get('#subToolbar > .q-btn--standard').click();
cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', { cy.selectOption("[data-cy='field-to-edit']", 'Min price');
force: true, 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('tbody > tr').then((value) => { cy.get('.q-notification__message').should('have.text', 'Data saved');
const u = undefined; });
it.skip('Massive remove', function () {
//Create and check if exist new row cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click();
let newFileTd = Cypress.$(value).length; cy.get('#subToolbar > .q-btn--flat').click();
cy.get('.q-btn--standard > .q-btn__content > .block').click(); cy.get(
expect(value).to.have.length(newFileTd++); '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
const newRowSelector = `tbody > :nth-child(${newFileTd})`; ).click();
cy.waitForElement(newRowSelector); cy.get('.q-notification__message').should('have.text', 'Data saved');
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]);
});
}); });
}); });