Skip to content

Commit

Permalink
use old phantom setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ded committed Feb 13, 2014
1 parent cf23504 commit 03456c4
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions phantom.js
@@ -1,23 +1,20 @@
var phantom = require('phantom')
phantom.create(function (ph) {
return ph.createPage(function (page) {
return page.open('http://localhost:3000/tests/', function (status) {
function f() {
setTimeout(function () {
var clsName = page.evaluate(function() {
var el = document.getElementById('tests')
return el.className
})
if (!clsName.match(/sink-done/)) f()
else {
var pass = !!clsName.match(/sink-pass/)
if (pass) console.log('qwery tests have passed')
else console.log('qwery tests have failed')
phantom.exit(pass ? 0 : 1)
}
}, 100)
var page = require('webpage').create()
page.open('http://localhost:3000/tests/', function() {

function f() {
setTimeout(function () {
var clsName = page.evaluate(function() {
var el = document.getElementById('tests')
return el.className
})
if (!clsName.match(/sink-done/)) f()
else {
var pass = !!clsName.match(/sink-pass/)
if (pass) console.log('tests have passed')
else console.log('tests failed')
phantom.exit(pass ? 0 : 1)
}
f()
})
})
}, 10)
}
f()
})

0 comments on commit 03456c4

Please sign in to comment.