salix-front/test/cypress/integration/parking/parkingList.spec.js

31 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-03-08 09:32:41 +00:00
/// <reference types="cypress" />
describe('ParkingList', () => {
2024-10-28 10:37:32 +00:00
const searchbar = '#searchbar input';
const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none';
2024-03-08 09:32:41 +00:00
const summaryHeader = '.summaryBody .header';
beforeEach(() => {
2024-07-02 06:29:55 +00:00
cy.viewport(1920, 1080);
2024-03-08 09:32:41 +00:00
cy.login('developer');
2025-02-04 13:37:41 +00:00
cy.visit(`/#/shelving/parking/list`);
2024-03-08 09:32:41 +00:00
});
it('should redirect on clicking a parking', () => {
2024-10-28 10:37:32 +00:00
cy.get(searchbar).type('{enter}');
cy.get(firstCard).click();
cy.get(summaryHeader).contains('Basic data');
2024-03-08 09:32:41 +00:00
});
it('should filter and redirect if there is only one result', () => {
cy.dataCy('Code_input').type('01{enter}');
cy.dataCy('Sector_select').type('First{enter}');
2024-03-08 09:32:41 +00:00
cy.get(summaryHeader).contains('Basic data');
});
it('should filter and redirect to summary if only one result', () => {
cy.dataCy('Code_input').type('A{enter}');
cy.dataCy('Sector_select').type('First Sector{enter}');
cy.url().should('match', /\/shelving\/parking\/\d+\/summary/);
});
2024-03-08 09:32:41 +00:00
});