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

31 lines
1003 B
JavaScript
Raw Normal View History

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(() => {
2024-07-02 06:29:55 +00:00
cy.viewport(1920, 1080);
2024-03-08 09:32:41 +00:00
cy.login('developer');
cy.visit(`/#/parking/list`);
});
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');
});
});