Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

integration tests

  • Loading branch information...
commit b3f63cf54efef2fa8b7870f2ce23c9e321c5827d 1 parent 4d1181b
@zzo authored
View
53 backend/nodejute/examples/integration/testYahoo.js
@@ -1,26 +1,52 @@
+//var YUI = require("yui3").YUI;
YUI({
logInclude: { TestRunner: true },
}).use('test', function(Y) {
var suite = new Y.Test.Suite('Yahoo'),
- soda = require('soda'),
+ soda = require('soda');
browser = soda.createClient({
- url: 'http://yahoo.com',
- host: 'localhost',
- browser: '*firefox'
- }).session(function(sid) {
+ url: 'http://yahoo.com',
+ host: '99-184-251-18.lightspeed.sndgca.sbcglobal.net',
+ browser: '*firefox'
+ });
suite.add(new Y.Test.Case({
name:'Yahoo Search',
testSearch: function() {
var test = this;
+
+ /*
+ Y.log('running test search: ' + browser);
+ Y.log('running test search: ' + browser.session);
+ browser.session(function(err, sid) {
+ Y.log('sess: ' + err);
+ Y.log('sess sid: ' + sid);
+ Y.log(browser.open);
+ browser.open('/', function(err) {
+ Y.log('open: ' + err);
+ Y.log(browser.waitForPageToLoad);
+ browser.waitForPageToLoad(10000, function(err) {
+ Y.log('wait: ' + err);
+ browser.testComplete(function(err) {
+ Y.log('complete: ' + err);
+ test.resume(function() {
+ Y.log('resume: ' + err);
+ Y.Assert.isNull(err);
+ });
+ });
+ });
+ });
+ });
+ */
browser.
chain.
+ session().
open('/').
- waitForPageToLoad(10000).
+ waitForPageToLoad(600000).
typeKeys('name=p', 'ZZO Associates').
submit('name=sf1').
- waitForPageToLoad(10000).
+ waitForPageToLoad(600000).
getText('id=cquery', function(val) {
console.log('TEXT: ' + val);
}).
@@ -36,13 +62,14 @@ YUI({
});
});
- this.wait(3100);
+ test.wait(1000000);
}
}));
suite.add(new Y.Test.Case({
name:'Yahoo Search Again',
testSearch: function() {
+ var test = this;
browser.
chain.
open('/').
@@ -53,27 +80,25 @@ YUI({
getText('id=cquery', function(val) {
console.log('TEXT: ' + val);
}).
- /*
verifyText('id=cquery', 'We have included zoo associates results - Show only ZZO Associates', function(error) {
if (error) {
console.log('TEST FAILED: ' + val);
}
}).
- */
testComplete().
end(function(error) {
test.resume(function() {
Y.Assert.isNull(error);
});
});
+
+ test.wait(10000000);
}
}));
+ Y.Test.Runner.add(suite);
+ Y.Test.Runner.run();
- });
-
- Y.Test.Runner.add(suite);
- Y.Test.Runner.run();
});
View
16 backend/nodejute/jute_v8.js
@@ -50,7 +50,6 @@ var fs = require('fs')
,DEBUG = function() { if (process.env.JUTE_DEBUG==1) { console.log(Array.prototype.join.call(arguments, ' ')); } }
,REQUIRE = require
,DONE = false
- ,EXIT = false
,coverageReportJar = PATH.join(__dirname, 'jute', 'actions', 'yuitest-coverage-report.jar')
,coverageJar = PATH.join(__dirname, 'jute', 'yuitest-coverage.jar')
,TEST_FILE
@@ -342,7 +341,7 @@ function doit(data) {
getScript(tag, executeScript);
} else {
// Give the slacker 10 seconds to exit
- setTimeout(function() { process.exit(0); }, 10000);
+// setTimeout(function() { process.exit(0); }, 10000);
}
});
@@ -441,7 +440,7 @@ function doit(data) {
src = value.substring(7);
}
ssrc = src.split('?');
- DEBUG('loading: ' + ssrc[1]);
+ DEBUG('loading: ' + ssrc);
if (ssrc[1] === 'coverage=1' && DO_COVERAGE) {
// Get coveraged version of this file
DEBUG('Doing coverage for ' + ssrc[0]);
@@ -475,13 +474,12 @@ process.on('uncaughtException', function (err) {
});
process.on('exit', function () {
- if (!EXIT) {
- EXIT = true;
- if (!DONE) {
- console.log('Premature exit: FAIL!');
- }
- process.exit(DONE ? 0 : 1);
+ if (!DONE) {
+ DONE=true;
+ console.trace();
+ console.log('Premature exit: FAIL!');
}
+ process.exit(DONE ? 0 : 1);
});
Please sign in to comment.
Something went wrong with that request. Please try again.