salix-front/test/cypress/integration/shelving/shelvingList.spec.js

42 lines
1.5 KiB
JavaScript

/// <reference types="cypress" />
describe('ShelvingList', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/shelving/list`);
});
it('should redirect on clicking a shelving', () => {
cy.typeSearchbar('{enter}');
cy.dataCy('cardBtn').eq(0).click();
cy.get('.summaryHeader > .header > .q-icon').click();
cy.url().should('include', '/shelving/1/summary');
});
it('should redirect from preview to basic-data', () => {
cy.typeSearchbar('{enter}');
cy.dataCy('cardBtn').eq(0).click();
cy.get('.q-card > .header').click();
cy.url().should('include', '/shelving/1/basic-data');
});
it('should filter and redirect if only one result', () => {
cy.selectOption('[data-cy="Parking_select"]', 'P-02-2');
cy.dataCy('Parking_select').type('{enter}');
cy.url().should('match', /\/shelving\/\d+\/summary/);
});
it('should create a new shelving', () => {
cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('code-create-popup').type('Test');
cy.dataCy('Priority_input').type('10');
cy.selectOption(
'.grid-create > .q-select > .q-field__inner > .q-field__control > .q-field__control-container',
'100-01',
);
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
cy.url().should('match', /\/shelving\/\d+\/basic-data/);
});
});