Here's my conf file:
exports.config = {
seleniumServerJar: './selenium-server-standalone-2.43.1.jar',
"capabilities": {
"browserName": "phantomjs"
},
specs: [
"test.js"
],
jasmineNodeOpts: {
isVerbose: false,
showColors: true,
includeStackTrace: true
},
};
here's the called test.js .It is against ng-europe
community site so everybody who wish will be able to run this.I choose it to learn protractor as it is written in angular:
describe('test ng-europe', function() {
beforeEach(function() {
browser.get('http://ngeurope.org');
});
it('should have a title', function() {
expect(browser.getTitle()).toContain('ng-europe');
element.all(by.repeater('avatar in talk.avatars')).count().then(function(count) {
console.log(count);
});
});
it('search something', function() {
var search_=element(by.model('speakerq'));
var speakers_=element.all(by.repeater('speaker in config.speakers').column('name'));
var speakers = $$('div.speaker.col-xs-12.col-sm-4.text-center.ng-scope img.img-responsive.img-thumbnail.img-circle.avatar');
search_.sendKeys('igor');
expect(speakers.count()).toBe(1);
console.log("speakers count" + speakers.count());
});
it('search something else', function() {
var search_=element(by.model('talksq'));
var talkers = $$('ul.list-unstyled li.ng-scope.ng-binding span.speakers-names.ng-binding');
search_.sendKeys('with');
expect(talkers.count()).toBe(8);
console.log("talkers count" + talkers.count());
});
it('click on jobs', function() {
var jobs_button=element(by.linkText('Jobs'));
jobs_button.click();
var sponsors=$$('div.col-md-4 img.sponsor-logo.gold-sponsor')
expect(sponsors.count()).toBe(4);
});
});
And here's how I call this:
>protractor conf.js
selenium driver is in the same directory node,%appdata%\npm is in the path, phantomjs is installed and updated.Everything runs fine if I set the driver to chrome or firefox but with phantomjs the script just hangs forever and nothing happens.No error displayed , nothing.Just this:
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://XX.XX.XXX.XX:60324/wd/hub
What I am missing?