diff --git a/backend/ypovoli/settings.py b/backend/ypovoli/settings.py index ca8d8152..259f96d6 100644 --- a/backend/ypovoli/settings.py +++ b/backend/ypovoli/settings.py @@ -46,8 +46,8 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = environ.get("DJANGO_DEBUG", "False").lower() in ["true", "1", "t"] DOMAIN_NAME = environ.get("DJANGO_DOMAIN_NAME", "localhost") -ALLOWED_HOSTS = [DOMAIN_NAME] -CSRF_TRUSTED_ORIGINS = ["https://" + DOMAIN_NAME] +ALLOWED_HOSTS = [DOMAIN_NAME, "nginx"] +CSRF_TRUSTED_ORIGINS = ["https://" + DOMAIN_NAME, "https://nginx"] # Application definition INSTALLED_APPS = [ diff --git a/frontend/Dockerfile.cypress b/frontend/Dockerfile.cypress new file mode 100644 index 00000000..509d7ca1 --- /dev/null +++ b/frontend/Dockerfile.cypress @@ -0,0 +1,4 @@ +ARG CHROME_VERSION="114.0.5735.133-1" +ARG NODE_VERSION="18.17.1" + +FROM cypress/factory diff --git a/frontend/cypress.config.js b/frontend/cypress.config.js index 6b759d73..83abcaba 100644 --- a/frontend/cypress.config.js +++ b/frontend/cypress.config.js @@ -2,7 +2,7 @@ import { defineConfig } from 'cypress'; export default defineConfig({ e2e: { - baseUrl: 'http://nginx', + baseUrl: 'https://nginx', specPattern: 'src/test/e2e/**/*.cy.{js,jsx,ts,tsx}', }, }); diff --git a/test.sh b/test.sh index 91cb140d..500e6073 100755 --- a/test.sh +++ b/test.sh @@ -92,7 +92,7 @@ fi exit_code=0 echo "-----------------" -if [ $vitest_exit -ne 0 ] || [ $django_exit -ne 0 ]; then +if [ $cypress_exit -ne 0 ] || [ $vitest_exit -ne 0 ] || [ $django_exit -ne 0 ]; then echo "Tests failed:" if [ $cypress_exit -ne 0 ]; then echo " - Cypress" diff --git a/test.yml b/test.yml index 0f274abd..05051584 100644 --- a/test.yml +++ b/test.yml @@ -52,6 +52,8 @@ services: command: sh -c "./setup.sh && python manage.py runsslserver 0.0.0.0:8000" volumes: - $BACKEND_DIR:/code + depends_on: + - redis celery: <<: *common-keys-selab_test @@ -89,7 +91,13 @@ services: cypress: <<: *common-keys-selab_test container_name: cypress - image: cypress/included:cypress-12.17.3-node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1 + build: + context: $FRONTEND_DIR + dockerfile: Dockerfile.cypress + command: sh -c "npm install && npm run cypress:test" working_dir: /e2e volumes: - ${FRONTEND_DIR}:/e2e + - /e2e/node_modules + depends_on: + - frontend