I am trying to get webdriver.io and Jasmine to work.
After their example, my script is in test/specs/first/test2.js (as configured) and contains:
var webdriverio = require('webdriverio'); describe('my webdriverio tests', function() { var client = {}; jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999; beforeEach(function() { client = webdriverio.remote({ desiredCapabilities: {browserName: 'firefox'} }); client.init(); }); it('test it', function(done) { client .url("http://localhost:3000/") .waitForVisible("h2.btn.btn-primary") .click("h2.btn.btn-primary") .waitForVisible("h2.btn.btn-primary") .call(done); }); afterEach(function(done) { client.end(done); }); });
I use wdio as a test runner and configure it using the interactive setup. This config is automatically generated and everything is quite simple, so I do not see the need to publish it.
In another terminal window, I run selenium-server-andalone-2.47.1.jar with Java 7. I have Firefox installed on my computer (it starts when the test starts), and my computer runs OS 10.10.5.
This is what happens when I run the test runner:
$ wdio wdio.conf.js ======================================================================================= Selenium 2.0/webdriver protocol bindings implementation with helper commands in nodejs. For a complete list of commands, visit http://webdriver.io/docs.html. ======================================================================================= [18:17:22]: SET SESSION ID 46731149-79aa-412e-b9b5-3d32e75dbc8d [18:17:22]: RESULT {"platform":"MAC","javascriptEnabled":true,"acceptSslCerts":true,"browserName":"firefox","rotatable":false,"locationContextEnabled":true,"webdriver.remote.sessionid":"46731149-79aa-412e-b9b5-3d32e75dbc8d","version":"40.0.3","databaseEnabled":true,"cssSelectorsEnabled":true,"handlesAlerts":true,"webStorageEnabled":true,"nativeEvents":false,"applicationCacheEnabled":true,"takesScreenshot":true} NoSessionIdError: A session id is required for this command but wasn't found in the response payload at waitForVisible("h2.btn.btn-primary") - test2.js:21:14 /usr/local/lib/node_modules/webdriverio/node_modules/q/q.js:141 throw e; ^ NoSessionIdError: A session id is required for this command but wasn't found in the response payload 0 passing (3.90s) $
I find this very strange and inexplicable, especially considering that it even prints the session id.
Any ideas?