44 lines
1.1 KiB
Bash
44 lines
1.1 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
|
|
echo "git checkout dev"
|
|
echo "git pull origin dev"
|
|
echo "git checkout -b ${BRANCH_NAME}"
|
|
|
|
# Paso 2: Copiar archivos al directorio destino
|
|
SOURCE_DIR="../salix/e2e/paths/${E2E_PATH}"
|
|
DEST_DIR="../test-processing/tests"
|
|
|
|
echo "mkdir -p ${DEST_DIR}"
|
|
echo "cp -r ${SOURCE_DIR}/* ${DEST_DIR}"
|
|
|
|
# Paso 3: Ejecutar el comando node
|
|
echo "cd ../test-processing"
|
|
PROCESS_SCRIPT="../test-processing/index.js"
|
|
echo "node ${PROCESS_SCRIPT}"
|
|
echo "cd ../salix-front"
|
|
|
|
# Paso 4: Copiar archivos procesados al destino Cypress
|
|
PROCESSED_DIR="../test-processing/processedTests"
|
|
CYPRESS_DEST="./test/cypress/integration/${MODULO}"
|
|
|
|
echo "mkdir -p ${CYPRESS_DEST}"
|
|
echo "cp -r ${PROCESSED_DIR}/* ${CYPRESS_DEST}"
|
|
|
|
# Confirmación final
|
|
echo "Flujo completado (pendiente de ejecución real). Valida los comandos antes de proceder."
|