35 lines
1.3 KiB
JavaScript
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.get('#searchbar input').type('{enter}');
|
||
|
});
|
||
|
|
||
|
it('should filter the items and redirect to the summary', () => {
|
||
|
cy.dataCy('ItemFilterCategorySelect').type('Plant');
|
||
|
cy.get('.q-menu .q-item').contains('Plant').click();
|
||
|
cy.dataCy('ItemFilterTypeSelect').type('Anthurium');
|
||
|
cy.get('.q-menu .q-item').contains('Anthurium').click();
|
||
|
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
|
||
|
});
|
||
|
|
||
|
it('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');
|
||
|
});
|
||
|
});
|