Skip to content

Commit ceae4f0

Browse files
committed
Added command line argument at seleniumbender.py,
to target a specific common test if used.
1 parent e357e49 commit ceae4f0

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

bin/seleniumbender.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ def __init__(self, url, environment):
2121
'.gitignore'
2222
]
2323

24-
def run(self, operation, libraries=None):
24+
def run(self, operation, test=None, libraries=None):
2525
if operation == 'common':
26-
self.common()
26+
self.common(test)
2727
elif operation == 'libraries':
2828
self.libraries()
2929
elif operation == 'examples':
@@ -79,8 +79,11 @@ def send_mail_with_logs(self, identifier):
7979
def create_command(self, test_directory, *extra_arguments):
8080
return ['tox', 'tests/' + test_directory, '--', '--url={}'.format(TARGETS[self.url])] + list(extra_arguments)
8181

82-
def common(self, identifier='common'):
83-
command = self.create_command('common', '--plugin')
82+
def common(self, test, identifier='common'):
83+
test_directory = 'common'
84+
if test:
85+
test_directory = os.path.join(test_directory, test)
86+
command = self.create_command(test_directory, '--plugin')
8487
retval = self.run_command(command)
8588
if retval != 0:
8689
self.send_mail_no_logs(identifier)
@@ -189,9 +192,12 @@ def main():
189192
parser.add_argument('--config',
190193
default='config.cfg',
191194
help='Configuration file to load (default: config.cfg).')
195+
parser.add_argument('--test',
196+
default=None,
197+
help='Common test to run when using operation: common (default: all)')
192198
parser.add_argument('--libraries',
193199
default=None,
194-
help='Libraries to test (comma separated machine names) when using option: target')
200+
help='Libraries to test (comma separated machine names) when using operation: target')
195201
parser.add_argument('--saucelabs',
196202
action='store_true',
197203
default=False,
@@ -214,6 +220,8 @@ def main():
214220
parser.print_help()
215221
sys.exit()
216222

223+
test = args.test
224+
217225
libraries = args.libraries
218226
if operation == 'target' and not libraries:
219227
print('No target libraries specified!\n')
@@ -258,7 +266,7 @@ def main():
258266

259267
# Run tests
260268
tests = Tests(target, config)
261-
tests.run(operation, libraries=libraries)
269+
tests.run(operation, test=test, libraries=libraries)
262270

263271
if __name__ == '__main__':
264272
main()

0 commit comments

Comments
 (0)