Skip to content

Instantly share code, notes, and snippets.

@shs96c
Last active October 16, 2017 09:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shs96c/ced5eaa7ddc1777e0b9f6030d7a9e4c8 to your computer and use it in GitHub Desktop.
Save shs96c/ced5eaa7ddc1777e0b9f6030d7a9e4c8 to your computer and use it in GitHub Desktop.
Running WPT WebDriver Tests with geckodriver

I'm assuming you're on a recent version of OS X with a blazing fast Net connection. These instructions are based on those given by @AutomatedTester

We begin by checking out and building geckodriver. Note: I've had conflicting suggestions from Mozillians about enabling artifact builds. For now, I've disabled them

hg clone https://hg.mozilla.org/mozilla-central/
cd mozilla-central
./mach bootstrap 
# Add this to enable (faster!) artifact builds
#echo "ac_add_options --enable-artifact-builds" >> .mozconfig
echo "ac_add_options --enable-geckodriver" >> .mozconfig
./mach configure
./mach build testing/geckodriver

At this point, geckodriver is meant to build quietly and seamlessly. On my machine it's located at ./obj-x86_64-apple-darwin16.6.0/testing/geckodriver/x86_64-apple-darwin/release/geckodriver. Copy that to "somewhere" on your $PATH. If it doesn't compile, we can cheat...:

cd testing/geckodriver
cargo build
cp target/debug/geckodriver $HOME/bin

I'll assume you have $HOME/bin on your $PATH.

Download Firefox Nightly and stick it somewhere handy. I renamed it to "Firefox" in my /Applications directory because that makes life easy for me.

git clone --depth 1 https://github.com/w3c/web-platform-tests.git
cd web-platform-tests
brew install nss
PATH=/usr/local/opt/nss/bin:$PATH ./wpt run --log-wptreport=FF58.json --binary /Applications/Firefox.app/Contents/MacOS/firefox firefox /webdriver

The WebDriver tests should now run. Well done.

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