Skip to content

Commit 793d52c

Browse files
committed
counter e2e tests
1 parent 19b4aab commit 793d52c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/e2e/counter.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
casper.test.begin('counter', 8, function (test) {
2+
casper
3+
.start('examples/counter/index.html')
4+
.then(function () {
5+
test.assertSelectorHasText('div', 'Clicked: 0 times')
6+
})
7+
.thenClick('button:nth-child(1)', function () {
8+
test.assertSelectorHasText('div', 'Clicked: 1 times')
9+
})
10+
.thenClick('button:nth-child(2)', function () {
11+
test.assertSelectorHasText('div', 'Clicked: 0 times')
12+
})
13+
.thenClick('button:nth-child(3)', function () {
14+
test.assertSelectorHasText('div', 'Clicked: 0 times')
15+
})
16+
.thenClick('button:nth-child(1)', function () {
17+
test.assertSelectorHasText('div', 'Clicked: 1 times')
18+
})
19+
.thenClick('button:nth-child(3)', function () {
20+
test.assertSelectorHasText('div', 'Clicked: 2 times')
21+
})
22+
.thenClick('button:nth-child(4)', function () {
23+
test.assertSelectorHasText('div', 'Clicked: 2 times')
24+
})
25+
.wait(1000)
26+
.then(function () {
27+
test.assertSelectorHasText('div', 'Clicked: 3 times')
28+
})
29+
.run(function () {
30+
test.done()
31+
})
32+
})

0 commit comments

Comments
 (0)