Skip to content

Commit

Permalink
TC-47 Test cypress e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Tkachev committed Jan 16, 2025
1 parent 238969c commit 2a36cf9
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 14 deletions.
92 changes: 92 additions & 0 deletions .github/oxid-esales/config/osc_telecash.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
id: osc_telecash
moduleSource: vendor/oxid-solution-catalysts/telecash-module
version: 1.0.0-rc.1
activated: true
title:
de: 'Zahlungs-Module für Zahlungsdienstleisters Telecash'
en: 'Payment-Module for Payment-Provider Telecash'
description:
de: 'Dieses Modul ermöglicht die Integration des Zahlungsdienstleisters Telecash.'
en: 'This module provides the integration of the payment provider Telecash.'
lang: ''
thumbnail: pictures/logo.png
author: 'OXID eSales AG'
url: ''
email: ''
classExtensions:
OxidEsales\Eshop\Application\Controller\Admin\ModuleConfiguration: OxidSolutionCatalysts\TeleCash\Extension\Application\Controller\Admin\ModuleConfiguration
OxidEsales\Eshop\Application\Controller\Admin\PaymentMain: OxidSolutionCatalysts\TeleCash\Extension\Application\Controller\Admin\PaymentMain
OxidEsales\Eshop\Application\Controller\Admin\OrderMain: OxidSolutionCatalysts\TeleCash\Extension\Application\Controller\Admin\OrderMain
OxidEsales\Eshop\Application\Controller\Admin\OrderOverview: OxidSolutionCatalysts\TeleCash\Extension\Application\Controller\Admin\OrderOverview
OxidEsales\Eshop\Application\Controller\OrderController: OxidSolutionCatalysts\TeleCash\Extension\Application\Controller\OrderController
OxidEsales\Eshop\Application\Controller\PaymentController: OxidSolutionCatalysts\TeleCash\Extension\Application\Controller\PaymentController
OxidEsales\Eshop\Application\Model\Address: OxidSolutionCatalysts\TeleCash\Extension\Application\Model\Address
OxidEsales\Eshop\Application\Model\Country: OxidSolutionCatalysts\TeleCash\Extension\Application\Model\Country
OxidEsales\Eshop\Application\Model\Order: OxidSolutionCatalysts\TeleCash\Extension\Application\Model\Order
OxidEsales\Eshop\Application\Model\Payment: OxidSolutionCatalysts\TeleCash\Extension\Application\Model\Payment
OxidEsales\Eshop\Application\Model\PaymentGateway: OxidSolutionCatalysts\TeleCash\Extension\Application\Model\PaymentGateway
OxidEsales\Eshop\Application\Model\PaymentList: OxidSolutionCatalysts\TeleCash\Extension\Application\Model\PaymentList
OxidEsales\Eshop\Application\Model\User: OxidSolutionCatalysts\TeleCash\Extension\Application\Model\User
OxidEsales\Eshop\Application\Model\State: OxidSolutionCatalysts\TeleCash\Extension\Application\Model\State
controllers:
AdminTeleCashJsonEndpoint: OxidSolutionCatalysts\TeleCash\Application\Controller\Admin\AdminTeleCashJsonEndpoint
OrderTeleCash: OxidSolutionCatalysts\TeleCash\Application\Controller\Admin\OrderTeleCash
FrontendTeleCashNotificationEndpoint: OxidSolutionCatalysts\TeleCash\Application\Controller\FrontendTeleCashNotificationEndpoint
events:
onActivate: '\OxidSolutionCatalysts\TeleCash\Core\ModuleEvents::onActivate'
onDeactivate: '\OxidSolutionCatalysts\TeleCash\Core\ModuleEvents::onDeactivate'
moduleSettings:
osctelecash_apimode:
group: osctelecash_api
type: select
value: sandbox
constraints:
- sandbox
- live
osctelecash_storeid:
group: osctelecash_api
type: str
value: '12022224803'
osctelecash_shared_secret:
group: osctelecash_api_frontend
type: str
value: g^Fj5@S9Cu
osctelecash_userid:
group: osctelecash_api_backend
type: str
value: WS12022224803._.1
osctelecash_basicauthpassword:
group: osctelecash_api_backend
type: str
value: GH9=/YN2My
osctelecash_certificateinstallationpassword:
group: osctelecash_api_backend
type: str
value: Je6Q|q$6YH
osctelecash_clientcertificateprivatekeypassword:
group: osctelecash_api_backend
type: str
value: ''
osctelecash_languages:
group: osctelecash_language
type: aarr
value:
de: de_DE
en: en_US
osctelecash_loglevel:
group: osctelecash_debug
type: select
value: debug
constraints:
- error
- info
- debug
osctelecash_clientcertificatep12file:
type: str
value: ws12022224803._.1.p12
osctelecash_clientcertificateprivatekeyfile:
type: str
value: ws12022224803._.1.key
osctelecash_trustanchorpemfile:
type: str
value: tlstrust.pem
30 changes: 16 additions & 14 deletions .github/oxid-esales/cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color

SCRIPT_DIR=$(dirname "$(readlink -f "$0")")

set -e # Exit on error
echo "Current directory: $(pwd)"
Expand All @@ -23,6 +23,13 @@ check_docker_compose() {
fi
}


"$SCRIPT_DIR/set_shop_url.sh" http://apache
echo "Setting module configuration..."
cp "$SCRIPT_DIR/config/osc_telecash.yaml" source/var/configuration/environment/shops/1/modules/osc_telecash.yaml
docker compose run php ./bin/oe-console oe:module:reset-configurations
docker compose run php ./bin/oe-console oe:module:activate osc_telecash

echo "Stopping running containers..."
docker compose down --remove-orphans || {
echo "Error stopping containers"
Expand Down Expand Up @@ -76,11 +83,17 @@ docker compose exec mysql sh -c 'until mysqladmin ping --silent; do sleep 2; don


echo "Running database scripts..."
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
chmod +x "$SCRIPT_DIR/db_backup.sh"
"$SCRIPT_DIR/db_backup.sh" backup
"$SCRIPT_DIR/db_backup.sh" import_test_db

echo "Validating docker-compose.yml..."
docker compose config || {
echo "Invalid docker-compose.yml. Restoring backup..."
mv docker-compose.yml.backup docker-compose.yml
exit 1
}

echo "Adding Cypress service..."
cat <<EOF >> docker-compose.yml
Expand All @@ -105,25 +118,14 @@ cat <<EOF >> docker-compose.yml
condition: service_healthy
EOF

"$SCRIPT_DIR/set_shop_url.sh" http://apache

echo "Validating docker-compose.yml..."
docker compose config || {
echo "Invalid docker-compose.yml. Restoring backup..."
mv docker-compose.yml.backup docker-compose.yml
exit 1
}

echo "Starting all containers..."
echo "Finally starting Cypress..."
docker compose up -d || {
echo "Error starting containers. Checking logs..."
docker compose logs
echo "Restoring backup..."
mv docker-compose.yml.backup docker-compose.yml
exit 1
}
EXIT_CODE=$?


echo "Waiting for services to stabilize..."
sleep 30
Expand Down

0 comments on commit 2a36cf9

Please sign in to comment.