Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
feat(webdrive): Support geckodriver and chromedriver
Browse files Browse the repository at this point in the history
  • Loading branch information
hypery2k committed Feb 9, 2017
1 parent c034ece commit b7fa251
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -24,7 +24,9 @@
],
"dependencies": {
"async": "^0.9.0",
"galenframework": "2.3.2"
"chromedriver": "^2.27.2",
"galenframework": "2.3.2",
"geckodriver": "^1.3.0"
},
"devDependencies": {
"conventional-changelog-cli": "1.2.0",
Expand Down
18 changes: 17 additions & 1 deletion tasks/galen.js
Expand Up @@ -41,6 +41,18 @@ var fs = require('fs'),
childprocess = require('child_process'),
async = require('async');

function resolveNodePath(module, subpath) {
var filename = path.resolve(__dirname + '/../node_modules/' + module + '/' + subpath);
try {
fs.statSync(filename);
}
catch (err) {
filename = path.resolve(__dirname + '/../../../node_modules/' + module + '/' + subpath);
}
return filename;
}


var galenTasks = function (grunt) {
grunt.registerMultiTask('galen', 'Run Galen tests.', function () {
/*
Expand Down Expand Up @@ -288,6 +300,8 @@ var galenTasks = function (grunt) {
var junitReport = options.junitreport === true ? '--junitreport ' + (options.junitReportDest || '') : '';
var jsonReport = options.jsonreport === true ? '--jsonreport ' + (options.jsonReportDest || '') : '';
var testngReport = options.testngReport === true ? '--testngreport ' + (options.testngReportDest || '') : '';
var chromedriver = '-Dwebdriver.chrome.driver=' + resolveNodePath('chromedriver', 'bin/chromedriver');
var geckodriver = '-Dwebdriver.gecko.driver=' + resolveNodePath('geckodriver', 'bin/geckodriver');

var resultPadding = 0;
testFiles.forEach(function (filePath) {
Expand Down Expand Up @@ -320,7 +334,9 @@ var galenTasks = function (grunt) {
htmlReport,
testngReport,
junitReport,
jsonReport
jsonReport,
chromedriver,
geckodriver
].join(' ');
debug('Starting galen with command: ' + command);
var padding = 4;
Expand Down

0 comments on commit b7fa251

Please sign in to comment.