{{ t('Compensation') }}
@@ -287,27 +282,8 @@ async function getAmountPaid() {
-
-
-
-
-
+
diff --git a/src/pages/Customer/composables/__tests__/getAddresses.spec.js b/src/pages/Customer/composables/__tests__/getAddresses.spec.js
index 8c90bf2813..76825377dc 100644
--- a/src/pages/Customer/composables/__tests__/getAddresses.spec.js
+++ b/src/pages/Customer/composables/__tests__/getAddresses.spec.js
@@ -17,7 +17,21 @@ describe('getAddresses', () => {
expect(axios.get).toHaveBeenCalledWith(`Clients/${clientId}/addresses`, {
params: {
filter: JSON.stringify({
- fields: ['nickname', 'street', 'city', 'id', 'isActive'],
+ include: [
+ {
+ relation: 'client',
+ scope: {
+ fields: ['defaultAddressFk'],
+ include: {
+ relation: 'defaultAddress',
+ scope: {
+ fields: ['id', 'agencyModeFk'],
+ },
+ },
+ },
+ },
+ ],
+ fields: ['nickname', 'street', 'city', 'id', 'isActive', 'clientFk'],
where: { isActive: true },
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
}),
diff --git a/src/pages/Customer/composables/getAddresses.js b/src/pages/Customer/composables/getAddresses.js
index 5f18530e75..568b7b5710 100644
--- a/src/pages/Customer/composables/getAddresses.js
+++ b/src/pages/Customer/composables/getAddresses.js
@@ -4,7 +4,21 @@ export async function getAddresses(clientId, _filter = {}) {
if (!clientId) return;
const filter = {
..._filter,
- fields: ['nickname', 'street', 'city', 'id', 'isActive'],
+ include: [
+ {
+ relation: 'client',
+ scope: {
+ fields: ['defaultAddressFk'],
+ include: {
+ relation: 'defaultAddress',
+ scope: {
+ fields: ['id', 'agencyModeFk'],
+ },
+ },
+ },
+ },
+ ],
+ fields: ['nickname', 'street', 'city', 'id', 'isActive', 'clientFk'],
where: { isActive: true },
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
};
diff --git a/src/pages/Entry/Card/EntryCard.vue b/src/pages/Entry/Card/EntryCard.vue
index be82289f4a..50f8b8e554 100644
--- a/src/pages/Entry/Card/EntryCard.vue
+++ b/src/pages/Entry/Card/EntryCard.vue
@@ -1,10 +1,10 @@
-
{
-
+
diff --git a/src/pages/InvoiceIn/Card/InvoiceInCard.vue b/src/pages/InvoiceIn/Card/InvoiceInCard.vue
index 34cc26437a..a1bae87a68 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInCard.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInCard.vue
@@ -1,5 +1,5 @@
-
import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
-import VnCardBeta from 'components/common/VnCardBeta.vue';
+import VnCard from 'components/common/VnCard.vue';
import filter from './InvoiceOutFilter.js';
-
{{ t('invoiceOut.card.customerCard') }}
@@ -81,6 +82,7 @@ function ticketFilter(invoice) {
name: 'TicketList',
query: { table: ticketFilter(entity) },
}"
+ data-cy="invoiceOutDescriptorTicketList"
>
{{ t('invoiceOut.card.ticketList') }}
diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue
index a6ec9923e4..034f416ed8 100644
--- a/src/pages/InvoiceOut/InvoiceOutList.vue
+++ b/src/pages/InvoiceOut/InvoiceOutList.vue
@@ -185,7 +185,7 @@ watchEffect(selectedRows);
prefix="invoiceOut"
:array-data-props="{
url: 'InvoiceOuts/filter',
- order: ['id DESC'],
+ order: 'id DESC',
}"
>
@@ -230,7 +230,7 @@ watchEffect(selectedRows);
-
+
@@ -396,7 +396,6 @@ watchEffect(selectedRows);
:label="
t('invoiceOutList.tableVisibleColumns.taxArea')
"
- :options="taxAreasOptions"
option-label="code"
option-value="code"
/>
diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue
index cd9836bb78..579ab8871c 100644
--- a/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue
+++ b/src/pages/InvoiceOut/InvoiceOutNegativeBasesFilter.vue
@@ -20,7 +20,7 @@ const props = defineProps({
diff --git a/src/pages/Item/Card/ItemBarcode.vue b/src/pages/Item/Card/ItemBarcode.vue
index 590b524cd8..53b4514b72 100644
--- a/src/pages/Item/Card/ItemBarcode.vue
+++ b/src/pages/Item/Card/ItemBarcode.vue
@@ -94,6 +94,7 @@ const submit = async (rows) => {
icon="add_circle"
v-shortcut="'+'"
flat
+ data-cy="addBarcode_input"
>
{{ t('Add barcode') }}
diff --git a/src/pages/Item/Card/ItemCard.vue b/src/pages/Item/Card/ItemCard.vue
index 610b77a02a..ddd21fe368 100644
--- a/src/pages/Item/Card/ItemCard.vue
+++ b/src/pages/Item/Card/ItemCard.vue
@@ -1,9 +1,9 @@
- {
order="shipped ASC, isOk ASC"
:columns="columns"
:user-params="userParams"
- :is-editable="true"
:right-search="false"
auto-load
:disable-option="{ card: true }"
diff --git a/src/pages/Item/ItemType/Card/ItemTypeCard.vue b/src/pages/Item/ItemType/Card/ItemTypeCard.vue
index 84e810de51..bd41b1be2e 100644
--- a/src/pages/Item/ItemType/Card/ItemTypeCard.vue
+++ b/src/pages/Item/ItemType/Card/ItemTypeCard.vue
@@ -1,11 +1,11 @@
-
-import VnCardBeta from 'components/common/VnCardBeta.vue';
+import VnCard from 'components/common/VnCard.vue';
import OrderDescriptor from 'pages/Order/Card/OrderDescriptor.vue';
import filter from './OrderFilter.js';
-
import { useI18n } from 'vue-i18n';
-import { computed, ref, onMounted } from 'vue';
+import { computed, ref, onMounted, watch } from 'vue';
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
import { toDateTimeFormat } from 'src/filters/date';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
@@ -16,6 +16,7 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSection from 'src/components/common/VnSection.vue';
+import { getAddresses } from '../Customer/composables/getAddresses';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
@@ -24,6 +25,11 @@ const agencyList = ref([]);
const route = useRoute();
const addressOptions = ref([]);
const dataKey = 'OrderList';
+const formInitialData = ref({
+ active: true,
+ addressId: null,
+ clientFk: null,
+});
const columns = computed(() => [
{
@@ -147,41 +153,57 @@ const columns = computed(() => [
],
},
]);
-onMounted(() => {
- if (!route.query.createForm) return;
- const clientId = route.query.createForm;
- const id = JSON.parse(clientId);
- fetchClientAddress(id.clientFk);
+onMounted(async () => {
+ if (!route.query) return;
+ if (route.query?.createForm) {
+ await onClientSelected(JSON.parse(route.query?.createForm));
+ } else if (route.query?.table) {
+ const query = JSON.parse(route.query?.table);
+ const clientFk = query?.clientFk;
+ if (clientFk) await onClientSelected({ clientFk });
+ }
+ if (tableRef.value) tableRef.value.create.formInitialData = formInitialData.value;
});
-async function fetchClientAddress(id, formData = {}) {
- const { data } = await axios.get(`Clients/${id}/addresses`, {
- params: {
- filter: JSON.stringify({
- include: [
- {
- relation: 'client',
- scope: {
- fields: ['defaultAddressFk'],
- },
- },
- ],
- order: ['isActive DESC'],
- }),
- },
- });
+watch(
+ () => route.query.table,
+ async (newValue) => {
+ if (newValue) {
+ const clientFk = +JSON.parse(newValue)?.clientFk;
+ if (clientFk) await onClientSelected({ clientFk });
+ if (tableRef.value)
+ tableRef.value.create.formInitialData = formInitialData.value;
+ }
+ },
+);
+
+async function onClientSelected({ clientFk }, formData = {}) {
+ if (!clientFk) {
+ addressOptions.value = [];
+ formData.defaultAddressFk = null;
+ formData.addressId = null;
+ return;
+ }
+ const { data } = await getAddresses(clientFk);
addressOptions.value = data;
- formData.addressId = data[0].client.defaultAddressFk;
- fetchAgencies(formData);
+ formData.defaultAddressFk = data[0].client.defaultAddressFk;
+ formData.addressId = formData.defaultAddressFk;
+ formInitialData.value = { ...formData, clientFk };
+ await fetchAgencies(formData);
}
-async function fetchAgencies({ landed, addressId }) {
- if (!landed || !addressId) return (agencyList.value = []);
+async function fetchAgencies(formData) {
+ const { landed, addressId } = formData;
+ if (!landed || !addressId) {
+ formData.defaultAddressFk = formInitialData.value.defaultAddressFk;
+
+ return (agencyList.value = []);
+ }
const { data } = await axios.get('Agencies/landsThatDay', {
params: {
filter: JSON.stringify({
- order: ['agencyMode DESC', 'agencyModeFk ASC'],
+ order: ['name ASC', 'agencyMode DESC', 'agencyModeFk ASC'],
}),
addressFk: addressId,
landed,
@@ -199,6 +221,11 @@ const getDateColor = (date) => {
if (difference == 0) return 'bg-warning';
if (difference < 0) return 'bg-success';
};
+
+const isDefaultAddress = (opt, data) => {
+ const addressId = data.defaultAddressFk ?? data.addressId;
+ return addressId === opt.id && opt.isActive;
+};
@@ -224,11 +251,7 @@ const getDateColor = (date) => {
onDataSaved: (url) => {
tableRef.redirect(`${url}/catalog`);
},
- formInitialData: {
- active: true,
- addressId: null,
- clientFk: null,
- },
+ formInitialData,
}"
:user-params="{ showEmpty: false }"
:columns="columns"
@@ -260,7 +283,9 @@ const getDateColor = (date) => {
:include="{ relation: 'addresses' }"
v-model="data.clientFk"
:label="t('module.customer')"
- @update:model-value="(id) => fetchClientAddress(id, data)"
+ @update:model-value="
+ (id) => onClientSelected({ clientFk: id }, data)
+ "
>
@@ -285,7 +310,19 @@ const getDateColor = (date) => {
@update:model-value="() => fetchAgencies(data)"
>
-
+
+
+
+
fetchAgencies(data)"
/>
import AgencyDescriptor from 'pages/Route/Agency/Card/AgencyDescriptor.vue';
-import VnCardBeta from 'src/components/common/VnCardBeta.vue';
+import VnCard from 'src/components/common/VnCard.vue';
-
+
diff --git a/src/pages/Route/Card/RouteCard.vue b/src/pages/Route/Card/RouteCard.vue
index c178dc6bf3..b71f7d0881 100644
--- a/src/pages/Route/Card/RouteCard.vue
+++ b/src/pages/Route/Card/RouteCard.vue
@@ -1,10 +1,10 @@
- {
const filter = {
where: { routeFk: $props.id ? $props.id : route.params.id },
};
- const { data } = await axios.get('Tickets/findOne', {
+ const { data } = await axios.get('Tickets/filter', {
params: {
filter: JSON.stringify(filter),
},
});
- zoneId.value = data.zoneFk;
+
+ if (!data.length) return;
+ const firstRecord = data[0];
+
+ zoneId.value = firstRecord.zoneFk;
const { data: zoneData } = await axios.get(`Zones/${zoneId.value}`);
zone.value = zoneData.name;
};
diff --git a/src/pages/Route/Cmr/CmrList.vue b/src/pages/Route/Cmr/CmrList.vue
index b3eaf3b48f..d0683e4819 100644
--- a/src/pages/Route/Cmr/CmrList.vue
+++ b/src/pages/Route/Cmr/CmrList.vue
@@ -2,28 +2,38 @@
import { onBeforeMount, onMounted, computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { Notify } from 'quasar';
+import { useRoute } from 'vue-router';
import { useSession } from 'src/composables/useSession';
import { toDateHourMin } from 'filters/index';
import { useStateStore } from 'src/stores/useStateStore';
-import axios from 'axios';
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnTable from 'components/VnTable/VnTable.vue';
+import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
+const route = useRoute();
const { t } = useI18n();
const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia();
const state = useStateStore();
-const warehouses = ref([]);
const selectedRows = ref([]);
+const dataKey = 'CmrList';
+const shipped = Date.vnNew();
+shipped.setHours(0, 0, 0, 0);
+shipped.setDate(shipped.getDate() - 1);
+const userParams = {
+ shipped: null,
+};
+
+
const columns = computed(() => [
{
align: 'left',
name: 'cmrFk',
- label: t('route.cmr.list.cmrFk'),
+ label: t('route.cmr.params.cmrFk'),
chip: {
condition: () => true,
},
@@ -32,62 +42,67 @@ const columns = computed(() => [
{
align: 'center',
name: 'hasCmrDms',
- label: t('route.cmr.list.hasCmrDms'),
+ label: t('route.cmr.params.hasCmrDms'),
component: 'checkbox',
cardVisible: true,
},
{
align: 'left',
- label: t('route.cmr.list.ticketFk'),
+ label: t('route.cmr.params.ticketFk'),
name: 'ticketFk',
},
{
align: 'left',
- label: t('route.cmr.list.routeFk'),
+ label: t('route.cmr.params.routeFk'),
name: 'routeFk',
},
{
align: 'left',
- label: t('route.cmr.list.clientFk'),
+ label: t('route.cmr.params.clientFk'),
name: 'clientFk',
},
{
align: 'right',
- label: t('route.cmr.list.country'),
+ label: t('route.cmr.params.countryFk'),
name: 'countryFk',
- cardVisible: true,
+ component: 'select',
attrs: {
url: 'countries',
fields: ['id', 'name'],
- optionLabel: 'name',
- optionValue: 'id',
},
columnFilter: {
- inWhere: true,
- component: 'select',
+ name: 'countryFk',
+ attrs: {
+ url: 'countries',
+ fields: ['id', 'name'],
+ },
},
format: ({ countryName }) => countryName,
},
{
align: 'right',
- label: t('route.cmr.list.shipped'),
+ label: t('route.cmr.params.shipped'),
name: 'shipped',
cardVisible: true,
- columnFilter: {
- component: 'date',
- inWhere: true,
- },
+ component: 'date',
format: ({ shipped }) => toDateHourMin(shipped),
},
{
align: 'right',
+ label: t('route.cmr.params.warehouseFk'),
name: 'warehouseFk',
- label: t('globals.warehouse'),
- columnFilter: {
- component: 'select',
- },
+ component: 'select',
attrs: {
- options: warehouses.value,
+ url: 'warehouses',
+ fields: ['id', 'name'],
+ },
+ columnFilter: {
+ inWhere: true,
+ name: 'warehouseFk',
+ attrs: {
+ url: 'warehouses',
+ fields: ['id', 'name'],
+ },
},
format: ({ warehouseName }) => warehouseName,
},
@@ -96,7 +111,7 @@ const columns = computed(() => [
name: 'tableActions',
actions: [
{
- title: t('Ver cmr'),
+ title: t('route.cmr.params.viewCmr'),
icon: 'visibility',
isPrimary: true,
action: (row) => window.open(getCmrUrl(row?.cmrFk), '_blank'),
@@ -105,13 +120,17 @@ const columns = computed(() => [
},
]);
-onBeforeMount(async () => {
- const { data } = await axios.get('Warehouses');
- warehouses.value = data;
+onBeforeMount(() => {
+ initializeFromQuery();
});
onMounted(() => (state.rightDrawer = true));
+const initializeFromQuery = () => {
+ const query = route.query.table ? JSON.parse(route.query.table) : {};
+ shipped.value = query.shipped || shipped.toISOString();
+ Object.assign(userParams, { shipped });
+};
function getApiUrl() {
return new URL(window.location).origin;
}
@@ -133,6 +152,11 @@ function downloadPdfs() {
}
+
- {{ t('route.cmr.list.downloadCmrs') }}
+ {{ t('route.cmr.params.downloadCmrs') }}
-import VnCardBeta from 'components/common/VnCardBeta.vue';
+import VnCard from 'components/common/VnCard.vue';
import RoadmapDescriptor from 'pages/Route/Roadmap/RoadmapDescriptor.vue';
-
+
diff --git a/src/pages/Route/Vehicle/Card/VehicleCard.vue b/src/pages/Route/Vehicle/Card/VehicleCard.vue
index f59420aa24..b6038c24c1 100644
--- a/src/pages/Route/Vehicle/Card/VehicleCard.vue
+++ b/src/pages/Route/Vehicle/Card/VehicleCard.vue
@@ -1,10 +1,10 @@
-
-import VnCardBeta from 'components/common/VnCardBeta.vue';
+import VnCard from 'components/common/VnCard.vue';
import ShelvingDescriptor from 'pages/Shelving/Card/ShelvingDescriptor.vue';
import filter from './ShelvingFilter.js';
-
-import VnCardBeta from 'components/common/VnCardBeta.vue';
+import VnCard from 'components/common/VnCard.vue';
import ParkingDescriptor from 'pages/Shelving/Parking/Card/ParkingDescriptor.vue';
import filter from './ParkingFilter.js';
-
-import VnPaginate from 'components/ui/VnPaginate.vue';
-import CardList from 'components/ui/CardList.vue';
-import VnLv from 'components/ui/VnLv.vue';
+import { computed } from 'vue';
import { useRouter } from 'vue-router';
-import ShelvingFilter from 'pages/Shelving/Card/ShelvingFilter.vue';
-import ShelvingSummary from 'pages/Shelving/Card/ShelvingSummary.vue';
-import { useSummaryDialog } from 'src/composables/useSummaryDialog';
+import { useI18n } from 'vue-i18n';
+import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
+import ShelvingFilter from 'pages/Shelving/Card/ShelvingFilter.vue';
+import ShelvingSummary from './Card/ShelvingSummary.vue';
+import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import exprBuilder from './ShelvingExprBuilder.js';
+import VnSelect from 'src/components/common/VnSelect.vue';
+import VnCheckbox from 'src/components/common/VnCheckbox.vue';
+const { t } = useI18n();
const router = useRouter();
const { viewSummary } = useSummaryDialog();
const dataKey = 'ShelvingList';
@@ -17,9 +20,56 @@ const filter = {
include: [{ relation: 'parking' }],
};
-function navigate(id) {
- router.push({ path: `/shelving/${id}` });
-}
+const columns = computed(() => [
+ {
+ align: 'left',
+ name: 'code',
+ label: t('globals.code'),
+ isId: true,
+ isTitle: true,
+ columnFilter: false,
+ create: true,
+ },
+ {
+ align: 'left',
+ name: 'parking',
+ label: t('shelving.list.parking'),
+ sortable: true,
+ format: (val) => val?.code ?? '',
+ cardVisible: true,
+ },
+ {
+ align: 'left',
+ name: 'priority',
+ label: t('shelving.list.priority'),
+ sortable: true,
+ cardVisible: true,
+ create: true,
+ },
+ {
+ align: 'left',
+ name: 'isRecyclable',
+ label: t('shelving.summary.recyclable'),
+ sortable: true,
+ },
+ {
+ align: 'right',
+ label: '',
+ name: 'tableActions',
+ actions: [
+ {
+ title: t('components.smartCard.viewSummary'),
+ icon: 'preview',
+ action: (row) => viewSummary(row.id, ShelvingSummary),
+ isPrimary: true,
+ },
+ ],
+ },
+]);
+
+const onDataSaved = ({ id }) => {
+ router.push({ name: 'ShelvingBasicData', params: { id } });
+};
@@ -37,48 +87,75 @@ function navigate(id) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('shelving.list.newShelving') }}
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ es:
+ shelving:
+ list:
+ parking: Estacionamiento
+ priority: Prioridad
+
+ summary:
+ recyclable: Reciclable
+ en:
+ shelving:
+ list:
+ parking: Parking
+ priority: Priority
+
+ summary:
+ recyclable: Recyclable
+
diff --git a/src/pages/Supplier/Card/SupplierCard.vue b/src/pages/Supplier/Card/SupplierCard.vue
index e30f79f962..74b3520bf9 100644
--- a/src/pages/Supplier/Card/SupplierCard.vue
+++ b/src/pages/Supplier/Card/SupplierCard.vue
@@ -1,10 +1,10 @@
-
diff --git a/src/pages/Supplier/SupplierList.vue b/src/pages/Supplier/SupplierList.vue
index c9625518f8..ec89d77e0d 100644
--- a/src/pages/Supplier/SupplierList.vue
+++ b/src/pages/Supplier/SupplierList.vue
@@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
import VnInput from 'src/components/common/VnInput.vue';
-import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'src/components/FetchData.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import SupplierSummary from './Card/SupplierSummary.vue';
@@ -53,7 +52,7 @@ const columns = computed(() => [
label: t('globals.alias'),
name: 'alias',
columnFilter: {
- name: 'search',
+ name: 'nickname',
},
cardVisible: true,
},
@@ -120,6 +119,21 @@ const columns = computed(() => [
],
},
]);
+
+const filterColumns = computed(() => {
+ const copy = [...columns.value];
+ copy.splice(copy.length - 1, 0, {
+ align: 'left',
+ label: t('globals.params.provinceFk'),
+ name: 'provinceFk',
+ options: provincesOptions.value,
+ columnFilter: {
+ component: 'select',
+ },
+ });
+
+ return copy;
+});
[
/>
[
-
-
-
diff --git a/src/pages/Ticket/Card/TicketCard.vue b/src/pages/Ticket/Card/TicketCard.vue
index e22d5799ab..19dbd608c6 100644
--- a/src/pages/Ticket/Card/TicketCard.vue
+++ b/src/pages/Ticket/Card/TicketCard.vue
@@ -1,10 +1,10 @@
-
+
+
+ {{ `saleGroup: ${row.saleGroupFk}` }}
+
+
@@ -740,7 +751,7 @@ watch(
{{ row?.item?.subName.toUpperCase() }}
-
+
!isUpdate || field in item;
+ const shouldExist = (field) => field in item;
if (!shouldExist('ticketServiceTypeFk') && !item.ticketServiceTypeFk) {
notify('Description is required', 'negative');
diff --git a/src/pages/Ticket/Card/TicketTracking.vue b/src/pages/Ticket/Card/TicketTracking.vue
index acf464fb1e..00610de443 100644
--- a/src/pages/Ticket/Card/TicketTracking.vue
+++ b/src/pages/Ticket/Card/TicketTracking.vue
@@ -81,6 +81,7 @@ const openCreateModal = () => createTrackingDialogRef.value.show();
ref="paginateRef"
data-key="TicketTracking"
:user-filter="paginateFilter"
+ search-url="table"
url="TicketTrackings"
auto-load
order="created DESC"
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index c2d8f39f37..dfaabc8484 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -1,6 +1,6 @@
diff --git a/src/pages/Travel/Card/TravelCard.vue b/src/pages/Travel/Card/TravelCard.vue
index cb09eafd68..479b47fb9f 100644
--- a/src/pages/Travel/Card/TravelCard.vue
+++ b/src/pages/Travel/Card/TravelCard.vue
@@ -1,10 +1,10 @@
-
-import VnCard from 'components/common/VnCard.vue';
+import VnCard from 'src/components/common/VnCard.vue';
-
+
diff --git a/src/pages/Wagon/WagonList.vue b/src/pages/Wagon/WagonList.vue
index e716686d1c..16c5fca633 100644
--- a/src/pages/Wagon/WagonList.vue
+++ b/src/pages/Wagon/WagonList.vue
@@ -8,6 +8,7 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
import { computed, ref } from 'vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
+import VnSection from 'src/components/common/VnSection.vue';
const quasar = useQuasar();
const arrayData = useArrayData('WagonList');
@@ -15,6 +16,7 @@ const store = arrayData.store;
const router = useRouter();
const { t } = useI18n();
const tableRef = ref();
+const dataKey = 'WagonList';
const filter = {
include: {
relation: 'type',
@@ -75,101 +77,110 @@ function navigate(id) {
}
async function remove(row) {
- try {
- await axios.delete(`Wagons/${row.id}`).then(async () => {
- quasar.notify({
- message: t('wagon.list.removeItem'),
- type: 'positive',
- });
- store.data.splice(store.data.indexOf(row), 1);
- window.location.reload();
+ await axios.delete(`Wagons/${row.id}`).then(async () => {
+ quasar.notify({
+ message: t('wagon.list.removeItem'),
+ type: 'positive',
});
- } catch (error) {
- //
- }
+ store.data.splice(store.data.indexOf(row), 1);
+ window.location.reload();
+ });
}
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ t('wagon.warnings.noData') }}
+
+
+
+
-
-
-
- {{ t('wagon.warnings.noData') }}
-
-
-
-
+
-
+
es:
Create new wagon: Crear nuevo vagón
-
\ No newline at end of file
+
diff --git a/src/pages/Worker/Card/WorkerBasicData.vue b/src/pages/Worker/Card/WorkerBasicData.vue
index a78983e5c9..b8c1c54dfc 100644
--- a/src/pages/Worker/Card/WorkerBasicData.vue
+++ b/src/pages/Worker/Card/WorkerBasicData.vue
@@ -96,6 +96,7 @@ async function setAdvancedSummary(data) {
option-label="name"
option-value="code"
v-model="data.maritalStatus"
+ data-cy="MaritalStatus"
/>
@@ -107,6 +108,7 @@ async function setAdvancedSummary(data) {
option-label="name"
option-value="id"
v-model="data.originCountryFk"
+ data-cy="country"
/>
-
+
diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue
index 3b7a62025a..591dadcd21 100644
--- a/src/pages/Worker/Card/WorkerCard.vue
+++ b/src/pages/Worker/Card/WorkerCard.vue
@@ -1,9 +1,9 @@
-
@@ -116,6 +118,7 @@ watch(
option-value="code"
v-model="row.itemPackingTypeFk"
:required="true"
+ data-cy="itemPackingType"
/>
@@ -132,6 +136,7 @@ watch(
hide-selected
option-label="description"
v-model="row.sectorFk"
+ data-cy="sector"
/>
@@ -160,11 +166,13 @@ watch(
:label="t('worker.operator.linesLimit')"
v-model="row.linesLimit"
lazy-rules
+ data-cy="linesLimit"
/>
@@ -172,6 +180,7 @@ watch(
:label="t('worker.operator.sizeLimit')"
v-model="row.sizeLimit"
lazy-rules
+ data-cy="sizeLimit"
/>
{
:label="t('familySituation')"
clearable
v-model="data.familySituation"
+ data-cy="familySituation"
+ />
+
-
{
clearable
v-model="data.childPension"
:label="t(`childPension`)"
+ data-cy="childPension"
/>
@@ -190,12 +198,14 @@ const deleteRelative = async (id) => {
type="number"
v-model="row.birthed"
:label="t(`birthed`)"
+ data-cy="birthed"
/>
(isEditMode.value ? t('Edit entry') : t('Add time')
const urlCreate = computed(() =>
isEditMode.value
? `WorkerTimeControls/${$props.entryId}/updateTimeEntry`
- : `WorkerTimeControls/${route.params.id}/addTimeEntry`
+ : `WorkerTimeControls/${route.params.id}/addTimeEntry`,
);
onBeforeMount(() => {
@@ -83,6 +83,7 @@ onBeforeMount(() => {
autofocus
:required="true"
:is-clearable="false"
+ data-cy="entryHour"
/>
{
option-value="code"
option-label="description"
hide-selected
+ data-cy="entryType"
/>
diff --git a/src/pages/Worker/Department/Card/DepartmentCard.vue b/src/pages/Worker/Department/Card/DepartmentCard.vue
index 2e3f115214..0fbc903327 100644
--- a/src/pages/Worker/Department/Card/DepartmentCard.vue
+++ b/src/pages/Worker/Department/Card/DepartmentCard.vue
@@ -1,9 +1,9 @@
-
-
+
-
+
{
@@ -75,7 +75,6 @@ const setFilteredAddresses = (data) => {
min="0"
/>
-
{
/>
-
{
min="0"
:required="true"
clearable
+ data-cy="ZoneBasicDataPrice"
/>
{
option-label="nickname"
:options="addresses"
:fields="['id', 'nickname']"
- sort-by="id"
+ sort-by="nickname ASC"
hide-selected
map-options
:rules="validate('data.addressFk')"
- :filter-options="['id']"
/>
diff --git a/src/pages/Zone/Card/ZoneCard.vue b/src/pages/Zone/Card/ZoneCard.vue
index 41daff5c0b..2ce4193a00 100644
--- a/src/pages/Zone/Card/ZoneCard.vue
+++ b/src/pages/Zone/Card/ZoneCard.vue
@@ -1,38 +1,7 @@
-
-
+
diff --git a/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue b/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue
index 3c45700cb1..f8683773d6 100644
--- a/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue
+++ b/src/pages/Zone/Card/ZoneDescriptorMenuItems.vue
@@ -36,13 +36,13 @@ function openConfirmDialog(callback) {
}
-
+
{{ t('deleteZone') }}
-
+
diff --git a/src/pages/Zone/Card/ZoneEventExclusionForm.vue b/src/pages/Zone/Card/ZoneEventExclusionForm.vue
index 4b6aa52bdf..3828c998f2 100644
--- a/src/pages/Zone/Card/ZoneEventExclusionForm.vue
+++ b/src/pages/Zone/Card/ZoneEventExclusionForm.vue
@@ -171,9 +171,10 @@ onMounted(() => {
openConfirmationModal(
t('eventsPanel.deleteTitle'),
t('eventsPanel.deleteSubtitle'),
- () => deleteEvent()
+ () => deleteEvent(),
)
"
+ data-cy="ZoneEventExclusionDeleteBtn"
/>
{
eventInclusionFormData.value.weekDays = weekdayStore.toSet(
- eventInclusionFormData.value.wdays
+ eventInclusionFormData.value.wdays,
);
if (inclusionType.value == 'day') eventInclusionFormData.value.weekDays = '';
@@ -74,7 +73,7 @@ const createEvent = async () => {
else
await axios.put(
`Zones/${route.params.id}/events/${props.event?.id}`,
- eventInclusionFormData.value
+ eventInclusionFormData.value,
);
await refetchEvents();
@@ -123,12 +122,14 @@ onMounted(() => {
dense
val="day"
:label="t('eventsInclusionForm.oneDay')"
+ data-cy="ZoneEventInclusionDayRadio"
/>
{
val="range"
:label="t('eventsInclusionForm.rangeOfDates')"
class="q-mb-sm"
+ data-cy="ZoneEventInclusionRangeRadio"
/>
@@ -221,7 +223,7 @@ onMounted(() => {
openConfirmationModal(
t('zone.deleteTitle'),
t('zone.deleteSubtitle'),
- () => deleteEvent()
+ () => deleteEvent(),
)
"
/>
diff --git a/src/pages/Zone/Card/ZoneEvents.vue b/src/pages/Zone/Card/ZoneEvents.vue
index 1e6debd25d..2fa7dfb436 100644
--- a/src/pages/Zone/Card/ZoneEvents.vue
+++ b/src/pages/Zone/Card/ZoneEvents.vue
@@ -1,18 +1,14 @@
-
-
-
+
+
+
+
+
{
await fetchData();
},
- { immediate: true, deep: true }
+ { immediate: true, deep: true },
);
const formatWdays = (event) => {
@@ -178,9 +176,10 @@ onMounted(async () => {
openConfirmationModal(
t('zone.deleteTitle'),
t('zone.deleteSubtitle'),
- () => deleteEvent(event.id)
+ () => deleteEvent(event.id),
)
"
+ data-cy="ZoneEventsPanelDeleteBtn"
>
{{ t('eventsPanel.delete') }}
diff --git a/src/pages/Zone/Card/ZoneLocationsTree.vue b/src/pages/Zone/Card/ZoneLocationsTree.vue
index 5c87faf999..0834364403 100644
--- a/src/pages/Zone/Card/ZoneLocationsTree.vue
+++ b/src/pages/Zone/Card/ZoneLocationsTree.vue
@@ -1,6 +1,7 @@
+
+
+
{
-
-
+
diff --git a/src/pages/Zone/Card/ZoneSearchbar.vue b/src/pages/Zone/Card/ZoneSearchbar.vue
deleted file mode 100644
index d1188a1e8b..0000000000
--- a/src/pages/Zone/Card/ZoneSearchbar.vue
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
diff --git a/src/pages/Zone/Card/ZoneSummary.vue b/src/pages/Zone/Card/ZoneSummary.vue
index 5b29b495b0..2c56fa3e29 100644
--- a/src/pages/Zone/Card/ZoneSummary.vue
+++ b/src/pages/Zone/Card/ZoneSummary.vue
@@ -60,10 +60,11 @@ onMounted(async () => {
#{{ entity.id }} - {{ entity.name }}
diff --git a/src/pages/Zone/ZoneCalendar.vue b/src/pages/Zone/ZoneCalendar.vue
index c2abd15ffb..7cae596985 100644
--- a/src/pages/Zone/ZoneCalendar.vue
+++ b/src/pages/Zone/ZoneCalendar.vue
@@ -185,6 +185,7 @@ const handleDateClick = (timestamp) => {
:class="{
'--today': isToday(timestamp),
}"
+ data-cy="ZoneCalendarDay"
>
-
diff --git a/src/pages/Zone/ZoneDeliveryPanel.vue b/src/pages/Zone/ZoneDeliveryPanel.vue
index 0a535afcb6..a8cb05afcc 100644
--- a/src/pages/Zone/ZoneDeliveryPanel.vue
+++ b/src/pages/Zone/ZoneDeliveryPanel.vue
@@ -46,7 +46,7 @@ watch(
inq.value = {
deliveryMethodFk: { inq: deliveryMethods.value[deliveryMethodFk.value] },
};
- }
+ },
);
@@ -89,7 +89,7 @@ watch(
v-model="formData.geoFk"
url="Postcodes/location"
:fields="['geoFk', 'code', 'townFk', 'countryFk']"
- :sort-by="['code ASC']"
+ :sort-by="'code ASC'"
option-value="geoFk"
option-label="code"
:filter-options="['code']"
@@ -98,6 +98,7 @@ watch(
outlined
rounded
map-key="geoFk"
+ data-cy="ZoneDeliveryDaysPostcodeSelect"
>
@@ -129,6 +130,7 @@ watch(
dense
outlined
rounded
+ data-cy="ZoneDeliveryDaysAgencySelect"
/>
-import { ref } from 'vue';
-import { useI18n } from 'vue-i18n';
-import VnInput from 'components/common/VnInput.vue';
-import FetchData from 'components/FetchData.vue';
-import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
-import VnSelect from 'components/common/VnSelect.vue';
-import order from 'src/router/modules/order';
-
-const { t } = useI18n();
-const props = defineProps({
- dataKey: {
- type: String,
- required: true,
- },
- exprBuilder: {
- type: Function,
- default: null,
- },
-});
-
-const agencies = ref([]);
-
-
-
- (agencies = data)"
- auto-load
- />
-
-
-
- {{ t(`filterPanel.${tag.label}`) }}:
- {{ tag.value }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue
index eb54ec15b2..869b0c12c9 100644
--- a/src/pages/Zone/ZoneList.vue
+++ b/src/pages/Zone/ZoneList.vue
@@ -14,9 +14,7 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputTime from 'src/components/common/VnInputTime.vue';
-import RightMenu from 'src/components/common/RightMenu.vue';
-import ZoneFilterPanel from './ZoneFilterPanel.vue';
-import ZoneSearchbar from './Card/ZoneSearchbar.vue';
+import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n();
const router = useRouter();
@@ -25,7 +23,7 @@ const { viewSummary } = useSummaryDialog();
const { openConfirmationModal } = useVnConfirm();
const tableRef = ref();
const warehouseOptions = ref([]);
-
+const dataKey = 'ZoneList';
const tableFilter = {
include: [
{
@@ -114,6 +112,7 @@ const columns = computed(() => [
columnFilter: {
inWhere: true,
},
+ columnClass: 'shrink-column',
},
{
align: 'left',
@@ -169,77 +168,128 @@ function formatRow(row) {
return dashIfEmpty(`${row?.address?.nickname},
${row?.address?.postcode?.town?.name} (${row?.address?.province?.name})`);
}
+
+const exprBuilder = (param, value) => {
+ switch (param) {
+ case 'name':
+ return {
+ name: { like: `%${value}%` },
+ };
+ case 'code':
+ return {
+ code: { like: `%${value}%` },
+ };
+ case 'agencyModeFk':
+ return {
+ agencyModeFk: value,
+ };
+ case 'search':
+ return /^\d+$/.test(value) ? { id: value } : { name: { like: `%${value}%` } };
+ case 'price':
+ return {
+ price: value,
+ };
+ }
+};
-
-
-
-
-
-
-
-
- {{ dashIfEmpty(formatRow(row)) }}
+
+
+
+
+
+ {{ dashIfEmpty(formatRow(row)) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
es:
Search zone: Buscar zona
diff --git a/src/pages/Zone/ZoneUpcoming.vue b/src/pages/Zone/ZoneUpcoming.vue
index adcdfbc044..b8664dc2fd 100644
--- a/src/pages/Zone/ZoneUpcoming.vue
+++ b/src/pages/Zone/ZoneUpcoming.vue
@@ -7,7 +7,6 @@ import FetchData from 'components/FetchData.vue';
import { toDateFormat } from 'src/filters/date.js';
import { useWeekdayStore } from 'src/stores/useWeekdayStore';
-import ZoneSearchbar from './Card/ZoneSearchbar.vue';
const { t } = useI18n();
const weekdayStore = useWeekdayStore();
@@ -31,7 +30,7 @@ const columns = computed(() => [
label: t('list.id'),
name: 'id',
field: 'zoneFk',
- align: 'left',
+ align: 'center',
},
]);
@@ -53,7 +52,6 @@ onMounted(() => weekdayStore.initStore());
@on-fetch="(data) => (details = data)"
auto-load
/>
-
diff --git a/src/pages/Zone/locale/en.yml b/src/pages/Zone/locale/en.yml
index e53e7b560a..22f4b1ae6e 100644
--- a/src/pages/Zone/locale/en.yml
+++ b/src/pages/Zone/locale/en.yml
@@ -11,10 +11,13 @@ zone:
m3Max: Max m³
deleteTitle: This item will be deleted
deleteSubtitle: Are you sure you want to continue?
- volumetric: Volumetric
bonus: Bonus
closing: Closing
travelingDays: Traveling days
+ search: Search zone
+ searchInfo: Search zone by id or name
+ searchLocations: Search locations
+ searchLocationsInfo: Search locations by post code
list:
clone: Clone
id: Id
@@ -30,6 +33,7 @@ list:
confirmCloneTitle: All it's properties will be copied
confirmCloneSubtitle: Do you want to clone this zone?
warehouse: Warehouse
+ isVolumetric: Volumetric
createZone: Create zone
zoneSummary: Summary
addressFk: Address
diff --git a/src/pages/Zone/locale/es.yml b/src/pages/Zone/locale/es.yml
index bc31e74a95..777bc1c031 100644
--- a/src/pages/Zone/locale/es.yml
+++ b/src/pages/Zone/locale/es.yml
@@ -15,6 +15,10 @@ zone:
bonus: Bonificación
closing: Cierre
travelingDays: Días de viaje
+ search: Buscar zona
+ searchInfo: Buscar zona por Id o nombre
+ searchLocations: Buscar localización
+ searchLocationsInfo: Buscar localización por código postal
list:
clone: Clonar
id: Id
diff --git a/src/router/modules/invoiceIn.js b/src/router/modules/invoiceIn.js
index fe70a10562..b8021e69f9 100644
--- a/src/router/modules/invoiceIn.js
+++ b/src/router/modules/invoiceIn.js
@@ -1,10 +1,15 @@
import { RouterView } from 'vue-router';
+import { setRectificative } from 'src/pages/InvoiceIn/composables/setRectificative';
const invoiceInCard = {
name: 'InvoiceInCard',
path: ':id',
component: () => import('src/pages/InvoiceIn/Card/InvoiceInCard.vue'),
redirect: { name: 'InvoiceInSummary' },
+ beforeEnter: async (to, from, next) => {
+ await setRectificative(to);
+ next();
+ },
meta: {
menu: [
'InvoiceInBasicData',
@@ -32,8 +37,7 @@ const invoiceInCard = {
title: 'basicData',
icon: 'vn:settings',
},
- component: () =>
- import('src/pages/InvoiceIn/Card/InvoiceInBasicData.vue'),
+ component: () => import('src/pages/InvoiceIn/Card/InvoiceInBasicData.vue'),
},
{
name: 'InvoiceInVat',
@@ -51,8 +55,7 @@ const invoiceInCard = {
title: 'dueDay',
icon: 'vn:calendar',
},
- component: () =>
- import('src/pages/InvoiceIn/Card/InvoiceInDueDay.vue'),
+ component: () => import('src/pages/InvoiceIn/Card/InvoiceInDueDay.vue'),
},
{
name: 'InvoiceInIntrastat',
@@ -61,8 +64,7 @@ const invoiceInCard = {
title: 'intrastat',
icon: 'vn:lines',
},
- component: () =>
- import('src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue'),
+ component: () => import('src/pages/InvoiceIn/Card/InvoiceInIntrastat.vue'),
},
{
name: 'InvoiceInCorrective',
@@ -71,8 +73,7 @@ const invoiceInCard = {
title: 'corrective',
icon: 'attachment',
},
- component: () =>
- import('src/pages/InvoiceIn/Card/InvoiceInCorrective.vue'),
+ component: () => import('src/pages/InvoiceIn/Card/InvoiceInCorrective.vue'),
},
{
name: 'InvoiceInLog',
@@ -86,7 +87,7 @@ const invoiceInCard = {
],
};
-export default {
+export default {
name: 'InvoiceIn',
path: '/invoice-in',
meta: {
@@ -98,7 +99,7 @@ export default {
component: RouterView,
redirect: { name: 'InvoiceInMain' },
children: [
- {
+ {
name: 'InvoiceInMain',
path: '',
component: () => import('src/components/common/VnModule.vue'),
@@ -111,7 +112,7 @@ export default {
component: () => import('src/pages/InvoiceIn/InvoiceInList.vue'),
children: [
{
- name: 'InvoiceInList',
+ name: 'InvoiceInList',
path: 'list',
meta: {
title: 'list',
@@ -137,9 +138,10 @@ export default {
title: 'serial',
icon: 'view_list',
},
- component: () => import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
+ component: () =>
+ import('src/pages/InvoiceIn/Serial/InvoiceInSerial.vue'),
},
],
},
],
-};
\ No newline at end of file
+};
diff --git a/src/router/modules/shelving.js b/src/router/modules/shelving.js
index c085dd8dc7..94ff274dc1 100644
--- a/src/router/modules/shelving.js
+++ b/src/router/modules/shelving.js
@@ -111,15 +111,6 @@ export default {
shelvingCard,
],
},
- {
- path: 'create',
- name: 'ShelvingCreate',
- meta: {
- title: 'shelvingCreate',
- icon: 'add',
- },
- component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'),
- },
{
path: 'parking',
name: 'ParkingMain',
diff --git a/src/router/modules/wagon.js b/src/router/modules/wagon.js
index 4a322d305f..798c671eb9 100644
--- a/src/router/modules/wagon.js
+++ b/src/router/modules/wagon.js
@@ -1,52 +1,60 @@
import { RouterView } from 'vue-router';
+const wagonCard = {
+ name: 'WagonCard',
+ path: ':id',
+ component: () => import('src/pages/Wagon/Card/WagonCard.vue'),
+ redirect: { name: 'WagonEdit' },
+ meta: {
+ menu: ['WagonEdit'],
+ },
+ children: [
+ {
+ path: 'edit',
+ name: 'WagonEdit',
+ meta: {
+ title: 'wagonEdit',
+ icon: 'edit',
+ },
+ component: () => import('src/pages/Wagon/WagonCreate.vue'),
+ },
+ ],
+};
+
export default {
- path: '/wagon',
name: 'Wagon',
+ path: '/wagon',
meta: {
title: 'wagons',
icon: 'vn:trolley',
moduleName: 'Wagon',
+ menu: ['WagonList', 'WagonTypeList', 'WagonCounter'],
},
component: RouterView,
redirect: { name: 'WagonMain' },
- menus: {
- main: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'],
- card: [],
- },
children: [
{
- path: '/wagon',
+ path: '',
name: 'WagonMain',
component: () => import('src/components/common/VnModule.vue'),
- redirect: { name: 'WagonList' },
+ redirect: { name: 'WagonIndexMain' },
children: [
{
- path: 'list',
- name: 'WagonList',
- meta: {
- title: 'list',
- icon: 'vn:trolley',
- },
+ path: '',
+ name: 'WagonIndexMain',
+ redirect: { name: 'WagonList' },
component: () => import('src/pages/Wagon/WagonList.vue'),
- },
- {
- path: 'create',
- name: 'WagonCreate',
- meta: {
- title: 'wagonCreate',
- icon: 'create',
- },
- component: () => import('src/pages/Wagon/WagonCreate.vue'),
- },
- {
- path: ':id/edit',
- name: 'WagonEdit',
- meta: {
- title: 'wagonEdit',
- icon: 'edit',
- },
- component: () => import('src/pages/Wagon/WagonCreate.vue'),
+ children: [
+ {
+ name: 'WagonList',
+ path: 'list',
+ meta: {
+ title: 'list',
+ icon: 'view_list',
+ },
+ },
+ wagonCard,
+ ],
},
{
path: 'counter',
@@ -57,40 +65,32 @@ export default {
},
component: () => import('src/pages/Wagon/WagonCounter.vue'),
},
- ],
- },
- {
- path: '/wagon/type',
- name: 'WagonTypeMain',
- component: () => import('src/components/common/VnModule.vue'),
- redirect: { name: 'WagonTypeList' },
- children: [
{
- path: 'list',
- name: 'WagonTypeList',
- meta: {
- title: 'typesList',
- icon: 'view_list',
- },
- component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'),
- },
- {
- path: 'create',
- name: 'WagonTypeCreate',
- meta: {
- title: 'typeCreate',
- icon: 'create',
- },
- component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'),
- },
- {
- path: ':id/edit',
- name: 'WagonTypeEdit',
- meta: {
- title: 'typeEdit',
- icon: 'edit',
- },
- component: () => import('src/pages/Wagon/Type/WagonTypeEdit.vue'),
+ path: 'type',
+ name: 'WagonTypeMain',
+ redirect: { name: 'WagonTypeList' },
+ children: [
+ {
+ path: 'list',
+ name: 'WagonTypeList',
+ meta: {
+ title: 'typesList',
+ icon: 'view_list',
+ },
+ component: () =>
+ import('src/pages/Wagon/Type/WagonTypeList.vue'),
+ },
+ {
+ path: ':id/edit',
+ name: 'WagonTypeEdit',
+ meta: {
+ title: 'typeEdit',
+ icon: 'edit',
+ },
+ component: () =>
+ import('src/pages/Wagon/Type/WagonTypeEdit.vue'),
+ },
+ ],
},
],
},
diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js
index f400a708e2..f48a715b94 100644
--- a/src/router/modules/zone.js
+++ b/src/router/modules/zone.js
@@ -1,24 +1,12 @@
import { RouterView } from 'vue-router';
-export default {
- path: '/zone',
- name: 'Zone',
+const zoneCard = {
+ name: 'ZoneCard',
+ path: ':id',
+ component: () => import('src/pages/Zone/Card/ZoneCard.vue'),
+ redirect: { name: 'ZoneSummary' },
meta: {
- title: 'zones',
- icon: 'vn:zone',
- moduleName: 'Zone',
- keyBinding: 'z',
- },
- component: RouterView,
- redirect: { name: 'ZoneMain' },
- menus: {
- main: [
- 'ZoneList',
- 'ZoneDeliveryDays',
- 'ZoneUpcomingList',
- 'ZoneUpcomingDeliveries',
- ],
- card: [
+ menu: [
'ZoneBasicData',
'ZoneWarehouses',
'ZoneHistory',
@@ -28,19 +16,102 @@ export default {
},
children: [
{
- path: '/zone',
+ name: 'ZoneSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ icon: 'launch',
+ },
+ component: () => import('src/pages/Zone/Card/ZoneSummary.vue'),
+ },
+ {
+ path: 'basic-data',
+ name: 'ZoneBasicData',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () => import('src/pages/Zone/Card/ZoneBasicData.vue'),
+ },
+ {
+ path: 'location',
+ name: 'ZoneLocations',
+ meta: {
+ title: 'locations',
+ icon: 'my_location',
+ },
+ component: () => import('src/pages/Zone/Card/ZoneLocations.vue'),
+ },
+ {
+ path: 'warehouses',
+ name: 'ZoneWarehouses',
+ meta: {
+ title: 'warehouses',
+ icon: 'home',
+ },
+ component: () => import('src/pages/Zone/Card/ZoneWarehouses.vue'),
+ },
+ {
+ path: 'log',
+ name: 'ZoneHistory',
+ meta: {
+ title: 'log',
+ icon: 'history',
+ },
+ component: () => import('src/pages/Zone/Card/ZoneLog.vue'),
+ },
+ {
+ path: 'events',
+ name: 'ZoneEvents',
+ meta: {
+ title: 'calendar',
+ icon: 'vn:calendar',
+ },
+ component: () => import('src/pages/Zone/Card/ZoneEvents.vue'),
+ },
+ ],
+};
+
+export default {
+ name: 'Zone',
+ path: '/zone',
+ meta: {
+ title: 'zones',
+ icon: 'vn:zone',
+ moduleName: 'Zone',
+ keyBinding: 'z',
+ menu: [
+ 'ZoneList',
+ 'ZoneDeliveryDays',
+ 'ZoneUpcomingList',
+ 'ZoneUpcomingDeliveries',
+ ],
+ },
+ component: RouterView,
+ redirect: { name: 'ZoneMain' },
+ children: [
+ {
name: 'ZoneMain',
+ path: '',
component: () => import('src/components/common/VnModule.vue'),
- redirect: { name: 'ZoneList' },
+ redirect: { name: 'ZoneIndexMain' },
children: [
{
- path: 'list',
- name: 'ZoneList',
- meta: {
- title: 'zonesList',
- icon: 'view_list',
- },
+ path: '',
+ name: 'ZoneIndexMain',
+ redirect: { name: 'ZoneList' },
component: () => import('src/pages/Zone/ZoneList.vue'),
+ children: [
+ {
+ name: 'ZoneList',
+ path: 'list',
+ meta: {
+ title: 'list',
+ icon: 'view_list',
+ },
+ },
+ zoneCard,
+ ],
},
{
path: 'delivery-days',
@@ -62,67 +133,5 @@ export default {
},
],
},
- {
- name: 'ZoneCard',
- path: ':id',
- component: () => import('src/pages/Zone/Card/ZoneCard.vue'),
- redirect: { name: 'ZoneSummary' },
- children: [
- {
- name: 'ZoneSummary',
- path: 'summary',
- meta: {
- title: 'summary',
- icon: 'launch',
- },
- component: () => import('src/pages/Zone/Card/ZoneSummary.vue'),
- },
- {
- name: 'ZoneBasicData',
- path: 'basic-data',
- meta: {
- title: 'basicData',
- icon: 'vn:settings',
- },
- component: () => import('src/pages/Zone/Card/ZoneBasicData.vue'),
- },
- {
- name: 'ZoneLocations',
- path: 'location',
- meta: {
- title: 'locations',
- icon: 'my_location',
- },
- component: () => import('src/pages/Zone/Card/ZoneLocations.vue'),
- },
- {
- name: 'ZoneWarehouses',
- path: 'warehouses',
- meta: {
- title: 'warehouses',
- icon: 'home',
- },
- component: () => import('src/pages/Zone/Card/ZoneWarehouses.vue'),
- },
- {
- name: 'ZoneHistory',
- path: 'log',
- meta: {
- title: 'log',
- icon: 'history',
- },
- component: () => import('src/pages/Zone/Card/ZoneLog.vue'),
- },
- {
- name: 'ZoneEvents',
- path: 'events',
- meta: {
- title: 'calendar',
- icon: 'vn:calendar',
- },
- component: () => import('src/pages/Zone/Card/ZoneEvents.vue'),
- },
- ],
- },
],
};
diff --git a/test/cypress/.gitignore b/test/cypress/.gitignore
index 3a1fcbf37d..52595efbcb 100644
--- a/test/cypress/.gitignore
+++ b/test/cypress/.gitignore
@@ -5,3 +5,4 @@ downloads/*
storage/*
reports/*
docker/logs/*
+results/*
diff --git a/test/cypress/cypressParallel.sh b/test/cypress/cypressParallel.sh
new file mode 100644
index 0000000000..8ef26bcde8
--- /dev/null
+++ b/test/cypress/cypressParallel.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+find 'test/cypress/integration' \
+ -mindepth 1 \
+ -maxdepth 1 \
+ -type d | \
+xargs -P "$1" -I {} sh -c '
+ echo "🔷 {}" &&
+ xvfb-run -a cypress run \
+ --headless \
+ --spec "{}" \
+ --quiet \
+ > /dev/null
+'
+wait
diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js
index 7ca6472af1..05ee7f0b84 100755
--- a/test/cypress/integration/claim/claimDevelopment.spec.js
+++ b/test/cypress/integration/claim/claimDevelopment.spec.js
@@ -10,8 +10,6 @@ describe('ClaimDevelopment', () => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
- cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
- cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
cy.waitForElement('tbody');
});
@@ -36,7 +34,6 @@ describe('ClaimDevelopment', () => {
});
it('should add and remove new line', () => {
- cy.wait(['@workers', '@workers']);
cy.addCard();
cy.waitForElement(thirdRow);
diff --git a/test/cypress/integration/claim/claimNotes.spec.js b/test/cypress/integration/claim/claimNotes.spec.js
index ae8b4186ce..576671a383 100644
--- a/test/cypress/integration/claim/claimNotes.spec.js
+++ b/test/cypress/integration/claim/claimNotes.spec.js
@@ -1,4 +1,4 @@
-describe.skip('ClaimNotes', () => {
+describe('ClaimNotes', () => {
const saveBtn = '.q-field__append > .q-btn > .q-btn__content > .q-icon';
const firstNote = '.q-infinite-scroll :nth-child(1) > .q-card__section--vert';
beforeEach(() => {
@@ -8,7 +8,10 @@ describe.skip('ClaimNotes', () => {
it('should add a new note', () => {
const message = 'This is a new message.';
- cy.get('.q-textarea').should('not.be.disabled').type(message);
+ cy.get('.q-textarea')
+ .should('be.visible')
+ .should('not.be.disabled')
+ .type(message);
cy.get(saveBtn).click();
cy.get(firstNote).should('have.text', message);
diff --git a/test/cypress/integration/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js
index c3522cbfed..b84b4f9581 100755
--- a/test/cypress/integration/claim/claimPhoto.spec.js
+++ b/test/cypress/integration/claim/claimPhoto.spec.js
@@ -1,6 +1,7 @@
///
-// redmine.verdnatura.es/issues/8417
-describe.skip('ClaimPhoto', () => {
+describe('ClaimPhoto', () => {
+ const carrouselClose =
+ '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon';
beforeEach(() => {
const claimId = 1;
cy.login('developer');
@@ -12,47 +13,38 @@ describe.skip('ClaimPhoto', () => {
cy.get('label > .q-btn input').selectFile('test/cypress/fixtures/image.jpg', {
force: true,
});
- cy.get('.q-notification__message').should('have.text', 'Data saved');
+ cy.checkNotification('Data saved');
});
it('should add new file with drag and drop', () => {
+ cy.get('.container').should('be.visible').and('exist');
cy.get('.container').selectFile('test/cypress/fixtures/image.jpg', {
action: 'drag-drop',
});
- cy.get('.q-notification__message').should('have.text', 'Data saved');
+ cy.checkNotification('Data saved');
});
it('should open first image dialog change to second and close', () => {
- cy.get(':nth-last-child(1) > .q-card').click();
- cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
- 'be.visible',
- );
+ cy.dataCy('file-1').click();
+ cy.get(carrouselClose).click();
- cy.get('.q-carousel__control > button').click();
-
- cy.get(
- '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon',
- ).click();
- cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
- 'not.be.visible',
- );
+ cy.dataCy('file-1').click();
+ cy.get('.q-carousel__control > button').as('nextButton').click();
+ cy.get('.q-carousel__slide > .q-ma-none').should('be.visible');
+ cy.get(carrouselClose).click();
});
it('should remove third and fourth file', () => {
- cy.get(
- '.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon',
- ).click();
+ cy.dataCy('delete-button-4').click();
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
).click();
- cy.get('.q-notification__message').should('have.text', 'Data deleted');
+ cy.checkNotification('Data deleted');
- cy.get(
- '.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon',
- ).click();
+ cy.dataCy('delete-button-3').click();
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
).click();
- cy.get('.q-notification__message').should('have.text', 'Data deleted');
+ cy.checkNotification('Data deleted');
});
});
diff --git a/test/cypress/integration/client/clientBalance.spec.js b/test/cypress/integration/client/clientBalance.spec.js
index abfa74cec6..56ce016920 100644
--- a/test/cypress/integration/client/clientBalance.spec.js
+++ b/test/cypress/integration/client/clientBalance.spec.js
@@ -5,7 +5,10 @@ describe('Client balance', () => {
cy.login('developer');
cy.visit('#/customer/1101/balance');
});
- it('Should load layout', () => {
- cy.get('.q-page').should('be.visible');
+ it('Should create a mandate', () => {
+ cy.get('.q-page-sticky > div > .q-btn').click();
+ cy.selectOption('[data-cy="paymentBank"]', 2);
+ cy.dataCy('paymentAmount_input').type('100');
+ cy.saveCard();
});
});
diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js
index f83d292789..b29ad74af7 100644
--- a/test/cypress/integration/client/clientList.spec.js
+++ b/test/cypress/integration/client/clientList.spec.js
@@ -58,14 +58,23 @@ describe('Client list', () => {
cy.waitForElement('.q-form');
cy.checkValueForm(1, search);
cy.checkValueForm(2, search);
+ cy.dataCy('Customer_select').should('have.value', search);
+ cy.dataCy('Address_select').should('have.value', search);
});
it('Client founded create order', () => {
const search = 'Jessica Jones';
- cy.searchByLabel('Name', search);
+
+ cy.intercept('GET', /\/api\/Clients\/1110\/summary/).as('customer');
+ cy.dataCy('Name_input').type(`${search}{enter}`);
+ cy.wait('@customer');
+ cy.get('.actions > .q-card__actions').should('exist');
cy.clickButtonWith('icon', 'icon-basketadd');
+ cy.url().should('include', `/customer/1110/summary`);
cy.waitForElement('#formModel');
cy.waitForElement('.q-form');
cy.checkValueForm(1, search);
+ cy.dataCy('Client_select').should('have.value', search);
+ cy.dataCy('Address_select').should('have.value', search);
});
});
diff --git a/test/cypress/integration/client/clientWebAccess.spec.js b/test/cypress/integration/client/clientWebAccess.spec.js
index 6803336a3e..970aab71c2 100644
--- a/test/cypress/integration/client/clientWebAccess.spec.js
+++ b/test/cypress/integration/client/clientWebAccess.spec.js
@@ -12,7 +12,7 @@ describe('Client web-access', () => {
cy.get('.q-btn-group > :nth-child(1)').should('not.be.disabled');
cy.get('.q-checkbox__inner').click();
cy.get('.q-btn-group > .q-btn--standard.q-btn--actionable').should(
- 'not.be.disabled'
+ 'not.be.disabled',
);
cy.get('.q-btn-group > .q-btn--flat').should('not.be.disabled');
cy.get('.q-btn-group > :nth-child(1)').click();
diff --git a/test/cypress/integration/entry/entryList.spec.js b/test/cypress/integration/entry/entryList.spec.js
index d43ec895a9..4c4c4f0042 100644
--- a/test/cypress/integration/entry/entryList.spec.js
+++ b/test/cypress/integration/entry/entryList.spec.js
@@ -20,7 +20,7 @@ describe('Entry', () => {
);
});
- it('Create entry, modify travel and add buys', () => {
+ it.skip('Create entry, modify travel and add buys', () => {
createEntryAndBuy();
cy.get('a[data-cy="EntryBasicData-menu-item"]').click();
selectTravel('two');
diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
index 1e7ce1003b..3e9997a74f 100644
--- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
@@ -10,8 +10,6 @@ describe('InvoiceInVat', () => {
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/invoice-in/1/vat`);
- cy.intercept('GET', '/api/InvoiceIns/1/getTotals').as('lastCall');
- cy.wait('@lastCall');
});
it('should edit the sage iva', () => {
diff --git a/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js b/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js
index 145f492a19..e93326f1d3 100644
--- a/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js
+++ b/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js
@@ -1,5 +1,5 @@
///
-describe('InvoiceOut manual invoice', () => {
+describe.skip('InvoiceOut manual invoice', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
@@ -10,12 +10,17 @@ describe('InvoiceOut manual invoice', () => {
it('should create an invoice from a ticket and go to that invoice', () => {
cy.searchByLabel('Customer ID', '1101');
cy.get(
- '[data-q-vs-anchor=""] > :nth-child(1) > .q-checkbox > .q-checkbox__inner'
+ '[data-q-vs-anchor=""] > :nth-child(1) > .q-checkbox > .q-checkbox__inner',
).click();
cy.dataCy('ticketListMakeInvoiceBtn').click();
cy.checkNotification('Data saved');
cy.get('.q-virtual-scroll__content > :nth-child(1) > :nth-child(3)').click();
cy.get(':nth-child(8) > .value > .link').click();
- cy.get('.header > :nth-child(3) > .q-btn__content').click();
+ cy.get('.q-menu > .descriptor > .header').should('be.visible');
+ cy.get(
+ '.q-menu > .descriptor > .header > [data-cy="descriptor-more-opts"] > .q-btn__content',
+ ).click();
+ cy.get('[data-cy="descriptor-more-opts-menu"] > .q-list > :nth-child(4)').click();
+ cy.dataCy('VnConfirm_confirm').click();
});
});
diff --git a/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
index 4d530de05f..0039f6240c 100644
--- a/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
+++ b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
@@ -9,7 +9,7 @@ describe('InvoiceOut negative bases', () => {
cy.visit(`/#/invoice-out/negative-bases`);
});
- it('should open the posible descriptors', () => {
+ it.skip('should open the posible descriptors', () => {
cy.get(getDescriptors('clientId')).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1101');
diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
index 29d841acc8..63e828f556 100644
--- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
+++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
@@ -7,17 +7,14 @@ describe('InvoiceOut summary', () => {
const firstRowDescriptors = (opt) =>
`tbody > :nth-child(1) > :nth-child(${opt}) > .q-btn`;
- const toCustomerSummary = '[href="#/customer/1101"]';
const toTicketList = '[href="#/ticket/list?table={%22refFk%22:%22T1111111%22}"]';
const selectMenuOption = (opt) => `.q-menu > .q-list > :nth-child(${opt})`;
const confirmSend = '.q-btn--unelevated';
beforeEach(() => {
- cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/invoice-out/1/summary`);
});
-
it('open the descriptors', () => {
cy.get(firstRowDescriptors(1)).click();
cy.get('.descriptor').should('be.visible');
@@ -27,16 +24,17 @@ describe('InvoiceOut summary', () => {
cy.get('.q-item > .q-item__label').should('include.text', '1101');
});
- it('should open the client summary and the ticket list', () => {
- cy.get(toCustomerSummary).click();
+ it('should open the client summary', () => {
+ cy.dataCy('invoiceOutDescriptorCustomerCard').click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1101');
});
- it.skip('should open the ticket list', () => {
+ it('should open the ticket list', () => {
cy.get(toTicketList).click();
- cy.get('.descriptor').should('be.visible');
- cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111');
+ cy.get('[data-col-field="stateFk"]').each(($el) => {
+ cy.wrap($el).contains('T1111111');
+ });
});
it('should transfer the invoice ', () => {
@@ -52,6 +50,7 @@ describe('InvoiceOut summary', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(3)).click();
cy.dataCy('InvoiceOutDescriptorMenuSendPdfOption').click();
+ cy.dataCy('SendEmailNotifiactionDialogInput').should('be.visible');
cy.get(confirmSend).click();
cy.checkNotification('Notification sent');
});
@@ -60,18 +59,11 @@ describe('InvoiceOut summary', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(3)).click();
cy.dataCy('InvoiceOutDescriptorMenuSendCsvOption').click();
+ cy.dataCy('SendEmailNotifiactionDialogInput').should('be.visible');
cy.get(confirmSend).click();
cy.checkNotification('Notification sent');
});
- it('should delete an invoice ', () => {
- cy.typeSearchbar('T2222222{enter}');
- cy.dataCy('descriptor-more-opts').click();
- cy.get(selectMenuOption(4)).click();
- cy.dataCy('VnConfirm_confirm').click();
- cy.checkNotification('InvoiceOut deleted');
- });
-
it('should book the invoice', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(5)).click();
diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js
index 2cf9c2cafa..404e8e365f 100644
--- a/test/cypress/integration/item/ItemFixedPrice.spec.js
+++ b/test/cypress/integration/item/ItemFixedPrice.spec.js
@@ -3,7 +3,6 @@ function goTo(n = 1) {
return `.q-virtual-scroll__content > :nth-child(${n})`;
}
const firstRow = goTo();
-`.q-virtual-scroll__content > :nth-child(2)`;
describe('Handle Items FixedPrice', () => {
beforeEach(() => {
cy.viewport(1280, 720);
diff --git a/test/cypress/integration/item/itemBarcodes.spec.js b/test/cypress/integration/item/itemBarcodes.spec.js
index 844768d9e9..1f6698f9c9 100644
--- a/test/cypress/integration/item/itemBarcodes.spec.js
+++ b/test/cypress/integration/item/itemBarcodes.spec.js
@@ -3,23 +3,22 @@ describe('ItemBarcodes', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit(`/#/item/list`);
- cy.typeSearchbar('1{enter}');
+ cy.visit(`/#/item/1/barcode`);
});
it('should throw an error if the barcode exists', () => {
- cy.get('[href="#/item/1/barcode"]').click();
- cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
- cy.dataCy('Code_input').eq(3).type('1111111111');
- cy.dataCy('crudModelDefaultSaveBtn').click();
+ newBarcode('1111111111');
cy.checkNotification('Codes can not be repeated');
});
it('should create a new barcode', () => {
- cy.get('[href="#/item/1/barcode"]').click();
- cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
- cy.dataCy('Code_input').eq(3).type('1231231231');
- cy.dataCy('crudModelDefaultSaveBtn').click();
+ newBarcode('1231231231');
cy.checkNotification('Data saved');
});
+
+ function newBarcode(text) {
+ cy.dataCy('addBarcode_input').click();
+ cy.dataCy('Code_input').eq(3).should('exist').type(text);
+ cy.dataCy('crudModelDefaultSaveBtn').click();
+ }
});
diff --git a/test/cypress/integration/item/itemBotanical.spec.js b/test/cypress/integration/item/itemBotanical.spec.js
index 08886d9a8c..6105ef1792 100644
--- a/test/cypress/integration/item/itemBotanical.spec.js
+++ b/test/cypress/integration/item/itemBotanical.spec.js
@@ -7,11 +7,9 @@ describe('Item botanical', () => {
});
it('should modify the botanical', () => {
- cy.dataCy('AddGenusSelectDialog').type('Abies');
- cy.get('.q-menu .q-item').contains('Abies').click();
- cy.dataCy('AddSpeciesSelectDialog').type('dealbata');
- cy.get('.q-menu .q-item').contains('dealbata').click();
- cy.get('.q-btn-group > .q-btn--standard').click();
+ cy.selectOption('[data-cy="AddGenusSelectDialog"]', 'Abies');
+ cy.selectOption('[data-cy="AddSpeciesSelectDialog"]', 'dealbata');
+ cy.saveCard();
cy.checkNotification('Data saved');
});
diff --git a/test/cypress/integration/item/itemList.spec.js b/test/cypress/integration/item/itemList.spec.js
index f0c744f214..10e388580e 100644
--- a/test/cypress/integration/item/itemList.spec.js
+++ b/test/cypress/integration/item/itemList.spec.js
@@ -1,6 +1,6 @@
///
-describe('Item list', () => {
+describe.skip('Item list', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
@@ -16,8 +16,7 @@ describe('Item list', () => {
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
});
- // https://redmine.verdnatura.es/issues/8421
- it.skip('should create an item', () => {
+ it('should create an item', () => {
const data = {
Description: { val: `Test item` },
Type: { val: `Crisantemo`, type: 'select' },
diff --git a/test/cypress/integration/order/orderList.spec.js b/test/cypress/integration/order/orderList.spec.js
new file mode 100644
index 0000000000..c48b317a8e
--- /dev/null
+++ b/test/cypress/integration/order/orderList.spec.js
@@ -0,0 +1,74 @@
+///
+describe('OrderList', () => {
+ const clientCreateSelect = '#formModel [data-cy="Client_select"]';
+ const addressCreateSelect = '#formModel [data-cy="Address_select"]';
+ const agencyCreateSelect = '#formModel [data-cy="Agency_select"]';
+
+ beforeEach(() => {
+ cy.login('developer');
+ cy.viewport(1920, 1080);
+ cy.visit('/#/order/list');
+ });
+
+ it('create order', () => {
+ cy.get('[data-cy="vnTableCreateBtn"]').click();
+ cy.selectOption(clientCreateSelect, 1101);
+ cy.get(addressCreateSelect).click();
+ cy.get(
+ '.q-menu > div> div.q-item:nth-child(1) >div.q-item__section--avatar > i',
+ ).should('have.text', 'star');
+ cy.dataCy('landedDate').find('input').type('06/01/2001');
+ cy.selectOption(agencyCreateSelect, 1);
+
+ cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale');
+ cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click();
+ cy.wait('@orderSale');
+ cy.get('.q-item > .q-item__label.subtitle').then((text) => {
+ const id = text.text().trim().split('#')[1];
+ cy.get('.q-item > .q-item__label').should('have.text', ` #${id}`);
+ });
+ cy.url().should('include', `/order`);
+ });
+
+ it('filter list and create order', () => {
+ cy.dataCy('Customer ID_input').type('1101{enter}');
+ cy.dataCy('vnTableCreateBtn').click();
+ cy.dataCy('landedDate').find('input').type('06/01/2001');
+ cy.selectOption(agencyCreateSelect, 1);
+
+ cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale');
+ cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click();
+ cy.wait('@orderSale');
+ cy.get('.q-item > .q-item__label.subtitle').then((text) => {
+ const id = text.text().trim().split('#')[1];
+ cy.get('.q-item > .q-item__label').should('have.text', ` #${id}`);
+ });
+ cy.url().should('include', `/order`);
+ });
+
+ it('create order from customer summary', function () {
+ const clientId = 1101;
+ cy.dataCy('Customer ID_input').type(`${clientId}{enter}`);
+ cy.get(
+ ':nth-child(1) > [data-col-field="clientFk"] > .no-padding > .link',
+ ).click();
+ cy.get(
+ `[href="#/order/list?createForm={%22clientFk%22:${clientId},%22addressId%22:1}"] > .q-btn__content > .q-icon`,
+ ).click();
+ cy.dataCy('vnTableCreateBtn').click();
+
+ cy.get(clientCreateSelect).should('have.value', 'Bruce Wayne');
+ cy.get(addressCreateSelect).should('have.value', 'Bruce Wayne');
+ cy.dataCy('landedDate').find('input').type('06/01/2001');
+ cy.selectOption(agencyCreateSelect, 1);
+
+ cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale');
+ cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click();
+ cy.wait('@orderSale');
+ cy.get('.q-item > .q-item__label.subtitle').then((text) => {
+ const id = text.text().trim().split('#')[1];
+ cy.get('.q-item > .q-item__label').should('have.text', ` #${id}`);
+ });
+ cy.url().should('include', `/order`);
+ });
+});
diff --git a/test/cypress/integration/outLogin/logout.spec.js b/test/cypress/integration/outLogin/logout.spec.js
index bcdacec78c..373f0cc933 100644
--- a/test/cypress/integration/outLogin/logout.spec.js
+++ b/test/cypress/integration/outLogin/logout.spec.js
@@ -2,7 +2,7 @@
describe('Logout', () => {
beforeEach(() => {
cy.login('developer');
- cy.visit(`/#/dashboard`);
+ cy.visit(`/#/dashboard`, false);
cy.waitForElement('.q-page', 6000);
});
describe('by user', () => {
diff --git a/test/cypress/integration/route/roadMap/roadmapList.spec.js b/test/cypress/integration/route/roadMap/roadmapList.spec.js
index 6d46b2cf62..35c0c2b028 100644
--- a/test/cypress/integration/route/roadMap/roadmapList.spec.js
+++ b/test/cypress/integration/route/roadMap/roadmapList.spec.js
@@ -1,12 +1,74 @@
describe('RoadMap', () => {
+ const getSelector = (colField) =>
+ `tr:last-child > [data-col-field="${colField}"] > .no-padding`;
+
+ const selectors = {
+ roadmap: getSelector('name'),
+ id: getSelector('id'),
+ etd: getSelector('etd'),
+ summaryHeader: '.summaryHeader > :nth-child(2)',
+ summaryGoToSummaryBtn: '.summaryHeader > a > .q-icon',
+ summaryBtn: 'tableAction-0',
+ inputRoadmap: 'Roadmap_input',
+ checkbox: '.q-virtual-scroll__content tr:last-child .q-checkbox',
+ cloneFormBtn: '.q-card__actions > .q-btn--standard',
+ cloneBtn: '#subToolbar > :nth-child(3)',
+ deleteBtn: ':nth-child(4) > .q-btn__content',
+ confirmBtn: 'VnConfirm_confirm',
+ inputEtd: 'ETD_inputDate',
+ };
+
+ const data = {
+ roadmap: 'TEST-ROADMAP',
+ etd: '01/01/2025',
+ };
+
+ const dataCreated = 'Data created';
+ const summaryUrl = '/summary';
+
beforeEach(() => {
+ cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/roadmap`);
+ cy.typeSearchbar('{enter}');
});
+
+ it('Should list roadmaps', () => {
+ cy.get('.q-table')
+ .children()
+ .should('be.visible')
+ .should('have.length.greaterThan', 0);
+ });
+
it('Route list create roadmap and redirect', () => {
cy.addBtnClick();
- cy.get('input[name="name"]').type('roadMapTestOne{enter}');
- cy.get('.q-notification__message').should('have.text', 'Data created');
- cy.url().should('include', '/summary');
+ cy.dataCy(selectors.inputRoadmap).type(`${data.roadmap}{enter}`);
+ cy.checkNotification(dataCreated);
+ cy.url().should('include', summaryUrl);
+ });
+
+ it('open summary', () => {
+ cy.dataCy(selectors.summaryBtn).last().click();
+ cy.get(selectors.summaryHeader).should('contain', data.roadmap);
+ cy.get(selectors.summaryGoToSummaryBtn).click();
+ cy.get(selectors.summaryHeader).should('contain', data.roadmap);
+ });
+
+ it('Should clone selected roadmap with new ETD', () => {
+ cy.get(selectors.checkbox).click();
+ cy.get(selectors.cloneBtn).click();
+ cy.dataCy(selectors.inputEtd).click().type(`${data.etd}{enter}`);
+ cy.get(selectors.cloneFormBtn).click();
+ cy.get(selectors.etd).should('contain', data.etd);
+ });
+
+ it('Should delete selected roadmap', () => {
+ cy.get(selectors.id).then(($el) => {
+ cy.get(selectors.checkbox).click();
+ cy.get(selectors.deleteBtn).click();
+ cy.dataCy(selectors.confirmBtn).click();
+ cy.typeSearchbar('{enter}');
+ cy.get(selectors.id).should('not.have.text', $el.text);
+ });
});
});
diff --git a/test/cypress/integration/route/routeExtendedList.spec.js b/test/cypress/integration/route/routeExtendedList.spec.js
index e3505ad609..5fda93b25f 100644
--- a/test/cypress/integration/route/routeExtendedList.spec.js
+++ b/test/cypress/integration/route/routeExtendedList.spec.js
@@ -32,18 +32,18 @@ describe.skip('Route extended list', () => {
const originalFields = [
{ selector: selectors.worker, type: 'select', value: 'logistic' },
- { selector: selectors.agency, type: 'select', value: 'Super-Man delivery' },
+ { selector: selectors.agency, type: 'select', value: 'inhouse pickup' },
{ selector: selectors.vehicle, type: 'select', value: '3333-IMK' },
- { selector: selectors.date, type: 'date', value: '01/02/2024' },
+ { selector: selectors.date, type: 'date', value: '01/01/2001' },
{ selector: selectors.description, type: 'input', value: 'Test route' },
{ selector: selectors.served, type: 'checkbox', value: checkboxState.uncheck },
];
const updateFields = [
{ selector: selectors.worker, type: 'select', value: 'salesperson' },
- { selector: selectors.agency, type: 'select', value: 'inhouse pickup' },
+ { selector: selectors.agency, type: 'select', value: 'Super-Man delivery' },
{ selector: selectors.vehicle, type: 'select', value: '1111-IMK' },
- { selector: selectors.date, type: 'date', value: '01/01/2001' },
+ { selector: selectors.date, type: 'date', value: '11/01/2001' },
{ selector: selectors.description, type: 'input', value: 'Description updated' },
{ selector: selectors.served, type: 'checkbox', value: checkboxState.check },
];
@@ -57,11 +57,11 @@ describe.skip('Route extended list', () => {
break;
case 'input':
cy.get(selector).should('be.visible').click();
- cy.dataCy('null_input').clear().type(`${value}{enter}`);
+ cy.dataCy('null_input').clear().type(`${value}`);
break;
case 'date':
cy.get(selector).should('be.visible').click();
- cy.dataCy('null_inputDate').clear().type(`${value}{enter}`);
+ cy.dataCy('null_inputDate').clear().type(`${value}`);
break;
case 'checkbox':
cy.get(selector).should('be.visible').click().click();
@@ -76,15 +76,6 @@ describe.skip('Route extended list', () => {
cy.typeSearchbar('{enter}');
});
- after(() => {
- cy.visit(url);
- cy.typeSearchbar('{enter}');
- cy.get(selectors.lastRowSelectCheckBox).click();
-
- cy.get(selectors.removeBtn).click();
- cy.dataCy(selectors.confirmBtn).click();
- });
-
it('Should list routes', () => {
cy.get('.q-table')
.children()
@@ -97,9 +88,9 @@ describe.skip('Route extended list', () => {
const data = {
Worker: { val: 'logistic', type: 'select' },
- Agency: { val: 'Super-Man delivery', type: 'select' },
+ Agency: { val: 'inhouse pickup', type: 'select' },
Vehicle: { val: '3333-IMK', type: 'select' },
- Date: { val: '02-01-2024', type: 'date' },
+ Date: { val: '01-01-2001', type: 'date' },
From: { val: '01-01-2024', type: 'date' },
To: { val: '10-01-2024', type: 'date' },
'Km start': { val: 1000 },
@@ -129,7 +120,7 @@ describe.skip('Route extended list', () => {
it('Should clone selected route', () => {
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.cloneBtn).click();
- cy.dataCy('route.Starting date_inputDate').type('10-05-2001{enter}');
+ cy.dataCy('route.Starting date_inputDate').type('10-05-2001').click();
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
cy.validateContent(selectors.date, '05/10/2001');
});
@@ -142,10 +133,6 @@ describe.skip('Route extended list', () => {
const fileName = 'download.zip';
cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
-
- cy.task('deleteFile', `${downloadsFolder}/${fileName}`).then((deleted) => {
- expect(deleted).to.be.true;
- });
});
it('Should mark as served the selected route', () => {
@@ -165,6 +152,13 @@ describe.skip('Route extended list', () => {
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', () => {
updateFields.forEach(({ selector, type, value }) => {
fillField(selector, type, value);
@@ -175,18 +169,15 @@ describe.skip('Route extended list', () => {
cy.typeSearchbar('{enter}');
- updateFields.forEach(({ selector, value }) => {
+ updateFields.forEach(({ selector, value, type }) => {
+ if (type === 'date') {
+ const [month, day, year] = value.split('/');
+ value = `${day}/${month}/${year}`;
+ }
cy.validateContent(selector, value);
});
});
- 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 open summary pop-up when click summuary icon', () => {
cy.dataCy('tableAction-1').last().click();
cy.get('.summaryHeader > :nth-child(2').should('contain', updateFields[4].value);
diff --git a/test/cypress/integration/shelving/parking/parkingBasicData.spec.js b/test/cypress/integration/shelving/parking/parkingBasicData.spec.js
index e28d7eecab..81c1586845 100644
--- a/test/cypress/integration/shelving/parking/parkingBasicData.spec.js
+++ b/test/cypress/integration/shelving/parking/parkingBasicData.spec.js
@@ -6,13 +6,16 @@ describe('ParkingBasicData', () => {
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/shelving/parking/1/basic-data`);
+ cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should(
+ 'not.be.visible',
+ );
});
it('should give an error if the code aldready exists', () => {
cy.get(codeInput).eq(0).should('have.value', '700-01').clear();
cy.get(codeInput).eq(0).type('700-02');
cy.saveCard();
- cy.get('.q-notification__message').should('have.text', 'The code already exists');
+ cy.checkNotification('The code already exists');
});
it('should edit the code and sector', () => {
@@ -24,7 +27,8 @@ describe('ParkingBasicData', () => {
cy.dataCy('Picking order_input').clear().type(80230);
cy.saveCard();
- cy.get('.q-notification__message').should('have.text', 'Data saved');
+ cy.checkNotification('Data saved');
+
cy.get(sectorSelect).should('have.value', 'First sector');
cy.get(codeInput).should('have.value', '700-01');
cy.dataCy('Picking order_input').should('have.value', 80230);
diff --git a/test/cypress/integration/shelving/parking/parkingList.spec.js b/test/cypress/integration/shelving/parking/parkingList.spec.js
index ecee8aab74..ca18776214 100644
--- a/test/cypress/integration/shelving/parking/parkingList.spec.js
+++ b/test/cypress/integration/shelving/parking/parkingList.spec.js
@@ -1,7 +1,7 @@
///
describe('ParkingList', () => {
const searchbar = '#searchbar input';
- const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none';
+ const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none';
const summaryHeader = '.summaryBody .header';
beforeEach(() => {
diff --git a/test/cypress/integration/shelving/shelvingBasicData.spec.js b/test/cypress/integration/shelving/shelvingBasicData.spec.js
new file mode 100644
index 0000000000..d7b0dc692e
--- /dev/null
+++ b/test/cypress/integration/shelving/shelvingBasicData.spec.js
@@ -0,0 +1,24 @@
+///
+describe('ShelvingList', () => {
+ const parking =
+ '.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container';
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/shelving/1/basic-data`);
+ });
+
+ it('should give an error if the code aldready exists', () => {
+ cy.dataCy('Code_input').should('exist').clear().type('AA7');
+ cy.saveCard();
+ cy.get('.q-notification__message').should('have.text', 'The code already exists');
+ });
+ it('should edit the data and save', () => {
+ cy.selectOption(parking, 'P-01-1');
+ cy.dataCy('Code_input').clear().type('AA1');
+ cy.dataCy('Priority_input').clear().type('10');
+ cy.get(':nth-child(2) > .q-checkbox > .q-checkbox__inner').click();
+ cy.saveCard();
+ cy.get('.q-notification__message').should('have.text', 'Data saved');
+ });
+});
diff --git a/test/cypress/integration/shelving/shelvingList.spec.js b/test/cypress/integration/shelving/shelvingList.spec.js
new file mode 100644
index 0000000000..745dd1b787
--- /dev/null
+++ b/test/cypress/integration/shelving/shelvingList.spec.js
@@ -0,0 +1,41 @@
+///
+describe('ShelvingList', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/shelving/list`);
+ });
+
+ it('should redirect on clicking a shelving', () => {
+ cy.typeSearchbar('{enter}');
+ cy.dataCy('cardBtn').eq(0).click();
+ cy.get('.summaryHeader > .header > .q-icon').click();
+ cy.url().should('include', '/shelving/1/summary');
+ });
+
+ it('should redirect from preview to basic-data', () => {
+ cy.typeSearchbar('{enter}');
+ cy.dataCy('cardBtn').eq(0).click();
+ cy.get('.q-card > .header').click();
+ cy.url().should('include', '/shelving/1/basic-data');
+ });
+
+ it('should filter and redirect if only one result', () => {
+ cy.selectOption('[data-cy="Parking_select"]', 'P-02-2');
+ cy.dataCy('Parking_select').type('{enter}');
+ cy.url().should('match', /\/shelving\/\d+\/summary/);
+ });
+
+ it('should create a new shelving', () => {
+ cy.dataCy('vnTableCreateBtn').click();
+ cy.dataCy('code-create-popup').type('Test');
+ cy.dataCy('Priority_input').type('10');
+ cy.selectOption(
+ '.grid-create > .q-select > .q-field__inner > .q-field__control > .q-field__control-container',
+ '100-01',
+ );
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('Data created');
+ cy.url().should('match', /\/shelving\/\d+\/basic-data/);
+ });
+});
diff --git a/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js b/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js
index 9ea1cff631..b4997fa69c 100644
--- a/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js
+++ b/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js
@@ -1,5 +1,5 @@
///
-describe('Ticket Lack detail', () => {
+describe.skip('Ticket Lack detail', () => {
beforeEach(() => {
cy.login('developer');
cy.intercept('GET', /\/api\/Tickets\/itemLack\/5.*$/, {
@@ -37,11 +37,11 @@ describe('Ticket Lack detail', () => {
],
}).as('getItemLack');
- cy.visit('/#/ticket/negative/5');
+ cy.visit('/#/ticket/negative/5', false);
cy.wait('@getItemLack');
});
describe('Table actions', () => {
- it.skip('should display only one row in the lack list', () => {
+ it('should display only one row in the lack list', () => {
cy.location('href').should('contain', '#/ticket/negative/5');
cy.get('[data-cy="changeItem"]').should('be.disabled');
@@ -138,8 +138,8 @@ describe('Ticket Lack detail', () => {
cy.get('[data-cy="itemProposal"]').click();
cy.wait('@getItemGetSimilar');
});
- describe('Replace item if', () => {
- it.only('Quantity is less than available', () => {
+ describe.skip('Replace item if', () => {
+ it('Quantity is less than available', () => {
cy.get(':nth-child(1) > .text-right > .q-btn').click();
});
});
diff --git a/test/cypress/integration/ticket/ticketDescriptor.spec.js b/test/cypress/integration/ticket/ticketDescriptor.spec.js
index 3fc2842d35..0ba2723a25 100644
--- a/test/cypress/integration/ticket/ticketDescriptor.spec.js
+++ b/test/cypress/integration/ticket/ticketDescriptor.spec.js
@@ -14,8 +14,6 @@ describe('Ticket descriptor', () => {
it('should clone the ticket without warehouse', () => {
cy.visit('/#/ticket/1/summary');
- cy.intercept('GET', /\/api\/Tickets\/\d/).as('ticket');
- cy.wait('@ticket');
cy.openActionsDescriptor();
cy.contains(listItem, toCloneOpt).click();
cy.clickConfirm();
diff --git a/test/cypress/integration/ticket/ticketExpedition.spec.js b/test/cypress/integration/ticket/ticketExpedition.spec.js
index 6d7dc67212..95ec330dc4 100644
--- a/test/cypress/integration/ticket/ticketExpedition.spec.js
+++ b/test/cypress/integration/ticket/ticketExpedition.spec.js
@@ -10,10 +10,8 @@ describe('Ticket expedtion', () => {
it('should change the state', () => {
cy.visit('#/ticket/1/expedition');
- cy.intercept('GET', /\/api\/Expeditions\/filter/).as('show');
cy.intercept('POST', /\/api\/ExpeditionStates\/addExpeditionState/).as('add');
- cy.wait('@show');
cy.selectRows([1, 2]);
cy.dataCy('change-state').click();
diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js
index c9b3092a89..2409dd1491 100644
--- a/test/cypress/integration/ticket/ticketList.spec.js
+++ b/test/cypress/integration/ticket/ticketList.spec.js
@@ -5,18 +5,16 @@ describe('TicketList', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
- cy.visit('/#/ticket/list');
+ cy.visit('/#/ticket/list', false);
});
const searchResults = (search) => {
if (search) cy.typeSearchbar().type(search);
cy.dataCy('vn-searchbar').find('input').type('{enter}');
- // cy.dataCy('ticketListTable').should('exist');
cy.get(firstRow).should('exist');
};
it('should search results', () => {
- // cy.dataCy('ticketListTable').should('not.exist');
cy.get('.q-field__control').should('exist');
searchResults();
});
@@ -40,8 +38,8 @@ describe('TicketList', () => {
it('filter client and create ticket', () => {
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
searchResults();
+ cy.wait('@ticketSearchbar');
- cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
cy.dataCy('Customer ID_input').clear('1');
cy.dataCy('Customer ID_input').type('1101{enter}');
@@ -52,7 +50,7 @@ describe('TicketList', () => {
cy.getOption().click();
cy.dataCy('Address_select').should('have.value', 'Bruce Wayne');
});
- it('Client list create new client', () => {
+ it('Client list create new ticket', () => {
cy.dataCy('vnTableCreateBtn').should('exist');
cy.dataCy('vnTableCreateBtn').click();
const data = {
@@ -68,7 +66,7 @@ describe('TicketList', () => {
cy.url().should('match', /\/ticket\/\d+\/summary/);
});
- it('should show the corerct problems', () => {
+ it('should show the correct problems', () => {
cy.intercept('GET', '**/api/Tickets/filter*', (req) => {
req.headers['cache-control'] = 'no-cache';
req.headers['pragma'] = 'no-cache';
diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js
index 8051988571..81ea761c42 100644
--- a/test/cypress/integration/ticket/ticketSale.spec.js
+++ b/test/cypress/integration/ticket/ticketSale.spec.js
@@ -182,14 +182,17 @@ describe('TicketSale', () => {
it('change quantity ', () => {
const quantity = Math.floor(Math.random() * 100) + 1;
cy.waitForElement(firstRow);
- cy.dataCy('ticketSaleQuantityInput').clear();
- cy.dataCy('ticketSaleQuantityInput').type(quantity).trigger('tab');
+ cy.dataCy('ticketSaleQuantityInput').find('input').clear();
+ cy.dataCy('ticketSaleQuantityInput')
+ .find('input')
+ .type(quantity)
+ .trigger('tab');
cy.get('.q-page > :nth-child(6)').click();
handleVnConfirm();
cy.get('[data-cy="ticketSaleQuantityInput"]')
- .find('[data-cy="undefined_input"]')
+ .find('input')
.should('have.value', `${quantity}`);
});
});
diff --git a/test/cypress/integration/vnComponent/VnAccountNumber.spec.js b/test/cypress/integration/vnComponent/VnAccountNumber.spec.js
index 63ab646fe4..053902f354 100644
--- a/test/cypress/integration/vnComponent/VnAccountNumber.spec.js
+++ b/test/cypress/integration/vnComponent/VnAccountNumber.spec.js
@@ -1,35 +1,37 @@
-describe('VnInput Component', () => {
+describe('VnAccountNumber', () => {
+ const accountInput = 'input[data-cy="supplierFiscalDataAccount_input"]';
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/supplier/1/fiscal-data');
});
- it('should replace character at cursor position in insert mode', () => {
- // Simula escribir en el input
- cy.dataCy('supplierFiscalDataAccount').clear();
- cy.dataCy('supplierFiscalDataAccount').type('4100000001');
- // Coloca el cursor en la posición 0
- cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
- // Escribe un número y verifica que se reemplace correctamente
- cy.dataCy('supplierFiscalDataAccount').type('999');
- cy.dataCy('supplierFiscalDataAccount').should('have.value', '9990000001');
+ describe('VnInput handleInsertMode()', () => {
+ it('should replace character at cursor position in insert mode', () => {
+ cy.get(accountInput).type('{selectall}4100000001');
+ cy.get(accountInput).type('{movetostart}');
+ cy.get(accountInput).type('999');
+ cy.get(accountInput).should('have.value', '9990000001');
+ });
+
+ it('should replace character at cursor position in insert mode', () => {
+ cy.get(accountInput).clear();
+ cy.get(accountInput).type('4100000001');
+ cy.get(accountInput).type('{movetostart}');
+ cy.get(accountInput).type('999');
+ cy.get(accountInput).should('have.value', '9990000001');
+ });
+
+ it('should respect maxlength prop', () => {
+ cy.get(accountInput).clear();
+ cy.get(accountInput).type('123456789012345');
+ cy.get(accountInput).should('have.value', '1234567890');
+ });
});
- it('should replace character at cursor position in insert mode', () => {
- // Simula escribir en el input
- cy.dataCy('supplierFiscalDataAccount').clear();
- cy.dataCy('supplierFiscalDataAccount').type('4100000001');
- // Coloca el cursor en la posición 0
- cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
- // Escribe un número y verifica que se reemplace correctamente en la posicion incial
- cy.dataCy('supplierFiscalDataAccount').type('999');
- cy.dataCy('supplierFiscalDataAccount').should('have.value', '9990000001');
- });
-
- it('should respect maxlength prop', () => {
- cy.dataCy('supplierFiscalDataAccount').clear();
- cy.dataCy('supplierFiscalDataAccount').type('123456789012345');
- cy.dataCy('supplierFiscalDataAccount').should('have.value', '1234567890'); // asumiendo que maxlength es 10
+ it('should convert short account number to standard format', () => {
+ cy.get(accountInput).clear();
+ cy.get(accountInput).type('123.');
+ cy.get(accountInput).should('have.value', '1230000000');
});
});
diff --git a/test/cypress/integration/vnComponent/VnSearchBar.spec.js b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
index 11d9bbe6a8..8fed23643c 100644
--- a/test/cypress/integration/vnComponent/VnSearchBar.spec.js
+++ b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
@@ -27,7 +27,7 @@ describe('VnSearchBar', () => {
const searchAndCheck = (searchTerm, expectedText) => {
cy.clearSearchbar();
cy.typeSearchbar(`${searchTerm}{enter}`);
- cy.get(idGap).should('have.text', expectedText);
+ cy.get(idGap).should('include.text', expectedText);
};
const checkTableLength = (expectedLength) => {
diff --git a/test/cypress/integration/wagon/wagonCreate.spec.js b/test/cypress/integration/wagon/wagonCreate.spec.js
index 4e78e57de9..88855fdf9a 100644
--- a/test/cypress/integration/wagon/wagonCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonCreate.spec.js
@@ -16,8 +16,8 @@ describe('WagonCreate', () => {
cy.get(
'.grid-create > [label="Volume"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Volume_input"]',
).type('100');
- cy.dataCy('Type_select').type('{downarrow}{enter}');
-
+ cy.selectOption('[data-cy="Type_select"]', '1');
+ cy.dataCy('FormModelPopup_save').click();
cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
});
});
diff --git a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
index 49d7d9f01e..915927a6de 100644
--- a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
@@ -2,7 +2,7 @@ describe('WagonTypeCreate', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit('/#/wagon/type/create');
+ cy.visit('/#/wagon/type/list');
cy.waitForElement('.q-page', 6000);
});
diff --git a/test/cypress/integration/worker/workerBasicData.spec.js b/test/cypress/integration/worker/workerBasicData.spec.js
new file mode 100644
index 0000000000..cf452a0448
--- /dev/null
+++ b/test/cypress/integration/worker/workerBasicData.spec.js
@@ -0,0 +1,15 @@
+describe('WorkerBasicData', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/worker/1107/basic-data');
+ });
+
+ it('should modify worker summary', () => {
+ cy.dataCy('MaritalStatus').type('Married');
+ cy.dataCy('fi').type('42572374H');
+ cy.dataCy('country').type('Alemania');
+ cy.saveCard();
+ cy.checkNotification('Data saved');
+ });
+});
diff --git a/test/cypress/integration/worker/workerBusiness.spec.js b/test/cypress/integration/worker/workerBusiness.spec.js
new file mode 100644
index 0000000000..46da28cd6a
--- /dev/null
+++ b/test/cypress/integration/worker/workerBusiness.spec.js
@@ -0,0 +1,34 @@
+describe.skip('WorkerBusiness', () => {
+ const saveBtn = '.q-mt-lg > .q-btn--standard';
+ const contributionCode = `Representantes de comercio`;
+ const contractType = `INDEFINIDO A TIEMPO COMPLETO`;
+
+ const Business = {
+ 'Start Date': { val: '26-12-2002', type: 'date' },
+ Company: { val: `VNL`, type: 'select' },
+ Department: { val: `RECICLAJE`, type: 'select' },
+ 'Professional Category': { val: `employee`, type: 'select' },
+ 'Work Calendar': { val: `General schedule`, type: 'select' },
+ 'Work Center': { val: `Silla`, type: 'select' },
+ 'Contract Category': { val: `INFORMATICA`, type: 'select' },
+ 'Contribution Code': { val: contributionCode, type: 'select' },
+ Rate: { val: `5` },
+ 'Contract Type': { val: contractType, type: 'select' },
+ 'Transport Workers Salary': { val: `1000` },
+ };
+
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('hr');
+ cy.visit('/#/worker/1107/business');
+ cy.addCard();
+ });
+
+ it('should create a business', () => {
+ cy.fillInForm({
+ ...Business,
+ });
+ cy.get(saveBtn).click();
+ cy.checkNotification('Data created');
+ });
+});
diff --git a/test/cypress/integration/worker/workerCreate.spec.js b/test/cypress/integration/worker/workerCreate.spec.js
index 6349f04a0e..71fd6b347e 100644
--- a/test/cypress/integration/worker/workerCreate.spec.js
+++ b/test/cypress/integration/worker/workerCreate.spec.js
@@ -1,4 +1,4 @@
-describe.skip('WorkerCreate', () => {
+describe('WorkerCreate', () => {
const externalRadio = '.q-radio:nth-child(2)';
const developerBossId = 120;
const payMethodCross =
diff --git a/test/cypress/integration/worker/workerMutual.spec.js b/test/cypress/integration/worker/workerMutual.spec.js
new file mode 100644
index 0000000000..a6d2c5f4f6
--- /dev/null
+++ b/test/cypress/integration/worker/workerMutual.spec.js
@@ -0,0 +1,23 @@
+///
+describe('WorkerMutual', () => {
+ const userId = 1106;
+ const saveBtn = '.q-mt-lg > .q-btn--standard';
+ const medicalReview = {
+ Date: { val: '01-01-2001', type: 'date' },
+ 'Formation Center': { val: '1', type: 'select' },
+ Invoice: { val: '24532' },
+ Amount: { val: '540' },
+ };
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#/worker/${userId}/medical`);
+ cy.addCard();
+ });
+
+ it('should create a medical Review', () => {
+ cy.fillInForm(medicalReview);
+ cy.get(saveBtn).click();
+ cy.checkNotification('Data created');
+ });
+});
diff --git a/test/cypress/integration/worker/workerNotes.spec.js b/test/cypress/integration/worker/workerNotes.spec.js
new file mode 100644
index 0000000000..661314ac9f
--- /dev/null
+++ b/test/cypress/integration/worker/workerNotes.spec.js
@@ -0,0 +1,13 @@
+///
+describe('WorkerNotes', () => {
+ const userId = 1106;
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#/worker/${userId}/notes`);
+ });
+
+ it('Should load layout', () => {
+ cy.get('.q-card').should('be.visible');
+ });
+});
diff --git a/test/cypress/integration/worker/workerNotificationsManager.spec.js b/test/cypress/integration/worker/workerNotificationsManager.spec.js
index 0907cc4adc..ad48d8a6cb 100644
--- a/test/cypress/integration/worker/workerNotificationsManager.spec.js
+++ b/test/cypress/integration/worker/workerNotificationsManager.spec.js
@@ -22,7 +22,7 @@ describe('WorkerNotificationsManager', () => {
);
});
- it.skip('should active a notification that is yours', () => {
+ it('should active a notification that is yours', () => {
cy.login('developer');
cy.visit(`/#/worker/${developerId}/notifications`);
cy.waitForElement(activeList);
diff --git a/test/cypress/integration/worker/workerOperator.spec.js b/test/cypress/integration/worker/workerOperator.spec.js
new file mode 100644
index 0000000000..95839aeba9
--- /dev/null
+++ b/test/cypress/integration/worker/workerOperator.spec.js
@@ -0,0 +1,19 @@
+///
+describe('WorkerOperator', () => {
+ const userId = 1106;
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('hr');
+ cy.visit(`/#/worker/${userId}/operator`);
+ });
+
+ it('should fill the operator form', () => {
+ cy.dataCy('numberOfWagons').type('4');
+ cy.dataCy('linesLimit').type('6');
+ cy.dataCy('volumeLimit').type('3');
+ cy.dataCy('sizeLimit').type('3');
+ cy.saveCard();
+
+ cy.checkNotification('Data saved');
+ });
+});
diff --git a/test/cypress/integration/worker/workerPit.spec.js b/test/cypress/integration/worker/workerPit.spec.js
index 19cbebc204..04f2326486 100644
--- a/test/cypress/integration/worker/workerPit.spec.js
+++ b/test/cypress/integration/worker/workerPit.spec.js
@@ -1,19 +1,5 @@
describe('WorkerPit', () => {
- const familySituationInput = '[data-cy="Family Situation_input"]';
- const familySituation = '1';
- const childPensionInput = '[data-cy="Child Pension_input"]';
- const childPension = '120';
- const spouseNifInput = '[data-cy="Spouse Pension_input"]';
- const spouseNif = '65117125P';
- const spousePensionInput = '[data-cy="Spouse Pension_input"]';
- const spousePension = '120';
const addRelative = '[data-cy="addRelative"]';
- const isDescendantSelect = '[data-cy="Descendant/Ascendant"]';
- const Descendant = 'Descendiente';
- const birthedInput = '[data-cy="Birth Year_input"]';
- const birthed = '2002';
- const adoptionYearInput = '[data-cy="Adoption Year_input"]';
- const adoptionYear = '2004';
const saveRelative = '[data-cy="workerPitRelativeSaveBtn"]';
const savePIT = '#st-actions > .q-btn-group > .q-btn--standard';
@@ -24,15 +10,15 @@ describe('WorkerPit', () => {
});
it('complete PIT', () => {
- cy.get(familySituationInput).type(familySituation);
- cy.get(childPensionInput).type(childPension);
- cy.get(spouseNifInput).type(spouseNif);
- cy.get(spousePensionInput).type(spousePension);
+ cy.dataCy('familySituation').type('1');
+ cy.dataCy('childPension').type('120');
+ cy.dataCy('spouseNif').type('65117125P');
+ cy.dataCy('spousePension').type('120');
cy.get(savePIT).click();
cy.get(addRelative).click();
- cy.get(isDescendantSelect).type(Descendant);
- cy.get(birthedInput).type(birthed);
- cy.get(adoptionYearInput).type(adoptionYear);
+ cy.dataCy('Descendant/Ascendant').type('Descendiente');
+ cy.dataCy('birthed').type('2002');
+ cy.dataCy('adoptionYear').type('2004');
cy.get(saveRelative).click();
});
});
diff --git a/test/cypress/integration/worker/workerSummary.spec.js b/test/cypress/integration/worker/workerSummary.spec.js
index 3d70fdf967..c50b2c9431 100644
--- a/test/cypress/integration/worker/workerSummary.spec.js
+++ b/test/cypress/integration/worker/workerSummary.spec.js
@@ -1,4 +1,6 @@
describe('WorkerSummary', () => {
+ const departmentDescriptor = ':nth-child(1) > :nth-child(3) > .value > .link';
+ const roleDescriptor = ':nth-child(3) > :nth-child(4) > .value > .link';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@@ -10,7 +12,17 @@ describe('WorkerSummary', () => {
cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss');
cy.get(':nth-child(1) > :nth-child(2) > .value > span').should(
'have.text',
- 'salesBossNick'
+ 'salesBossNick',
);
});
+
+ it('should try descriptors', () => {
+ cy.waitForElement('.summaryHeader');
+ cy.get(departmentDescriptor).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '43');
+ cy.get(roleDescriptor).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '19');
+ });
});
diff --git a/test/cypress/integration/zone/zoneBasicData.spec.js b/test/cypress/integration/zone/zoneBasicData.spec.js
index 6db39b0722..2d255d9597 100644
--- a/test/cypress/integration/zone/zoneBasicData.spec.js
+++ b/test/cypress/integration/zone/zoneBasicData.spec.js
@@ -1,5 +1,5 @@
describe('ZoneBasicData', () => {
- const priceBasicData = '[data-cy="Price_input"]';
+ const priceBasicData = '[data-cy="ZoneBasicDataPrice"]';
const saveBtn = '.q-btn-group > .q-btn--standard';
beforeEach(() => {
@@ -8,20 +8,13 @@ describe('ZoneBasicData', () => {
cy.visit('/#/zone/4/basic-data');
});
- it('should throw an error if the name is empty', () => {
- cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
-
- cy.get(saveBtn).click();
- cy.checkNotification("can't be blank");
- });
-
it('should throw an error if the price is empty', () => {
cy.get(priceBasicData).clear();
cy.get(saveBtn).click();
- cy.checkNotification('cannot be blank');
+ cy.get('.q-field__messages > div').should('have.text', 'Field required');
});
- it("should edit the basicData's zone", () => {
+ it("should edit the basicData's zone name", () => {
cy.get('.q-card > :nth-child(1)').type(' modified');
cy.get(saveBtn).click();
cy.checkNotification('Data saved');
diff --git a/test/cypress/integration/zone/zoneCalendar.spec.js b/test/cypress/integration/zone/zoneCalendar.spec.js
new file mode 100644
index 0000000000..07661a17de
--- /dev/null
+++ b/test/cypress/integration/zone/zoneCalendar.spec.js
@@ -0,0 +1,51 @@
+describe('ZoneCalendar', () => {
+ const addEventBtn = '.q-page-sticky > div > .q-btn';
+ const submitBtn = '.q-mt-lg > .q-btn--standard';
+ const deleteBtn = '[data-cy="ZoneEventsPanelDeleteBtn"]';
+
+ beforeEach(() => {
+ cy.login('developer');
+ cy.viewport(1920, 1080);
+ cy.visit(`/#/zone/13/events`);
+ });
+
+ it('should include a one day event, then delete it', () => {
+ cy.get(addEventBtn).click();
+ cy.dataCy('ZoneEventInclusionDayRadio').click();
+ cy.get('.q-card > :nth-child(5)').type('01/01/2001');
+ cy.get(submitBtn).click();
+ cy.get(deleteBtn).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+
+ it('should include an indefinitely event for monday and tuesday', () => {
+ cy.get(addEventBtn).click();
+ cy.get('.flex > .q-gutter-x-sm > :nth-child(1)').click();
+ cy.get('.flex > .q-gutter-x-sm > :nth-child(2)').click();
+ cy.get(submitBtn).click();
+ cy.get(deleteBtn).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+
+ it('should include a range of dates event', () => {
+ cy.get(addEventBtn).click();
+ cy.dataCy('ZoneEventInclusionRangeRadio').click();
+ cy.get('.flex > .q-gutter-x-sm > :nth-child(1)').click();
+ cy.dataCy('From_inputDate').type('01/01/2001');
+ cy.dataCy('To_inputDate').type('31/01/2001');
+ cy.get(submitBtn).click();
+ cy.get(deleteBtn).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+
+ it('should exclude an event', () => {
+ cy.get('.q-mb-sm > .q-radio__inner').click();
+ cy.get('.q-current-day > .q-calendar-month__day--label__wrapper').click();
+ cy.get('.q-mt-lg > .q-btn--standard').click();
+ cy.get(
+ '.q-current-day > .q-calendar-month__day--content > [data-cy="ZoneCalendarDay"]',
+ ).click();
+ cy.dataCy('ZoneEventExclusionDeleteBtn').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+});
diff --git a/test/cypress/integration/zone/zoneCreate.spec.js b/test/cypress/integration/zone/zoneCreate.spec.js
index 0f630db5d4..fadf5b07fa 100644
--- a/test/cypress/integration/zone/zoneCreate.spec.js
+++ b/test/cypress/integration/zone/zoneCreate.spec.js
@@ -9,7 +9,6 @@ describe('ZoneCreate', () => {
};
beforeEach(() => {
- cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/zone/list');
cy.get('.q-page-sticky > div > .q-btn').click();
diff --git a/test/cypress/integration/zone/zoneDeliveryDays.spec.js b/test/cypress/integration/zone/zoneDeliveryDays.spec.js
index 1e1fc8ff5b..291c20ce32 100644
--- a/test/cypress/integration/zone/zoneDeliveryDays.spec.js
+++ b/test/cypress/integration/zone/zoneDeliveryDays.spec.js
@@ -1,15 +1,61 @@
describe('ZoneDeliveryDays', () => {
+ const postcode = '46680';
+ const agency = 'Gotham247Expensive';
+ const submitForm = '.q-form > .q-btn > .q-btn__content';
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit(`/#/zone/delivery-days`);
});
- it('should query for the day', () => {
+ it('should return no data when querying without params', () => {
cy.get('.q-form > .q-btn > .q-btn__content').click();
cy.get('.q-notification__message').should(
'have.text',
- 'No service for the specified zone'
+ 'No service for the specified zone',
);
});
+
+ it('should query for delivery', () => {
+ cy.intercept('GET', /\/api\/Zones\/getEvents/, (req) => {
+ req.headers['cache-control'] = 'no-cache';
+ req.headers['pragma'] = 'no-cache';
+ req.headers['expires'] = '0';
+ req.on('response', (res) => {
+ delete res.headers['if-none-match'];
+ delete res.headers['if-modified-since'];
+ });
+ }).as('events');
+
+ cy.dataCy('ZoneDeliveryDaysPostcodeSelect').type(postcode);
+ cy.get('.q-menu .q-item').contains(postcode).click();
+ cy.get('.q-menu').then(($menu) => {
+ if ($menu.is(':visible')) {
+ cy.get('[data-cy="ZoneDeliveryDaysPostcodeSelect"]')
+ .as('focusedElement')
+ .focus();
+ cy.get('@focusedElement').blur();
+ }
+ });
+ cy.get('.q-menu').should('not.exist');
+
+ cy.dataCy('ZoneDeliveryDaysAgencySelect').type(agency);
+ cy.get('.q-menu .q-item').contains(agency).click();
+ cy.get('.q-menu').then(($menu) => {
+ if ($menu.is(':visible')) {
+ cy.get('[data-cy="ZoneDeliveryDaysAgencySelect"]')
+ .as('focusedElement')
+ .focus();
+ cy.get('@focusedElement').blur();
+ }
+ });
+ cy.get('.q-menu').should('not.exist');
+
+ cy.get(submitForm).click();
+ cy.wait('@events').then((interception) => {
+ cy.log('interception: ', interception);
+ const data = interception.response.body.events;
+ expect(data.length).to.be.greaterThan(0);
+ });
+ });
});
diff --git a/test/cypress/integration/zone/zoneList.spec.js b/test/cypress/integration/zone/zoneList.spec.js
index 68e9246354..c84b1b017a 100644
--- a/test/cypress/integration/zone/zoneList.spec.js
+++ b/test/cypress/integration/zone/zoneList.spec.js
@@ -1,21 +1,25 @@
describe('ZoneList', () => {
const agency = 'inhouse pickup';
+ const firstSummaryIcon =
+ ':nth-child(1) > .q-table--col-auto-width > [data-cy="tableAction-0"]';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/zone/list');
- });
-
- it('should filter by agency', () => {
- cy.dataCy('zoneFilterPanelNameInput').type('{downArrow}{enter}');
+ cy.typeSearchbar('{enter}');
});
it('should open the zone summary', () => {
- cy.dataCy('zoneFilterPanelAgencySelect').type(agency);
- cy.get('.q-menu .q-item').contains(agency).click();
- cy.get(':nth-child(1) > [data-col-field="agencyModeFk"]').should(
- 'include.text',
- agency,
- );
+ cy.get(firstSummaryIcon).click();
+ cy.get('.header > .q-icon').click();
+ cy.url().should('include', 'zone/1/summary');
+ });
+
+ it('should clone the zone', () => {
+ cy.get('.router-link-active > .q-icon').click();
+ cy.dataCy('tableAction-1').eq(1).click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.url().should('not.include', 'zone/2/');
+ cy.url().should('match', /zone\/\d+\/basic-data/);
});
});
diff --git a/test/cypress/integration/zone/zoneLocations.spec.js b/test/cypress/integration/zone/zoneLocations.spec.js
new file mode 100644
index 0000000000..cdc2c778b0
--- /dev/null
+++ b/test/cypress/integration/zone/zoneLocations.spec.js
@@ -0,0 +1,26 @@
+describe('ZoneLocations', () => {
+ const data = {
+ Warehouse: { val: 'Warehouse One', type: 'select' },
+ };
+
+ const postalCode =
+ '[style=""] > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > .q-tree__node--parent > .q-tree__node-collapsible > .q-tree__children';
+
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#/zone/2/location`);
+ });
+
+ it('should show all locations on entry', () => {
+ cy.get('.q-tree > :nth-child(1) > :nth-child(2) > :nth-child(1)')
+ .children()
+ .should('have.length', 9);
+ });
+
+ it('should be able to search by postal code', () => {
+ cy.get('#searchbarForm').type('46680');
+ cy.get('.router-link-active > .q-icon').click();
+ cy.get(postalCode).should('include.text', '46680');
+ });
+});
diff --git a/test/cypress/integration/zone/zoneSummary.spec.js b/test/cypress/integration/zone/zoneSummary.spec.js
new file mode 100644
index 0000000000..fa9c5353c8
--- /dev/null
+++ b/test/cypress/integration/zone/zoneSummary.spec.js
@@ -0,0 +1,22 @@
+describe('ZoneSummary', () => {
+ const agency = 'inhouse pickup';
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/zone/2/summary');
+ });
+
+ it('should clone the zone, then delete it', () => {
+ cy.dataCy('descriptor-more-opts').click();
+ cy.dataCy('Clone_button').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.url().should('not.include', 'zone/2/');
+ cy.url().should('match', /zone\/\d+\/basic-data/);
+ cy.get('.list-box > :nth-child(1)').should('include.text', agency);
+ cy.get('.title > span').should('include.text', 'Zone pickup B');
+ cy.get('.q-page').should('exist');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.dataCy('Delete_button').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ });
+});
diff --git a/test/cypress/integration/zone/zoneUpcomingDeliveries.spec.js b/test/cypress/integration/zone/zoneUpcomingDeliveries.spec.js
index 28e2222d40..576b2ea705 100644
--- a/test/cypress/integration/zone/zoneUpcomingDeliveries.spec.js
+++ b/test/cypress/integration/zone/zoneUpcomingDeliveries.spec.js
@@ -1,9 +1,17 @@
describe('ZoneUpcomingDeliveries', () => {
+ const tableFields = (opt) =>
+ `:nth-child(1) > .q-table__container > .q-table__middle > .q-table > thead > tr > :nth-child(${opt})`;
+
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit(`/#/zone/upcoming-deliveries`);
});
- it('should show the page', () => {});
+ it('should show the page', () => {
+ cy.get('.q-card').should('be.visible');
+ cy.get(tableFields(1)).should('be.visible').should('have.text', 'Province');
+ cy.get(tableFields(2)).should('be.visible').should('have.text', 'Closing');
+ cy.get(tableFields(3)).should('be.visible').should('have.text', 'Id');
+ });
});
diff --git a/test/cypress/integration/zone/zoneWarehouse.spec.js b/test/cypress/integration/zone/zoneWarehouse.spec.js
index 0f646f33a0..bca5ced22d 100644
--- a/test/cypress/integration/zone/zoneWarehouse.spec.js
+++ b/test/cypress/integration/zone/zoneWarehouse.spec.js
@@ -1,20 +1,19 @@
describe('ZoneWarehouse', () => {
const data = {
- Warehouse: { val: 'Warehouse One', type: 'select' },
+ Warehouse: { val: 'Warehouse Two', type: 'select' },
};
-
const dataError = 'The introduced warehouse already exists';
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
- cy.visit(`/#/zone/2/warehouses`);
+ cy.visit(`/#/zone/1/warehouses`);
});
it('should throw an error if the warehouse chosen is already put in the zone', () => {
cy.addBtnClick();
- cy.dataCy('Warehouse_select').type('Warehouse Two{enter}');
+ cy.dataCy('Warehouse_select').type('Warehouse One{enter}');
cy.get(saveBtn).click();
cy.checkNotification(dataError);
});
@@ -26,7 +25,5 @@ describe('ZoneWarehouse', () => {
cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click();
cy.get('[title="Confirm"]').click();
-
- cy.reload();
});
});
diff --git a/test/cypress/run.sh b/test/cypress/run.sh
new file mode 100755
index 0000000000..1f506aa57a
--- /dev/null
+++ b/test/cypress/run.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+cleanup() {
+ if [[ -z "$ended" ]]; then
+ ended=true
+ docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml down -v
+ fi
+}
+
+trap cleanup SIGINT
+
+#CLEAN
+rm -rf test/cypress/screenshots
+rm -f test/cypress/results/*
+rm -f test/cypress/reports/*
+rm -f junit/e2e-*.xml
+
+#RUN
+export CI=true
+export TZ=Europe/Madrid
+
+docker-compose -p e2e --project-directory . -f test/cypress/docker-compose.yml up -d
+
+docker run -it --rm \
+ -v "$(pwd)":/app \
+ --network e2e_default \
+ -e CI \
+ -e TZ \
+ lilium-dev \
+ bash -c 'sh test/cypress/cypressParallel.sh 2'
+
+cleanup
diff --git a/test/cypress/summary.sh b/test/cypress/summary.sh
new file mode 100644
index 0000000000..4bca3255d9
--- /dev/null
+++ b/test/cypress/summary.sh
@@ -0,0 +1,3 @@
+pnpm exec junit-merge --dir junit --out junit/junit-final.xml
+pnpm exec xunit-viewer -r junit/junit-final.xml -o junit/report.html
+xdg-open junit/report.html
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index dfec341cd2..8437112e0c 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -27,6 +27,7 @@
// DO NOT REMOVE
// Imports Quasar Cypress AE predefined commands
// import { registerCommands } from '@quasar/quasar-app-extension-testing-e2e-cypress';
+
import waitUntil from './waitUntil';
Cypress.Commands.add('waitUntil', { prevSubject: 'optional' }, waitUntil);
@@ -57,14 +58,20 @@ Cypress.Commands.add('login', (user = 'developer') => {
});
});
-Cypress.Commands.overwrite('visit', (originalFn, url, options) => {
+Cypress.Commands.overwrite('visit', (originalFn, url, options, waitRequest = true) => {
originalFn(url, options);
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
cy.waitUntil(() => cy.get('main').should('exist'));
+ if (waitRequest)
+ cy.get('body').then(($body) => {
+ if ($body.find('[data-cy="loading-spinner"]').length) {
+ cy.get('[data-cy="loading-spinner"]').should('not.be.visible');
+ }
+ });
});
-Cypress.Commands.add('waitForElement', (element, timeout = 10000) => {
- cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
+Cypress.Commands.add('waitForElement', (element) => {
+ cy.get(element).should('be.visible').and('not.be.disabled');
});
Cypress.Commands.add('getValue', (selector) => {
@@ -331,7 +338,7 @@ Cypress.Commands.add('openUserPanel', () => {
});
Cypress.Commands.add('checkNotification', (text) => {
- cy.get('.q-notification', { timeout: 10000 })
+ cy.get('.q-notification')
.should('be.visible')
.should('have.length.greaterThan', 0)
.should(($elements) => {
@@ -341,7 +348,6 @@ Cypress.Commands.add('checkNotification', (text) => {
expect(found).to.be.true;
});
});
-
Cypress.Commands.add('openActions', (row) => {
cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
});
diff --git a/test/cypress/support/index.js b/test/cypress/support/index.js
index 075e0c8eba..87e869b6d9 100644
--- a/test/cypress/support/index.js
+++ b/test/cypress/support/index.js
@@ -40,4 +40,30 @@ style.innerHTML = `
`;
document.head.appendChild(style);
+const waitForApiReady = (url, maxRetries = 20, delay = 1000) => {
+ let retries = 0;
+
+ function checkApi() {
+ return cy
+ .request({
+ url,
+ failOnStatusCode: false,
+ })
+ .then((response) => {
+ if (response.status !== 200 && retries < maxRetries) {
+ retries++;
+ cy.wait(delay);
+ return checkApi();
+ }
+ expect(response.status).to.eq(200);
+ });
+ }
+
+ return checkApi();
+};
+
+before(() => {
+ waitForApiReady('/api/Applications/status');
+});
+
export { randomString, randomNumber, randomizeValue };