#!/bin/bash
cd client/

if [[ -z "${CYPRESS_API_URL+x}" ]]; then
  echo "CYPRESS_API_URL not set"
  exit 1
fi
if [[ -z "${CYPRESS_RECORD_KEY+x}" ]]; then
  echo "CYPRESS_RECORD_KEY not set"
  exit 2
fi

now=`date +%F-%T`
build_id="skillbox-build-${now}"

#CYPRESS_API_URL="https://iterativ-cypress-director.herokuapp.com/"
#cmd=""

cmd() {
  npx cy2 run --parallel --record  --config-file cypress.frontend.json --ci-build-id ${build_id}
}

#cmd

for number in {1..6}
do
  echo "running command ${number}"
  cmd &
done

wait
#exit 0
