-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommits.js
38 lines (35 loc) · 1.37 KB
/
commits.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
casper.on('remote.message', function (e) {
console.log(e)
})
casper.test.begin('commits', 18, function (test) {
casper
.start('examples/commits/index.html')
.then(function () {
// radio inputs & labels
test.assertElementCount('input', 2)
test.assertElementCount('label', 2)
test.assertSelectorHasText('label[for="master"]', 'master')
test.assertSelectorHasText('label[for="dev"]', 'dev')
// initial fetched commits
test.assertField('branch', 'master')
test.assertSelectorHasText('p', 'vuejs/vue@master')
test.assertElementCount('li', 3)
test.assertSelectorHasText('li:first-child a.commit', '1111111')
test.assertSelectorHasText('li:first-child span.message', 'one')
test.assertSelectorHasText('li:first-child span.author', 'Evan')
test.assertSelectorHasText('li:first-child span.date', '2014-10-15 13:52:58')
})
.thenClick('input[value="dev"]', function () {
test.assertField('branch', 'dev')
test.assertSelectorHasText('p', 'vuejs/vue@dev')
test.assertElementCount('li', 3)
test.assertSelectorHasText('li:first-child a.commit', '2222222')
test.assertSelectorHasText('li:first-child span.message', 'two')
test.assertSelectorHasText('li:first-child span.author', 'Evan')
test.assertSelectorHasText('li:first-child span.date', '2014-10-15 13:52:58')
})
// run
.run(function () {
test.done()
})
})