forked from webdriverio/webdriverio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webdriverio.with.mocha.and.chai.js
37 lines (32 loc) · 1.18 KB
/
webdriverio.with.mocha.and.chai.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var chai = require('chai'),
assert = chai.assert,
webdriverio = require('../index');
describe('my webdriverio tests', function(){
this.timeout(99999999);
var client = {};
before(function(done){
client = webdriverio.remote({ desiredCapabilities: {browserName: 'phantomjs'} });
client.init(done);
});
it('Github test',function(done) {
client
.url('https://github.com/')
.getElementSize('.header-logo-wordmark', function(err, result) {
assert.equal(undefined, err);
assert.strictEqual(result.height , 26);
assert.strictEqual(result.width, 37);
})
.getTitle(function(err, title) {
assert.equal(undefined, err);
assert.strictEqual(title,'GitHub · Build software better, together.');
})
.getCssProperty('a[href="/plans"]', 'color', function(err, result){
assert.equal(undefined, err);
assert.strictEqual(result.value, 'rgba(64,120,192,1)');
})
.call(done);
});
after(function(done) {
client.end(done);
});
});