* [functional_test_runner] replace functional testing tools with custom/pluggable solution
* [functional_test_runner] Convert unit tests to commonjs format
* [functional_test_runner] Fix dashboard test in wrong mode
* [functional_test_runner] Add dashboardLandingPage test subject
* [functional_test_runner] Get Visualize page object
* [functional_test_runner] Fix outdated references
* [functional_test_runner] Fix more outdated refs
* [functional_test_runner] Remove duplicate tests
* [functional_test_runner] Improve test readability
* [functional_test_runner] 😞 So many duplicate methods
* [functional_test_runner] Move mgmt `before` outside toplevel describe
* [functional_test_runner] Settings page obj missing methods
* [functional_test_runner] Add improvements from @gammon
* [functional_test_runner] Fix return statements in async funcs
* [functional_test_runner] Move before() to correct scope
* [functional_test_runner] Add after() hooks to remove index patterns
* [functional_test_runner] Attempt to fix vertical bar chart tests
* [functional_test_runner] Clean up
* [functional_test_runner] Reinstate unit tests
* [functional_test_runner] Set default loglevel back to info
* [functional_test_runner] Replace `context`s with `describe`s
* [functional_test_runner] Better error handling
* [functional_test_runner] Add in new Tile Map tests
* Incorporate changes from master
* [functional_test_runner] validate that every test file has a single top-level suite
* Update contributing doc with link to full doc
* [docs] Spelling and grammar fixes
* docs: writing and running functional tests
* [docs] Move plugin doc to plugin area
* [docs] Housekeeping. Doc in wrong place
* [docs] Remove dup doc file
* [grunt] Only run mocha_setup when running tests, not every grunt task
107 lines
2.3 KiB
JavaScript
107 lines
2.3 KiB
JavaScript
import _, { keys } from 'lodash';
|
|
|
|
import visualRegression from '../utilities/visual_regression';
|
|
|
|
module.exports = function (grunt) {
|
|
grunt.registerTask(
|
|
'test:visualRegression:buildGallery',
|
|
'Compare screenshots and generate diff images.',
|
|
function () {
|
|
const done = this.async();
|
|
visualRegression.run(done);
|
|
}
|
|
);
|
|
|
|
grunt.registerTask('test:server', [
|
|
'checkPlugins',
|
|
'esvm:test',
|
|
'simplemocha:all',
|
|
'esvm_shutdown:test',
|
|
]);
|
|
|
|
grunt.registerTask('test:browser', [
|
|
'checkPlugins',
|
|
'run:testServer',
|
|
'karma:unit',
|
|
]);
|
|
|
|
grunt.registerTask('test:browser-ci', () => {
|
|
const ciShardTasks = keys(grunt.config.get('karma'))
|
|
.filter(key => key.startsWith('ciShard-'))
|
|
.map(key => `karma:${key}`);
|
|
|
|
grunt.log.ok(`Running UI tests in ${ciShardTasks.length} shards`);
|
|
|
|
grunt.task.run([
|
|
'run:testServer',
|
|
...ciShardTasks
|
|
]);
|
|
});
|
|
|
|
grunt.registerTask('test:coverage', [ 'run:testCoverageServer', 'karma:coverage' ]);
|
|
|
|
grunt.registerTask('test:quick', [
|
|
'test:server',
|
|
'test:ui',
|
|
'test:jest',
|
|
'test:browser',
|
|
'test:api'
|
|
]);
|
|
|
|
grunt.registerTask('test:dev', [
|
|
'checkPlugins',
|
|
'run:devTestServer',
|
|
'karma:dev'
|
|
]);
|
|
|
|
grunt.registerTask('test:ui', [
|
|
'checkPlugins',
|
|
'esvm:ui',
|
|
'run:testUIServer',
|
|
'clean:screenshots',
|
|
'functionalTestRunner',
|
|
'esvm_shutdown:ui',
|
|
'stop:testUIServer'
|
|
]);
|
|
|
|
grunt.registerTask('test:ui:server', [
|
|
'checkPlugins',
|
|
'esvm:ui',
|
|
'run:testUIDevServer:keepalive'
|
|
]);
|
|
|
|
grunt.registerTask('test:ui:runner', [
|
|
'checkPlugins',
|
|
'clean:screenshots',
|
|
'functionalTestRunner'
|
|
]);
|
|
|
|
grunt.registerTask('test:api', [
|
|
'esvm:ui',
|
|
'run:apiTestServer',
|
|
'simplemocha:api',
|
|
'esvm_shutdown:ui',
|
|
'stop:apiTestServer'
|
|
]);
|
|
|
|
grunt.registerTask('test:api:server', [
|
|
'esvm:ui',
|
|
'run:apiTestServer:keepalive'
|
|
]);
|
|
|
|
grunt.registerTask('test:api:runner', [
|
|
'simplemocha:api'
|
|
]);
|
|
|
|
grunt.registerTask('test', subTask => {
|
|
if (subTask) grunt.fail.fatal(`invalid task "test:${subTask}"`);
|
|
|
|
grunt.task.run(_.compact([
|
|
!grunt.option('quick') && 'eslint:source',
|
|
'licenses',
|
|
'test:quick'
|
|
]));
|
|
});
|
|
|
|
grunt.registerTask('quick-test', ['test:quick']); // historical alias
|
|
};
|