Finally, we are able to run our tests! Add the cucumber-js command just prior to the kill command:
npx cucumber-js spec/cucumber/features --require-module @babel/register --require spec/cucumber/steps
Your final scripts/e2e.test.sh script should look like this (comments removed):
#!/usr/bin/env bashif ss -lnt | grep -q :$SERVER_PORT; then echo "Another process is already listening to port $SERVER_PORT" exit 1;fiRETRY_INTERVAL=${RETRY_INTERVAL:-0.2}if ! systemctl is-active --quiet elasticsearch.service; then sudo systemctl start elasticsearch.service until curl --silent $ELASTICSEARCH_HOSTNAME:$ELASTICSEARCH_PORT -w "" -o /dev/null; do sleep $RETRY_INTERVAL donefiyarn run serve &until ss -lnt | grep -q :$SERVER_PORT; do ...