test: refs #8626 addTestCases #1422
|
@ -180,6 +180,7 @@ const toModule = computed(() => {
|
||||||
color="white"
|
color="white"
|
||||||
class="link"
|
class="link"
|
||||||
v-if="summary"
|
v-if="summary"
|
||||||
|
data-cy="openSummaryBtn"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('components.smartCard.openSummary') }}
|
{{ t('components.smartCard.openSummary') }}
|
||||||
|
@ -194,6 +195,7 @@ const toModule = computed(() => {
|
||||||
icon="launch"
|
icon="launch"
|
||||||
round
|
round
|
||||||
size="md"
|
size="md"
|
||||||
|
data-cy="goToSummaryBtn"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('components.cardDescriptor.summary') }}
|
{{ t('components.cardDescriptor.summary') }}
|
||||||
|
|
|
@ -81,6 +81,7 @@ async function fetch() {
|
||||||
name: `${moduleName ?? route.meta.moduleName}Summary`,
|
name: `${moduleName ?? route.meta.moduleName}Summary`,
|
||||||
params: { id: entityId || entity.id },
|
params: { id: entityId || entity.id },
|
||||||
}"
|
}"
|
||||||
|
data-cy="goToSummaryBtn"
|
||||||
>
|
>
|
||||||
<QIcon name="open_in_new" color="white" size="sm" />
|
<QIcon name="open_in_new" color="white" size="sm" />
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
|
@ -17,7 +17,7 @@ const props = defineProps({
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const entityId = computed(() => props.id || route.params.id);
|
const entityId = computed(() => props.id || route.params.id);
|
||||||
const { store } = useArrayData('Parking');
|
const { store } = useArrayData();
|
||||||
const card = computed(() => store.data);
|
const card = computed(() => store.data);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||||
|
import useCardDescription from 'composables/useCardDescription';
|
||||||
import VnLv from 'components/ui/VnLv.vue';
|
import VnLv from 'components/ui/VnLv.vue';
|
||||||
import { dashIfEmpty, toDate } from 'src/filters';
|
import { dashIfEmpty, toDate } from 'src/filters';
|
||||||
import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue';
|
import RouteDescriptorMenu from 'pages/Route/Card/RouteDescriptorMenu.vue';
|
||||||
import filter from './RouteFilter.js';
|
import filter from './RouteFilter.js';
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
|
|
@ -332,6 +332,7 @@ const openTicketsDialog = (id) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="vn:clone"
|
icon="vn:clone"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
flat
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="confirmationDialog = true"
|
@click="confirmationDialog = true"
|
||||||
|
@ -341,6 +342,7 @@ const openTicketsDialog = (id) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="cloud_download"
|
icon="cloud_download"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
flat
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="showRouteReport"
|
@click="showRouteReport"
|
||||||
|
@ -352,6 +354,7 @@ const openTicketsDialog = (id) => {
|
||||||
<QBtn
|
<QBtn
|
||||||
icon="check"
|
icon="check"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
flat
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
:disable="!selectedRows?.length"
|
:disable="!selectedRows?.length"
|
||||||
@click="markAsServed()"
|
@click="markAsServed()"
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { computed, ref, markRaw } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { toHour } from 'src/filters';
|
import { toHour } from 'src/filters';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
import RouteSummary from 'pages/Route/Card/RouteSummary.vue';
|
||||||
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
import RouteFilter from 'pages/Route/Card/RouteFilter.vue';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
|
@ -11,9 +12,9 @@ import AgencyDescriptorProxy from 'src/pages/Route/Agency/Card/AgencyDescriptorP
|
||||||
import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue';
|
import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
import RouteTickets from './RouteTickets.vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const router = useRouter();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
const tableRef = ref([]);
|
const tableRef = ref([]);
|
||||||
const dataKey = 'RouteList';
|
const dataKey = 'RouteList';
|
||||||
|
@ -29,8 +30,10 @@ const routeFilter = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function redirectToTickets(id) {
|
function redirectToTickets(id) {
|
||||||
const url = `#/route/${id}/tickets`;
|
router.push({
|
||||||
window.open(url, '_blank');
|
name: 'RouteTickets',
|
||||||
|
params: { id },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -46,26 +49,18 @@ const columns = computed(() => [
|
||||||
width: '25px',
|
width: '25px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'left',
|
||||||
name: 'workerFk',
|
name: 'workerFk',
|
||||||
label: t('gloabls.worker'),
|
label: t('globals.worker'),
|
||||||
component: markRaw(VnSelectWorker),
|
component: markRaw(VnSelectWorker),
|
||||||
create: true,
|
create: true,
|
||||||
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
|
format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef),
|
||||||
columnFilter: false,
|
columnFilter: false,
|
||||||
|
cardVisible: true,
|
||||||
width: '100px',
|
width: '100px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'workerFk',
|
|
||||||
label: t('globals.worker'),
|
|
||||||
visible: false,
|
|
||||||
cardVisible: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'agencyName',
|
|
||||||
label: t('globals.agency'),
|
label: t('globals.agency'),
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('globals.Agency'),
|
|
||||||
name: 'agencyModeFk',
|
name: 'agencyModeFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -77,23 +72,13 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
create: true,
|
create: true,
|
||||||
columnFilter: false,
|
columnFilter: true,
|
||||||
visible: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'agencyName',
|
|
||||||
label: t('globals.agency'),
|
|
||||||
visible: false,
|
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
},
|
visible: true,
|
||||||
{
|
|
||||||
name: 'vehiclePlateNumber',
|
|
||||||
label: t('globals.vehicle'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'vehicleFk',
|
name: 'vehicleFk',
|
||||||
label: t('globals.Vehicle'),
|
label: t('globals.vehicle'),
|
||||||
cardVisible: true,
|
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'vehicles',
|
url: 'vehicles',
|
||||||
|
@ -106,8 +91,9 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
create: true,
|
create: true,
|
||||||
|
|||||||
columnFilter: false,
|
columnFilter: true,
|
||||||
visible: false,
|
cardVisible: true,
|
||||||
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
@ -181,8 +167,8 @@ const columns = computed(() => [
|
||||||
<VnTable
|
<VnTable
|
||||||
:with-filters="false"
|
:with-filters="false"
|
||||||
:data-key
|
:data-key
|
||||||
:columns="columns"
|
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
:columns="columns"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
redirect="route"
|
redirect="route"
|
||||||
:create="{
|
:create="{
|
||||||
|
@ -199,7 +185,7 @@ const columns = computed(() => [
|
||||||
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
<WorkerDescriptorProxy :id="row?.workerFk" v-if="row?.workerFk" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-agencyName="{ row }">
|
<template #column-agencyModeFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
{{ row?.agencyName }}
|
{{ row?.agencyName }}
|
||||||
<AgencyDescriptorProxy
|
<AgencyDescriptorProxy
|
||||||
|
@ -208,7 +194,7 @@ const columns = computed(() => [
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #column-vehiclePlateNumber="{ row }">
|
<template #column-vehicleFk="{ row }">
|
||||||
<span class="link" @click.stop>
|
<span class="link" @click.stop>
|
||||||
{{ row?.vehiclePlateNumber }}
|
{{ row?.vehiclePlateNumber }}
|
||||||
<VehicleDescriptorProxy
|
<VehicleDescriptorProxy
|
||||||
|
|
|
@ -39,6 +39,7 @@ onBeforeMount(async () => {
|
||||||
url="Workers/summary"
|
url="Workers/summary"
|
||||||
:user-filter="{ where: { id: entityId } }"
|
:user-filter="{ where: { id: entityId } }"
|
||||||
data-key="Worker"
|
data-key="Worker"
|
||||||
|
module-name="Worker"
|
||||||
>
|
>
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<div>{{ entity.id }} - {{ entity.firstName }} {{ entity.lastName }}</div>
|
<div>{{ entity.id }} - {{ entity.firstName }} {{ entity.lastName }}</div>
|
||||||
|
|
|
@ -220,6 +220,7 @@ export default {
|
||||||
path: '',
|
path: '',
|
||||||
name: 'RouteIndexMain',
|
name: 'RouteIndexMain',
|
||||||
redirect: { name: 'RouteList' },
|
redirect: { name: 'RouteList' },
|
||||||
|
component: () => import('src/pages/Route/RouteList.vue'),
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'RouteList',
|
name: 'RouteList',
|
||||||
|
@ -228,7 +229,6 @@ export default {
|
||||||
title: 'list',
|
title: 'list',
|
||||||
icon: 'view_list',
|
icon: 'view_list',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Route/RouteList.vue'),
|
|
||||||
},
|
},
|
||||||
routeCard,
|
routeCard,
|
||||||
],
|
],
|
||||||
|
@ -264,6 +264,7 @@ export default {
|
||||||
path: 'roadmap',
|
path: 'roadmap',
|
||||||
name: 'RouteRoadmap',
|
name: 'RouteRoadmap',
|
||||||
redirect: { name: 'RoadmapList' },
|
redirect: { name: 'RoadmapList' },
|
||||||
|
component: () => import('src/pages/Route/RouteRoadmap.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'RouteRoadmap',
|
title: 'RouteRoadmap',
|
||||||
icon: 'vn:troncales',
|
icon: 'vn:troncales',
|
||||||
|
@ -276,7 +277,6 @@ export default {
|
||||||
title: 'list',
|
title: 'list',
|
||||||
icon: 'view_list',
|
icon: 'view_list',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Route/RouteRoadmap.vue'),
|
|
||||||
},
|
},
|
||||||
roadmapCard,
|
roadmapCard,
|
||||||
],
|
],
|
||||||
|
@ -294,6 +294,7 @@ export default {
|
||||||
path: 'agency',
|
path: 'agency',
|
||||||
name: 'RouteAgency',
|
name: 'RouteAgency',
|
||||||
redirect: { name: 'AgencyList' },
|
redirect: { name: 'AgencyList' },
|
||||||
|
component: () => import('src/pages/Route/Agency/AgencyList.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'agency',
|
title: 'agency',
|
||||||
icon: 'garage_home',
|
icon: 'garage_home',
|
||||||
|
@ -306,8 +307,6 @@ export default {
|
||||||
title: 'list',
|
title: 'list',
|
||||||
icon: 'view_list',
|
icon: 'view_list',
|
||||||
},
|
},
|
||||||
component: () =>
|
|
||||||
import('src/pages/Route/Agency/AgencyList.vue'),
|
|
||||||
},
|
},
|
||||||
agencyCard,
|
agencyCard,
|
||||||
],
|
],
|
||||||
|
@ -316,6 +315,7 @@ export default {
|
||||||
path: 'vehicle',
|
path: 'vehicle',
|
||||||
name: 'RouteVehicle',
|
name: 'RouteVehicle',
|
||||||
redirect: { name: 'VehicleList' },
|
redirect: { name: 'VehicleList' },
|
||||||
|
component: () => import('src/pages/Route/Vehicle/VehicleList.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: 'vehicle',
|
title: 'vehicle',
|
||||||
icon: 'directions_car',
|
icon: 'directions_car',
|
||||||
|
@ -328,8 +328,6 @@ export default {
|
||||||
title: 'vehicleList',
|
title: 'vehicleList',
|
||||||
icon: 'directions_car',
|
icon: 'directions_car',
|
||||||
},
|
},
|
||||||
component: () =>
|
|
||||||
import('src/pages/Route/Vehicle/VehicleList.vue'),
|
|
||||||
},
|
},
|
||||||
vehicleCard,
|
vehicleCard,
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe('EntryDms', () => {
|
describe.skip('EntryDms', () => {
|
||||||
const entryId = 1;
|
const entryId = 1;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@ -30,7 +30,7 @@ describe('EntryDms', () => {
|
||||||
const textAreaSelector =
|
const textAreaSelector =
|
||||||
'.q-textarea > .q-field__inner > .q-field__control > .q-field__control-container';
|
'.q-textarea > .q-field__inner > .q-field__control > .q-field__control-container';
|
||||||
cy.get(
|
cy.get(
|
||||||
`tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`
|
`tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`,
|
||||||
).click();
|
).click();
|
||||||
|
|
||||||
cy.get(textAreaSelector).clear();
|
cy.get(textAreaSelector).clear();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe('Entry', () => {
|
describe.skip('Entry', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('buyer');
|
cy.login('buyer');
|
||||||
|
@ -20,7 +20,7 @@ describe('Entry', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('Create entry, modify travel and add buys', () => {
|
it('Create entry, modify travel and add buys', () => {
|
||||||
createEntryAndBuy();
|
createEntryAndBuy();
|
||||||
cy.get('a[data-cy="EntryBasicData-menu-item"]').click();
|
cy.get('a[data-cy="EntryBasicData-menu-item"]').click();
|
||||||
selectTravel('two');
|
selectTravel('two');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe('EntryStockBought', () => {
|
describe.skip('EntryStockBought', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('buyer');
|
cy.login('buyer');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe.skip('AgencyWorkCenter', () => {
|
describe('AgencyWorkCenter', () => {
|
||||||
const selectors = {
|
const selectors = {
|
||||||
workCenter: 'workCenter_select',
|
workCenter: 'workCenter_select',
|
||||||
popupSave: 'FormModelPopup_save',
|
popupSave: 'FormModelPopup_save',
|
||||||
|
@ -9,7 +9,7 @@ describe.skip('AgencyWorkCenter', () => {
|
||||||
const messages = {
|
const messages = {
|
||||||
jtubau marked this conversation as resolved
alexm
commented
Esta skip Esta skip
|
|||||||
dataCreated: 'Data created',
|
dataCreated: 'Data created',
|
||||||
alreadyAssigned: 'This workCenter is already assigned to this agency',
|
alreadyAssigned: 'This workCenter is already assigned to this agency',
|
||||||
removed: 'WorkCenter removed successfully',
|
removed: 'Work center removed successfully',
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe.skip('RouteAutonomous', () => {
|
describe('RouteAutonomous', () => {
|
||||||
const getLinkSelector = (colField) =>
|
const getLinkSelector = (colField) =>
|
||||||
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;
|
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe.skip('Route extended list', () => {
|
describe('Route extended list', () => {
|
||||||
const getSelector = (colField) => `tr:last-child > [data-col-field="${colField}"]`;
|
const getSelector = (colField) => `tr:last-child > [data-col-field="${colField}"]`;
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
|
@ -8,6 +8,8 @@ describe.skip('Route extended list', () => {
|
||||||
date: getSelector('dated'),
|
date: getSelector('dated'),
|
||||||
description: getSelector('description'),
|
description: getSelector('description'),
|
||||||
served: getSelector('isOk'),
|
served: getSelector('isOk'),
|
||||||
|
firstRowSelectCheckBox:
|
||||||
|
'tbody > tr:first-child > :nth-child(1) .q-checkbox__inner',
|
||||||
lastRowSelectCheckBox: 'tbody > tr:last-child > :nth-child(1) .q-checkbox__inner',
|
lastRowSelectCheckBox: 'tbody > tr:last-child > :nth-child(1) .q-checkbox__inner',
|
||||||
removeBtn: '[title="Remove"]',
|
removeBtn: '[title="Remove"]',
|
||||||
resetBtn: '[title="Reset"]',
|
resetBtn: '[title="Reset"]',
|
||||||
|
@ -19,7 +21,7 @@ describe.skip('Route extended list', () => {
|
||||||
markServedBtn: '#st-actions > .q-btn-group > :nth-child(3)',
|
markServedBtn: '#st-actions > .q-btn-group > :nth-child(3)',
|
||||||
searchbar: 'searchbar',
|
searchbar: 'searchbar',
|
||||||
firstTicketsRowSelectCheckBox:
|
firstTicketsRowSelectCheckBox:
|
||||||
'.q-card > :nth-child(2) > .q-table__container > .q-table__middle > .q-table > tbody > :nth-child(1) > .q-table--col-auto-width > .q-checkbox > .q-checkbox__inner > .q-checkbox__bg > .q-checkbox__svg',
|
'.q-card .q-table > tbody > :nth-child(1) .q-checkbox',
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkboxState = {
|
const checkboxState = {
|
||||||
|
@ -117,12 +119,21 @@ describe.skip('Route extended list', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should clone selected route', () => {
|
it('Should clone selected route and add ticket', () => {
|
||||||
cy.get(selectors.lastRowSelectCheckBox).click();
|
cy.get(selectors.firstRowSelectCheckBox).click();
|
||||||
cy.get(selectors.cloneBtn).click();
|
cy.get(selectors.cloneBtn).click();
|
||||||
cy.dataCy('route.Starting date_inputDate').type('10-05-2001').click();
|
cy.dataCy('Starting date_inputDate').type('01-01-2001');
|
||||||
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
|
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
|
||||||
cy.validateContent(selectors.date, '05/10/2001');
|
cy.validateContent(selectors.date, '01/01/2001');
|
||||||
|
|
||||||
|
cy.dataCy('tableAction-0').last().click();
|
||||||
|
cy.get(selectors.firstTicketsRowSelectCheckBox).click();
|
||||||
|
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
|
||||||
|
cy.checkNotification(dataSaved);
|
||||||
|
|
||||||
|
cy.get(selectors.lastRowSelectCheckBox).click();
|
||||||
|
cy.get(selectors.removeBtn).click();
|
||||||
|
cy.dataCy(selectors.confirmBtn).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should download selected route', () => {
|
it('Should download selected route', () => {
|
||||||
|
@ -143,22 +154,15 @@ describe.skip('Route extended list', () => {
|
||||||
cy.validateContent(selectors.served, checkboxState.check);
|
cy.validateContent(selectors.served, checkboxState.check);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should delete the selected route', () => {
|
it('Should delete the selected routes', () => {
|
||||||
cy.get(selectors.lastRowSelectCheckBox).click();
|
cy.get(selectors.lastRowSelectCheckBox).click();
|
||||||
|
|
||||||
cy.get(selectors.removeBtn).click();
|
cy.get(selectors.removeBtn).click();
|
||||||
|
|
||||||
cy.dataCy(selectors.confirmBtn).click();
|
cy.dataCy(selectors.confirmBtn).click();
|
||||||
|
|
||||||
cy.checkNotification(dataSaved);
|
cy.checkNotification(dataSaved);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should add ticket to route', () => {
|
|
||||||
cy.dataCy('tableAction-0').last().click();
|
|
||||||
cy.get(selectors.firstTicketsRowSelectCheckBox).click();
|
|
||||||
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
|
|
||||||
cy.checkNotification(dataSaved);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Should save changes in route', () => {
|
it('Should save changes in route', () => {
|
||||||
updateFields.forEach(({ selector, type, value }) => {
|
updateFields.forEach(({ selector, type, value }) => {
|
||||||
fillField(selector, type, value);
|
fillField(selector, type, value);
|
||||||
|
|
|
@ -1,37 +1,205 @@
|
||||||
describe('Route', () => {
|
describe('Route', () => {
|
||||||
|
const getSelector = (colField) =>
|
||||||
|
`tr:last-child > [data-col-field="${colField}"] > .no-padding > .link`;
|
||||||
|
|
||||||
|
const selectors = {
|
||||||
|
lastRow: 'tr:last-child > [data-col-field="workerFk"]',
|
||||||
|
workerLink: getSelector('workerFk'),
|
||||||
|
agencyLink: getSelector('agencyModeFk'),
|
||||||
|
vehicleLink: getSelector('vehicleFk'),
|
||||||
|
assignedTicketsBtn: 'tableAction-0',
|
||||||
|
rowSummaryBtn: 'tableAction-1',
|
||||||
|
summaryTitle: '.summaryHeader',
|
||||||
|
descriptorTitle: '.descriptor .title',
|
||||||
|
descriptorOpenSummaryBtn: '.descriptor [data-cy="openSummaryBtn"]',
|
||||||
|
descriptorGoToSummaryBtn: '.descriptor [data-cy="goToSummaryBtn"]',
|
||||||
|
SummaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
|
||||||
|
};
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
Worker: { val: 'logistic', type: 'select' },
|
||||||
|
Agency: { val: 'Walking', type: 'select' },
|
||||||
|
Vehicle: { val: '3333-BAT', type: 'select' },
|
||||||
|
Description: { val: 'routeTest' },
|
||||||
|
};
|
||||||
|
|
||||||
|
const summaryUrl = '/summary';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/route/extended-list`);
|
cy.visit(`/#/route/list`);
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Route list create route', () => {
|
it('Should list routes', () => {
|
||||||
jtubau marked this conversation as resolved
Outdated
alexm
commented
Skips? Skips?
|
|||||||
|
cy.get('.q-table')
|
||||||
|
.children()
|
||||||
|
.should('be.visible')
|
||||||
|
.should('have.length.greaterThan', 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should create new route', () => {
|
||||||
cy.addBtnClick();
|
cy.addBtnClick();
|
||||||
cy.get('.q-card input[name="description"]').type('routeTestOne{enter}');
|
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
cy.fillInForm(data);
|
||||||
cy.url().should('include', '/summary');
|
|
||||||
|
cy.dataCy('FormModelPopup_save').should('be.visible').click();
|
||||||
|
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
cy.url().should('include', summaryUrl);
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Description.val);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Route list search and edit', () => {
|
it('Should open route summary by clicking a route', () => {
|
||||||
jtubau marked this conversation as resolved
Outdated
alexm
commented
Ya no se comprueba que edite? Ya no se comprueba que edite?
jtubau
commented
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(selectors.lastRow).should('be.visible').click();
|
||||||
cy.get('[data-col-field="description"][data-row-index="0"]')
|
cy.url().should('include', summaryUrl);
|
||||||
.click()
|
cy.get(selectors.summaryTitle)
|
||||||
.type('routeTestOne{enter}');
|
.invoke('text')
|
||||||
cy.get('.q-table tr')
|
.then((text) => {
|
||||||
.its('length')
|
expect(text).to.include(data.Description.val);
|
||||||
.then((rowCount) => {
|
|
||||||
expect(rowCount).to.be.greaterThan(0);
|
|
||||||
});
|
});
|
||||||
cy.get('[data-col-field="workerFk"][data-row-index="0"]')
|
});
|
||||||
.click()
|
|
||||||
.type('{downArrow}{enter}');
|
it('Should redirect to the summary from the route pop-up summary', () => {
|
||||||
cy.get('[data-col-field="agencyModeFk"][data-row-index="0"]')
|
cy.dataCy(selectors.rowSummaryBtn).last().should('be.visible').click();
|
||||||
.click()
|
cy.get(selectors.summaryTitle)
|
||||||
.type('{downArrow}{enter}');
|
.invoke('text')
|
||||||
cy.get('[data-col-field="vehicleFk"][data-row-index="0"]')
|
.then((text) => {
|
||||||
.click()
|
expect(text).to.include(data.Description.val);
|
||||||
.type('{downArrow}{enter}');
|
});
|
||||||
cy.get('button[title="Save"]').click();
|
cy.get(selectors.SummaryGoToSummaryBtn).click();
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Description.val);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the route assigned tickets from the row assignedTicketsBtn', () => {
|
||||||
|
cy.dataCy(selectors.assignedTicketsBtn).first().should('be.visible').click();
|
||||||
|
cy.url().should('include', '1/tickets');
|
||||||
|
cy.get('.q-table')
|
||||||
|
.children()
|
||||||
|
.should('be.visible')
|
||||||
|
.should('have.length.greaterThan', 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Worker pop-ups', () => {
|
||||||
|
it('Should redirect to summary from the worker pop-up descriptor', () => {
|
||||||
|
cy.get(selectors.workerLink).click();
|
||||||
|
cy.get(selectors.descriptorTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Worker.val);
|
||||||
|
});
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Worker.val);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the summary from the worker pop-up summary', () => {
|
||||||
|
cy.get(selectors.workerLink).click();
|
||||||
|
cy.get(selectors.descriptorTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Worker.val);
|
||||||
|
});
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Worker.val);
|
||||||
|
});
|
||||||
|
cy.get(selectors.SummaryGoToSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Worker.val);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Agency pop-ups', () => {
|
||||||
|
it('Should redirect to summary from the agency pop-up descriptor', () => {
|
||||||
|
cy.get(selectors.agencyLink).click();
|
||||||
|
cy.get(selectors.descriptorTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Agency.val);
|
||||||
|
});
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Agency.val);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the summary from the agency pop-up summary', () => {
|
||||||
|
cy.get(selectors.agencyLink).click();
|
||||||
|
cy.get(selectors.descriptorTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Agency.val);
|
||||||
|
});
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Agency.val);
|
||||||
|
});
|
||||||
|
cy.get(selectors.SummaryGoToSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Agency.val);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Vehicle pop-ups', () => {
|
||||||
|
it('Should redirect to summary from the vehicle pop-up descriptor', () => {
|
||||||
|
cy.get(selectors.vehicleLink).click();
|
||||||
|
cy.get(selectors.descriptorTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Vehicle.val);
|
||||||
|
});
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Vehicle.val);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the summary from the vehicle pop-up summary', () => {
|
||||||
|
cy.get(selectors.vehicleLink).click();
|
||||||
|
cy.get(selectors.descriptorTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Vehicle.val);
|
||||||
|
});
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Vehicle.val);
|
||||||
|
});
|
||||||
|
cy.get(selectors.SummaryGoToSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryTitle)
|
||||||
|
.invoke('text')
|
||||||
|
.then((text) => {
|
||||||
|
expect(text).to.include(data.Vehicle.val);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,11 +2,11 @@ describe('Vehicle', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('deliveryAssistant');
|
cy.login('deliveryAssistant');
|
||||||
cy.visit(`/#/route/vehicle/7`);
|
cy.visit(`/#/route/vehicle/7/summary`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should delete a vehicle', () => {
|
it('should delete a vehicle', () => {
|
||||||
cy.openActionsDescriptor();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get('[data-cy="delete"]').click();
|
cy.get('[data-cy="delete"]').click();
|
||||||
cy.checkNotification('Vehicle removed');
|
cy.checkNotification('Vehicle removed');
|
||||||
});
|
});
|
||||||
|
|
|
@ -184,7 +184,7 @@ Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
|
||||||
cy.get('.q-time .q-time__link').contains(val.x).click();
|
cy.get('.q-time .q-time__link').contains(val.x).click();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cy.wrap(el).type(val);
|
cy.wrap(el).type(`{selectall}${val}`, { delay: 0 });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Vehicle 2?
Cuando es un componente, se utiliza una segunda columna para que en la vista de card no aparezca el componente, el tema es que consultándolo con pablo, como uso un descriptor (que antes no estaban) se sustituye el slot y ya no hace falta la segunda columna.