execute method

Future<bool> execute()

Executes the tests.

Implementation

Future<bool> execute() async {
  if (parsedArgs.help) {
    return showHelp();
  }

  prepare();

  var testArgs = resolveTestArgs();

  await bonesUICompiler.compile();

  var configurationPath = resolveTestConfigurationPath(parsedArgs);

  registerPlatformPlugin([
    Runtime.chrome,
    Runtime.firefox,
    Runtime.safari,
  ], () => BonesUIPlatform.create(bonesUICompiler, showUI: showUI));

  print(
      '\n════════════════════════════════════════════════════════════════════════════════');
  print(
      '\n** Show UI: $showUI ${headless ? '(headless)' : '(showing browser)'}');

  final enableDeferredLibraries = this.enableDeferredLibraries;
  if (enableDeferredLibraries != null) {
    print(
        '** Deferred libraries: ${enableDeferredLibraries ? 'enabled' : 'disabled'}');
  }

  print('\n** Test ARGS: ${testArgs.join(' ')}');
  print('\n** Executing tests...\n');

  testArgs.insertAll(0, [
    '--configuration',
    configurationPath,
  ]);

  await test_executable.runTests(testArgs);
  test_executable.completeShutdown();

  _processJsonReportFile();

  bonesUICompiler.close();

  return true;
}