I have been experiencing some issues while trying to run Protractor using Gulp. The first two tasks are running smoothly, but when attempting to run the third task, it fails to locate the config.js file stored in the following path on my Windows system:
F:\Selenium2\Protractor\TypeScriptProject\ConvertedJSFiles\config\config.js
gulpfile.js
import * as gulp from 'gulp';
import * as protractor from 'gulp-protractor';
gulp.task('webdriver-update', protractor.webdriver_update);
gulp.task('webdriver-standalone', protractor.webdriver_standalone);
gulp.task('run-prot', function () {
console.log('About to run the specs...........')
gulp.src(['ConvertedJSFiles/specs/*.js']).pipe(protractor.protractor({
configFile: 'ConvertedJSFiles/config/config.js'
})).on('error',function(e){
throw e;
});
});
console.log(protractor.getProtractorDir() + ' is the protractor directory ***');
Console Error
F:\Selenium2\Protractor\TypeScriptProject\ConvertedJSFiles\build>gulp run-prot
F:\Selenium2\Protractor\TypeScriptProject\node_modules\.bin is the protractor directory ***
[18:16:17] Using gulpfile F:\Selenium2\Protractor\TypeScriptProject\ConvertedJSFiles\build\gulpfile.js
[18:16:18] Starting 'run-prot'...
About to run the specs...........
[18:16:18] Finished 'run-prot' after 106 ms
[18:16:20] E/configParser - Error code: 105
[18:16:20] E/configParser - Error message: failed loading configuration file ConvertedJSFiles/config/config.js
[18:16:20] E/configParser - Error: Cannot find module 'F:\Selenium2\Protractor\TypeScriptProject\ConvertedJSFiles\build\Convert
edJSFiles\config\config.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at ConfigParser.addFileConfig (F:\Selenium2\Protractor\TypeScriptProject\node_modules\protractor\built\configParser.js:125:
26)
at Object.initFn [as init] (F:\Selenium2\Protractor\TypeScriptProject\node_modules\protractor\built\launcher.js:93:22)
at Object.<anonymous> (F:\Selenium2\Protractor\TypeScriptProject\node_modules\protractor\built\cli.js:112:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
F:\Selenium2\Protractor\TypeScriptProject\ConvertedJSFiles\build\gulpfile.js:11
throw e;
^
Error: protractor exited with code 105