forked from webdriverio/webdriverio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webdriverio.with.vows.js
90 lines (63 loc) · 2.41 KB
/
webdriverio.with.vows.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
var vows = require('vows'),
assert = require('assert'),
webdriverio = require('../index'),
fs = require('fs');
var client;
// Create a Test Suite
vows.describe('my github tests').addBatch({
'init webdriverio': {
topic: function () {
client = webdriverio.remote({ desiredCapabilities: {browserName: 'phantomjs'} });
client.init(this.callback);
},
'starting webdriverio successfully': {
topic: function (init) {
client.url('https://github.com/', this.callback);
},
'check logo dimension': {
topic: function (url) {
client.getElementSize('.header-logo-wordmark', this.callback);
},
'getElementSize() should cause no error': function(err,result) {
assert(err === null);
},
'height is 32px': function(err,result) {
assert(result.height === 26);
},
'width is 89px': function(err,result) {
assert(result.width === 37);
}
},
'check title': {
topic: function() {
client.getTitle(this.callback);
},
'getTitle() should cause no error': function(err,result) {
assert(err === null);
},
'title should be "GitHub · Build software better, together."': function(err,result) {
assert(result === 'GitHub · Build software better, together.');
}
},
'check color of subheading': {
topic: function() {
client.getCssProperty('a[href="/plans"]', 'color', this.callback);
},
'getElementCssProperty() should cause no error': function(err,result) {
assert(err === null);
},
'color should be rgba(65,131,196,1)': function(err,result) {
assert(result.value === 'rgba(65,131,196,1)');
}
}
},
'end webdriverio': {
topic: function() {
client.end(this.callback);
},
'should end successfully': function(err,result) {
assert(err === null);
}
}
}
}).run(); // Run it