43 lines
1.0 KiB
Bash
43 lines
1.0 KiB
Bash
#!/bin/bash
|
|
|
|
# Verificar si se pasaron los parámetros correctos
|
|
if [ "$#" -ne 3 ]; then
|
|
echo "Uso: $0 <id_tarea> <modulo> <e2e_path>"
|
|
exit 1
|
|
fi
|
|
|
|
# Asignar parámetros a variables
|
|
ID_TAREA=$1
|
|
MODULO=$2
|
|
E2E_PATH=$3
|
|
|
|
# Nombre de la rama
|
|
BRANCH_NAME="${ID_TAREA}_${MODULO}_missing_e2e"
|
|
|
|
# Paso 1: Crear la rama local a partir de dev
|
|
git checkout dev
|
|
git pull origin dev
|
|
git checkout -b "${BRANCH_NAME}"
|
|
|
|
# Paso 2: Copiar archivos al directorio destino
|
|
SOURCE_DIR="../salix/e2e/paths/${E2E_PATH}"
|
|
DEST_DIR="../test-processing/tests"
|
|
|
|
mkdir -p "${DEST_DIR}"
|
|
cp -r "${SOURCE_DIR}"/* "${DEST_DIR}"
|
|
|
|
# Paso 3: Ejecutar el comando node
|
|
cd ../test-processing
|
|
PROCESS_SCRIPT="../test-processing/index.js"
|
|
node "${PROCESS_SCRIPT}"
|
|
cd ../salix-front
|
|
|
|
# Paso 4: Copiar archivos procesados al destino Cypress
|
|
PROCESSED_DIR="../test-processing/processedTests"
|
|
CYPRESS_DEST="./test/cypress/integration/${MODULO}"
|
|
mkdir -p "${CYPRESS_DEST}"
|
|
cp -r "${PROCESSED_DIR}"/* "${CYPRESS_DEST}"
|
|
|
|
# Confirmación final
|
|
echo "Flujo completado exitosamente. Revisa los resultados."
|