Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
}) |