Reputation: 75
I was running the same spec-test.js and config.js yesterday and it was working fine.
Today I tried and got the below error, This is happening on 2 out 3 machines:
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
[launcher] Error: SyntaxError: Unexpected identifier
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/FOLDERPATH/specs/spec-test.js:2:13)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
[launcher] Process exited with error code 100
I am using protractor 3.2.2, node 4.4.3
Any idea why the tests aren't executing.
PS: please ignore any file names mismatch/typos, since I have modified my code a little to ask on the forum. I have tried to run the below code but seeing the same error.
config.js:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['specs/spec-test.js'],
capabilities: {
browserName: 'chrome',
chromeOptions: {
debuggerAddress: '127.0.0.1:9000'
}
},
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 700000,
isVerbose: true
}
};
spec-test.js
var fs = require('fs');
var panel = require('../pageObjects/file1.js');
var panelHelper = require('../pageObjects/file2.js');
var panelApp = require('../pageObjects/file3.js');
describe("Just print Hello world", function() {
it('test 1', function() {
console.log("Hello World!");
});
});
Upvotes: 1
Views: 1512
Reputation: 3266
You must have a syntax error in one of those require
pageObject files, like a missing comma or something. I can't see anything wrong in your config. Also the fact that it starts the webDriver instance means it is getting past onPrepare and starting the spec, so it's not your config file.
It would throw a different error if you had an issue in your config i.e. ERROR - failed loading configuration file config/local.conf.js
. I would carefully look through those pageObject files for syntax errors.
Upvotes: 3