salix-front/test/cypress/integration/item/itemList.spec.js

35 lines
1.3 KiB
JavaScript

/// <reference types="cypress" />
describe('Item list', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/item/list`);
cy.typeSearchbar('{enter}');
});
it('should filter the items and redirect to the summary', () => {
cy.dataCy('Category_select').type('Plant');
cy.get('.q-menu .q-item').contains('Plant').click();
cy.dataCy('Type_select').type('Anthurium');
cy.get('.q-menu .q-item').contains('Anthurium').click();
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
});
// https://redmine.verdnatura.es/issues/8421
it.skip('should create an item', () => {
const data = {
Description: { val: `Test item` },
Type: { val: `Crisantemo`, type: 'select' },
Intrastat: { val: `Coral y materiales similares`, type: 'select' },
Origin: { val: `SPA`, type: 'select' },
};
cy.dataCy('vnTableCreateBtn').click();
cy.fillInForm(data);
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
cy.get(
':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content'
).should('be.visible');
});
});