forked from webdriverio/webdriverio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebdriverjs.with.mocha.js
36 lines (31 loc) · 1.09 KB
/
webdriverjs.with.mocha.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
var webdriverjs = require('../index'),
assert = require('assert');
describe('my webdriverjs tests', function(){
this.timeout(99999999);
var client = {};
before(function(done){
client = webdriverjs.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(err === null);
assert(result.height === 32);
assert(result.width === 89);
})
.getTitle(function(err, title) {
assert(err === null);
assert(title === 'GitHub · Build software better, together.');
})
.getCssProperty('a[href="/plans"]', 'color', function(err, result){
assert(err === null);
assert(result === 'rgba(65,131,196,1)');
})
.call(done);
});
after(function(done) {
client.end(done);
});
});