Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions mdk/commands/behat.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ class BehatCommand(Command):
'help': 'outputs the output from selenium in the same window'
}
),
(
['-x', '--xvfb'],
{
'action': 'store_true',
'dest': 'xvfb',
'help': 'Use XVFB when starting selenium'
}
),
(
['-X', '--no-xvfb'],
{
'action': 'store_true',
'dest': 'noxvfb',
'help': 'Do not use XVFB when starting selenium'
}
),
(
['name'],
{
Expand Down Expand Up @@ -223,6 +239,14 @@ def run(self, args):
if seleniumPath:
seleniumCommand = '%s -jar %s' % (self.C.get('java'), seleniumPath)

usexvfb = ((self.C.get('xvfb') and not args.noxvfb) or
(not self.C.get('xvfb') and args.xvfb and not args.noxvfb))
if usexvfb:
xvfbPath = self.C.get('xvfb-run')
seleniumCommand = '%s %s' % (xvfbPath, seleniumCommand)
if not os.path.isfile(xvfbPath):
raise Exception('xvfb-run command could not be found in the specified location %s' % (xvfbPath));

olderThan27 = M.branch_compare(27, '<')

if args.run:
Expand Down
6 changes: 6 additions & 0 deletions mdk/config-dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@
"lessc": "/usr/local/bin/lessc",
// Path to shifter
"shifter": "/usr/bin/shifter",
// Path to xvfb-run
"xvfb-run": "/usr/bin/xvfb-run",

// Whether to use xvfb by default
"xvfb": false,

// Path to your favourite editor. Set to null to guess it from the System environment.
"editor": null,

Expand Down