webdriver.io と Jasmine を機能させようとしています。
彼らの例に従って、私のスクリプトはtest/specs/first/test2.js
(構成に従って)にあり、次のものが含まれています。
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);
});
});
テスト ランナーとして wdio を使用し、対話型セットアップを使用してセットアップします。その構成は自動的に生成され、すべて非常に簡単なので、投稿する必要はありません。
別のターミナル ウィンドウで、Java 7 で selenium-server-andalone-2.47.1.jar を実行しています。私のコンピューターには Firefox がインストールされており (テストを実行すると、Firefox は空白で起動します)、私のコンピューターは OS 10.10 を実行しています。 5.
テスト ランナーを起動すると、次のようになります。
$ 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)
$
これは非常に奇妙で説明がつかないと思います。特に、セッション ID も出力されることを考えると。
何か案は?