Comparing version 0.0.1-beta2 to 0.0.1-beta3
{ | ||
"description": "test runner for conco.co", | ||
"name": "conco", | ||
"version": "0.0.1-beta2", | ||
"version": "0.0.1-beta3", | ||
"bin": { | ||
@@ -18,6 +18,9 @@ "conco": "./src/bin/conco" | ||
"devDependencies": { | ||
"chromedriver": "*", | ||
"conco-nightwatch": "0.0.1-beta1", | ||
"conco-saucelabs-plugin": "0.0.1-beta1", | ||
"config": "*", | ||
"nightwatch": "*", | ||
"selenium-server": "*", | ||
"chromedriver": "*" | ||
"request": "^2.88.0", | ||
"selenium-server": "*" | ||
}, | ||
@@ -24,0 +27,0 @@ "main": "index.js", |
@@ -11,2 +11,3 @@ "use strict"; | ||
let template = {}; | ||
let frameworkArgs = {}; | ||
@@ -21,13 +22,10 @@ if (innerArgs["config"]) { | ||
} | ||
// merge other innerArgs | ||
let options = _.extend({}, template, innerArgs); | ||
// special handler for tags, string,string,string => [string, string, string] | ||
if (options.tags && options.tags.length > 0) { | ||
options.tags = options.tags.split(","); | ||
if (innerArgs["framework_config"]) { | ||
// assign framework_config to config | ||
frameworkArgs = require(path.resolve(process.cwd(), innerArgs["framework_config"])); | ||
} | ||
if (options.browsers && options.browsers.length > 0) { | ||
options.browsers = options.browsers.split(","); | ||
} | ||
// merge other innerArgs | ||
let options = _.extend({}, template, innerArgs, frameworkArgs); | ||
@@ -34,0 +32,0 @@ // omit all undefined options |
@@ -14,3 +14,2 @@ | ||
this.options = options; | ||
console.log(options.framework) | ||
const FrameworkProxy = require(options.framework); | ||
@@ -24,6 +23,3 @@ | ||
// get tests from actual framework | ||
const tests = this.GetTests(this.options); | ||
log.log("Runner", `Found ${tests.length} tests`); | ||
return tests; | ||
return this.GetTests(this.options); | ||
} | ||
@@ -30,0 +26,0 @@ |
@@ -33,9 +33,3 @@ "use strict"; | ||
"demand": false | ||
}, | ||
"nightwatch_config": { | ||
"alias": "", | ||
"describe": "Config file location for conco nightwatch framework", | ||
"type": "string", | ||
"demand": false | ||
} | ||
}; |
@@ -13,9 +13,9 @@ "use strict"; | ||
const { log } = require("../../log"); | ||
class Nightwatch { | ||
constructor(options) { | ||
this.executable = "./node_modules/.bin/nightwatch"; | ||
this.frameworkConfig = options.framework_config; | ||
this.nightwatchConfigPath = options.nightwatch_config; | ||
this.nightwatchConfigPath = require(path.resolve(process.cwd(), this.frameworkConfig)).nightwatch_config; | ||
this.args = []; | ||
@@ -41,7 +41,2 @@ this.browsers = options.browsers; | ||
_.each(addons, (addon) => { | ||
// append info from addon to nightwatchConfig | ||
config = _.merge(config, addon); | ||
}); | ||
if (config.selenium) { | ||
@@ -57,2 +52,9 @@ // modify selenium port | ||
_.each(addons, (addon) => { | ||
log.debug("Nightwatch", `Addon ${addon.name} detected, merging addon items into test_settings`); | ||
// merge info from addon to nightwatchConfig | ||
config.test_settings = _.merge(config.test_settings, addon.items); | ||
log.debug("Nightwatch", `Merged addon from plugin ${addon.name} to framework Nightwatch: ${JSON.stringify(addon.items)}`); | ||
}); | ||
// write temp file | ||
@@ -59,0 +61,0 @@ mkdirp.sync(path.resolve(process.cwd(), util.format("./temp/%d", config.selenium.port))); |
@@ -13,4 +13,3 @@ const path = require("path"); | ||
let tests = []; | ||
// filter all tests | ||
console.log(options) | ||
// filter all tests | ||
const frameworkConfig = require(path.resolve(process.cwd(), options.framework_config)) | ||
@@ -39,3 +38,3 @@ const srcFolders = require(path.resolve(process.cwd(), frameworkConfig.nightwatch_config))["src_folders"]; | ||
log.log("Nightwatch", `Finished walking for ${path.resolve(current, srcFolder)}`); | ||
log.log("Nightwatch", `Finished walking for ${path.resolve(current, srcFolder)}, ${tempTests.length} tests in total`); | ||
}); | ||
@@ -59,5 +58,14 @@ | ||
if (frameworkConfig.browsers) { | ||
// // special handler for tags, string,string,string => [string, string, string] | ||
if (options.tags && options.tags.length > 0) { | ||
options.tags = options.tags.split(","); | ||
} | ||
if (options.browsers && options.browsers.length > 0) { | ||
options.browsers = options.browsers.split(","); | ||
} | ||
if (options.browsers) { | ||
// clone tests according to --browsers | ||
_.forEach(frameworkConfig.browsers, (browser) => { | ||
_.forEach(options.browsers, (browser) => { | ||
const temp = _.cloneDeep(tempTests); | ||
@@ -69,2 +77,6 @@ tests = _.concat(tests, _.map(temp, (t) => { | ||
}); | ||
log.log("Nightwatch", `Found ${tests.length} test(s)`); | ||
} else { | ||
log.err("Nightwatch", "Nightwatch test requires at least one browser"); | ||
} | ||
@@ -71,0 +83,0 @@ |
@@ -6,5 +6,8 @@ "use strict"; | ||
this.events = { | ||
// stage: function () {}, | ||
// run: function () {}, | ||
// end: function () {} | ||
stage_runner: this.stageRunner, | ||
run_runner: this.runRunner, | ||
end_runner: this.endRunner, | ||
stage_tester: this.stageTester, | ||
run_tester: this.runTester, | ||
end_tester: this.endTester | ||
} | ||
@@ -11,0 +14,0 @@ } |
@@ -20,14 +20,11 @@ "use strict"; | ||
// load plugin config | ||
const j = P.name; | ||
const config = _.concat(j.split(" "), "config").join("_"); | ||
const pOpts = {}; | ||
_.forEach(P.args, (v, k) => { | ||
if (options[k]) { | ||
pOpts[k] = options[k]; | ||
} | ||
}); | ||
// load plugin config | ||
if (options[config]) { | ||
_.extend(pOpts, require(path.resolve(process.cwd(), options[config]))); | ||
} | ||
this.plugins.push(new P.plugin(pOpts)); | ||
const Event = P.plugin; | ||
this.plugins.push(new Event(pOpts)); | ||
log.log( | ||
@@ -34,0 +31,0 @@ "Plugin Manager", |
@@ -39,2 +39,6 @@ "use strict"; | ||
const addons = await this.pluginManager.emit("stage_tester"); | ||
_.forEach(addons, (addon) => | ||
log.debug(`Tester ${this.index + 1}`, `Got addons from ${addon.name}: ${JSON.stringify(addon.items)}`)); | ||
this.framework = this.frameworkProxy.configure(addons); | ||
@@ -54,3 +58,2 @@ } catch (e) { | ||
try { | ||
self.testProcess = fork( | ||
@@ -57,0 +60,0 @@ self.framework.executable, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
13
35662
7
28
1084