Skip to content

Loading…

Added 'phing behat' command #24

Merged
merged 3 commits into from

2 participants

@chillu
SilverStripe Ltd. member

Relies on silverstripe/silverstripe-cms#236 and silverstripe/silverstripe-framework#948

I haven't added an automatic download or start of the selenium server runtime, since I think it adds too many assumptions: Projects can run their tests in a CI environment with a persistent Selenium server, or on SaaS like SauceLabs.

@sminnee sminnee merged commit 0f28a3d into silverstripe:3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 15, 2012
  1. @chillu

    Added 'phing behat' command

    chillu committed
  2. @chillu

    Added default behat.yml

    chillu committed
  3. @chillu
Showing with 45 additions and 2 deletions.
  1. +20 −0 behat.yml
  2. +25 −2 build.xml
View
20 behat.yml
@@ -0,0 +1,20 @@
+default:
+ extensions:
+
+ SilverStripe\BehatExtension\Extension:
+ framework_path: framework
+
+ Behat\MinkExtension\Extension:
+ # Adjust this to your own website URL.
+ # Uncomment, or set through environment variable:
+ # > export BEHAT_PARAMS="extensions[Behat\MinkExtension\Extension][base_url]=http://localhost/"
+ #
+ # base_url: http://localhost/
+
+ # TODO Dynamically set through LocatorProcessor
+ files_path: %behat.paths.base%/framework/tests/behat/features/files/
+ default_session: selenium2
+ javascript_session: selenium2
+ goutte: ~
+ selenium2:
+ browser: firefox
View
27 build.xml
@@ -133,6 +133,27 @@ Options:
<exec command="${phpunit_bin}" checkreturn="true" passthru="true" />
</target>
+ <target name="behat" if="basedir"
+ description="Runs behaviour tests through Behat, on the 'framework' and 'cms' modules (if available). Requires phpunit, composer and behat.">
+
+ <if>
+ <available file="${basedir}/framework/" type="dir" />
+ <then>
+ <echo msg="Testing 'framework' module" />
+ <exec command="vendor/bin/behat @framework" checkreturn="true" passthru="true" />
+ </then>
+ </if>
+
+ <if>
+ <available file="${basedir}/cms/" type="dir" />
+ <then>
+ <echo msg="Testing 'cms' module" />
+ <exec command="vendor/bin/behat @cms" checkreturn="true" passthru="true" />
+ </then>
+ </if>
+
+ </target>
+
<target name="tag" if="basedir"
description="Creates a new git tag in all the nested working copies (optionally pushes the created tag)"
depends="_gitRepositories,_gitBinary">
@@ -247,7 +268,8 @@ Options:
<exclude name="_ss_environment.php" />
<exclude name="*.tar.gz" />
<exclude name="*.zip" />
-
+ <exclude name="behat.yml" />
+ <exclude name="composer.*" />
</fileset>
<fileset dir="${basedir}">
<include name="assets/Uploads" />
@@ -278,7 +300,8 @@ Options:
<exclude name="_ss_environment.php" />
<exclude name="*.tar.gz" />
<exclude name="*.zip" />
-
+ <exclude name="behat.yml" />
+ <exclude name="composer.*" />
<exclude name="cms/**" />
</fileset>
<fileset dir="${basedir}">
Something went wrong with that request. Please try again.