Skip to content

Instantly share code, notes, and snippets.

@bregenspan
Created May 8, 2014 22:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bregenspan/b62c138cdec7042eaa2e to your computer and use it in GitHub Desktop.
Save bregenspan/b62c138cdec7042eaa2e to your computer and use it in GitHub Desktop.
Testing a Circle CI build with Sauce Labs
## Customize the test machine
machine:
environment:
SAUCEUSER: [USERNAME HERE]
SAUCEKEY: [KEY HERE]
dependencies:
post:
- wget https://d2nkw87yt5k0to.cloudfront.net/downloads/sc-latest-linux.tar.gz && tar -xvf sc-latest-linux.tar.gz
test:
override:
# Start Sauce Connect
- cd sc-*-linux && ./bin/sc -u ${SAUCEUSER} -k ${SAUCEKEY}:
background: true
# Start whatever server you need here
# - [SOME COMMAND HERE]:
# background: true
# Run tests, after waiting for server to start
- test_wrapper.sh
echo "Waiting for local test server to become available..."
curl http://[YOUR_LOCAL_SERVER_HOSTNAME] > /dev/null 2>&1
while [ $? -ne 0 ]; do
sleep 3
curl [http://YOUR_LOCAL_SERVER_HOSTNAME] > /dev/null 2>&1
done
echo "Waiting 10 seconds..."
sleep 10
echo "Running tests..."
grunt selenium
@bhgames
Copy link

bhgames commented Jun 19, 2014

How do you specify which browser sauce labs will use? Normally I specify it using the selenium driver. What if selenium doesnt support a browser that sauce does? Very confused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment