added element conversion examples

This commit is contained in:
sebv
2014-07-04 02:56:19 +08:00
parent ea442859fa
commit 1b69662ff6
3 changed files with 27 additions and 4 deletions

View File

@@ -43,5 +43,22 @@ describe('angularjs homepage', function () {
}).nodeify(done);
});
it('should convert to wd element', function (done) {
var el = element.all(by.repeater('todo in todos')).get(1);
wdBrowser.wdEl(el).text().then(function (text) {
expect(text).toEqual('build an angular app');
}).nodeify(done);
});
it('should convert from wd element', function (done) {
return wdBrowser
.elementById('add-some-control')
.then(function (el) {
return wdBrowser.swEl(el).getText().then(function (text) {
expect(text).toEqual('Add Some Control');
});
}).nodeify(done);
});
});
});