2024-03-08 09:32:41 +00:00
|
|
|
/// <reference types="cypress" />
|
|
|
|
describe('ParkingList', () => {
|
|
|
|
const firstCard = '.q-card:nth-child(1)';
|
|
|
|
const firstChipId =
|
|
|
|
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
|
|
|
|
const firstDetailBtn =
|
|
|
|
':nth-child(1) > :nth-child(1) > .card-list-body > .actions > .q-btn';
|
|
|
|
const summaryHeader = '.summaryBody .header';
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.login('developer');
|
|
|
|
cy.visit(`/#/parking/list`);
|
2024-03-11 14:17:49 +00:00
|
|
|
cy.closeSideMenu();
|
2024-03-08 09:32:41 +00:00
|
|
|
});
|
|
|
|
|
2024-03-22 13:57:36 +00:00
|
|
|
it('should redirect on clicking a parking', () => {
|
2024-03-08 09:32:41 +00:00
|
|
|
cy.get(firstChipId)
|
|
|
|
.invoke('text')
|
|
|
|
.then((content) => {
|
|
|
|
const id = content.substring(4);
|
|
|
|
cy.get(firstCard).click();
|
|
|
|
cy.url().should('include', `/parking/${id}/summary`);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should open the details', () => {
|
|
|
|
cy.get(firstDetailBtn).click();
|
|
|
|
cy.get(summaryHeader).contains('Basic data');
|
|
|
|
});
|
|
|
|
});
|