Commit 36444006 authored by Samuel Sirois's avatar Samuel Sirois
Browse files

Add a <tags> argument to the <test> command

We can now filter which scenarios are run by behat.
parent e79b5bdf
......@@ -6,6 +6,8 @@ This project adheres to http://semver.org/[Semantic Versioning].
== [Unreleased]
* Add a "tags" argument to the "test" command in order to limit which scenarios are run by behat.
=== Fixed
* Site name can now have whitespaces without breaking the shell execution string
......
......@@ -25,16 +25,19 @@ def init():
@task
def test():
def test(tags=''):
"""
Setup Behat and run the complete tests suite. Default output formatters: pretty and JUnit.
The JUnit report file is specified in the Behat configuration file. Default: tests/behat/out/behat.junit.xml.
:param tag Specific Behat tests tags to run.
:param tags Specific Behat tests tags to run.
"""
execute(behat.init)
execute(behat.run)
if not tags:
execute(behat.run)
else:
execute(behat.run, tags='{}'.format(tags))
......
......@@ -51,7 +51,7 @@ def install():
@task
@roles('docker')
def run():
def run(tags='~@wip&&~@disabled&&~@test'):
"""
Execute the complete Behat tests suite.
:param role Default 'role' where to run the task
......@@ -68,8 +68,5 @@ def run():
if not h.fab_exists(role, '{}/tests/behat/behat.yml'.format(workspace)):
init()
with h.fab_cd(role, '{}/tests/behat'.format(workspace)):
h.fab_run(role, 'behat --format junit --format pretty --tags "~@wip&&~@disabled&&~@test" --colors')
# To run behat with only one test for example, comment previous line
# and uncomment next one
# fab_run(role, 'behat --format pretty --tags "~@wip&&~@disabled&&@yourTest" --colors')
h.fab_run(role, 'behat --format junit --format pretty --tags "{}" --colors'.format(tags))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment