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';
|
2025-02-18 10:59:20 +00:00
|
|
|
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
|
|
|
});
|
|
|
|
|
2024-03-22 13:57:36 +00:00
|
|
|
it('should redirect on clicking a parking', () => {
|
2024-10-28 10:37:32 +00:00
|
|
|
cy.get(searchbar).type('{enter}');
|
2025-02-18 10:59:20 +00:00
|
|
|
cy.get(firstCard).click();
|
|
|
|
cy.get(summaryHeader).contains('Basic data');
|
2024-03-08 09:32:41 +00:00
|
|
|
});
|
|
|
|
|
2025-02-18 10:59:20 +00:00
|
|
|
it('should filter and redirect if there is only one result', () => {
|
2025-02-21 12:04:49 +00:00
|
|
|
cy.dataCy('Code_input').type('1{enter}');
|
|
|
|
cy.dataCy('Sector_select').type('Normal{enter}');
|
2024-03-08 09:32:41 +00:00
|
|
|
cy.get(summaryHeader).contains('Basic data');
|
|
|
|
});
|
2025-02-14 09:01:46 +00:00
|
|
|
|
|
|
|
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
|
|
|
});
|