Reputation: 1545
I am creating my first protractor framework and I am setting up my on prepare in my configuration file.
I keep getting an error X
symbol and I can't figure out why.
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['PageObjectLocator1.js'],
capabilities: {
browserName: 'chrome'
}
onPrepare = function {
//place global functions here
}
}
Here's a screen shot too.
Upvotes: 0
Views: 128
Reputation: 1957
onPrepare should look like this
onPrepare: function() {
//your code
}
and in your case
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['PageObjectLocator1.js'],
capabilities: { browserName: 'chrome' }, //don't forget the comma
onPrepare: function() {
//your code
}
}
Upvotes: 1
Reputation: 4191
You had issues with the syntax, where you needed :
to separate the key (onPrepare) and a value (function).
Also you are missing a comma (,
) between capabilities
and onPrepare
keys.
Here is code that you need:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['PageObjectLocator1.js'],
capabilities: {
browserName: 'chrome'
},
onPrepare: function() {
//your code
}
}
Upvotes: 3