($props.useLike ? { like: `%${val}%` } : val);
.q-field--outlined {
max-width: 100%;
}
+.q-field__inner {
+ .q-field__control {
+ min-height: auto !important;
+
+ display: flex;
+ align-items: flex-end;
+ .q-field__native.row {
+ min-height: auto !important;
+ }
+ }
+}
diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue
index ef07b7bef..43d634ad9 100644
--- a/src/components/ui/VnFilterPanel.vue
+++ b/src/components/ui/VnFilterPanel.vue
@@ -3,7 +3,6 @@ import { onMounted, ref, computed, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useArrayData } from 'composables/useArrayData';
import { useRoute } from 'vue-router';
-import { date } from 'quasar';
import toDate from 'filters/toDate';
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
@@ -59,7 +58,6 @@ const $props = defineProps({
});
defineExpose({ search, sanitizer });
-
const emit = defineEmits([
'update:modelValue',
'refresh',
@@ -114,9 +112,9 @@ watch(
);
const isLoading = ref(false);
-async function search() {
+async function search(evt) {
try {
- if ($props.disableSubmitEvent) return;
+ if (evt && $props.disableSubmitEvent) return;
store.filter.where = {};
isLoading.value = true;
@@ -167,7 +165,7 @@ const tagsList = computed(() => {
for (const key of Object.keys(userParams.value)) {
const value = userParams.value[key];
if (value == null || ($props.hiddenTags || []).includes(key)) continue;
- tagList.push({ label: aliasField(key), value });
+ tagList.push({ label: key, value });
}
return tagList;
});
@@ -187,7 +185,6 @@ async function remove(key) {
}
function formatValue(value) {
- if (value instanceof Date) return date.formatDate(value, 'DD/MM/YYYY');
if (typeof value === 'boolean') return value ? t('Yes') : t('No');
if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value);
@@ -203,11 +200,6 @@ function sanitizer(params) {
}
return params;
}
-
-function aliasField(field) {
- const split = field.split('.');
- return split[1] ?? split[0];
-}
@@ -219,7 +211,7 @@ function aliasField(field) {
icon="search"
@click="search()"
>
-
+
diff --git a/src/components/ui/VnRow.vue b/src/components/ui/VnRow.vue
index 16bcfab7d..0df1fb7d4 100644
--- a/src/components/ui/VnRow.vue
+++ b/src/components/ui/VnRow.vue
@@ -9,6 +9,7 @@ defineProps({ wrap: { type: Boolean, default: false } });
diff --git a/src/pages/Entry/MyEntries.vue b/src/pages/Entry/MyEntries.vue
index 1c56427f4..2c37c2c42 100644
--- a/src/pages/Entry/MyEntries.vue
+++ b/src/pages/Entry/MyEntries.vue
@@ -9,22 +9,27 @@ import VnTable from 'components/VnTable/VnTable.vue';
const { t } = useI18n();
const quasar = useQuasar();
+const params = {
+ daysOnward: 7,
+ daysAgo: 3,
+};
+
const columns = computed(() => [
{
align: 'left',
name: 'id',
- label: t('customer.extendedList.tableVisibleColumns.id'),
+ label: t('myEntries.id'),
columnFilter: false,
isTitle: true,
},
{
visible: false,
align: 'right',
- label: t('shipped'),
+ label: t('myEntries.shipped'),
name: 'shipped',
columnFilter: {
name: 'fromShipped',
- label: t('fromShipped'),
+ label: t('myEntries.fromShipped'),
component: 'date',
},
format: ({ shipped }) => toDate(shipped),
@@ -32,11 +37,11 @@ const columns = computed(() => [
{
visible: false,
align: 'left',
- label: t('shipped'),
+ label: t('myEntries.shipped'),
name: 'shipped',
columnFilter: {
name: 'toShipped',
- label: t('toShipped'),
+ label: t('myEntries.toShipped'),
component: 'date',
},
format: ({ shipped }) => toDate(shipped),
@@ -44,14 +49,14 @@ const columns = computed(() => [
},
{
align: 'right',
- label: t('shipped'),
+ label: t('myEntries.shipped'),
name: 'shipped',
columnFilter: false,
format: ({ shipped }) => toDate(shipped),
},
{
align: 'right',
- label: t('landed'),
+ label: t('myEntries.landed'),
name: 'landed',
columnFilter: false,
format: ({ landed }) => toDate(landed),
@@ -59,26 +64,36 @@ const columns = computed(() => [
{
align: 'right',
- label: t('globals.wareHouseIn'),
+ label: t('myEntries.wareHouseIn'),
name: 'warehouseInFk',
- format: (row) => row.warehouseInName,
+ format: (row) => {
+ row.warehouseInName;
+ },
cardVisible: true,
columnFilter: {
+ name: 'warehouseInFk',
+ label: t('myEntries.warehouseInFk'),
component: 'select',
attrs: {
url: 'warehouses',
fields: ['id', 'name'],
optionLabel: 'name',
optionValue: 'id',
+ alias: 't',
},
- alias: 't',
inWhere: true,
},
},
{
align: 'left',
- label: t('globals.daysOnward'),
- name: 'days',
+ label: t('myEntries.daysOnward'),
+ name: 'daysOnward',
+ visible: false,
+ },
+ {
+ align: 'left',
+ label: t('myEntries.daysAgo'),
+ name: 'daysAgo',
visible: false,
},
{
@@ -88,6 +103,7 @@ const columns = computed(() => [
{
title: t('printLabels'),
icon: 'print',
+ isPrimary: true,
action: (row) => printBuys(row.id),
},
],
@@ -114,9 +130,11 @@ const printBuys = (rowId) => {
data-key="myEntriesList"
url="Entries/filter"
:columns="columns"
+ :user-params="params"
default-mode="card"
order="shipped DESC"
auto-load
+ chip-locale="myEntries"
/>
diff --git a/src/pages/Entry/locale/en.yml b/src/pages/Entry/locale/en.yml
index a9faa814b..b4d7c33bc 100644
--- a/src/pages/Entry/locale/en.yml
+++ b/src/pages/Entry/locale/en.yml
@@ -6,9 +6,15 @@ entryFilter:
filter:
search: General search
reference: Reference
-landed: Landed
-shipped: Shipped
-fromShipped: Shipped(from)
-toShipped: Shipped(to)
-printLabels: Print stickers
-viewLabel: View sticker
+myEntries:
+ id: ID
+ landed: Landed
+ shipped: Shipped
+ fromShipped: Shipped(from)
+ toShipped: Shipped(to)
+ printLabels: Print stickers
+ viewLabel: View sticker
+ wareHouseIn: Warehouse in
+ warehouseInFk: Warehouse in
+ daysOnward: Days onward
+ daysAgo: Days ago
diff --git a/src/pages/Entry/locale/es.yml b/src/pages/Entry/locale/es.yml
index eb1e3f88a..2dfd601b1 100644
--- a/src/pages/Entry/locale/es.yml
+++ b/src/pages/Entry/locale/es.yml
@@ -9,10 +9,15 @@ entryFilter:
filter:
search: Búsqueda general
reference: Referencia
-
-landed: F. llegada
-shipped: F. salida
-fromShipped: F. salida(desde)
-toShipped: F. salida(hasta)
-printLabels: Imprimir etiquetas
-viewLabel: Ver etiqueta
+myEntries:
+ id: ID
+ landed: F. llegada
+ shipped: F. salida
+ fromShipped: F. salida(desde)
+ toShipped: F. salida(hasta)
+ printLabels: Imprimir etiquetas
+ viewLabel: Ver etiqueta
+ wareHouseIn: Alm. entrada
+ warehouseInFk: Alm. entrada
+ daysOnward: Días adelante
+ daysAgo: Días atras
diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue
index 5157d957b..3dc565251 100644
--- a/src/pages/InvoiceOut/InvoiceOutList.vue
+++ b/src/pages/InvoiceOut/InvoiceOutList.vue
@@ -27,13 +27,16 @@ const { openReport } = usePrintService();
const columns = computed(() => [
{
- align: 'left',
+ align: 'center',
name: 'id',
label: t('invoiceOutList.tableVisibleColumns.id'),
chip: {
condition: () => true,
},
isId: true,
+ columnFilter: {
+ name: 'search',
+ },
},
{
align: 'left',
diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue
index 774b42478..1ea19033c 100644
--- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue
+++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue
@@ -9,6 +9,7 @@ import { useArrayData } from 'src/composables/useArrayData';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
+import VnInputDate from 'components/common/VnInputDate.vue';
const { t } = useI18n();
const tableRef = ref();
@@ -64,7 +65,8 @@ const columns = computed(() => [
cardVisible: true,
attrs: {
url: 'Clients',
- fields: ['id', 'name'],
+ optionLabel: 'socialName',
+ optionValue: 'socialName',
},
columnField: {
component: null,
@@ -192,10 +194,33 @@ const downloadCSV = async () => {
+
+
+
+
es:
Download as CSV: Descargar como CSV
+ params:
+ from: Desde
+ to: Hasta
+en:
+ params:
+ from: From
+ to: To
diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue
index fddf154a2..7d4d6b896 100644
--- a/src/pages/Item/ItemFixedPrice.vue
+++ b/src/pages/Item/ItemFixedPrice.vue
@@ -514,7 +514,7 @@ function handleOnDataSave({ CrudModelRef }) {
-
+
[
condition: () => true,
},
isId: true,
+ columnFilter: false,
},
{
align: 'left',
label: t('globals.name'),
name: 'name',
isTitle: true,
+ columnFilter: false,
+ columnClass: 'expand',
},
{
align: 'left',
@@ -70,18 +73,33 @@ const columns = computed(() => [
data-key="AgencyList"
:expr-builder="exprBuilder"
/>
-
+
+
es:
isOwn: Tiene propietario
diff --git a/src/pages/Route/Card/RouteListTicketsDialog.vue b/src/pages/Route/Card/RouteListTicketsDialog.vue
index ba07f859f..b9b2ee36b 100644
--- a/src/pages/Route/Card/RouteListTicketsDialog.vue
+++ b/src/pages/Route/Card/RouteListTicketsDialog.vue
@@ -167,8 +167,8 @@ const setTicketsRoute = async () => {
{{ props.value }}
-
+
diff --git a/src/pages/Route/RouteExtendedList.vue b/src/pages/Route/RouteExtendedList.vue
new file mode 100644
index 000000000..51da4ec12
--- /dev/null
+++ b/src/pages/Route/RouteExtendedList.vue
@@ -0,0 +1,360 @@
+
+
+
+
+
+
+
+ {{ t('route.Select the starting date') }}
+
+
+
+
+
+
+
+
+ {{ t('globals.clone') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('route.Clone Selected Routes') }}
+
+
+ {{ t('route.Download selected routes as PDF') }}
+
+
+ {{ t('route.Mark as served') }}
+
+
+
+
diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue
index 1e20df99c..d0feb9a65 100644
--- a/src/pages/Route/RouteList.vue
+++ b/src/pages/Route/RouteList.vue
@@ -1,34 +1,19 @@
-
-
-
-
- {{ t('Select the starting date') }}
-
-
-
-
-
-
-
-
- {{ t('globals.clone') }}
-
-
-
-
-
-
-
- {{ t('Clone Selected Routes') }}
-
-
- {{ t('Download selected routes as PDF') }}
-
-
- {{ t('Mark as served') }}
-
+
+
+ {{ row?.workerUserName }}
+
+
-
-
-
-en:
- newRoute: New Route
- hourStarted: Started hour
- hourFinished: Finished hour
-es:
- From: Desde
- To: Hasta
- Worker: Trabajador
- Agency: Agencia
- Vehicle: Vehículo
- Volume: Volumen
- Date: Fecha
- Description: Descripción
- Hour started: Hora inicio
- Hour finished: Hora fin
- KmStart: Km inicio
- KmEnd: Km fin
- Served: Servida
- newRoute: Nueva Ruta
- Clone Selected Routes: Clonar rutas seleccionadas
- Select the starting date: Seleccione la fecha de inicio
- Stating date: Fecha de inicio
- Cancel: Cancelar
- Mark as served: Marcar como servidas
- Download selected routes as PDF: Descargar rutas seleccionadas como PDF
- Add ticket: Añadir tickets
- Preview: Vista previa
- Summary: Resumen
- Route is closed: La ruta está cerrada
- Route is not served: La ruta no está servida
- hourStarted: Hora de inicio
- hourFinished: Hora de fin
-
diff --git a/src/pages/Route/RouteRoadmap.vue b/src/pages/Route/RouteRoadmap.vue
index d921dab1f..3687442f5 100644
--- a/src/pages/Route/RouteRoadmap.vue
+++ b/src/pages/Route/RouteRoadmap.vue
@@ -87,7 +87,7 @@ const columns = computed(() => [
actions: [
{
title: t('Ver cmr'),
- icon: 'visibility',
+ icon: 'preview',
isPrimary: true,
action: (row) => viewSummary(row?.id, RoadmapSummary),
},
diff --git a/src/pages/Route/RouteTickets.vue b/src/pages/Route/RouteTickets.vue
index 5960636b0..3bdad4fec 100644
--- a/src/pages/Route/RouteTickets.vue
+++ b/src/pages/Route/RouteTickets.vue
@@ -342,10 +342,7 @@ const openSmsDialog = async () => {
-
+
{{ value }}
{{ t('Open buscaman') }}
@@ -353,7 +350,7 @@ const openSmsDialog = async () => {
-
+
{{ value }}
@@ -361,7 +358,7 @@ const openSmsDialog = async () => {
-
+
{{ value }}
diff --git a/src/pages/Route/locale/en.yml b/src/pages/Route/locale/en.yml
new file mode 100644
index 000000000..617d704d2
--- /dev/null
+++ b/src/pages/Route/locale/en.yml
@@ -0,0 +1,25 @@
+route:
+ Worker: Worker
+ Agency: Agency
+ Vehicle: Vehicle
+ Description: Description
+ hourStarted: H.Start
+ hourFinished: H.End
+ createRoute: Create route
+ From: From
+ To: To
+ Date: Date
+ KmStart: Km start
+ KmEnd: Km end
+ Served: Served
+ Clone Selected Routes: Clone selected routes
+ Select the starting date: Select the starting date
+ Stating date: Starting date
+ Cancel: Cancel
+ Mark as served: Mark as served
+ Download selected routes as PDF: Download selected routes as PDF
+ Add ticket: Add ticket
+ Preview: Preview
+ Summary: Summary
+ Route is closed: Route is closed
+ Route is not served: Route is not served
diff --git a/src/pages/Route/locale/es.yml b/src/pages/Route/locale/es.yml
new file mode 100644
index 000000000..ed96ad915
--- /dev/null
+++ b/src/pages/Route/locale/es.yml
@@ -0,0 +1,25 @@
+route:
+ Worker: Trabajador
+ Agency: Agencia
+ Vehicle: Vehículo
+ Description: Descripción
+ hourStarted: H.Inicio
+ hourFinished: H.Fin
+ createRoute: Crear ruta
+ From: Desde
+ To: Hasta
+ Date: Fecha
+ KmStart: Km inicio
+ KmEnd: Km fin
+ Served: Servida
+ Clone Selected Routes: Clonar rutas seleccionadas
+ Select the starting date: Seleccione la fecha de inicio
+ Stating date: Fecha de inicio
+ Cancel: Cancelar
+ Mark as served: Marcar como servidas
+ Download selected routes as PDF: Descargar rutas seleccionadas como PDF
+ Add ticket: Añadir tickets
+ Preview: Vista previa
+ Summary: Resumen
+ Route is closed: La ruta está cerrada
+ Route is not served: La ruta no está servida
diff --git a/src/pages/Supplier/Card/SupplierAddressesCreate.vue b/src/pages/Supplier/Card/SupplierAddressesCreate.vue
index 290373039..0feceb74a 100644
--- a/src/pages/Supplier/Card/SupplierAddressesCreate.vue
+++ b/src/pages/Supplier/Card/SupplierAddressesCreate.vue
@@ -84,6 +84,7 @@ function handleLocation(data, location) {
{
try {
const params = { ticketId: ticket.value.id, sales: props.sales };
const { data } = await axios.post(`Claims/createFromSales`, params);
- router.push({ name: 'ClaimBasicData', params: { id: data.id } });
+ push({ name: 'ClaimBasicData', params: { id: data.id } });
} catch (error) {
console.error('Error creating claim: ', error);
}
@@ -169,7 +169,7 @@ const createRefund = async (withWarehouse) => {
const { data } = await axios.post('Tickets/cloneAll', params);
const [refundTicket] = data;
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
- router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
+ push({ name: 'TicketSale', params: { id: refundTicket.id } });
} catch (error) {
console.error(error);
}
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index b6a60122c..2ca0b5727 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -1,7 +1,7 @@
-
-
-
-
-
- {{ t('globals.collapseMenu') }}
-
-
-
-
-
import { onMounted, ref, computed, watch, onUnmounted } from 'vue';
import { useRoute } from 'vue-router';
-
+import VnInput from 'src/components/common/VnInput.vue';
import { useState } from 'src/composables/useState';
import axios from 'axios';
import { useArrayData } from 'composables/useArrayData';
@@ -144,7 +144,8 @@ watch(storeData, async (val) => {
});
const reFetch = async () => {
- await arrayData.fetch({ append: false });
+ const { data } = await arrayData.fetch({ append: false });
+ nodes.value = data;
};
onMounted(async () => {
@@ -182,6 +183,16 @@ onUnmounted(() => {
+
+
+
+
+
import('src/components/common/VnSectionMain.vue'),
- props: {
- leftDrawer: false,
- },
redirect: { name: 'RouteList' },
children: [
{
@@ -33,6 +37,15 @@ export default {
},
component: () => import('src/pages/Route/RouteList.vue'),
},
+ {
+ path: 'extended-list',
+ name: 'RouteExtendedList',
+ meta: {
+ title: 'RouteExtendedList',
+ icon: 'format_list_bulleted',
+ },
+ component: () => import('src/pages/Route/RouteExtendedList.vue'),
+ },
{
path: 'create',
name: 'RouteCreate',
@@ -78,7 +91,7 @@ export default {
name: 'AgencyList',
meta: {
title: 'agencyList',
- icon: 'view_list',
+ icon: 'list',
},
component: () =>
import('src/pages/Route/Agency/AgencyList.vue'),
diff --git a/test/cypress/integration/vnComponent/UserPanel.spec.js b/test/cypress/integration/vnComponent/UserPanel.spec.js
new file mode 100644
index 000000000..e83d07954
--- /dev/null
+++ b/test/cypress/integration/vnComponent/UserPanel.spec.js
@@ -0,0 +1,58 @@
+///
+describe('UserPanel', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#dashboard`);
+ cy.waitForElement('.q-page', 6000);
+ });
+
+ it('should notify when update user warehouse', () => {
+ const userWarehouse =
+ '.q-menu .q-gutter-xs > :nth-child(3) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input';
+
+ // Abro el panel
+ cy.openUserPanel();
+
+ // Compruebo la opcion inicial
+ cy.get(userWarehouse).should('have.value', 'VNL').click();
+
+ // Actualizo la opción
+ getOption(3);
+
+ //Compruebo la notificación
+ cy.get('.q-notification').should('be.visible');
+ cy.get(userWarehouse).should('have.value', 'VNH');
+
+ //Restauro el valor
+ cy.get(userWarehouse).click();
+ getOption(2);
+ });
+ it('should notify when update user company', () => {
+ const userCompany =
+ '.q-menu .q-gutter-xs > :nth-child(2) > .q-field--float > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input';
+
+ // Abro el panel
+ cy.openUserPanel();
+
+ // Compruebo la opcion inicial
+ cy.get(userCompany).should('have.value', 'Warehouse One').click();
+
+ //Actualizo la opción
+ getOption(2);
+
+ //Compruebo la notificación
+ cy.get('.q-notification').should('be.visible');
+ cy.get(userCompany).should('have.value', 'Warehouse Two');
+
+ //Restauro el valor
+ cy.get(userCompany).click();
+ getOption(1);
+ });
+});
+
+function getOption(index) {
+ cy.waitForElement('[role="listbox"]');
+ const option = `[role="listbox"] .q-item:nth-child(${index})`;
+ cy.get(option).click();
+}
diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/vnLocation.spec.js
index 1872d3591..78dc38899 100644
--- a/test/cypress/integration/vnComponent/vnLocation.spec.js
+++ b/test/cypress/integration/vnComponent/vnLocation.spec.js
@@ -3,25 +3,90 @@ describe('VnLocation', () => {
const dialogInputs = '.q-dialog label input';
const createLocationButton = '.q-form > .q-card > .vn-row:nth-child(6) .--add-icon';
const inputLocation = '.q-form input[aria-label="Location"]';
+ const createForm = {
+ prefix: '.q-dialog__inner > .column > #formModel > .q-card',
+ sufix: ' .q-field__inner > .q-field__control',
+ };
+ describe('CreateFormDialog ', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
+ cy.waitForElement('.q-card');
+ cy.get(createLocationButton).click();
+ });
+ it('should filter provinces based on selected country', () => {
+ // Select a country
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
+ 'Ecuador'
+ );
+ // Verify that provinces are filtered
+ cy.get(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
+ ).should('have.length', 1);
+
+ // Verify that towns are filtered
+ cy.get(
+ `${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
+ ).should('have.length', 1);
+ });
+
+ it('should filter towns based on selected province', () => {
+ // Select a country
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`,
+ 'Ecuador'
+ );
+ // Verify that provinces are filtered
+ cy.get(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
+ ).should('have.length', 1);
+
+ // Verify that towns are filtered
+ cy.get(
+ `${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
+ ).should('have.length', 1);
+ });
+ it('should pass selected country', () => {
+ // Select a country
+ const country = 'Ecuador';
+ const province = 'Province five';
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
+ country
+ );
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
+ province
+ );
+ cy.get(
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon`
+ ).click();
+ cy.get(
+ `#q-portal--dialog--4 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
+ ).should('have.value', province);
+ });
+ });
describe('Worker Create', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/worker/create', { timeout: 5000 });
cy.waitForElement('.q-card');
+ cy.get(inputLocation).click();
});
it('Show all options', function () {
- cy.get(inputLocation).click();
cy.get(locationOptions).should('have.length.at.least', 5);
});
it('input filter location as "al"', function () {
- cy.get(inputLocation).click();
+ // cy.get(inputLocation).click();
cy.get(inputLocation).clear();
cy.get(inputLocation).type('al');
cy.get(locationOptions).should('have.length.at.least', 4);
});
it('input filter location as "ecuador"', function () {
- cy.get(inputLocation).click();
+ // cy.get(inputLocation).click();
cy.get(inputLocation).clear();
cy.get(inputLocation).type('ecuador');
cy.get(locationOptions).should('have.length.at.least', 1);
@@ -63,13 +128,11 @@ describe('VnLocation', () => {
cy.get(dialogInputs).eq(0).clear();
cy.get(dialogInputs).eq(0).type(postCode);
cy.selectOption(
- '.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > .q-select > .q-field__inner > .q-field__control ',
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
province
);
cy.get('.q-mt-lg > .q-btn--standard').click();
- cy.get('.q-dialog__inner > .column > #formModel > .q-card').should(
- 'not.exist'
- );
+ cy.get(`${createForm.prefix}`).should('not.exist');
checkVnLocation(postCode, province);
});
it('Create city', () => {
@@ -79,7 +142,7 @@ describe('VnLocation', () => {
cy.get(dialogInputs).eq(0).type(postCode);
// city create button
cy.get(
- '.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > .q-select > .q-field__inner > .q-field__control > :nth-child(2) > .q-icon'
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
).click();
cy.selectOption('#q-portal--dialog--2 .q-select', 'one');
cy.get('#q-portal--dialog--2 .q-input').type(province);
@@ -89,9 +152,7 @@ describe('VnLocation', () => {
});
function checkVnLocation(postCode, province) {
- cy.get('.q-dialog__inner > .column > #formModel > .q-card').should(
- 'not.exist'
- );
+ cy.get(`${createForm.prefix}`).should('not.exist');
cy.get('.q-form > .q-card > .vn-row:nth-child(6)')
.find('input')
.invoke('val')
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 43788f59f..83f45b721 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -248,3 +248,9 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
});
+
+Cypress.Commands.add('openUserPanel', () => {
+ cy.get(
+ '.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
+ ).click();
+});