engine/runner.js
function handleDirConfig(dir, files, parentDirConfig) {
  let config;
  if (files.includes(gT.engineConsts.dirConfigName)) {
    config = nodeUtils.requireEx(path.join(dir, gT.engineConsts.dirConfigName), true).result;
  } else {
    config = {};
  }

  // TODO: some error when suite configs or root configs is met in wrong places.
  _.pullAll(files, [
    gT.engineConsts.suiteConfigName,
    gT.engineConsts.dirConfigName,
    gT.engineConsts.suiteResDirName,
    gT.engineConsts.rootResDirName,
    gT.engineConsts.dirRootConfigName,
    gT.engineConsts.suiteRootConfigName,
  ]);

  if (config.require) {
    nodeUtils.requireArray(config.require);
  }

  const dirCfg = _.merge(_.cloneDeep(parentDirConfig), config);

  if (dirCfg.ignoreNames) {
    _.pullAll(files, dirCfg.ignoreNames);
  }

  if (config.browserProfileDir) {
    dirCfg.browserProfilePath = path.join(gIn.suite.browserProfilesPath, config.browserProfileDir);
  } else {
    dirCfg.browserProfilePath = gT.defaultRootProfile;
  }

  gIn.tracer.msg2(`Profile path: ${dirCfg.browserProfilePath}`);

  return dirCfg;
}
function handleDirConfig(dir, files, parentDirConfig) {
  let config;
  if (files.includes(gT.engineConsts.dirConfigName)) {
    config = nodeUtils.requireEx(path.join(dir, gT.engineConsts.dirConfigName), true).result;
  } else {
    config = {};
  }

  // TODO: some error when suite configs or root configs is met in wrong places.
  _.pullAll(files, [
    gT.engineConsts.suiteConfigName,
    gT.engineConsts.dirConfigName,
    gT.engineConsts.suiteResDirName,
    gT.engineConsts.rootResDirName,
    gT.engineConsts.dirRootConfigName,
    gT.engineConsts.suiteRootConfigName,
  ]);

  if (config.require) {
    nodeUtils.requireArray(config.require);
  }

  const dirCfg = _.merge(_.cloneDeep(parentDirConfig), config);

  if (dirCfg.ignoreNames) {
    _.pullAll(files, dirCfg.ignoreNames);
  }

  if (config.browserProfileDir) {
    dirCfg.browserProfilePath = path.join(gIn.suite.browserProfilesPath, config.browserProfileDir);
  } else {
    dirCfg.browserProfilePath = gT.defaultRootProfile;
  }

  gIn.tracer.msg2(`Profile path: ${dirCfg.browserProfilePath}`);

  return dirCfg;
}
function handleDirConfig ( dir , files , parentDirConfig ) { let config ; if ( files . includes ( gT . engineConsts . dirConfigName ) ) { config = nodeUtils . requireEx ( path . join ( dir , gT . engineConsts . dirConfigName ) , true ) . result ; } else { config = { } ; } // TODO: some error when suite configs or root configs is met in wrong places. _ . pullAll ( files , [ gT . engineConsts . suiteConfigName , gT . engineConsts . dirConfigName , gT . engineConsts . suiteResDirName , gT . engineConsts . rootResDirName , gT . engineConsts . dirRootConfigName , gT . engineConsts . suiteRootConfigName , ] ) ; if ( config . require ) { nodeUtils . requireArray ( config . require ) ; } const dirCfg = _ . merge ( _ . cloneDeep ( parentDirConfig ) , config ) ; if ( dirCfg . ignoreNames ) { _ . pullAll ( files , dirCfg . ignoreNames ) ; } if ( config . browserProfileDir ) { dirCfg . browserProfilePath = path . join ( gIn . suite . browserProfilesPath , config . browserProfileDir ) ; } else { dirCfg . browserProfilePath = gT . defaultRootProfile ; } gIn . tracer . msg2 ( ` ${ dirCfg . browserProfilePath } ` ) ; return dirCfg ; }
Removes config from files. Merges current config to parrent config.
Also removes names specified by config.ignoreNames.
@param {String} dir
@param {Array<String>} files
@param {Object} parentDirConfig
@return {Object} directory config.
Removes config from files . Merges current config to parrent config . Also removes names specified by config . ignoreNames .