diff --git a/.github/oxid-esales/cypress.sh b/.github/oxid-esales/cypress.sh index 72b8825..99ae2e2 100755 --- a/.github/oxid-esales/cypress.sh +++ b/.github/oxid-esales/cypress.sh @@ -7,7 +7,11 @@ function create_network() { function start_services() { echo "Starting services with Docker Compose..." - docker-compose up -d php mysql selenium mailpit + docker compose up -d php mysql selenium mailpit + + echo "Stopping and removing any existing Apache container..." + docker rm -f telecash-module-apache-1 || echo "No existing Apache container to remove." + echo "Starting Apache with explicit hostname and ServerName..." docker run -d --name telecash-module-apache-1 \ --hostname oxideshop.local \ @@ -18,13 +22,6 @@ function start_services() { httpd:latest bash -c 'echo "ServerName oxideshop.local" >> /usr/local/apache2/conf/httpd.conf && httpd-foreground' } -function connect_services_to_network() { - echo "Connecting services to app-network..." - for service in telecash-module-php-1 telecash-module-mysql-1 telecash-module-mailpit-1 telecash-module-selenium-1; do - docker network connect app-network $service || echo "Service $service already connected to app-network." - done -} - function start_cypress() { echo "Starting Cypress container..." docker run -d --name cypress-container \ @@ -35,9 +32,6 @@ function start_cypress() { -e CYPRESS_WORKDIR=/var/www \ -e CYPRESS_CONFIG=/var/www/cypress.config.js \ cypress/included:latest bash -c "apt-get update && apt-get install -y iputils-ping curl && npx cypress run --config-file /var/www/cypress.config.js" - - docker exec cypress-container ping oxideshop.local - docker exec cypress-container curl -I http://oxideshop.local } function test_connectivity() { @@ -62,7 +56,6 @@ function cleanup() { # Main script execution create_network start_services -connect_services_to_network start_cypress test_connectivity cleanup