0
0
Fork 0

feat: refs #5186 add e2e

This commit is contained in:
Jorge Penadés 2024-03-08 10:32:41 +01:00
parent d8a0adb852
commit 300e384f75
3 changed files with 55 additions and 1 deletions

View File

@ -38,7 +38,7 @@ export default {
component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'),
},
{
path: '/parking',
path: '/parking/list',
name: 'ParkingList',
meta: {
title: 'parkingList',

View File

@ -0,0 +1,23 @@
/// <reference types="cypress" />
describe('ParkingBasicData', () => {
const codeInput = 'form .q-card .q-input input';
const sectorSelect = 'form .q-card .q-select input';
const sectorOpt = '.q-menu .q-item';
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/parking/1/basic-data`);
});
it('should edit the code and sector', () => {
cy.get(sectorSelect).type('Second');
cy.get(sectorOpt).click();
cy.get(codeInput).eq(0).clear();
cy.get(codeInput).eq(0).type(123);
cy.saveCard();
cy.get(sectorSelect).should('have.value', 'Second sector');
cy.get(codeInput).should('have.value', 123);
});
});

View File

@ -0,0 +1,31 @@
/// <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';
const screen = '.q-page-container > .q-drawer-container > .fullscreen';
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/parking/list`);
cy.get(screen).click();
});
it('should redirect on clicking a invoice', () => {
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');
});
});