forked from webdriverio/webdriverio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webdriverio.with.nodeunit.js
35 lines (31 loc) · 1.38 KB
/
webdriverio.with.nodeunit.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
var webdriverio = require('../index'),
assert = require('assert');
module.exports = {
setUp: function (callback) {
client = webdriverio.remote({ desiredCapabilities: {browserName: 'phantomjs'} });
client.init();
callback();
},
test1: function (test) {
client
.url('https://github.com/')
.getElementSize('.header-logo-wordmark', function(err, result) {
test.ok(err === undefined, 'getElementSize() should cause no error');
test.ok(result.height === 26, 'logo height should be 32px');
test.ok(result.width === 37, 'logo width should be 89px');
})
.getTitle(function(err, title) {
test.ok(err === undefined, 'getTitle() should cause no error');
test.ok(title === 'GitHub · Build software better, together.', 'title should be "GitHub · Build software better, together."');
})
.getCssProperty('a[href="/plans"]', 'color', function(err, result){
test.ok(err === undefined, 'getElementCssProperty() should cause no error');
test.ok(result.value === 'rgba(65,131,196,1)', 'color is "' + result + '" but should be "rgba(65,131,196,1)"');
});
test.done();
},
tearDown: function (callback) {
// clean up
client.end(callback);
}
};