haven-cypress-integration 2.1.5 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haven-cypress-integration",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Seamless Cypress integration with HAVEN test case management",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -245,11 +245,20 @@ if [ -n "$E2E_COMMAND" ]; then
245
245
 
246
246
  # If E2E_COMMAND contains "cypress run", inject --env args
247
247
  if echo "$E2E_COMMAND" | grep -q "cypress run"; then
248
- # Replace "cypress run" with "cypress run --env <args>"
249
- MODIFIED_COMMAND="${E2E_COMMAND/cypress run/cypress run --env ${FINAL_ENV_ARGS}}"
250
- echo "Modified command with env args:"
251
- echo "$MODIFIED_COMMAND"
252
- eval "$MODIFIED_COMMAND" 2>&1 | tee ${RESULTS_DIR}/logs.txt
248
+ # Build the full command with proper quoting for special characters
249
+ echo "Final env args: $FINAL_ENV_ARGS"
250
+ echo "Running: npm install && cypress run --env '$FINAL_ENV_ARGS'"
251
+
252
+ # Execute npm install first, then cypress run with env args
253
+ eval "npm install" 2>&1 | tee ${RESULTS_DIR}/logs.txt
254
+ INSTALL_EXIT=$?
255
+
256
+ if [ $INSTALL_EXIT -eq 0 ]; then
257
+ echo "npm install succeeded, running cypress..."
258
+ npx cypress run --env "$FINAL_ENV_ARGS" 2>&1 | tee -a ${RESULTS_DIR}/logs.txt
259
+ else
260
+ echo "npm install failed with exit code $INSTALL_EXIT"
261
+ fi
253
262
  else
254
263
  # For npm scripts like "npm run test:cy", env vars are already exported with CYPRESS_ prefix
255
264
  echo "Note: Custom command doesn't contain 'cypress run'. CYPRESS_* env vars exported as fallback."