Mocha と webdriverjs を発見した後readme.md
、https://github.com/camme/webdriverjsを読んだ後、試してみたかったので、簡単なテストから始めました。
var webdriverjs = require("webdriverjs"),
client = webdriverjs.remote(),
expect = require("chai").expect;
suite('Functional tests', function(done) {
setup(function(done) {
client.init().url('http://www.google.com', done);
});
test('test if you can open a firefox page', function() {
var inputType = client.getAttribute('#searchtext_home', 'type');
expect(inputType).to.be.a('string');
console.log(myString);
});
teardown(function(done) {
client.end(done);
//done();
});
});
Google の入力要素を取得し、その型がテキストであることを期待します。inputType
最終的に変数内のオブジェクトになります。
AssertionError: { Object (sessionId, desiredCapabilities, ...) } が文字列であると予想されます