Merge pull request 'test: refs #8594 add vehicle summary component and integration tests for vehicle list functionality' (!1464) from 8594---createTestE2eVehicleList into dev
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1464 Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
commit
6e838133e2
|
@ -22,7 +22,12 @@ const links = {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<CardSummary data-key="Vehicle" :url="`Vehicles/${entityId}`" :filter="VehicleFilter">
|
<CardSummary
|
||||||
|
data-key="Vehicle"
|
||||||
|
:url="`Vehicles/${entityId}`"
|
||||||
|
module-name="Vehicle"
|
||||||
|
:filter="VehicleFilter"
|
||||||
|
>
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<div>{{ entity.id }} - {{ entity.numberPlate }}</div>
|
<div>{{ entity.id }} - {{ entity.numberPlate }}</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
describe('Vehicle list', () => {
|
||||||
|
const selectors = {
|
||||||
|
saveFormBtn: 'FormModelPopup_save',
|
||||||
|
summaryPopupBtn: 'tr:last-child > .q-table--col-auto-width > .q-btn',
|
||||||
|
summaryGoToSummaryBtn: '.header > .q-icon',
|
||||||
|
summaryHeader: '.summaryHeader > div',
|
||||||
|
numberPlate: 'tr:last-child > [data-col-field="numberPlate"] > .no-padding',
|
||||||
|
};
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
'Nº Plate': { val: '9465-LPA' },
|
||||||
|
'Trade Mark': { val: 'WAYNE INDUSTRIES' },
|
||||||
|
Model: { val: 'BATREMOLQUE' },
|
||||||
|
Type: { val: 'remolque', type: 'select' },
|
||||||
|
Warehouse: { val: 'Warehouse One', type: 'select' },
|
||||||
|
Country: { val: 'Portugal', type: 'select' },
|
||||||
|
Description: { val: 'Exclusive for batpod transport' },
|
||||||
|
};
|
||||||
|
|
||||||
|
const expected = data['Nº Plate'].val;
|
||||||
|
const summaryUrl = '/summary';
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/route/vehicle/list`);
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should list vehicles', () => {
|
||||||
|
cy.get('.q-table')
|
||||||
|
.children()
|
||||||
|
.should('be.visible')
|
||||||
|
.should('have.length.greaterThan', 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should add new vehicle', () => {
|
||||||
|
cy.addBtnClick();
|
||||||
|
cy.fillInForm(data);
|
||||||
|
cy.dataCy(selectors.saveFormBtn).should('be.visible').click();
|
||||||
|
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
cy.get(selectors.summaryHeader).should('contain', expected);
|
||||||
|
cy.url().should('include', summaryUrl);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should open summary by clicking a vehicle', () => {
|
||||||
|
cy.get(selectors.numberPlate).click();
|
||||||
|
cy.get(selectors.summaryHeader).should('contain', expected);
|
||||||
|
cy.url().should('include', summaryUrl);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should redirect to vehicle summary when click summary icon on summary pop-up', () => {
|
||||||
|
cy.get(selectors.summaryPopupBtn).click();
|
||||||
|
cy.get(selectors.summaryHeader).should('contain', expected);
|
||||||
|
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||||
|
cy.url().should('include', summaryUrl);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue