diff options
author | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-24 12:13:30 +0400 |
---|---|---|
committer | diosmosis <benakamoorthi@fastmail.fm> | 2014-03-24 12:13:30 +0400 |
commit | faa4f1c35323ccccda751cebfce116fbade80d25 (patch) | |
tree | 245e45199d29c3bbda557360d7247ba6e9442dfe /tests/lib | |
parent | dba4664cd738096603583eb912d604b23f09c345 (diff) |
Allow plugin UI tests to have name different than plugin. Added --plugin option to screenshot test runner that filters tests based on their location.
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/screenshot-testing/support/app.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js index fbbcd20722..71f1c73ff2 100644 --- a/tests/lib/screenshot-testing/support/app.js +++ b/tests/lib/screenshot-testing/support/app.js @@ -46,6 +46,7 @@ Application.prototype.printHelpAndExit = function () { console.log(" --persist-fixture-data: Persists test data in a database and does not execute tear down."); console.log(" After the first run, the database setup will not be called, which"); console.log(" Makes running tests faster."); + console.log(" --plugin=name: Runs all tests for a plugin."); console.log(" --keep-symlinks: If supplied, the recursive symlinks created in tests/PHPUnit/proxy"); console.log(" aren't deleted after tests are run. Specify this option if you'd like"); console.log(" to view pages phantomjs captures in a browser."); @@ -103,6 +104,12 @@ Application.prototype.loadTestModules = function () { }); } + if (options.plugin) { + mocha.suite.suites = mocha.suite.suites.filter(function (suite) { + return suite.baseDirectory.match(new RegExp("\/plugins\/" + options.plugin + "\/")); + }); + } + // configure suites (auto-add fixture setup/teardown) mocha.suite.suites.forEach(function (suite) { var fixture = typeof suite.fixture === 'undefined' ? 'UITestFixture' : suite.fixture; |