#8074: Modify spinner size #1521
|
@ -31,6 +31,7 @@ yarn-error.log*
|
|||
# Cypress directories and files
|
||||
/test/cypress/videos
|
||||
/test/cypress/screenshots
|
||||
/junit
|
||||
|
||||
# VitePress directories and files
|
||||
/docs/.vitepress/cache
|
||||
|
|
|
@ -114,15 +114,16 @@ pipeline {
|
|||
}
|
||||
steps {
|
||||
script {
|
||||
sh 'rm junit/e2e-*.xml || true'
|
||||
sh 'rm -f junit/e2e-*.xml'
|
||||
env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev'
|
||||
|
||||
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
|
||||
|
||||
sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
|
||||
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
|
||||
|
||||
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
|
||||
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
|
||||
sh 'cypress run --browser chromium || true'
|
||||
sh 'sh test/cypress/cypressParallel.sh 2'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
import { defineConfig } from 'cypress';
|
||||
|
||||
let urlHost, reporter, reporterOptions;
|
||||
let urlHost, reporter, reporterOptions, timeouts;
|
||||
|
||||
if (process.env.CI) {
|
||||
urlHost = 'front';
|
||||
reporter = 'junit';
|
||||
reporterOptions = {
|
||||
mochaFile: 'junit/e2e-[hash].xml',
|
||||
toConsole: false,
|
||||
};
|
||||
timeouts = {
|
||||
defaultCommandTimeout: 30000,
|
||||
requestTimeout: 30000,
|
||||
responseTimeout: 60000,
|
||||
pageLoadTimeout: 60000,
|
||||
};
|
||||
} else {
|
||||
urlHost = 'localhost';
|
||||
|
@ -20,17 +25,19 @@ if (process.env.CI) {
|
|||
reportDir: 'test/cypress/reports',
|
||||
inlineAssets: true,
|
||||
};
|
||||
timeouts = {
|
||||
defaultCommandTimeout: 10000,
|
||||
requestTimeout: 10000,
|
||||
responseTimeout: 30000,
|
||||
pageLoadTimeout: 60000,
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
e2e: {
|
||||
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',
|
||||
|
@ -50,8 +57,8 @@ export default defineConfig({
|
|||
},
|
||||
viewportWidth: 1280,
|
||||
viewportHeight: 720,
|
||||
...timeouts,
|
||||
includeShadowDom: true,
|
||||
waitForAnimations: true,
|
||||
},
|
||||
experimentalMemoryManagement: true,
|
||||
defaultCommandTimeout: 10000,
|
||||
numTestsKeptInMemory: 2,
|
||||
});
|
||||
|
|
|
@ -39,7 +39,7 @@ ENV PNPM_HOME="/home/app/.local/share/pnpm"
|
|||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
RUN pnpm setup \
|
||||
&& pnpm install --global cypress@13.6.6 \
|
||||
&& pnpm install --global cypress@14.1.0 \
|
||||
&& cypress install
|
||||
|
||||
WORKDIR /app
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
|
||||
"test:e2e": "cypress open",
|
||||
"test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run",
|
||||
"test:e2e:parallel": "bash ./test/cypress/cypressParallel.sh",
|
||||
"test:e2e:summary": "bash ./test/cypress/summary.sh",
|
||||
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
|
||||
"test:front": "vitest",
|
||||
"test:front:ci": "vitest run",
|
||||
|
@ -47,18 +49,20 @@
|
|||
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
|
||||
"@vue/test-utils": "^2.4.4",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"cypress": "^13.6.6",
|
||||
"cypress": "^14.1.0",
|
||||
"cypress-mochawesome-reporter": "^3.8.2",
|
||||
"eslint": "^9.18.0",
|
||||
"eslint-config-prettier": "^10.0.1",
|
||||
"eslint-plugin-cypress": "^4.1.0",
|
||||
"eslint-plugin-vue": "^9.32.0",
|
||||
"husky": "^8.0.0",
|
||||
"mocha": "^11.1.0",
|
||||
"postcss": "^8.4.23",
|
||||
"prettier": "^3.4.2",
|
||||
"sass": "^1.83.4",
|
||||
"vitepress": "^1.6.3",
|
||||
"vitest": "^0.34.0"
|
||||
"vitest": "^0.34.0",
|
||||
"xunit-viewer": "^10.6.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20 || ^18 || ^16",
|
||||
|
|
2054
pnpm-lock.yaml
2054
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -245,7 +245,7 @@ export function useArrayData(key, userOptions) {
|
|||
async function loadMore() {
|
||||
if (!store.hasMoreData) return;
|
||||
|
||||
store.skip = store.limit * store.page;
|
||||
store.skip = (store?.filter?.limit ?? store.limit) * store.page;
|
||||
store.page += 1;
|
||||
|
||||
await fetch({ append: true });
|
||||
|
|
|
@ -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'],
|
||||
}),
|
||||
|
|
|
@ -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'],
|
||||
};
|
||||
|
|
|
@ -94,6 +94,7 @@ const submit = async (rows) => {
|
|||
icon="add_circle"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
data-cy="addBarcode_input"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Add barcode') }}
|
||||
|
|
|
@ -226,7 +226,6 @@ const onDenyAccept = (_, responseData) => {
|
|||
order="shipped ASC, isOk ASC"
|
||||
:columns="columns"
|
||||
:user-params="userParams"
|
||||
:is-editable="true"
|
||||
:right-search="false"
|
||||
auto-load
|
||||
:disable-option="{ card: true }"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
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,32 +153,47 @@ 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) {
|
||||
const query = JSON.parse(route.query?.createForm);
|
||||
formInitialData.value = query;
|
||||
await onClientSelected({ ...formInitialData.value, clientFk: query?.clientFk });
|
||||
} 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;
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
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 = { addressId: formData.addressId, clientFk };
|
||||
await fetchAgencies(formData);
|
||||
}
|
||||
|
||||
async function fetchAgencies({ landed, addressId }) {
|
||||
|
@ -181,7 +202,7 @@ async function fetchAgencies({ landed, addressId }) {
|
|||
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,
|
||||
|
@ -224,11 +245,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 +277,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)
|
||||
"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
@ -285,7 +304,22 @@ const getDateColor = (date) => {
|
|||
@update:model-value="() => fetchAgencies(data)"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItem
|
||||
v-bind="scope.itemProps"
|
||||
:class="{ disabled: !scope.opt.isActive }"
|
||||
>
|
||||
<QItemSection style="min-width: min-content" avatar>
|
||||
<QIcon
|
||||
v-if="
|
||||
scope.opt.isActive &&
|
||||
data.defaultAddressFk === scope.opt.id
|
||||
"
|
||||
size="sm"
|
||||
color="grey"
|
||||
name="star"
|
||||
class="fill-icon"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<QItemLabel
|
||||
:class="{
|
||||
|
@ -313,6 +347,7 @@ const getDateColor = (date) => {
|
|||
<VnInputDate
|
||||
v-model="data.landed"
|
||||
:label="t('module.landed')"
|
||||
data-cy="landedDate"
|
||||
@update:model-value="() => fetchAgencies(data)"
|
||||
/>
|
||||
<VnSelect
|
||||
|
|
|
@ -751,7 +751,7 @@ watch(
|
|||
{{ row?.item?.subName.toUpperCase() }}
|
||||
</div>
|
||||
</div>
|
||||
<FetchedTags :item="row" :max-length="6" />
|
||||
<FetchedTags :item="row.item" :max-length="6" />
|
||||
<QPopupProxy v-if="row.id && isTicketEditable">
|
||||
<VnInput
|
||||
v-model="row.concept"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { computed, ref, onBeforeMount, watch } from 'vue';
|
||||
import { computed, ref, onBeforeMount, watch, onMounted } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
@ -22,7 +22,6 @@ import { toTimeFormat } from 'src/filters/date';
|
|||
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
|
||||
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
import { getClient } from 'src/pages/Customer/composables/getClient';
|
||||
import { getAddresses } from 'src/pages/Customer/composables/getAddresses';
|
||||
import { getAgencies } from 'src/pages/Route/Agency/composables/getAgencies';
|
||||
|
||||
|
@ -51,10 +50,21 @@ const userParams = {
|
|||
onBeforeMount(() => {
|
||||
initializeFromQuery();
|
||||
stateStore.rightDrawer = true;
|
||||
if (!route.query.createForm) return;
|
||||
onClientSelected(JSON.parse(route.query.createForm));
|
||||
});
|
||||
onMounted(async () => {
|
||||
if (!route.query) return;
|
||||
if (route.query?.createForm) {
|
||||
formInitialData.value = JSON.parse(route.query?.createForm);
|
||||
await onClientSelected(formInitialData.value);
|
||||
} else if (route.query?.table) {
|
||||
const query = route.query?.table;
|
||||
const clientId = +JSON.parse(query)?.clientFk;
|
||||
if (clientId) await onClientSelected({ clientId });
|
||||
}
|
||||
if (tableRef.value) tableRef.value.create.formInitialData = formInitialData.value;
|
||||
});
|
||||
const initializeFromQuery = () => {
|
||||
if (!route) return;
|
||||
const query = route.query.table ? JSON.parse(route.query.table) : {};
|
||||
from.value = query.from || from.toISOString();
|
||||
to.value = query.to || to.toISOString();
|
||||
|
@ -69,7 +79,6 @@ const companiesOptions = ref([]);
|
|||
const accountingOptions = ref([]);
|
||||
const amountToReturn = ref();
|
||||
const dataKey = 'TicketList';
|
||||
const filterPanelRef = ref(null);
|
||||
const formInitialData = ref({});
|
||||
|
||||
const columns = computed(() => [
|
||||
|
@ -251,7 +260,38 @@ const columns = computed(() => [
|
|||
],
|
||||
},
|
||||
]);
|
||||
const onClientSelected = async (formData) => {
|
||||
resetAgenciesSelector(formData);
|
||||
await fetchAddresses(formData);
|
||||
};
|
||||
|
||||
const fetchAddresses = async (formData) => {
|
||||
if (!formData.clientId) {
|
||||
addressesOptions.value = [];
|
||||
formData.defaultAddressFk = null;
|
||||
formData.addressId = null;
|
||||
return;
|
||||
}
|
||||
const { data } = await getAddresses(formData.clientId);
|
||||
formInitialData.value = { clientId: formData.clientId };
|
||||
if (!data) return;
|
||||
addressesOptions.value = data;
|
||||
selectedClient.value = data[0].client;
|
||||
formData.addressId = selectedClient.value.defaultAddressFk;
|
||||
formInitialData.value.addressId = formData.addressId;
|
||||
};
|
||||
watch(
|
||||
() => route.query.table,
|
||||
async (newValue) => {
|
||||
if (newValue) {
|
||||
const clientId = +JSON.parse(newValue)?.clientFk;
|
||||
if (clientId) await onClientSelected({ clientId });
|
||||
if (tableRef.value)
|
||||
tableRef.value.create.formInitialData = formInitialData.value;
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
function resetAgenciesSelector(formData) {
|
||||
agenciesOptions.value = [];
|
||||
if (formData) formData.agencyModeId = null;
|
||||
|
@ -262,12 +302,6 @@ function redirectToLines(id) {
|
|||
window.open(url, '_blank');
|
||||
}
|
||||
|
||||
const onClientSelected = async (formData) => {
|
||||
resetAgenciesSelector(formData);
|
||||
await fetchClient(formData);
|
||||
await fetchAddresses(formData);
|
||||
};
|
||||
|
||||
const fetchAvailableAgencies = async (formData) => {
|
||||
resetAgenciesSelector(formData);
|
||||
const response = await getAgencies(formData, selectedClient.value);
|
||||
|
@ -278,22 +312,6 @@ const fetchAvailableAgencies = async (formData) => {
|
|||
if (agency) formData.agencyModeId = agency.agencyModeFk;
|
||||
};
|
||||
|
||||
const fetchClient = async (formData) => {
|
||||
const response = await getClient(formData.clientId);
|
||||
if (!response) return;
|
||||
const [client] = response.data;
|
||||
selectedClient.value = client;
|
||||
};
|
||||
|
||||
const fetchAddresses = async (formData) => {
|
||||
const response = await getAddresses(formData.clientId);
|
||||
if (!response) return;
|
||||
addressesOptions.value = response.data;
|
||||
|
||||
const { defaultAddress } = selectedClient.value;
|
||||
formData.addressId = defaultAddress.id;
|
||||
};
|
||||
|
||||
const getColor = (row) => {
|
||||
if (row.alertLevelCode === 'OK') return 'bg-success';
|
||||
else if (row.alertLevelCode === 'FREE') return 'bg-notice';
|
||||
|
@ -445,22 +463,6 @@ function setReference(data) {
|
|||
|
||||
dialogData.value.value.description = newDescription;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => route.query.table,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
const clientId = +JSON.parse(newValue)?.clientFk;
|
||||
if (!clientId) return;
|
||||
formInitialData.value = {
|
||||
clientId,
|
||||
};
|
||||
if (tableRef.value) tableRef.value.create.formInitialData = { clientId };
|
||||
onClientSelected({ clientId });
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -279,7 +279,11 @@ async function autofillBic(worker) {
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInput v-model="data.fi" :label="t('worker.create.fi')" />
|
||||
<VnInput
|
||||
v-model="data.fi"
|
||||
:label="t('worker.create.fi')"
|
||||
required
|
||||
/>
|
||||
<VnInputDate
|
||||
v-model="data.birth"
|
||||
:label="t('worker.create.birth')"
|
||||
|
|
|
@ -5,3 +5,4 @@ downloads/*
|
|||
storage/*
|
||||
reports/*
|
||||
docker/logs/*
|
||||
results/*
|
||||
|
|
|
@ -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
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('ClaimPhoto', () => {
|
||||
const carrouselClose = '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon';
|
||||
const carrouselClose =
|
||||
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon';
|
||||
beforeEach(() => {
|
||||
const claimId = 1;
|
||||
cy.login('developer');
|
||||
|
@ -12,7 +13,7 @@ describe('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', () => {
|
||||
|
@ -20,7 +21,7 @@ describe('ClaimPhoto', () => {
|
|||
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', () => {
|
||||
|
@ -38,12 +39,12 @@ describe('ClaimPhoto', () => {
|
|||
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.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');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('InvoiceOut manual invoice', () => {
|
||||
describe.skip('InvoiceOut manual invoice', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
|
@ -10,7 +10,7 @@ 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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -13,7 +13,6 @@ describe('InvoiceOut summary', () => {
|
|||
const confirmSend = '.q-btn--unelevated';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/invoice-out/1/summary`);
|
||||
});
|
||||
|
@ -34,7 +33,9 @@ describe('InvoiceOut summary', () => {
|
|||
|
||||
it('should open the ticket list', () => {
|
||||
cy.get(toTicketList).click();
|
||||
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 ', () => {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
|
||||
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' },
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('OrderList', () => {
|
||||
beforeEach(() => {
|
||||
cy.login('developer');
|
||||
cy.viewport(1920, 1080);
|
||||
cy.visit('/#/order/list');
|
||||
});
|
||||
|
||||
it('create order', () => {
|
||||
cy.get('[data-cy="vnTableCreateBtn"]').click();
|
||||
cy.get('[data-cy="Client_select"]').type('1101');
|
||||
cy.get('.q-menu').contains('Bruce Wayne').click();
|
||||
cy.get('[data-cy="Address_select"]').click();
|
||||
cy.get(
|
||||
'.q-menu > div> div.q-item:nth-child(1) >div.q-item__section--avatar > i',
|
||||
).should('have.text', 'star');
|
||||
cy.get('.q-menu > div> .q-item:nth-child(1)').click();
|
||||
cy.dataCy('landedDate').find('input').type('06/01/2001');
|
||||
cy.get('.q-card [data-cy="Agency_select"]').click();
|
||||
cy.get('.q-menu > div> .q-item:nth-child(1)').click();
|
||||
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.get('.q-card [data-cy="Agency_select"]').click();
|
||||
cy.get('.q-menu > div> .q-item:nth-child(1)').click();
|
||||
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('[data-cy="Client_select"]').should('have.value', 'Bruce Wayne');
|
||||
cy.get('[data-cy="Address_select"]').should('have.value', 'Bruce Wayne');
|
||||
cy.dataCy('landedDate').find('input').type('06/01/2001');
|
||||
cy.get('.q-card [data-cy="Agency_select"]').click();
|
||||
cy.get('.q-menu > div> .q-item:nth-child(1)').click();
|
||||
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`);
|
||||
});
|
||||
});
|
|
@ -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', () => {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
@ -139,7 +139,7 @@ describe('Ticket Lack detail', () => {
|
|||
cy.wait('@getItemGetSimilar');
|
||||
});
|
||||
describe('Replace item if', () => {
|
||||
it.only('Quantity is less than available', () => {
|
||||
it('Quantity is less than available', () => {
|
||||
cy.get(':nth-child(1) > .text-right > .q-btn').click();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
@ -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';
|
||||
|
|
|
@ -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}`);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
describe('WagonCreate', () => {
|
||||
describe.skip('WagonCreate', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
|
@ -16,7 +16,7 @@ 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.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
describe.skip('WorkerCreate', () => {
|
||||
describe('WorkerCreate', () => {
|
||||
const externalRadio = '.q-radio:nth-child(2)';
|
||||
const developerBossId = 120;
|
||||
const payMethodCross =
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
describe('ZoneCreate', () => {
|
||||
describe.skip('ZoneCreate', () => {
|
||||
const data = {
|
||||
Name: { val: 'Zone pickup D' },
|
||||
Price: { val: '3' },
|
||||
|
@ -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();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
describe('ZoneWarehouse', () => {
|
||||
describe.skip('ZoneWarehouse', () => {
|
||||
const data = {
|
||||
Warehouse: { val: 'Warehouse One', type: 'select' },
|
||||
};
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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 };
|
||||
|
|
Loading…
Reference in New Issue