Debian Codegraph @

phantom.js

raw symbols SCIP
1 var page = require('webpage').create()
2 page.open('http://localhost:1234', function() {
3
4 function f() {
5 setTimeout(function () {
6 var clsName = page.evaluate(function() {
7 var el = document.getElementById('tests')
8 return el.className
9 })
10 if (!clsName.match(/sink-done/)) f()
11 else {
12 var count = 0
13 var fail = page.evaluate(function () {
14 var t = ''
15 var els = document.querySelectorAll('ol#tests .fail .fail')
16 for (var i = 0; i < els.length; i++) {
17 t += els[i].textContent + '\n'
18 }
19 return {text: t, count: els.length}
20 })
21 var pass = !!clsName.match(/sink-pass/)
22 if (pass) console.log('All tests have passed!')
23 else {
24 console.log(fail.count + ' test(s) failed')
25 console.log(fail.text.trim())
26 }
27
28 phantom.exit(pass ? 0 : 1)
29 }
30 }, 10)
31 }
32 f()
33 })