From 14c0c5060ad1f3556b1665f077406c6a58010b33 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Wed, 28 Feb 2024 16:29:35 -0800 Subject: [PATCH] working compose file for cypress --- cypress/cypress.config.ts => cypress.config.ts | 4 ---- cypress/docker-compose.yml | 12 ++++++++---- cypress/tsconfig.json | 2 +- package.json | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) rename cypress/cypress.config.ts => cypress.config.ts (63%) diff --git a/cypress/cypress.config.ts b/cypress.config.ts similarity index 63% rename from cypress/cypress.config.ts rename to cypress.config.ts index c52aeb49..5bed49b8 100644 --- a/cypress/cypress.config.ts +++ b/cypress.config.ts @@ -4,8 +4,4 @@ export default defineConfig({ e2e: { baseUrl: 'http://localhost:3000', }, - env: { - umami_user: 'admin', - umami_password: 'pennydoodoo', - }, }); diff --git a/cypress/docker-compose.yml b/cypress/docker-compose.yml index 8ce1c938..3cd8f546 100644 --- a/cypress/docker-compose.yml +++ b/cypress/docker-compose.yml @@ -2,7 +2,8 @@ version: '3' services: umami: - image: ghcr.io/umami-software/umami:postgresql-latest + build: ../ + #image: ghcr.io/umami-software/umami:postgresql-latest ports: - '3000:3000' environment: @@ -38,10 +39,13 @@ services: - umami - db environment: - - CYPRESS_baseUrl=http://localhost:3000 - entrypoint: /bin/sh -c "yarn install" - working_dir: /cypress + - CYPRESS_baseUrl=http://umami:3000 + - CYPRESS_umami_user=admin + - CYPRESS_umami_password=umami volumes: + - ../tsconfig.json:/tsconfig.json + - ../cypress.config.ts:/cypress.config.ts - ./:/cypress + - ../node_modules/:/node_modules volumes: umami-db-data: diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json index 18edb199..48c3e14e 100644 --- a/cypress/tsconfig.json +++ b/cypress/tsconfig.json @@ -4,5 +4,5 @@ "lib": ["es5", "dom"], "types": ["cypress", "node"] }, - "include": ["**/*.ts"] + "include": ["**/*.ts", "../cypress.config.ts"] } diff --git a/package.json b/package.json index 16658e2e..895ff334 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ "lint": "next lint --quiet", "prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || husky install", "postbuild": "node scripts/postbuild.js", - "cypress-open": "cypress open cypress run --config-file cypress/cypress.config.ts", - "cypress-run": "cypress run cypress run --config-file cypress/cypress.config.ts" + "cypress-open": "cypress open cypress run", + "cypress-run": "cypress run cypress run" }, "lint-staged": { "**/*.{js,jsx,ts,tsx}": [