-
-
Save n1k0/5652689 to your computer and use it in GitHub Desktop.
tets case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* global casper*/ | |
casper.test.begin("tests", 3, function(test) { | |
"use strict"; | |
var eobDocuments; | |
function findLinks() { | |
var map = Array.prototype.map; | |
return map.call(document.querySelectorAll('li'), function(row) { | |
return { | |
'key': row.innerText, | |
'key2': 'value2' | |
}; | |
}); | |
} | |
casper.start().viewport(1280, 1024).thenOpen('testcase.html', function() { | |
this.setContent([ | |
'<html>', | |
'<body>', | |
' <ol>', | |
' <li>1</li>', | |
' <li>2</li>', | |
' <li>3</li>', | |
' <li>4</li>', | |
' </ol>', | |
'</body>', | |
'</html>' | |
].join('')); | |
}); | |
casper.then(function() { | |
eobDocuments = this.evaluate(findLinks); | |
}); | |
casper.run(function() { | |
var eobDocument = eobDocuments[0]; | |
var testLocal = [{'a': 1, 'b': 2}, {'a': 3, 'b': 4}]; | |
var testLocal0 = testLocal[0]; | |
test.assertTrue(testLocal0 === testLocal[0]); | |
test.assertEquals(eobDocument, eobDocuments[0]); | |
test.assertEquals(eobDocuments[0], eobDocuments[0]); | |
test.done(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment