From 34b60e43190a0cc29e8359187bacfb7752928c9e Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 5 Nov 2013 09:07:41 +0800 Subject: [PATCH] Add support for running behat tests by name --- lib/commands/behat.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/commands/behat.py b/lib/commands/behat.py index e76fcd9..d0d9a77 100644 --- a/lib/commands/behat.py +++ b/lib/commands/behat.py @@ -57,6 +57,13 @@ class BehatCommand(Command): } ), ( + ['-n', '--name'], + { + 'metavar': 'name', + 'help': 'Only execute the feature elements which match part of the given name or regex.' + } + ), + ( ['-t', '--tags'], { 'metavar': 'tags', @@ -192,8 +199,13 @@ class BehatCommand(Command): cmd = ['vendor/bin/behat'] if args.tags: cmd.append('--tags=%s' % (args.tags)) - elif nojavascript: + + if args.name: + cmd.append('--name=%s' % (args.name)) + + if not (args.tags or args.name) and nojavascript: cmd.append('--tags ~@javascript') + cmd.append('--config=%s/behat/behat.yml' % (M.get('behat_dataroot'))) # Checking feature argument -- 2.11.0