describe('EntryStockBought', () => { const reserveField = 'input[name="reserve"]'; beforeEach(() => { cy.viewport(1920, 1080); cy.login('buyer'); cy.visit( `/#/entry/stock-Bought?table={"filter":"{}","dated":"2000-12-31T23:00:00.000Z"}` ); }); it('Should edit the reserved space', () => { cy.get('tBody > tr').its('length').should('eq', 1); cy.get(reserveField).type('10{enter}'); cy.get('button[title="Save"]').click(); cy.get('.q-notification__message').should('have.text', 'Data saved'); }); it('Should add a new reserved space for buyerBoss', () => { cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); 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'); cy.get('input[aria-label="Buyer"]').type('buyerboss{downarrow}{enter}'); cy.get('.q-notification__message').should('have.text', 'Data created'); cy.get('tBody > tr').its('length').should('eq', 2); }); it('Should check detail for the buyer', () => { cy.get(':nth-child(1) > .sticky > .q-btn > .q-btn__content > .q-icon').click(); cy.get('tBody > tr').eq(1).its('length').should('eq', 1); }); it('Should check detail for the buyerBoss and had no content', () => { cy.get(':nth-child(2) > .sticky > .q-btn > .q-btn__content > .q-icon').click(); cy.get('.q-table__bottom.row.items-center.q-table__bottom--nodata').should( 'have.text', 'warningNo data available' ); }); });