gorealis v2 refactor (#5)

* Changing default timeout for start maintenance.

* Upgrading dependencies to gorealis v2 and thrift  0.12.0

* Refactored to update to gorealis v2.
This commit is contained in:
Renan DelValle 2018-12-27 11:31:51 -08:00 committed by GitHub
parent ad4dd9606e
commit 6ab5c9334d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1335 changed files with 137431 additions and 61530 deletions

View file

@ -28,18 +28,18 @@ function waitFor(testFx, onReady, timeOutMillis) {
start = new Date().getTime(),
condition = false,
interval = setInterval(function() {
if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) {
if ((new Date().getTime() - start < maxtimeOutMillis) && !condition) {
// If not time-out yet and condition not yet fulfilled
condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code
condition = (typeof(testFx) === 'string' ? eval(testFx) : testFx()); //< defensive code
} else {
if(!condition) {
if (!condition) {
// If condition still not fulfilled (timeout but condition is 'false')
console.log("'waitFor()' timeout");
phantom.exit(1);
} else {
// Condition fulfilled (timeout and/or condition is 'true')
console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms.");
if (typeof(onReady) === "string") {
console.log("'waitFor()' finished in " + (new Date().getTime() - start) + 'ms.');
if (typeof(onReady) === 'string') {
eval(onReady);
} else {
onReady(); //< Do what it's supposed to do once the condition is fulfilled
@ -63,21 +63,21 @@ page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open(system.args[1], function(status){
if (status !== "success") {
console.log("Unable to access network");
page.open(system.args[1], function(status) {
if (status !== 'success') {
console.log('Unable to access network');
phantom.exit(1);
} else {
waitFor(function(){
return page.evaluate(function(){
waitFor(function() {
return page.evaluate(function() {
var el = document.getElementById('qunit-testresult');
if (el && el.innerText.match('completed')) {
return true;
}
return false;
});
}, function(){
var failedNum = page.evaluate(function(){
}, function() {
var failedNum = page.evaluate(function() {
var el = document.getElementById('qunit-testresult');
console.log(el.innerText);
try {