Running Behat tests from CircleCI to a Platform.sh environment

Thumbnail
Thumbnail
Thumbnail
curl -sS https://platform.sh/cli/installer | php
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
PLATFORMSH_ENVIRONMENT=${CIRCLE_BRANCH}
else
PR_NUMBER="$(echo ${CIRCLE_PULL_REQUEST} | grep / | cut -d/ -f7-)"
PLATFORMSH_ENVIRONMENT="pr-${PR_NUMBER}"
fi
BEHAT_URL=$(~/.platformsh/bin/platform url --pipe -p 3eelsfv6keojw -e ${PLATFORMSH_ENVIRONMENT} | head -n 1 | tail -n 1)
export BEHAT_PARAMS="{\"extensions\" : {\"Behat\\\MinkExtension\" : {\"base_url\" : \"${BEHAT_URL}\"}}}"
#!/usr/bin/env bash
curl -sS https://platform.sh/cli/installer | php

if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
PLATFORMSH_ENVIRONMENT=${CIRCLE_BRANCH}
else
PR_NUMBER="$(echo ${CIRCLE_PULL_REQUEST} | grep / | cut -d/ -f7-)"
PLATFORMSH_ENVIRONMENT="pr-${PR_NUMBER}"
fi

BEHAT_URL=$(~/.platformsh/bin/platform url --pipe -p projectabc123 -e ${PLATFORMSH_ENVIRONMENT} | head -n 1 | tail -n 1)
export BEHAT_PARAMS="{\"extensions\" : {\"Behat\\\MinkExtension\" : {\"base_url\" : \"${BEHAT_URL}\"}}}"
- run:
name: Start PhantomJS
command: phantomjs --webdriver=4444
background: true
- run:
name: Get environment URL and run tests
command: |
. .circleci/prepare-behat.sh
./bin/behat -c behat.defaults.yml --debug
./bin/behat -c behat.defaults.yml
Thumbnail
platform environment:push -p projectabc123 -e ${PLATFORMSH_ENVIRONMENT}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store