test: refs #8626 addTestCases #1422

Merged
jtubau merged 40 commits from 8626-addTestCasesInRouteListTest into dev 2025-03-17 11:43:39 +00:00
3 changed files with 65 additions and 27 deletions
Showing only changes of commit 8b9408d0fb - Show all commits

View File

@ -1,11 +1,14 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import useCardDescription from 'composables/useCardDescription';
import VnLv from 'components/ui/VnLv.vue';
import { dashIfEmpty, toDate } from 'src/filters';
import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue';
import filter from './RouteFilter.js';
import axios from 'axios';
const $props = defineProps({
id: {

View File

@ -56,7 +56,7 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'agencyName',
name: 'agencyModeFk',
label: t('route.Agency'),
cardVisible: true,
component: 'select',
@ -74,7 +74,7 @@ const columns = computed(() => [
},
{
align: 'left',
name: 'vehiclePlateNumber',
name: 'vehicleFk',
label: t('route.Vehicle'),
cardVisible: true,
component: 'select',
@ -155,6 +155,7 @@ const columns = computed(() => [
<template #body>
<VnTable
:data-key
ref="tableRef"
:columns="columns"
:right-search="false"
redirect="route"
@ -172,6 +173,16 @@ const columns = computed(() => [
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
</span>
</template>
<template #column-agencyModeFk="{ row }">
jtubau marked this conversation as resolved Outdated

usando format podemos evitar el template no?

usando format podemos evitar el template no?
<span>
{{ row?.agencyName }}
</span>
</template>
<template #column-vehicleFk="{ row }">
<span>
{{ row?.vehiclePlateNumber }}
</span>
</template>
</VnTable>
</template>
</VnSection>

View File

@ -2,36 +2,60 @@ describe('Route', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/extended-list`);
cy.visit(`/#/route/list`);
cy.typeSearchbar('{enter}');
});
it('Route list create route', () => {
it('Should list routes', () => {
cy.get('.q-table')
.children()
.should('be.visible')
.should('have.length.greaterThan', 0);
});
it('Should create new route', () => {
cy.addBtnClick();
cy.get('input[name="description"]').type('routeTestOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
const data = {
Worker: { val: 'logistic', type: 'select' },
Agency: { val: 'Walking', type: 'select' },
Vehicle: { val: '3333-BAT', type: 'select' },
Description: { val: 'routeTest' },
};
cy.fillInForm(data);
cy.dataCy('FormModelPopup_save').should('be.visible').click();
cy.get('.q-notification__message')
.should('be.visible')
.should('have.text', 'Data created');
cy.url().should('include', '/summary');
});
it('Route list search and edit', () => {
jtubau marked this conversation as resolved Outdated
Outdated
Review

Ya no se comprueba que edite?

Ya no se comprueba que edite?

no, routeList no puede editar, el que edita es routeExtendedList, copie el archivo si no recuerdo mal, por eso esta lo de editar (la línea 5 hacía el visit a extended-list)

no, routeList no puede editar, el que edita es routeExtendedList, copie el archivo si no recuerdo mal, por eso esta lo de editar (la línea 5 hacía el visit a extended-list)
cy.get('#searchbar input').type('{enter}');
cy.get('[data-col-field="description"][data-row-index="0"]')
.click()
.type('routeTestOne{enter}');
cy.get('.q-table tr')
.its('length')
.then((rowCount) => {
expect(rowCount).to.be.greaterThan(0);
});
cy.get('[data-col-field="workerFk"][data-row-index="0"]')
.click()
.type('{downArrow}{enter}');
cy.get('[data-col-field="agencyModeFk"][data-row-index="0"]')
.click()
.type('{downArrow}{enter}');
cy.get('[data-col-field="vehicleFk"][data-row-index="0"]')
.click()
.type('{downArrow}{enter}');
cy.get('button[title="Save"]').click();
cy.get('.q-notification__message').should('have.text', 'Data saved');
it('Should open summary by clicking a route', () => {
jtubau marked this conversation as resolved Outdated
Outdated
Review

Skips?

Skips?
cy.get(':nth-child(1) > [data-col-field="vehicleFk"]')
.should('be.visible')
.click();
cy.url().should('include', '/summary');
});
it('Should open the route summary pop-up', () => {
cy.get(
':nth-child(1) > .q-table--col-auto-width > [data-cy="tableAction-0"] > .q-btn__content > .q-icon',
)
.should('be.visible')
.click();
cy.validateContent('.summaryHeader > :nth-child(2)', '1 - first route');
cy.validateContent(':nth-child(2) > :nth-child(3) > .value > span', '3333-BAT');
});
it('Should redirect to the summary from the route summary pop-up', () => {
cy.get(
':nth-child(1) > .q-table--col-auto-width > [data-cy="tableAction-0"] > .q-btn__content > .q-icon',
)
.should('be.visible')
.click();
cy.get('.header > .q-icon').should('be.visible').click();
cy.url().should('include', '/summary');
});
});