diff --git a/cypress.config.js b/cypress.config.js index c45c1037d..3b58887ee 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -3,13 +3,14 @@ import vitePreprocessor from 'cypress-vite'; // https://docs.cypress.io/app/tooling/reporters // https://docs.cypress.io/app/references/configuration // https://www.npmjs.com/package/cypress-mochawesome-reporter -// baseUrl: `http://${process.env.NETWORK ? 'front' : 'localhost'}:9000`, +const baseUrl = `http://${process.env.DOCKER ? 'front' : 'localhost'}:9000`; export default defineConfig({ e2e: { - baseUrl: `http://front:9000`, + baseUrl, experimentalStudio: false, // Desactivado para evitar tiempos de espera innecesarios defaultCommandTimeout: 10000, + trashAssetsBeforeRuns: false, requestTimeout: 10000, responseTimeout: 30000, pageLoadTimeout: 60000, diff --git a/docker-compose.e2e.local.yml b/docker-compose.e2e.local.yml index e881598fa..04781d7e7 100644 --- a/docker-compose.e2e.local.yml +++ b/docker-compose.e2e.local.yml @@ -1,7 +1,7 @@ version: '3.7' services: back: - image: registry.verdnatura.es/salix-back:25.08.0-build1314 + image: registry.verdnatura.es/salix-back:dev # image: back_try volumes: - ./test/cypress/storage:/salix/storage @@ -18,6 +18,7 @@ services: working_dir: /app environment: - TZ=Europe/Madrid + - DOCKER=true # ports: # - '9000:9000' @@ -26,6 +27,7 @@ services: command: sh -c "while [ ! -d node_modules/cypress ]; do sleep 1; done && pnpm exec cypress run --browser chromium --spec ${CYPRESS_SPEC:?}" environment: - TZ=Europe/Madrid + - DOCKER=true volumes: - .:/app working_dir: /app @@ -38,62 +40,6 @@ services: volumes: - .:/app:delegated vn-database: - image: alexmorenovn/vn_db:latest + image: registry.verdnatura.es/salix-db:dev # ports: # - '3306:3306' - - # e2e: - # command: npx cypress run --browser chromium - # build: - # context: . - # dockerfile: ./Dockerfile.e2e - # volumes: - # - .:/app - # working_dir: /app - - # front: - # # command: pnpx quasar dev - # # command: npx quasar serve --history --proxy ./proxy.mjs --hostname 127.0.0.1 --port 9000 - # build: - # context: . - # dockerfile: ./Dockerfile.e2e - # network_mode: host - # e2e: - # command: pnpx cypress run --browser chromium - # build: - # context: . - # dockerfile: ./Dockerfile.e2e - # network_mode: host - # volumes: - # - ./node_modules:/app/node_modules - # db: - # image: db - # command: npx myt run -t --ci -d -n front_default - # build: - # context: . - # dockerfile: test/cypress/db/Dockerfile - # network_mode: host - # privileged: true - # volumes: - # - /var/run/docker.sock:/var/run/docker.sock - - # back: - # image: back - # build: - # context: ./salix - # dockerfile: salix/back/Dockerfile - # # depends_on: - # # - db - # ports: - # - 3000:3000 - # - 5000:5000 - # volumes: - # - ./test/cypress/storage:/salix/storage - - # e2e-2: - # image: registry.verdnatura.es/salix-frontend:${VERSION:?} - # command: npx cypress run --config-file test/cypress/configs/cypress.config.2.js - # build: - # context: . - # dockerfile: ./Dockerfile.e2e - # diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml index 9a8c167bb..d8b266cd0 100644 --- a/docker-compose.e2e.yml +++ b/docker-compose.e2e.yml @@ -1,15 +1,12 @@ version: '3.7' services: back: - image: registry.verdnatura.es/salix-back:25.08.0-build1296 - # image: back_try + 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: - vn-database - # ports: - # - '3000:3000' front: image: alexmorenovn/vndev:latest command: quasar dev @@ -18,73 +15,15 @@ services: working_dir: /app environment: - TZ=Europe/Madrid - # ports: - # - '9000:9000' + - DOCKER=true e2e: image: cypress-setup:latest command: sh -c "while [ ! -d node_modules/cypress ]; do sleep 1; done && pnpm exec cypress run --browser chromium" environment: - TZ=Europe/Madrid + - DOCKER=true volumes: - .:/app working_dir: /app vn-database: - image: alexmorenovn/vn_db:latest - # ports: - # - '3306:3306' - - # e2e: - # command: npx cypress run --browser chromium - # build: - # context: . - # dockerfile: ./Dockerfile.e2e - # volumes: - # - .:/app - # working_dir: /app - - # front: - # # command: pnpx quasar dev - # # command: npx quasar serve --history --proxy ./proxy.mjs --hostname 127.0.0.1 --port 9000 - # build: - # context: . - # dockerfile: ./Dockerfile.e2e - # network_mode: host - # e2e: - # command: pnpx cypress run --browser chromium - # build: - # context: . - # dockerfile: ./Dockerfile.e2e - # network_mode: host - # volumes: - # - ./node_modules:/app/node_modules - # db: - # image: db - # command: npx myt run -t --ci -d -n front_default - # build: - # context: . - # dockerfile: test/cypress/db/Dockerfile - # network_mode: host - # privileged: true - # volumes: - # - /var/run/docker.sock:/var/run/docker.sock - - # back: - # image: back - # build: - # context: ./salix - # dockerfile: salix/back/Dockerfile - # # depends_on: - # # - db - # ports: - # - 3000:3000 - # - 5000:5000 - # volumes: - # - ./test/cypress/storage:/salix/storage - - # e2e-2: - # image: registry.verdnatura.es/salix-frontend:${VERSION:?} - # command: npx cypress run --config-file test/cypress/configs/cypress.config.2.js - # build: - # context: . - # dockerfile: ./Dockerfile.e2e - # + image: registry.verdnatura.es/salix-db:dev diff --git a/quasar.config.js b/quasar.config.js index 6eff46be2..5df9250ad 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -11,8 +11,7 @@ import { configure } from 'quasar/wrappers'; import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'; import path from 'path'; -// const target = `http://${process.env.NETWORK ? 'back' : 'localhost'}:3000`; -const target = `http://back:3000`; +const target = `http://${process.env.DOCKER ? 'back' : 'localhost'}:3000`; export default configure(function (/* ctx */) { return { diff --git a/test/cypress/db/Dockerfile b/test/cypress/db/Dockerfile index c974a6eeb..78396753c 100644 --- a/test/cypress/db/Dockerfile +++ b/test/cypress/db/Dockerfile @@ -1,4 +1,4 @@ FROM mariadb:10.11.6 ENV TZ Europe/Madrid -COPY --from=mariadb-with-data /data /var/lib/mysql +COPY --from=vn-database /data /var/lib/mysql CMD ["mysqld"]