#!/bin/bash

echo "Tags $1"
echo "flag $2"
echo "type $3"

if [[ -n "$JOB_NAME" ]] && [[ -z "$CYPRESS_IS_ECS" ]]; then
  export CYPRESS_IS_JENKINS=true
  echo "Running tests locally on Jenkins"
fi

node framework/src/rerunPlugin.js run --feature-files "cypress/e2e/$2" --env TAGS="not @wip and $1"  --spec "cypress/e2e/$2/**/*.feature" --config specPattern="**/*.feature" --headless $3 $4
