}
),
(
+ ['-D', '--no-dump'],
+ {
+ 'action': 'store_false',
+ 'dest': 'faildump',
+ 'help': 'use the standard command without fancy screenshots or output to a directory'
+ }
+ ),
+ (
['-s', '--switch-completely'],
{
'action': 'store_true',
else:
prefix = None
+ outputDir = self.Wp.getExtraDir(M.get('identifier'), 'behat')
+ outpurUrl = self.Wp.getUrl(M.get('identifier'), extra='behat')
+
logging.info('Initialising Behat, please be patient!')
- M.initBehat(switchcompletely=args.switchcompletely, force=args.force, prefix=prefix)
+ M.initBehat(switchcompletely=args.switchcompletely, force=args.force, prefix=prefix, faildumppath=outputDir)
logging.info('Behat ready!')
# Preparing Behat command
if not (args.tags or args.testname) and nojavascript:
cmd.append('--tags ~@javascript')
+ if args.faildump:
+ cmd.append('--format="progress,progress,html,failed"')
+ cmd.append('--out=",{0}/progress.txt,{0}/status.html,{0}/failed.txt"'.format(outputDir))
+
cmd.append('--config=%s/behat/behat.yml' % (M.get('behat_dataroot')))
# Checking feature argument
# Running the tests
try:
+ if args.faildump:
+ logging.info('More output can be found at:\n %s\n %s', outputDir, outpurUrl)
process(cmd, M.path, None, None)
except KeyboardInterrupt:
pass
self.disable(M)
else:
+ if args.faildump:
+ logging.info('More output will be accessible at:\n %s\n %s', outputDir, outpurUrl)
if olderThan26:
logging.info('Launch PHP Server (or set $CFG->behat_switchcompletely to True):\n %s' % (phpCommand))
if seleniumCommand:
"""Initialise the PHPUnit environment"""
raise Exception('This method is deprecated, use phpunit.PHPUnit.init() instead.')
- def initBehat(self, switchcompletely=False, force=False, prefix=None):
+ def initBehat(self, switchcompletely=False, force=False, prefix=None, faildumppath=None):
"""Initialise the Behat environment"""
if self.branch_compare(25, '<'):
currentPrefix = self.get('behat_prefix')
behat_prefix = prefix or 'zbehat_'
+ # Set behat_faildump_path
+ currentFailDumpPath = self.get('behat_faildump_path')
+ if faildumppath and currentFailDumpPath != faildumppath:
+ self.updateConfig('behat_faildump_path', faildumppath)
+ else:
+ self.removeConfig('behat_faildump_path')
+
if not currentPrefix or force:
self.updateConfig('behat_prefix', behat_prefix)
elif currentPrefix != behat_prefix and self.get('dbtype') != 'oci':