Merge branch 'dev' of https: refs #8602//gitea.verdnatura.es/verdnatura/salix-front into 8602-refatorAndCreateEntry
This commit is contained in:
commit
53f7492d68
|
@ -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,
|
||||||
],
|
],
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
describe.skip('EntryDms', () => {
|
||||||
|
const entryId = 1;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/entry/${entryId}/dms`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create edit and remove new dms', () => {
|
||||||
|
cy.addRow();
|
||||||
|
cy.get('.icon-attach').click();
|
||||||
|
cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', {
|
||||||
|
force: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
cy.get('tbody > tr').then((value) => {
|
||||||
|
const u = undefined;
|
||||||
|
|
||||||
|
//Create and check if exist new row
|
||||||
|
let newFileTd = Cypress.$(value).length;
|
||||||
|
cy.get('.q-btn--standard > .q-btn__content > .block').click();
|
||||||
|
expect(value).to.have.length(newFileTd++);
|
||||||
|
const newRowSelector = `tbody > :nth-child(${newFileTd})`;
|
||||||
|
cy.waitForElement(newRowSelector);
|
||||||
|
cy.validateRow(newRowSelector, [u, u, u, u, u, 'ENTRADA ID 1']);
|
||||||
|
|
||||||
|
//Edit new dms
|
||||||
|
const newDescription = 'entry id 1 modified';
|
||||||
|
const textAreaSelector =
|
||||||
|
'.q-textarea > .q-field__inner > .q-field__control > .q-field__control-container';
|
||||||
|
cy.get(
|
||||||
|
`tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`,
|
||||||
|
).click();
|
||||||
|
|
||||||
|
cy.get(textAreaSelector).clear();
|
||||||
|
cy.get(textAreaSelector).type(newDescription);
|
||||||
|
cy.saveCard();
|
||||||
|
cy.reload();
|
||||||
|
|
||||||
|
cy.validateRow(newRowSelector, [u, u, u, u, u, newDescription]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,50 @@
|
||||||
|
describe.skip('EntryStockBought', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('buyer');
|
||||||
|
cy.visit(`/#/entry/stock-Bought`);
|
||||||
|
});
|
||||||
|
it('Should edit the reserved space', () => {
|
||||||
|
cy.get('.q-field__native.q-placeholder').should('have.value', '01/01/2001');
|
||||||
|
cy.get('[data-col-field="reserve"][data-row-index="0"]').click();
|
||||||
|
cy.get('input[name="reserve"]').type('10{enter}');
|
||||||
|
cy.get('button[title="Save"]').click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
it('Should add a new reserved space for buyerBoss', () => {
|
||||||
|
cy.addBtnClick();
|
||||||
|
cy.get('input[aria-label="Reserve"]').type('1');
|
||||||
|
cy.get('input[aria-label="Date"]').eq(1).clear();
|
||||||
|
cy.get('input[aria-label="Date"]').eq(1).type('01-01');
|
||||||
|
cy.get('input[aria-label="Buyer"]').type('itNick');
|
||||||
|
cy.get('div[role="listbox"] > div > div[role="option"]')
|
||||||
|
.eq(1)
|
||||||
|
.should('be.visible')
|
||||||
|
.click();
|
||||||
|
|
||||||
|
cy.get('[data-cy="FormModelPopup_save"]').click();
|
||||||
|
cy.get('.q-notification__message').should('have.text', 'Data created');
|
||||||
|
|
||||||
|
cy.get('[data-col-field="reserve"][data-row-index="1"]').click().clear();
|
||||||
|
cy.get('[data-cy="searchBtn"]').eq(1).click();
|
||||||
|
cy.get('.q-table__bottom.row.items-center.q-table__bottom--nodata')
|
||||||
|
.should('have.text', 'warningNo data available')
|
||||||
|
.type('{esc}');
|
||||||
|
cy.get('[data-col-field="reserve"][data-row-index="1"]')
|
||||||
|
.click()
|
||||||
|
.type('{backspace}{enter}');
|
||||||
|
cy.get('[data-cy="crudModelDefaultSaveBtn"]').should('be.enabled').click();
|
||||||
|
cy.get('.q-notification__message').eq(1).should('have.text', 'Data saved');
|
||||||
|
});
|
||||||
|
it('Should check detail for the buyer', () => {
|
||||||
|
cy.get('[data-cy="searchBtn"]').eq(0).click();
|
||||||
|
cy.get('tBody > tr').eq(1).its('length').should('eq', 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should edit travel m3 and refresh', () => {
|
||||||
|
cy.get('[data-cy="edit-travel"]').should('be.visible').click();
|
||||||
|
cy.get('input[aria-label="m3"]').clear().type('60');
|
||||||
|
cy.get('[data-cy="FormModelPopup_save"]').click();
|
||||||
|
cy.get('.vn-row > div > :nth-child(2)').should('have.text', '60');
|
||||||
|
});
|
||||||
|
});
|
|
@ -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 = {
|
||||||
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', () => {
|
||||||
|
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', () => {
|
||||||
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"]')
|
it('Should redirect to the summary from the route pop-up summary', () => {
|
||||||
.click()
|
cy.dataCy(selectors.rowSummaryBtn).last().should('be.visible').click();
|
||||||
.type('{downArrow}{enter}');
|
cy.get(selectors.summaryTitle)
|
||||||
cy.get('[data-col-field="agencyModeFk"][data-row-index="0"]')
|
.invoke('text')
|
||||||
.click()
|
.then((text) => {
|
||||||
.type('{downArrow}{enter}');
|
expect(text).to.include(data.Description.val);
|
||||||
cy.get('[data-col-field="vehicleFk"][data-row-index="0"]')
|
});
|
||||||
.click()
|
cy.get(selectors.SummaryGoToSummaryBtn).click();
|
||||||
.type('{downArrow}{enter}');
|
cy.get(selectors.summaryTitle)
|
||||||
cy.get('button[title="Save"]').click();
|
.invoke('text')
|
||||||
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
.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