Kaynağa Gözat

Fix broken todomvc test (#3701)

* fix broken todomvc test

* bump casperjs
katashin 9 yıl önce
ebeveyn
işleme
a4396b9f07
2 değiştirilmiş dosya ile 8 ekleme ve 1 silme
  1. 1 1
      package.json
  2. 7 0
      test/e2e/todomvc.js

+ 1 - 1
package.json

@@ -51,7 +51,7 @@
     "babel-core": "^5.8.0",
     "babel-loader": "^5.4.0",
     "babel-runtime": "^5.8.0",
-    "casperjs": "^1.1.0-beta5",
+    "casperjs": "^1.1.3",
     "codecov.io": "^0.1.2",
     "eslint": "^2.9.0",
     "eslint-config-vue": "^1.0.0",

+ 7 - 0
test/e2e/todomvc.js

@@ -4,6 +4,7 @@ casper.test.begin('todomvc', 63, function (test) {
   casper
   .start('examples/todomvc/index.html')
   .then(function () {
+    this.viewport(1000, 1000) // for appearing destroy buttons by mouse hover
     test.assertNotVisible('.main', '.main should be hidden')
     test.assertNotVisible('.footer', '.footer should be hidden')
     test.assertElementCount('.filters .selected', 1, 'should have one filter selected')
@@ -90,6 +91,9 @@ casper.test.begin('todomvc', 63, function (test) {
 
   // remove a completed item --------------------------------------------
 
+  .then(function () {
+    this.mouse.move('.todo:nth-child(1)')
+  })
   .thenClick('.todo:nth-child(1) .destroy', function () {
     test.assertElementCount('.todo', 4, 'should have 4 items now')
     test.assertElementCount('.todo.completed', 2, 'should have 2 item completed')
@@ -98,6 +102,9 @@ casper.test.begin('todomvc', 63, function (test) {
 
   // remove a incompleted item ------------------------------------------
 
+  .then(function () {
+    this.mouse.move('.todo:nth-child(2)')
+  })
   .thenClick('.todo:nth-child(2) .destroy', function () {
     test.assertElementCount('.todo', 3, 'should have 3 items now')
     test.assertElementCount('.todo.completed', 2, 'should have 2 item completed')