salix-front/test/cypress/integration/entry/stockBought.spec.js

37 lines
1.6 KiB
JavaScript

describe('EntryStockBought', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('buyer');
cy.visit(`/#/entry/stock-Bought`);
});
it('Should edit the reserved space', () => {
cy.get('.q-field__native.q-placeholder').should('have.value', '01/01/2001');
cy.get('[data-col-field="reserve"][data-row-index="0"]').click();
cy.get('input[name="reserve"]').type('10{enter}');
cy.get('button[title="Save"]').click();
cy.checkNotification('Data saved');
});
it('Should add a new reserved space for buyerBoss', () => {
cy.addBtnClick();
cy.get('input[aria-label="Reserve"]').type('1');
cy.get('input[aria-label="Date"]').eq(1).clear();
cy.get('input[aria-label="Date"]').eq(1).type('01-01-2001');
cy.selectOption('input[aria-label="Buyer"]', 'buyerboss');
cy.get('#formModel button[title="Save"]').click();
cy.checkNotification('Data created');
});
it('Should check detail for the buyer', () => {
cy.get('[data-cy="searchBtn"]').eq(0).click();
cy.get('tBody > tr').eq(1).its('length').should('eq', 1);
});
it('Should edit travel m3 and refresh', () => {
cy.waitForElement('[data-cy="editTravelBtn"]');
cy.get('[data-cy="editTravelBtn"]').click();
cy.get('input[aria-label="m3"]').clear();
cy.get('input[aria-label="m3"]').type('60');
cy.get('.q-mt-lg > .q-btn--standard > .q-btn__content > .block').click();
cy.get('.vn-row > div > :nth-child(2)').should('have.text', '60');
});
});