Merge branch 'dev' into 8593-parkingTestsE2e
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
commit
b76bf88d24
|
@ -0,0 +1 @@
|
|||
node_modules
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
def PROTECTED_BRANCH
|
||||
def IS_LATEST
|
||||
|
||||
def BRANCH_ENV = [
|
||||
test: 'test',
|
||||
|
@ -10,16 +11,18 @@ def BRANCH_ENV = [
|
|||
|
||||
node {
|
||||
stage('Setup') {
|
||||
env.FRONT_REPLICAS = 1
|
||||
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
|
||||
|
||||
PROTECTED_BRANCH = [
|
||||
'dev',
|
||||
'test',
|
||||
'master',
|
||||
'main',
|
||||
'beta'
|
||||
].contains(env.BRANCH_NAME)
|
||||
|
||||
IS_LATEST = ['master', 'main'].contains(env.BRANCH_NAME)
|
||||
|
||||
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
||||
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||
|
@ -58,6 +61,19 @@ pipeline {
|
|||
PROJECT_NAME = 'lilium'
|
||||
}
|
||||
stages {
|
||||
stage('Version') {
|
||||
when {
|
||||
expression { PROTECTED_BRANCH }
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
def version = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
writeFile(file: 'VERSION.txt', text: version)
|
||||
echo "VERSION: ${version}"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Install') {
|
||||
environment {
|
||||
NODE_ENV = ""
|
||||
|
@ -71,17 +87,48 @@ pipeline {
|
|||
expression { !PROTECTED_BRANCH }
|
||||
}
|
||||
environment {
|
||||
NODE_ENV = ""
|
||||
NODE_ENV = ''
|
||||
CI = 'true'
|
||||
TZ = 'Europe/Madrid'
|
||||
}
|
||||
steps {
|
||||
sh 'pnpm run test:unit:ci'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
junit(
|
||||
testResults: 'junitresults.xml',
|
||||
allowEmptyResults: true
|
||||
)
|
||||
parallel {
|
||||
stage('Unit') {
|
||||
steps {
|
||||
sh 'pnpm run test:unit:ci'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
junit(
|
||||
testResults: 'junit/vitest.xml',
|
||||
allowEmptyResults: true
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('E2E') {
|
||||
environment {
|
||||
CREDENTIALS = credentials('docker-registry')
|
||||
COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}"
|
||||
COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ."
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
|
||||
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
|
||||
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
|
||||
sh 'cypress run --browser chromium'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
sh "docker-compose ${env.COMPOSE_PARAMS} down"
|
||||
junit(
|
||||
testResults: 'junit/e2e.xml',
|
||||
allowEmptyResults: true
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,25 +138,30 @@ pipeline {
|
|||
}
|
||||
environment {
|
||||
CREDENTIALS = credentials('docker-registry')
|
||||
VERSION = readFile 'VERSION.txt'
|
||||
}
|
||||
steps {
|
||||
sh 'quasar build'
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
sh 'quasar build'
|
||||
|
||||
def baseImage = "salix-frontend:${env.VERSION}"
|
||||
def image = docker.build(baseImage, ".")
|
||||
docker.withRegistry("https://${env.REGISTRY}", 'docker-registry') {
|
||||
image.push()
|
||||
image.push(env.BRANCH_NAME)
|
||||
if (IS_LATEST) image.push('latest')
|
||||
}
|
||||
}
|
||||
dockerBuild()
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
when {
|
||||
expression { PROTECTED_BRANCH }
|
||||
}
|
||||
environment {
|
||||
VERSION = readFile 'VERSION.txt'
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
}
|
||||
withKubeConfig([
|
||||
serverUrl: "$KUBERNETES_API",
|
||||
credentialsId: 'kubernetes',
|
||||
|
|
|
@ -1,12 +1,37 @@
|
|||
import { defineConfig } from 'cypress';
|
||||
// https://docs.cypress.io/app/tooling/reporters
|
||||
// https://docs.cypress.io/app/references/configuration
|
||||
// https://www.npmjs.com/package/cypress-mochawesome-reporter
|
||||
|
||||
let urlHost, reporter, reporterOptions;
|
||||
|
||||
if (process.env.CI) {
|
||||
urlHost = 'front';
|
||||
reporter = 'junit';
|
||||
reporterOptions = {
|
||||
mochaFile: 'junit/e2e.xml',
|
||||
toConsole: false,
|
||||
};
|
||||
} else {
|
||||
urlHost = 'localhost';
|
||||
reporter = 'cypress-mochawesome-reporter';
|
||||
reporterOptions = {
|
||||
charts: true,
|
||||
reportPageTitle: 'Cypress Inline Reporter',
|
||||
reportFilename: '[status]_[datetime]-report',
|
||||
embeddedScreenshots: true,
|
||||
reportDir: 'test/cypress/reports',
|
||||
inlineAssets: true,
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
e2e: {
|
||||
baseUrl: 'http://localhost:9000/',
|
||||
experimentalStudio: true,
|
||||
baseUrl: `http://${urlHost}:9000`,
|
||||
experimentalStudio: false,
|
||||
defaultCommandTimeout: 10000,
|
||||
trashAssetsBeforeRuns: false,
|
||||
requestTimeout: 10000,
|
||||
responseTimeout: 30000,
|
||||
pageLoadTimeout: 60000,
|
||||
defaultBrowser: 'chromium',
|
||||
fixturesFolder: 'test/cypress/fixtures',
|
||||
screenshotsFolder: 'test/cypress/screenshots',
|
||||
supportFile: 'test/cypress/support/index.js',
|
||||
|
@ -14,40 +39,19 @@ export default defineConfig({
|
|||
downloadsFolder: 'test/cypress/downloads',
|
||||
video: false,
|
||||
specPattern: 'test/cypress/integration/**/*.spec.js',
|
||||
experimentalRunAllSpecs: false,
|
||||
watchForFileChanges: false,
|
||||
reporter: 'cypress-mochawesome-reporter',
|
||||
reporterOptions: {
|
||||
charts: true,
|
||||
reportPageTitle: 'Cypress Inline Reporter',
|
||||
reportFilename: '[status]_[datetime]-report',
|
||||
embeddedScreenshots: true,
|
||||
reportDir: 'test/cypress/reports',
|
||||
inlineAssets: true,
|
||||
},
|
||||
experimentalRunAllSpecs: true,
|
||||
watchForFileChanges: true,
|
||||
reporter,
|
||||
reporterOptions,
|
||||
component: {
|
||||
componentFolder: 'src',
|
||||
testFiles: '**/*.spec.js',
|
||||
supportFile: 'test/cypress/support/unit.js',
|
||||
},
|
||||
setupNodeEvents: async (on, config) => {
|
||||
const plugin = await import('cypress-mochawesome-reporter/plugin');
|
||||
plugin.default(on);
|
||||
|
||||
const fs = await import('fs');
|
||||
on('task', {
|
||||
deleteFile(filePath) {
|
||||
if (fs.existsSync(filePath)) {
|
||||
fs.unlinkSync(filePath);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
});
|
||||
|
||||
return config;
|
||||
},
|
||||
viewportWidth: 1280,
|
||||
viewportHeight: 720,
|
||||
},
|
||||
experimentalMemoryManagement: true,
|
||||
defaultCommandTimeout: 10000,
|
||||
numTestsKeptInMemory: 2,
|
||||
});
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
main:
|
||||
image: registry.verdnatura.es/salix-frontend:${VERSION:?}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./Dockerfile
|
|
@ -0,0 +1,45 @@
|
|||
FROM debian:12.9-slim
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg2 \
|
||||
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||
&& apt-get install -y --no-install-recommends nodejs \
|
||||
&& npm install -g corepack@0.31.0 \
|
||||
&& corepack enable pnpm \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y --no-install-recommends install \
|
||||
apt-utils \
|
||||
chromium \
|
||||
libasound2 \
|
||||
libgbm-dev \
|
||||
libgtk-3-0 \
|
||||
libgtk2.0-0 \
|
||||
libnotify-dev \
|
||||
libnss3 \
|
||||
libxss1 \
|
||||
libxtst6 \
|
||||
xauth \
|
||||
xvfb \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN groupadd -r -g 1000 app \
|
||||
&& useradd -r -u 1000 -g app -m -d /home/app app
|
||||
USER app
|
||||
|
||||
ENV SHELL=bash
|
||||
ENV PNPM_HOME="/home/app/.local/share/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
RUN pnpm setup \
|
||||
&& pnpm install --global cypress@13.6.6 \
|
||||
&& cypress install
|
||||
|
||||
WORKDIR /app
|
|
@ -1,6 +1,6 @@
|
|||
export default [
|
||||
{
|
||||
path: '/api',
|
||||
rule: { target: 'http://0.0.0.0:3000' },
|
||||
rule: { target: 'http://127.0.0.1:3000' },
|
||||
},
|
||||
];
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
import { configure } from 'quasar/wrappers';
|
||||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||
import path from 'path';
|
||||
const target = `http://${process.env.CI ? 'back' : 'localhost'}:3000`;
|
||||
|
||||
export default configure(function (/* ctx */) {
|
||||
return {
|
||||
|
@ -108,13 +109,17 @@ export default configure(function (/* ctx */) {
|
|||
},
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://0.0.0.0:3000',
|
||||
target: target,
|
||||
logLevel: 'debug',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
},
|
||||
open: false,
|
||||
allowedHosts: [
|
||||
'front', // Agrega este nombre de host
|
||||
'localhost', // Opcional, para pruebas locales
|
||||
],
|
||||
},
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
|
||||
|
|
|
@ -12,6 +12,7 @@ import SkeletonForm from 'components/ui/SkeletonForm.vue';
|
|||
import VnConfirm from './ui/VnConfirm.vue';
|
||||
import { tMobile } from 'src/composables/tMobile';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||
|
||||
const { push } = useRouter();
|
||||
const quasar = useQuasar();
|
||||
|
@ -284,7 +285,12 @@ function trimData(data) {
|
|||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
function onBeforeSave(formData, originalData) {
|
||||
return getUpdatedValues(
|
||||
Object.keys(getDifferences(formData, originalData)),
|
||||
formData,
|
||||
);
|
||||
}
|
||||
async function onKeyup(evt) {
|
||||
if (evt.key === 'Enter' && !('prevent-submit' in attrs)) {
|
||||
const input = evt.target;
|
||||
|
@ -321,6 +327,7 @@ defineExpose({
|
|||
class="q-pa-md"
|
||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||
id="formModel"
|
||||
:mapper="onBeforeSave"
|
||||
>
|
||||
<QCard>
|
||||
<slot
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref, computed, useAttrs, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
|
||||
const emit = defineEmits(['onDataSaved', 'onDataCanceled']);
|
||||
|
||||
defineProps({
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
|
@ -22,12 +23,21 @@ defineProps({
|
|||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const attrs = useAttrs();
|
||||
const state = useState();
|
||||
const formModelRef = ref(null);
|
||||
const closeButton = ref(null);
|
||||
const isSaveAndContinue = ref(false);
|
||||
const onDataSaved = (formData, requestResponse) => {
|
||||
if (closeButton.value && !isSaveAndContinue.value) closeButton.value.click();
|
||||
const isSaveAndContinue = ref(props.showSaveAndContinueBtn);
|
||||
const isLoading = computed(() => formModelRef.value?.isLoading);
|
||||
const reset = computed(() => formModelRef.value?.reset);
|
||||
|
||||
const onDataSaved = async (formData, requestResponse) => {
|
||||
if (!isSaveAndContinue.value) closeButton.value?.click();
|
||||
if (isSaveAndContinue.value) {
|
||||
await nextTick();
|
||||
state.set(attrs.model, attrs.formInitialData);
|
||||
}
|
||||
isSaveAndContinue.value = props.showSaveAndContinueBtn;
|
||||
emit('onDataSaved', formData, requestResponse);
|
||||
};
|
||||
|
||||
|
@ -36,9 +46,6 @@ const onClick = async (saveAndContinue) => {
|
|||
await formModelRef.value.save();
|
||||
};
|
||||
|
||||
const isLoading = computed(() => formModelRef.value?.isLoading);
|
||||
const reset = computed(() => formModelRef.value?.reset);
|
||||
|
||||
defineExpose({
|
||||
isLoading,
|
||||
onDataSaved,
|
||||
|
@ -74,10 +81,7 @@ defineExpose({
|
|||
data-cy="FormModelPopup_cancel"
|
||||
v-close-popup
|
||||
z-max
|
||||
@click="
|
||||
isSaveAndContinue = false;
|
||||
emit('onDataCanceled');
|
||||
"
|
||||
@click="emit('onDataCanceled')"
|
||||
/>
|
||||
<QBtn
|
||||
:flat="showSaveAndContinueBtn"
|
||||
|
|
|
@ -85,7 +85,15 @@ const refresh = () => window.location.reload();
|
|||
</QTooltip>
|
||||
<PinnedModules ref="pinnedModulesRef" />
|
||||
</QBtn>
|
||||
<QBtn class="q-pa-none" rounded dense flat no-wrap id="user">
|
||||
<QBtn
|
||||
class="q-pa-none"
|
||||
rounded
|
||||
dense
|
||||
flat
|
||||
no-wrap
|
||||
id="user"
|
||||
data-cy="userPanel_btn"
|
||||
>
|
||||
<VnAvatar
|
||||
:worker-id="user.id"
|
||||
:title="user.name"
|
||||
|
|
|
@ -953,14 +953,6 @@ function cardClick(_, row) {
|
|||
transition-show="scale"
|
||||
transition-hide="scale"
|
||||
:full-width="createComplement?.isFullWidth ?? false"
|
||||
@before-hide="
|
||||
() => {
|
||||
if (createRef.isSaveAndContinue) {
|
||||
showForm = true;
|
||||
createForm.formInitialData = { ...create.formInitialData };
|
||||
}
|
||||
}
|
||||
"
|
||||
data-cy="vn-table-create-dialog"
|
||||
>
|
||||
<FormModelPopup
|
||||
|
|
|
@ -27,6 +27,7 @@ const claimActionsForm = ref();
|
|||
const rows = ref([]);
|
||||
const selectedRows = ref([]);
|
||||
const destinationTypes = ref([]);
|
||||
const shelvings = ref([]);
|
||||
const totalClaimed = ref(null);
|
||||
const DEFAULT_MAX_RESPONSABILITY = 5;
|
||||
const DEFAULT_MIN_RESPONSABILITY = 1;
|
||||
|
@ -56,6 +57,12 @@ const columns = computed(() => [
|
|||
field: (row) => row.claimDestinationFk,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'shelving',
|
||||
label: t('shelvings.shelving'),
|
||||
field: (row) => row.shelvingFk,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'Landed',
|
||||
label: t('Landed'),
|
||||
|
@ -125,6 +132,10 @@ async function updateDestination(claimDestinationFk, row, options = {}) {
|
|||
options.reload && claimActionsForm.value.reload();
|
||||
}
|
||||
}
|
||||
async function updateShelving(shelvingFk, row) {
|
||||
await axios.patch(`ClaimEnds/${row.id}`, { shelvingFk });
|
||||
claimActionsForm.value.reload();
|
||||
}
|
||||
|
||||
async function regularizeClaim() {
|
||||
await post(`Claims/${claimId}/regularizeClaim`);
|
||||
|
@ -200,6 +211,7 @@ async function post(query, params) {
|
|||
auto-load
|
||||
@on-fetch="(data) => (destinationTypes = data)"
|
||||
/>
|
||||
<FetchData url="Shelvings" auto-load @on-fetch="(data) => (shelvings = data)" />
|
||||
<RightMenu v-if="claim">
|
||||
<template #right-panel>
|
||||
<QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
|
||||
|
@ -312,6 +324,20 @@ async function post(query, params) {
|
|||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-shelving="{ row }">
|
||||
<QTd>
|
||||
<VnSelect
|
||||
v-model="row.shelvingFk"
|
||||
:options="shelvings"
|
||||
option-label="code"
|
||||
option-value="id"
|
||||
style="width: 100px"
|
||||
hide-selected
|
||||
@update:model-value="(value) => updateShelving(value, row)"
|
||||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
|
||||
<template #body-cell-price="{ value }">
|
||||
<QTd align="center">
|
||||
{{ toCurrency(value) }}
|
||||
|
@ -354,7 +380,7 @@ async function post(query, params) {
|
|||
(value) =>
|
||||
updateDestination(
|
||||
value,
|
||||
props.row
|
||||
props.row,
|
||||
)
|
||||
"
|
||||
/>
|
||||
|
@ -371,6 +397,17 @@ async function post(query, params) {
|
|||
</QTable>
|
||||
</template>
|
||||
<template #moreBeforeActions>
|
||||
<QBtn
|
||||
color="primary"
|
||||
text-color="white"
|
||||
:unelevated="true"
|
||||
:label="tMobile('Import claim')"
|
||||
:title="t('Import claim')"
|
||||
icon="Download"
|
||||
@click="importToNewRefundTicket"
|
||||
:disable="claim.claimStateFk == resolvedStateId"
|
||||
:loading="loading"
|
||||
/>
|
||||
<QBtn
|
||||
color="primary"
|
||||
text-color="white"
|
||||
|
@ -394,17 +431,6 @@ async function post(query, params) {
|
|||
@click="dialogDestination = !dialogDestination"
|
||||
:loading="loading"
|
||||
/>
|
||||
<QBtn
|
||||
color="primary"
|
||||
text-color="white"
|
||||
:unelevated="true"
|
||||
:label="tMobile('Import claim')"
|
||||
:title="t('Import claim')"
|
||||
icon="Upload"
|
||||
@click="importToNewRefundTicket"
|
||||
:disable="claim.claimStateFk == resolvedStateId"
|
||||
:loading="loading"
|
||||
/>
|
||||
</template>
|
||||
</CrudModel>
|
||||
<QDialog v-model="dialogDestination">
|
||||
|
|
|
@ -19,30 +19,36 @@ const columns = [
|
|||
name: 'itemFk',
|
||||
label: t('Id item'),
|
||||
columnFilter: false,
|
||||
align: 'left',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
name: 'ticketFk',
|
||||
label: t('Ticket'),
|
||||
columnFilter: false,
|
||||
align: 'left',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
name: 'claimDestinationFk',
|
||||
label: t('Destination'),
|
||||
columnFilter: false,
|
||||
align: 'left',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
name: 'shelvingCode',
|
||||
label: t('Shelving'),
|
||||
columnFilter: false,
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
name: 'landed',
|
||||
label: t('Landed'),
|
||||
format: (row) => toDate(row.landed),
|
||||
align: 'left',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'quantity',
|
||||
label: t('Quantity'),
|
||||
align: 'left',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
name: 'concept',
|
||||
|
@ -52,18 +58,18 @@ const columns = [
|
|||
{
|
||||
name: 'price',
|
||||
label: t('Price'),
|
||||
align: 'left',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
name: 'discount',
|
||||
label: t('Discount'),
|
||||
format: ({ discount }) => toPercentage(discount / 100),
|
||||
align: 'left',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
name: 'total',
|
||||
label: t('Total'),
|
||||
align: 'left',
|
||||
align: 'right',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
|
|
@ -143,6 +143,7 @@ const exprBuilder = (param, value) => {
|
|||
outlined
|
||||
rounded
|
||||
auto-load
|
||||
sortBy="name ASC"
|
||||
/></QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
|
|
|
@ -78,10 +78,20 @@ const columns = computed(() => [
|
|||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name'],
|
||||
fields: ['id', 'name', 'firstName'],
|
||||
where: { role: 'salesPerson' },
|
||||
optionFilter: 'firstName',
|
||||
},
|
||||
columnFilter: {
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers/activeWithInheritedRole',
|
||||
fields: ['id', 'name', 'firstName'],
|
||||
where: { role: 'salesPerson' },
|
||||
optionLabel: 'firstName',
|
||||
optionValue: 'id',
|
||||
},
|
||||
},
|
||||
create: false,
|
||||
columnField: {
|
||||
component: null,
|
||||
|
|
|
@ -18,6 +18,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import CustomerSamplesPreview from 'src/pages/Customer/components/CustomerSamplesPreview.vue';
|
||||
import FormPopup from 'src/components/FormPopup.vue';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
|
||||
const { dialogRef, onDialogOK } = useDialogPluginComponent();
|
||||
|
||||
|
@ -39,7 +40,7 @@ const optionsSamplesVisible = ref([]);
|
|||
const sampleType = ref({ hasPreview: false });
|
||||
const initialData = reactive({});
|
||||
const entityId = computed(() => route.params.id);
|
||||
const customer = computed(() => state.get('Customer'));
|
||||
const customer = computed(() => useArrayData('Customer').store?.data);
|
||||
const filterEmailUsers = { where: { userFk: user.value.id } };
|
||||
const filterClientsAddresses = {
|
||||
include: [
|
||||
|
@ -65,9 +66,9 @@ const filterSamplesVisible = {
|
|||
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
||||
|
||||
onBeforeMount(async () => {
|
||||
initialData.clientFk = customer.value.id;
|
||||
initialData.recipient = customer.value.email;
|
||||
initialData.recipientId = customer.value.id;
|
||||
initialData.clientFk = customer.value?.id;
|
||||
initialData.recipient = customer.value?.email;
|
||||
initialData.recipientId = customer.value?.id;
|
||||
});
|
||||
|
||||
const setEmailUser = (data) => {
|
||||
|
|
|
@ -21,7 +21,6 @@ import VnSection from 'src/components/common/VnSection.vue';
|
|||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const tableRef = ref();
|
||||
const invoiceOutSerialsOptions = ref([]);
|
||||
const customerOptions = ref([]);
|
||||
const selectedRows = ref([]);
|
||||
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
|
||||
|
@ -368,7 +367,6 @@ watchEffect(selectedRows);
|
|||
url="InvoiceOutSerials"
|
||||
v-model="data.serial"
|
||||
:label="t('invoiceOutModule.serial')"
|
||||
:options="invoiceOutSerialsOptions"
|
||||
option-label="description"
|
||||
option-value="code"
|
||||
option-filter
|
||||
|
|
|
@ -27,7 +27,7 @@ const user = state.getUser();
|
|||
const today = Date.vnNew();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
const warehousesOptions = ref([]);
|
||||
const itemBalances = computed(() => arrayDataItemBalances.store.data);
|
||||
const itemBalances = computed(() => arrayDataItemBalances.store.data || []);
|
||||
const where = computed(() => arrayDataItemBalances.store.filter.where || {});
|
||||
const showWhatsBeforeInventory = ref(false);
|
||||
const inventoriedDate = ref(null);
|
||||
|
@ -313,8 +313,8 @@ async function updateWarehouse(warehouseFk) {
|
|||
row.lineFk == row.lastPreparedLineFk
|
||||
? 'black'
|
||||
: row.balance < 0
|
||||
? 'negative'
|
||||
: ''
|
||||
? 'negative'
|
||||
: ''
|
||||
"
|
||||
dense
|
||||
style="font-size: 14px"
|
||||
|
|
|
@ -87,7 +87,7 @@ const insertTag = (rows) => {
|
|||
tagFk: undefined,
|
||||
}"
|
||||
:default-remove="false"
|
||||
:filter="{
|
||||
:user-filter="{
|
||||
fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'],
|
||||
where: { itemFk: route.params.id },
|
||||
include: {
|
||||
|
@ -119,6 +119,7 @@ const insertTag = (rows) => {
|
|||
"
|
||||
:required="true"
|
||||
:rules="validate('itemTag.tagFk')"
|
||||
:data-cy="`tag${row?.tag?.name}`"
|
||||
/>
|
||||
<VnSelect
|
||||
v-if="row.tag?.isFree === false"
|
||||
|
@ -145,6 +146,7 @@ const insertTag = (rows) => {
|
|||
:label="t('itemTags.value')"
|
||||
:is-clearable="false"
|
||||
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
|
||||
:data-cy="`tag${row?.tag?.name}Value`"
|
||||
/>
|
||||
<VnInput
|
||||
:label="t('itemBasicData.relevancy')"
|
||||
|
@ -162,6 +164,7 @@ const insertTag = (rows) => {
|
|||
name="delete"
|
||||
size="sm"
|
||||
dense
|
||||
:data-cy="`deleteTag${row?.tag?.name}`"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('itemTags.removeTag') }}
|
||||
|
@ -177,6 +180,7 @@ const insertTag = (rows) => {
|
|||
icon="add"
|
||||
v-shortcut="'+'"
|
||||
fab
|
||||
data-cy="createNewTag"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('itemTags.addTag') }}
|
||||
|
|
|
@ -175,17 +175,21 @@ const getSaleTotal = (sale) => {
|
|||
return price - discount;
|
||||
};
|
||||
|
||||
const getRowUpdateInputEvents = (sale) => ({
|
||||
'keyup.enter': () => {
|
||||
changeQuantity(sale);
|
||||
},
|
||||
blur: () => {
|
||||
changeQuantity(sale);
|
||||
},
|
||||
});
|
||||
|
||||
const resetChanges = async () => {
|
||||
arrayData.fetch({ append: false });
|
||||
tableRef.value.reload();
|
||||
};
|
||||
const rowToUpdate = ref(null);
|
||||
const changeQuantity = async (sale) => {
|
||||
if (
|
||||
!sale.itemFk ||
|
||||
sale.quantity == null ||
|
||||
edit.value?.oldQuantity === sale.quantity
|
||||
)
|
||||
if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity)
|
||||
return;
|
||||
if (!sale.id) return addSale(sale);
|
||||
|
||||
|
@ -197,11 +201,8 @@ const changeQuantity = async (sale) => {
|
|||
const updateQuantity = async (sale) => {
|
||||
try {
|
||||
let { quantity, id } = sale;
|
||||
if (!rowToUpdate.value) return;
|
||||
rowToUpdate.value = null;
|
||||
sale.isNew = false;
|
||||
const params = { quantity: quantity };
|
||||
await axios.post(`Sales/${id}/updateQuantity`, params);
|
||||
await axios.post(`Sales/${id}/updateQuantity`, { quantity });
|
||||
notify('globals.dataSaved', 'positive');
|
||||
tableRef.value.reload();
|
||||
} catch (e) {
|
||||
|
@ -772,9 +773,7 @@ watch(
|
|||
v-if="row.isNew || isTicketEditable"
|
||||
type="number"
|
||||
v-model.number="row.quantity"
|
||||
@blur="changeQuantity(row)"
|
||||
@keyup.enter.stop="changeQuantity(row)"
|
||||
@update:model-value="() => (rowToUpdate = row)"
|
||||
v-on="getRowUpdateInputEvents(row)"
|
||||
@focus="edit.oldQuantity = row.quantity"
|
||||
/>
|
||||
<span v-else>{{ row.quantity }}</span>
|
||||
|
|
|
@ -50,6 +50,7 @@ const { dialog } = useQuasar();
|
|||
const { notify } = useNotify();
|
||||
const acl = useAcl();
|
||||
const btnDropdownRef = ref(null);
|
||||
const editManaProxyRef = ref(null);
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
const newDiscount = ref(null);
|
||||
|
@ -131,13 +132,13 @@ const createClaim = () => {
|
|||
openConfirmationModal(
|
||||
t('Claim out of time'),
|
||||
t('Do you want to continue?'),
|
||||
onCreateClaimAccepted
|
||||
onCreateClaimAccepted,
|
||||
);
|
||||
else
|
||||
openConfirmationModal(
|
||||
t('Do you want to create a claim?'),
|
||||
false,
|
||||
onCreateClaimAccepted
|
||||
onCreateClaimAccepted,
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -216,8 +217,15 @@ const createRefund = async (withWarehouse) => {
|
|||
<QItemSection>
|
||||
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
||||
</QItemSection>
|
||||
<TicketEditManaProxy :mana="props.mana" @save="changeMultipleDiscount()">
|
||||
<TicketEditManaProxy
|
||||
ref="editManaProxyRef"
|
||||
:sale="row"
|
||||
:mana="props.mana"
|
||||
@save="changeMultipleDiscount"
|
||||
>
|
||||
<VnInput
|
||||
autofocus
|
||||
@keyup.enter.stop="() => editManaProxyRef.save(row)"
|
||||
v-model.number="newDiscount"
|
||||
:label="t('ticketSale.discount')"
|
||||
type="number"
|
||||
|
|
|
@ -46,6 +46,15 @@ const descriptorData = useArrayData('Ticket');
|
|||
onMounted(async () => {
|
||||
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
||||
});
|
||||
const formattedAddress = computed(() => {
|
||||
if (!ticket.value) return '';
|
||||
|
||||
const address = ticket.value.address;
|
||||
const postcode = address.postalCode;
|
||||
const province = address.province ? `(${address.province.name})` : '';
|
||||
|
||||
return `${address.street} - ${postcode} - ${address.city} ${province}`;
|
||||
});
|
||||
|
||||
function isEditable() {
|
||||
try {
|
||||
|
@ -238,7 +247,7 @@ onMounted(async () => {
|
|||
/>
|
||||
<VnLv
|
||||
:label="t('ticket.summary.consigneeStreet')"
|
||||
:value="entity.address?.street"
|
||||
:value="formattedAddress"
|
||||
/>
|
||||
</QCard>
|
||||
<QCard class="vn-one" v-if="entity.notes.length">
|
||||
|
|
|
@ -293,6 +293,7 @@ en:
|
|||
clientFk: Customer
|
||||
orderFk: Order
|
||||
from: From
|
||||
shipped: Shipped
|
||||
to: To
|
||||
salesPersonFk: Salesperson
|
||||
stateFk: State
|
||||
|
@ -320,6 +321,7 @@ es:
|
|||
clientFk: Cliente
|
||||
orderFk: Pedido
|
||||
from: Desde
|
||||
shipped: F. envío
|
||||
to: Hasta
|
||||
salesPersonFk: Comercial
|
||||
stateFk: Estado
|
||||
|
|
|
@ -108,13 +108,11 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'shippedDate',
|
||||
name: 'shipped',
|
||||
cardVisible: true,
|
||||
label: t('ticketList.shipped'),
|
||||
columnFilter: {
|
||||
component: 'date',
|
||||
alias: 't',
|
||||
inWhere: true,
|
||||
},
|
||||
format: ({ shippedDate }) => toDate(shippedDate),
|
||||
},
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
reports/*
|
||||
videos/*
|
||||
screenshots/*
|
||||
downloads/*
|
||||
downloads/*
|
||||
storage/*
|
||||
reports/*
|
||||
docker/logs/*
|
||||
|
|
|
@ -0,0 +1,149 @@
|
|||
{
|
||||
"db": {
|
||||
"connector": "memory",
|
||||
"timezone": "local"
|
||||
},
|
||||
"vn": {
|
||||
"connector": "vn-mysql",
|
||||
"database": "vn",
|
||||
"debug": false,
|
||||
"host": "db",
|
||||
"port": "3306",
|
||||
"username": "root",
|
||||
"password": "root",
|
||||
"connectionLimit": 100,
|
||||
"queueLimit": 100,
|
||||
"multipleStatements": true,
|
||||
"legacyUtcDateProcessing": false,
|
||||
"timezone": "local",
|
||||
"connectTimeout": 40000,
|
||||
"acquireTimeout": 90000,
|
||||
"waitForConnections": true,
|
||||
"maxIdleTime": 60000,
|
||||
"idleTimeout": 60000
|
||||
},
|
||||
"osticket": {
|
||||
"connector": "memory",
|
||||
"timezone": "local"
|
||||
},
|
||||
"tempStorage": {
|
||||
"name": "tempStorage",
|
||||
"connector": "loopback-component-storage",
|
||||
"provider": "filesystem",
|
||||
"root": "./storage/tmp",
|
||||
"maxFileSize": "262144000",
|
||||
"allowedContentTypes": [
|
||||
"application/x-7z-compressed",
|
||||
"application/x-zip-compressed",
|
||||
"application/x-rar-compressed",
|
||||
"application/octet-stream",
|
||||
"application/pdf",
|
||||
"application/zip",
|
||||
"application/rar",
|
||||
"multipart/x-zip",
|
||||
"image/png",
|
||||
"image/jpeg",
|
||||
"image/jpg",
|
||||
"image/webp",
|
||||
"video/mp4"
|
||||
]
|
||||
},
|
||||
"dmsStorage": {
|
||||
"name": "dmsStorage",
|
||||
"connector": "loopback-component-storage",
|
||||
"provider": "filesystem",
|
||||
"root": "./storage/dms",
|
||||
"maxFileSize": "262144000",
|
||||
"allowedContentTypes": [
|
||||
"application/x-7z-compressed",
|
||||
"application/x-zip-compressed",
|
||||
"application/x-rar-compressed",
|
||||
"application/octet-stream",
|
||||
"application/pdf",
|
||||
"application/zip",
|
||||
"application/rar",
|
||||
"multipart/x-zip",
|
||||
"image/png",
|
||||
"image/jpeg",
|
||||
"image/jpg",
|
||||
"image/webp"
|
||||
]
|
||||
},
|
||||
"imageStorage": {
|
||||
"name": "imageStorage",
|
||||
"connector": "loopback-component-storage",
|
||||
"provider": "filesystem",
|
||||
"root": "./storage/image",
|
||||
"maxFileSize": "52428800",
|
||||
"allowedContentTypes": [
|
||||
"image/png",
|
||||
"image/jpeg",
|
||||
"image/jpg",
|
||||
"image/webp"
|
||||
]
|
||||
},
|
||||
"invoiceStorage": {
|
||||
"name": "invoiceStorage",
|
||||
"connector": "loopback-component-storage",
|
||||
"provider": "filesystem",
|
||||
"root": "./storage/pdfs/invoice",
|
||||
"maxFileSize": "52428800",
|
||||
"allowedContentTypes": [
|
||||
"application/octet-stream",
|
||||
"application/pdf"
|
||||
]
|
||||
},
|
||||
"claimStorage": {
|
||||
"name": "claimStorage",
|
||||
"connector": "loopback-component-storage",
|
||||
"provider": "filesystem",
|
||||
"root": "./storage/dms",
|
||||
"maxFileSize": "31457280",
|
||||
"allowedContentTypes": [
|
||||
"image/png",
|
||||
"image/jpeg",
|
||||
"image/jpg",
|
||||
"image/webp",
|
||||
"video/mp4"
|
||||
]
|
||||
},
|
||||
"entryStorage": {
|
||||
"name": "entryStorage",
|
||||
"connector": "loopback-component-storage",
|
||||
"provider": "filesystem",
|
||||
"root": "./storage/dms",
|
||||
"maxFileSize": "31457280",
|
||||
"allowedContentTypes": [
|
||||
"image/png",
|
||||
"image/jpeg",
|
||||
"image/jpg",
|
||||
"image/webp",
|
||||
"video/mp4"
|
||||
]
|
||||
},
|
||||
"supplierStorage": {
|
||||
"name": "supplierStorage",
|
||||
"connector": "loopback-component-storage",
|
||||
"provider": "filesystem",
|
||||
"root": "./storage/dms",
|
||||
"maxFileSize": "31457280",
|
||||
"allowedContentTypes": [
|
||||
"image/png",
|
||||
"image/jpeg",
|
||||
"image/jpg",
|
||||
"image/webp",
|
||||
"video/mp4",
|
||||
"application/pdf"
|
||||
]
|
||||
},
|
||||
"accessStorage": {
|
||||
"name": "accessStorage",
|
||||
"connector": "loopback-component-storage",
|
||||
"provider": "filesystem",
|
||||
"root": "./storage/access",
|
||||
"maxFileSize": "524288000",
|
||||
"allowedContentTypes": [
|
||||
"application/x-7z-compressed"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
back:
|
||||
image: registry.verdnatura.es/salix-back:dev
|
||||
volumes:
|
||||
- ./test/cypress/storage:/salix/storage
|
||||
- ./test/cypress/back/datasources.json:/salix/loopback/server/datasources.json
|
||||
depends_on:
|
||||
- db
|
||||
dns_search: .
|
||||
front:
|
||||
image: lilium-dev:latest
|
||||
command: pnpm exec quasar dev
|
||||
volumes:
|
||||
- .:/app
|
||||
environment:
|
||||
- CI
|
||||
- TZ
|
||||
dns_search: .
|
||||
db:
|
||||
image: registry.verdnatura.es/salix-db:dev
|
|
@ -41,7 +41,7 @@ describe('OrderCatalog', () => {
|
|||
}
|
||||
});
|
||||
cy.get(
|
||||
'[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control'
|
||||
'[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control',
|
||||
).type('{enter}');
|
||||
cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
|
||||
cy.dataCy('catalogFilterValueDialogBtn').last().click();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('ClaimAction', () => {
|
||||
const claimId = 2;
|
||||
const claimId = 1;
|
||||
|
||||
const firstRow = 'tbody > :nth-child(1)';
|
||||
const destinationRow = '.q-item__section > .q-field';
|
||||
|
@ -24,9 +24,9 @@ describe('ClaimAction', () => {
|
|||
const rowData = [true];
|
||||
|
||||
cy.fillRow(firstRow, rowData);
|
||||
cy.get('[title="Change destination"]').click();
|
||||
cy.get('[title="Change destination"]').click({ force: true });
|
||||
cy.selectOption(destinationRow, 'Confeccion');
|
||||
cy.get('.q-card > .q-card__actions > .q-btn--standard').click();
|
||||
cy.get('.q-card > .q-card__actions > .q-btn--standard').click({ force: true });
|
||||
});
|
||||
|
||||
it('should regularize', () => {
|
||||
|
|
|
@ -8,7 +8,11 @@ describe('ClaimNotes', () => {
|
|||
|
||||
it('should add a new note', () => {
|
||||
const message = 'This is a new message.';
|
||||
cy.get('.q-textarea').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);
|
||||
});
|
||||
|
|
|
@ -23,14 +23,12 @@ describe.skip('ClaimPhoto', () => {
|
|||
});
|
||||
|
||||
it('should open first image dialog change to second and close', () => {
|
||||
cy.get(
|
||||
':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image'
|
||||
).click();
|
||||
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.get('.q-carousel__control > .q-btn > .q-btn__content > .q-icon').click();
|
||||
cy.get('.q-carousel__control > button').click();
|
||||
|
||||
cy.get(
|
||||
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'
|
||||
|
@ -42,7 +40,7 @@ describe.skip('ClaimPhoto', () => {
|
|||
|
||||
it('should remove third and fourth file', () => {
|
||||
cy.get(
|
||||
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
|
||||
'.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon'
|
||||
).click();
|
||||
cy.get(
|
||||
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
|
||||
|
@ -50,7 +48,7 @@ describe.skip('ClaimPhoto', () => {
|
|||
cy.get('.q-notification__message').should('have.text', 'Data deleted');
|
||||
|
||||
cy.get(
|
||||
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
|
||||
'.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon'
|
||||
).click();
|
||||
cy.get(
|
||||
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Client basic data', () => {
|
|||
it('Should load layout', () => {
|
||||
cy.get('.q-card').should('be.visible');
|
||||
cy.dataCy('customerPhone').find('input').should('be.visible');
|
||||
cy.dataCy('customerPhone').find('input').type('123456789');
|
||||
cy.dataCy('customerPhone').find('input').clear().type('123456789');
|
||||
cy.get('.q-btn-group > .q-btn--standard').click();
|
||||
cy.intercept('PATCH', '/api/Clients/1102', (req) => {
|
||||
const { body } = req;
|
||||
|
|
|
@ -184,9 +184,8 @@ describe('Entry', () => {
|
|||
}
|
||||
|
||||
function deleteEntry() {
|
||||
cy.get('[data-cy="descriptor-more-opts"]').click();
|
||||
cy.waitForElement('div[data-cy="delete-entry"]');
|
||||
cy.get('div[data-cy="delete-entry"]').should('be.visible').click();
|
||||
cy.get('[data-cy="descriptor-more-opts"]').should('be.visible').click();
|
||||
cy.waitForElement('div[data-cy="delete-entry"]').click();
|
||||
cy.url().should('include', 'list');
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('EntryStockBought', () => {
|
|||
cy.get('[data-col-field="reserve"][data-row-index="0"]').click();
|
||||
cy.get('input[name="reserve"]').type('10{enter}');
|
||||
cy.get('button[title="Save"]').click();
|
||||
cy.get('.q-notification__message').should('have.text', 'Data saved');
|
||||
cy.checkNotification('Data saved');
|
||||
});
|
||||
it('Should add a new reserved space for buyerBoss', () => {
|
||||
cy.addBtnClick();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('InvoiceOut summary', () => {
|
||||
describe.skip('InvoiceOut summary', () => {
|
||||
const transferInvoice = {
|
||||
Client: { val: 'employee', type: 'select' },
|
||||
Type: { val: 'Error in customer data', type: 'select' },
|
||||
|
|
|
@ -1,36 +1,33 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('Item tag', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/item/1/tags`);
|
||||
cy.get('.q-page').should('be.visible');
|
||||
cy.waitForElement('[data-cy="itemTags"]');
|
||||
});
|
||||
|
||||
const createNewTag = 'createNewTag';
|
||||
const saveBtn = 'crudModelDefaultSaveBtn';
|
||||
const newTag = 'tagundefined';
|
||||
|
||||
it('should throw an error adding an existent tag', () => {
|
||||
cy.get('.q-page').should('be.visible');
|
||||
cy.get('.q-page-sticky > div').click();
|
||||
cy.get('.q-page-sticky > div').click();
|
||||
cy.dataCy('Tag_select').eq(7).type('Tallos');
|
||||
cy.get('.q-menu .q-item').contains('Tallos').click();
|
||||
cy.get(':nth-child(8) > [label="Value"]').type('1');
|
||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||
cy.dataCy(createNewTag).click();
|
||||
cy.dataCy(newTag).should('be.visible').click().type('Genero{enter}');
|
||||
cy.dataCy('tagGeneroValue').eq(1).should('be.visible');
|
||||
cy.dataCy(saveBtn).click();
|
||||
cy.checkNotification("The tag or priority can't be repeated for an item");
|
||||
});
|
||||
|
||||
it('should add a new tag', () => {
|
||||
cy.get('.q-page').should('be.visible');
|
||||
cy.get('.q-page-sticky > div').click();
|
||||
cy.get('.q-page-sticky > div').click();
|
||||
cy.dataCy('Tag_select').eq(7).click();
|
||||
cy.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}');
|
||||
cy.get(':nth-child(8) > [label="Value"]').type('50');
|
||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||
cy.dataCy(createNewTag).click();
|
||||
cy.dataCy(newTag).should('be.visible').click().type('Forma{enter}');
|
||||
cy.dataCy('tagFormaValue').should('be.visible').type('50');
|
||||
cy.dataCy(saveBtn).click();
|
||||
|
||||
cy.checkNotification('Data saved');
|
||||
cy.dataCy('itemTags')
|
||||
.children(':nth-child(8)')
|
||||
.find('.justify-center > .q-icon')
|
||||
.click();
|
||||
cy.dataCy('VnConfirm_confirm').click();
|
||||
cy.dataCy('deleteTagForma').should('be.visible').click();
|
||||
cy.dataCy('VnConfirm_confirm').should('be.visible').click();
|
||||
cy.checkNotification('Data saved');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -24,7 +24,7 @@ describe('Recover Password', () => {
|
|||
it('should change password to user', () => {
|
||||
// Get token from mail
|
||||
cy.request(
|
||||
`http://localhost:3000/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
|
||||
`/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
|
||||
).then((response) => {
|
||||
const regex = /access_token=([a-zA-Z0-9]+)/;
|
||||
const [match] = response.body[0].body.match(regex);
|
||||
|
|
|
@ -11,7 +11,7 @@ describe('Two Factor', () => {
|
|||
it('should enable two factor to sysadmin', () => {
|
||||
cy.request(
|
||||
'PATCH',
|
||||
`http://localhost:3000/api/VnUsers/${userId}/update-user?access_token=DEFAULT_TOKEN`,
|
||||
`/api/VnUsers/${userId}/update-user?access_token=DEFAULT_TOKEN`,
|
||||
{ twoFactor: 'email' }
|
||||
);
|
||||
});
|
||||
|
@ -41,7 +41,7 @@ describe('Two Factor', () => {
|
|||
|
||||
// Get code from mail
|
||||
cy.request(
|
||||
`http://localhost:3000/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
|
||||
`/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
|
||||
).then((response) => {
|
||||
const tempDiv = document.createElement('div');
|
||||
tempDiv.innerHTML = response.body[0].body;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
describe('AgencyWorkCenter', () => {
|
||||
describe.skip('AgencyWorkCenter', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
describe('Route extended list', () => {
|
||||
describe.skip('Route extended list', () => {
|
||||
const getSelector = (colField) => `tr:last-child > [data-col-field="${colField}"]`;
|
||||
|
||||
const selectors = {
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('Route', () => {
|
|||
|
||||
it('Route list create route', () => {
|
||||
cy.addBtnClick();
|
||||
cy.get('input[name="description"]').type('routeTestOne{enter}');
|
||||
cy.get('.q-card input[name="description"]').type('routeTestOne{enter}');
|
||||
cy.get('.q-notification__message').should('have.text', 'Data created');
|
||||
cy.url().should('include', '/summary');
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
describe('TicketSale', () => {
|
||||
describe('Free ticket #31', () => {
|
||||
describe.skip('Free ticket #31', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
|
@ -121,7 +121,7 @@ describe('TicketSale', () => {
|
|||
cy.url().should('match', /\/ticket\/31\/log/);
|
||||
});
|
||||
});
|
||||
describe('Ticket prepared #23', () => {
|
||||
describe.skip('Ticket prepared #23', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
|
|
|
@ -40,7 +40,7 @@ describe('VnLocation', () => {
|
|||
cy.selectOption(countrySelector, country);
|
||||
cy.dataCy('locationProvince').type(`${province}{enter}`);
|
||||
cy.get(
|
||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) `
|
||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) `,
|
||||
).click();
|
||||
cy.dataCy('locationProvince').should('have.value', province);
|
||||
});
|
||||
|
@ -87,7 +87,7 @@ describe('VnLocation', () => {
|
|||
.get(':nth-child(1)')
|
||||
.should('have.length.at.least', 2);
|
||||
cy.get(
|
||||
firstOption.concat(' > .q-item__section > .q-item__label--caption')
|
||||
firstOption.concat(' > .q-item__section > .q-item__label--caption'),
|
||||
).should('have.text', postCodeLabel);
|
||||
cy.get(firstOption).click();
|
||||
cy.get('.q-btn-group > .q-btn--standard > .q-btn__content > .q-icon').click();
|
||||
|
@ -103,7 +103,7 @@ describe('VnLocation', () => {
|
|||
cy.get('.q-card > h1').should('have.text', 'New postcode');
|
||||
cy.selectOption(
|
||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
||||
province
|
||||
province,
|
||||
);
|
||||
cy.get(dialogInputs).eq(0).clear();
|
||||
cy.get(dialogInputs).eq(0).type(postCode);
|
||||
|
@ -156,7 +156,7 @@ describe('VnLocation', () => {
|
|||
cy.get(createLocationButton).click();
|
||||
cy.selectOption(
|
||||
`${createForm.prefix} > :nth-child(5) > :nth-child(3) `,
|
||||
'España'
|
||||
'España',
|
||||
);
|
||||
cy.dataCy('Province_icon').click();
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ describe('WorkerNotificationsManager', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('should active a notification that is yours', () => {
|
||||
it.skip('should active a notification that is yours', () => {
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/worker/${developerId}/notifications`);
|
||||
cy.waitForElement(activeList);
|
||||
|
|
|
@ -3,7 +3,7 @@ describe('ZoneWarehouse', () => {
|
|||
Warehouse: { val: 'Warehouse One', type: 'select' },
|
||||
};
|
||||
|
||||
const dataError = 'ER_DUP_ENTRY: Duplicate entry';
|
||||
const dataError = 'The introduced warehouse already exists';
|
||||
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -18,7 +18,7 @@ describe('ZoneWarehouse', () => {
|
|||
cy.get(saveBtn).click();
|
||||
cy.checkNotification(dataError);
|
||||
});
|
||||
|
||||
|
||||
it('should create & remove a warehouse', () => {
|
||||
cy.addBtnClick();
|
||||
cy.fillInForm(data);
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
// DO NOT REMOVE
|
||||
// Imports Quasar Cypress AE predefined commands
|
||||
// import { registerCommands } from '@quasar/quasar-app-extension-testing-e2e-cypress';
|
||||
Cypress.Commands.add('waitUntil', { prevSubject: 'optional' }, require('./waitUntil'));
|
||||
import waitUntil from './waitUntil';
|
||||
Cypress.Commands.add('waitUntil', { prevSubject: 'optional' }, waitUntil);
|
||||
|
||||
Cypress.Commands.add('resetDB', () => {
|
||||
cy.exec('pnpm run resetDatabase');
|
||||
});
|
||||
|
@ -57,7 +59,7 @@ Cypress.Commands.add('login', (user) => {
|
|||
Cypress.Commands.add('domContentLoad', (element, timeout = 5000) => {
|
||||
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
|
||||
});
|
||||
Cypress.Commands.add('waitForElement', (element, timeout = 5000) => {
|
||||
Cypress.Commands.add('waitForElement', (element, timeout = 10000) => {
|
||||
cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
|
||||
});
|
||||
|
||||
|
@ -321,19 +323,14 @@ Cypress.Commands.add('clickButtonDescriptor', (id) => {
|
|||
});
|
||||
|
||||
Cypress.Commands.add('openUserPanel', () => {
|
||||
cy.get(
|
||||
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image',
|
||||
).click();
|
||||
cy.dataCy('userPanel_btn').click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('checkNotification', (text) => {
|
||||
cy.get('.q-notification')
|
||||
cy.get('.q-notification', { timeout: 10000 })
|
||||
.should('be.visible')
|
||||
.last()
|
||||
.then(($lastNotification) => {
|
||||
if (!Cypress.$($lastNotification).text().includes(text))
|
||||
throw new Error(`Notification not found: "${text}"`);
|
||||
});
|
||||
.filter((_, el) => Cypress.$(el).text().includes(text))
|
||||
.should('have.length.greaterThan', 0);
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openActions', (row) => {
|
||||
|
|
|
@ -27,7 +27,17 @@ function randomNumber(options = { length: 10 }) {
|
|||
|
||||
function randomizeValue(characterSet, options) {
|
||||
return Array.from({ length: options.length }, () =>
|
||||
characterSet.charAt(Math.floor(Math.random() * characterSet.length))
|
||||
characterSet.charAt(Math.floor(Math.random() * characterSet.length)),
|
||||
).join('');
|
||||
}
|
||||
|
||||
const style = document.createElement('style');
|
||||
style.innerHTML = `
|
||||
* {
|
||||
transition: none !important;
|
||||
animation: none !important;
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
|
||||
export { randomString, randomNumber, randomizeValue };
|
||||
|
|
|
@ -5,9 +5,21 @@ import jsconfigPaths from 'vite-jsconfig-paths';
|
|||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
|
||||
import path from 'path';
|
||||
|
||||
let reporters,
|
||||
outputFile;
|
||||
|
||||
if (process.env.CI) {
|
||||
reporters = ['junit', 'default'];
|
||||
outputFile = {junit: './junit/vitest.xml'};
|
||||
} else {
|
||||
reporters = 'default';
|
||||
}
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
test: {
|
||||
reporters,
|
||||
outputFile,
|
||||
environment: 'happy-dom',
|
||||
setupFiles: 'test/vitest/setup-file.js',
|
||||
include: [
|
||||
|
|
Loading…
Reference in New Issue