habitica/test/casper/todos.casper.coffee

29 lines
1,009 B
CoffeeScript
Raw Normal View History

2013-01-28 22:43:50 +00:00
helper = new require('./test/casper/helpers')()
casper = helper.casper
utils = helper.utils
url = helper.url
casper.start url + '/?play=1'
2013-01-26 19:57:47 +00:00
# ---------- Todos ------------
casper.then ->
2013-01-28 22:43:50 +00:00
helper.reset()
helper.addTasks()
2013-01-26 19:57:47 +00:00
# Gained exp on +daily
casper.then ->
2013-01-28 22:43:50 +00:00
user = helper.userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
2013-01-26 19:57:47 +00:00
@test.assertEquals user.before.stats.hp, user.after.stats.hp, '+daily =hp'
@test.assert user.before.stats.exp < user.after.stats.exp, '+daily +exp'
@test.assert user.before.stats.money < user.after.stats.money, '+daily +money'
# -daily acts as undo
casper.then ->
2013-01-28 22:43:50 +00:00
user = helper.userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
2013-01-26 19:57:47 +00:00
@test.assertEquals user.before.stats.hp, user.after.stats.hp, '-daily =hp'
@test.assert user.before.stats.exp > user.after.stats.exp, '-daily -exp'
2013-01-28 22:43:50 +00:00
@test.assert user.before.stats.money > user.after.stats.money, '-daily -money'
# ---------- Run ------------
casper.run ->
casper.test.renderResults true