Document correct Firefox/Selenium, use composer

Use composer to install Selenium, which allows us to just specify the latest stable release.
Add some notes around Travis compat, since that's bitten us before with core tests.
This commit is contained in:
Ingo Schommer 2017-01-05 22:10:21 +13:00
parent 9fc5bf254b
commit 6eedb7e6ea
1 changed files with 18 additions and 12 deletions

View File

@ -40,21 +40,16 @@ Note: The extension has only been tested with the `selenium2` Mink driver.
Simply [install SilverStripe through Composer](http://doc.silverstripe.org/framework/en/installation/composer).
Skip this step if adding the module to an existing project.
composer create-project silverstripe/installer my-test-project 3.1.x-dev
composer create-project silverstripe/installer my-test-project 3.x-dev
Switch to the newly created webroot, and add the SilverStripe Behat extension.
cd my-test-project
composer require "silverstripe/behat-extension:*"
composer require --dev silverstripe/behat-extension:"@stable"
Now get the latest Selenium2 server (requires Java):
Now get the latest Selenium2 server (requires [Java](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)):
wget http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar
On OSX, you can also use [Homebrew](http://brew.sh/): `brew install selenium-server-standalone`.
If you are having issues running Selenium with your browser please check
that you're on the [latest driver](https://code.google.com/p/selenium/downloads/list),
since the download link above might be out of date.
composer require --dev se/selenium-server-standalone:"2.x@stable"
Download the latest [Firefox ESR](https://www.mozilla.org/en-US/firefox/organizations/all/) (Extended Support Release).
It might be older than your currently installed Firefox.
@ -87,11 +82,11 @@ Firefox will already have started the update, so close and delete it. The settin
You can run the server locally in a separate Terminal session:
java -jar selenium-server-standalone-2.41.0.jar
vendor/bin/selenium-server-standalone
In some cases it may be necessary to start a specific version of firefox
In some cases it may be necessary to start a specific version of Firefox
java -jar selenium-server-standalone-2.41.0.jar -Dwebdriver.firefox.bin="/Applications/Firefox31.app/Contents/MacOS/firefox-bin"
vendor/bin/selenium-server-standalone -Dwebdriver.firefox.bin="/Applications/Firefox31.app/Contents/MacOS/firefox-bin"
### Running the Tests
@ -407,6 +402,17 @@ parameters to `dev/testsession/start`, and debug in the browser instead.
The `macgdbp` IDE key needs to match your `xdebug.idekey` php.ini setting.
### How do I set up continuous integration through Travis?
Check out the [travis.yml](https://github.com/silverstripe/silverstripe-framework/blob/master/.travis.yml)
in `silverstripe/framework` for a good example on how to set up Behat tests through [travis-ci.org](http://travis-ci.org).
Note that the [Travis CI Environment](https://docs.travis-ci.com/user/ci-environment#Firefox)
does not default to the latest [Firefox ESR](https://www.mozilla.org/en-US/firefox/organizations/all/) release, but an older version.
(31.0 in January 2017). You should try to run your tests locally with the same Firefox version,
and [download the correct Firefox release](https://ftp.mozilla.org/pub/firefox/releases/)).
Alternatively, [configure Travis](https://docs.travis-ci.com/user/firefox/) to use a newer version.
Don't forget to disable auto-updates in your Firefox settings.
### How do I use SauceLabs.com for remote Selenium2 testing?
Here's a sample profile for your `behat.yml`: