fixed tests for phantomjs <1.9.0
Showing
2 changed files
with
8 additions
and
4 deletions
... | @@ -18,7 +18,8 @@ casper.test.begin('sendKeys() tests', 3, function(test) { | ... | @@ -18,7 +18,8 @@ casper.test.begin('sendKeys() tests', 3, function(test) { |
18 | }); | 18 | }); |
19 | }); | 19 | }); |
20 | 20 | ||
21 | casper.test.begin('sendKeys() key modifiers tests', 1, function(test) { | 21 | if (utils.gteVersion(phantom.version, '1.9.0')) { |
22 | casper.test.begin('sendKeys() key modifiers tests', 1, function(test) { | ||
22 | casper.start().then(function() { | 23 | casper.start().then(function() { |
23 | this.setContent([ | 24 | this.setContent([ |
24 | '<input>', | 25 | '<input>', |
... | @@ -38,4 +39,5 @@ casper.test.begin('sendKeys() key modifiers tests', 1, function(test) { | ... | @@ -38,4 +39,5 @@ casper.test.begin('sendKeys() key modifiers tests', 1, function(test) { |
38 | }).run(function() { | 39 | }).run(function() { |
39 | test.done(); | 40 | test.done(); |
40 | }); | 41 | }); |
41 | }); | 42 | }); |
43 | } | ... | ... |
... | @@ -52,7 +52,8 @@ casper.test.begin('utils.clone() tests', 2, function(test) { | ... | @@ -52,7 +52,8 @@ casper.test.begin('utils.clone() tests', 2, function(test) { |
52 | test.done(); | 52 | test.done(); |
53 | }); | 53 | }); |
54 | 54 | ||
55 | casper.test.begin('utils.computeModifier() tests', 7, function(test) { | 55 | if (utils.gteVersion(phantom.version, '1.9.0')) { |
56 | casper.test.begin('utils.computeModifier() tests', 7, function(test) { | ||
56 | var modifiers = require('webpage').create().event.modifier; | 57 | var modifiers = require('webpage').create().event.modifier; |
57 | test.assertType(modifiers, "object"); | 58 | test.assertType(modifiers, "object"); |
58 | test.assertEquals(utils.computeModifier("", modifiers), 0, | 59 | test.assertEquals(utils.computeModifier("", modifiers), 0, |
... | @@ -71,7 +72,8 @@ casper.test.begin('utils.computeModifier() tests', 7, function(test) { | ... | @@ -71,7 +72,8 @@ casper.test.begin('utils.computeModifier() tests', 7, function(test) { |
71 | test.assertThrows(utils.computeModifier, ["chuck+norris", modifiers], | 72 | test.assertThrows(utils.computeModifier, ["chuck+norris", modifiers], |
72 | 'computeModifier() checks for a valid complex modifier'); | 73 | 'computeModifier() checks for a valid complex modifier'); |
73 | test.done(); | 74 | test.done(); |
74 | }); | 75 | }); |
76 | } | ||
75 | 77 | ||
76 | casper.test.begin('equals() tests', 23, function(test) { | 78 | casper.test.begin('equals() tests', 23, function(test) { |
77 | test.assert(utils.equals(null, null), 'equals() null equality'); | 79 | test.assert(utils.equals(null, null), 'equals() null equality'); | ... | ... |
-
Please register or sign in to post a comment