Minor changes and debug logging for visualize tests.

This commit is contained in:
LeeDr 2015-11-30 14:26:24 -06:00
parent 025cbb0829
commit d5281075fb
4 changed files with 21 additions and 10 deletions

View file

@ -47,6 +47,7 @@ define(function (require) {
bdd.it('should have expected table headers', function checkingHeader() {
return settingsPage.getTableHeader()
.then(function (headers) {
common.debug('header.length = ' + headers.length);
var expectedHeaders = [
'name',
'type',
@ -93,6 +94,7 @@ define(function (require) {
return common.tryForTime(5000, function () {
return remote.getCurrentUrl()
.then(function (currentUrl) {
common.debug('currentUrl = ' + currentUrl);
expect(currentUrl).to.not.contain('logstash-*');
});
})

View file

@ -48,9 +48,11 @@ define(function (require) {
return common.sleep(1000);
})
.then(function openControlsByName() {
return settingsPage.openControlsByName(fieldName);
common.debug('Starting openControlsByName "geo.coordinates"');
return settingsPage.openControlsByName('geo.coordinates');
})
.then(function increasePopularity() {
common.debug('increasePopularity');
return settingsPage.increasePopularity();
});
});
@ -63,6 +65,7 @@ define(function (require) {
bdd.it('should update the popularity input', function () {
return settingsPage.getPopularity()
.then(function (popularity) {
common.debug('popularity = ' + popularity);
expect(popularity).to.be('1');
})
.catch(common.handleError(this));
@ -82,6 +85,7 @@ define(function (require) {
return settingsPage.getPopularity();
})
.then(function (popularity) {
common.debug('popularity = ' + popularity);
expect(popularity).to.be('0');
})
.catch(common.handleError(this));
@ -101,6 +105,7 @@ define(function (require) {
return settingsPage.getPopularity();
})
.then(function (popularity) {
common.debug('popularity = ' + popularity);
expect(popularity).to.be('1');
})
.catch(common.handleError(this));

View file

@ -47,6 +47,7 @@ define(function (require) {
bdd.it('should not select the time field', function () {
return settingsPage.getTimeFieldNameField().isSelected()
.then(function (timeFieldIsSelected) {
common.debug('timeField isSelected = ' + timeFieldIsSelected);
expect(timeFieldIsSelected).to.not.be.ok();
})
.catch(common.handleError(this));

View file

@ -150,12 +150,12 @@ define(function (require) {
return Promise
.try(block)
.then(function tryForTimeSuccess() {
self.debug('tryForTime success in about ' + (lastTry - start) + ' ms');
self.debug('tryForTime success in about ' + (lastTry - start) + ' milliseconds');
return (lastTry - start);
})
.catch(function tryForTimeCatch(err) {
self.debug('tryForTime failure, retry in ' + retryDelay + 'ms - ' + err.message);
tempMessage = err.message;
self.debug('failed with "' + err.message + '"');
self.debug('trying again in 1/2 second');
return Promise.delay(retryDelay).then(attempt);
});
}
@ -163,17 +163,20 @@ define(function (require) {
return Promise.try(attempt);
},
log: function (logString) {
log: function log(logString) {
console.log(moment().format('HH:mm:ss.SSS') + ': ' + logString);
},
debug: function (logString) {
debug: function debug(logString) {
if (config.debug) this.log(logString);
},
sleep: function (sleepMilliseconds) {
this.debug('sleeping for ' + sleepMilliseconds + 'ms');
return Promise.resolve().delay(sleepMilliseconds);
sleep: function sleep(sleepMilliseconds) {
var self = this;
self.debug('... sleep(' + sleepMilliseconds + ') start');
return Promise.resolve().delay(sleepMilliseconds)
.then(function () { self.debug('... sleep(' + sleepMilliseconds + ') end'); });
},
handleError: function (testObj) {
@ -191,7 +194,7 @@ define(function (require) {
};
},
saveScreenshot: function (filename) {
saveScreenshot: function saveScreenshot(filename) {
var self = this;
var outDir = path.resolve('test', 'output');