fix: refs #6695 update Cypress cache handling and increase wait timeout for elements
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:
parent
0f5f5b847e
commit
a4fa89f15e
|
@ -107,9 +107,8 @@ pipeline {
|
||||||
-e TZ=Europe/Madrid
|
-e TZ=Europe/Madrid
|
||||||
-e DOCKER=true
|
-e DOCKER=true
|
||||||
-e CI=true
|
-e CI=true
|
||||||
-e CYPRESS_CACHE_FOLDER=/root/.cache/Cypress
|
-e CYPRESS_CACHE_FOLDER=/app/.cypress_cache
|
||||||
""".stripIndent()) {
|
""".stripIndent()) {
|
||||||
sh 'ls -la /root/.cache/Cypress' // Debug opcional
|
|
||||||
sh 'pnpm exec cypress run --browser chromium'
|
sh 'pnpm exec cypress run --browser chromium'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,20 +3,18 @@ FROM alexmorenovn/vndev:latest
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
|
||||||
# Instalamos dependencias y Cypress
|
# Especificamos la ruta personalizada para la caché de Cypress
|
||||||
|
ENV CYPRESS_CACHE_FOLDER=/app/.cypress_cache
|
||||||
|
|
||||||
|
# Instalamos las dependencias y Cypress en la ruta definida
|
||||||
RUN pnpm install --frozen-lockfile \
|
RUN pnpm install --frozen-lockfile \
|
||||||
&& pnpm exec cypress install
|
&& CYPRESS_CACHE_FOLDER=$CYPRESS_CACHE_FOLDER pnpm exec cypress install
|
||||||
|
|
||||||
# Verificamos dónde está instalada la caché de Cypress
|
# Verificamos que la caché de Cypress se haya instalado correctamente
|
||||||
RUN echo "Cypress cache directory: $(pnpm exec cypress cache path)" \
|
RUN echo "Cypress cache installed at: $CYPRESS_CACHE_FOLDER" \
|
||||||
&& ls -la $(pnpm exec cypress cache path) || true
|
&& ls -la $CYPRESS_CACHE_FOLDER || true
|
||||||
|
|
||||||
# Aseguramos que la caché esté en un lugar accesible
|
# Configuramos el PATH para que Cypress sea accesible
|
||||||
ENV CYPRESS_CACHE_FOLDER=/root/.cache/Cypress
|
ENV PATH="$CYPRESS_CACHE_FOLDER/${CYPRESS_VERSION}/Cypress:${PATH}"
|
||||||
RUN mkdir -p ${CYPRESS_CACHE_FOLDER} \
|
|
||||||
&& if [ -d "/home/node/.cache/Cypress" ]; then cp -r /home/node/.cache/Cypress/* ${CYPRESS_CACHE_FOLDER}/; fi
|
|
||||||
|
|
||||||
# Configuramos la variable de entorno y el PATH
|
|
||||||
ENV PATH="${CYPRESS_CACHE_FOLDER}:${PATH}"
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
|
@ -59,7 +59,7 @@ Cypress.Commands.add('login', (user) => {
|
||||||
Cypress.Commands.add('domContentLoad', (element, timeout = 5000) => {
|
Cypress.Commands.add('domContentLoad', (element, timeout = 5000) => {
|
||||||
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
|
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
|
||||||
});
|
});
|
||||||
Cypress.Commands.add('waitForElement', (element, timeout = 10000) => {
|
Cypress.Commands.add('waitForElement', (element, timeout = 20000) => {
|
||||||
cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
|
cy.get(element, { timeout }).should('be.visible').and('not.be.disabled');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue