setWindowSize for discover and visualize tests otherwise side panels and header buttons can be hidden. Add catch to all visualize test before functions.

This commit is contained in:
LeeDr 2015-11-24 14:26:39 -06:00
parent 9e10b8c532
commit e1606db2db
11 changed files with 33 additions and 19 deletions

View file

@ -51,7 +51,8 @@ define(function (require) {
.then(function () {
common.debug('collapseTimepicker');
return headerPage.collapseTimepicker();
});
})
.catch(common.handleError(this));
});

View file

@ -20,6 +20,7 @@ define(function (require) {
bdd.before(function () {
common = new Common(this.remote);
remote = this.remote;
return remote.setWindowSize(1200,800);
});
bdd.after(function unloadMakelogs() {

View file

@ -95,7 +95,8 @@ define(function (require) {
.then(function getSpinnerDone() {
common.debug('Waiting...');
return headerPage.getSpinnerDone();
});
})
.catch(common.handleError(this));
});
bdd.describe('area charts', function indexPatternCreation() {

View file

@ -30,7 +30,8 @@ define(function (require) {
})
.then(function () {
return common.sleep(2000);
});
})
.catch(common.handleError(this));
});

View file

@ -87,7 +87,8 @@ define(function (require) {
})
.then(function () {
return headerPage.getSpinnerDone();
});
})
.catch(common.handleError(this));
});

View file

@ -84,7 +84,8 @@ define(function (require) {
})
.then(function () {
return headerPage.getSpinnerDone(); // only matches the hidden spinner
});
})
.catch(common.handleError(this));
});
bdd.describe('line charts', function indexPatternCreation() {

View file

@ -69,7 +69,8 @@ define(function (require) {
.then(function collapseTimepicker() {
common.debug('Collapse Time Picker pane');
return headerPage.collapseTimepicker();
});
})
.catch(common.handleError(this));
});

View file

@ -164,16 +164,16 @@ define(function (require) {
bdd.it('should show correct pie chart', function pageHeader() {
var remote = this.remote;
var expectedPieChartData = [ 'M1.6578656043457293e-14,-270.75A270.75,270.75 0 0,1 189.75224728469635,-193.1311656631509L0,0Z',
'M189.75224728469635,-193.1311656631509A270.75,270.75 0 0,1 269.6964470665495,-23.861872090845115L0,0Z',
'M269.6964470665495,-23.861872090845115A270.75,270.75 0 0,1 238.80833406479468,127.57798431233117L0,0Z',
'M238.80833406479468,127.57798431233117A270.75,270.75 0 0,1 123.34351021859935,241.02269807417366L0,0Z',
'M123.34351021859935,241.02269807417366A270.75,270.75 0 0,1 -39.99314183930237,267.77996770823137L0,0Z',
'M-39.99314183930237,267.77996770823137A270.75,270.75 0 0,1 -177.10647583455636,204.78979153625724L0,0Z',
'M-177.10647583455636,204.78979153625724A270.75,270.75 0 0,1 -264.8995143221307,55.98044133355214L0,0Z',
'M-264.8995143221307,55.98044133355214A270.75,270.75 0 0,1 -255.0335453610437,-90.90353810813123L0,0Z',
'M-255.0335453610437,-90.90353810813123A270.75,270.75 0 0,1 -166.77401090750624,-213.28851770740727L0,0Z',
'M-166.77401090750624,-213.28851770740727A270.75,270.75 0 0,1 -4.973596813037188e-14,-270.75L0,0Z'
var expectedPieChartData = ['M1.6287802428659797e-14,-266A266,266 0 0,1 186.423260490228,-189.7428995988851L0,0Z',
'M186.423260490228,-189.7428995988851A266,266 0 0,1 264.9649304513469,-23.443242755918007L0,0Z',
'M264.9649304513469,-23.443242755918007A266,266 0 0,1 234.6187141689211,125.33977406123763L0,0Z',
'M234.6187141689211,125.33977406123763A266,266 0 0,1 121.1795889866941,236.79422968690744L0,0Z',
'M121.1795889866941,236.79422968690744A266,266 0 0,1 -39.29150777194618,263.0820735379115L0,0Z',
'M-39.29150777194618,263.0820735379115A266,266 0 0,1 -173.99934467956413,201.19698817597202L0,0Z',
'M-173.99934467956413,201.19698817597202A266,266 0 0,1 -260.25215442174243,54.99832832770035L0,0Z',
'M-260.25215442174243,54.99832832770035A266,266 0 0,1 -250.55927263541136,-89.30873919395349L0,0Z',
'M-250.55927263541136,-89.30873919395349A266,266 0 0,1 -163.84815106702368,-209.54661388797908L0,0Z',
'M-163.84815106702368,-209.54661388797908A266,266 0 0,1 -4.886340728597939e-14,-266L0,0Z'
];
return visualizePage.getPieChartData()

View file

@ -82,7 +82,8 @@ define(function (require) {
})
.then(function () {
return headerPage.getSpinnerDone();
});
})
.catch(common.handleError(this));
});

View file

@ -111,6 +111,9 @@ define(function (require) {
.then(function () {
return visualizePage.loadSavedVisualization(vizName1);
})
.then(function () {
return headerPage.getSpinnerDone(); // only matches the hidden spinner
})
.then(function takeScreenshot() {
common.debug('Take screenshot');
common.saveScreenshot('./screenshot-' + testSubName + '.png');

View file

@ -38,8 +38,11 @@ define(function (require) {
bdd.before(function () {
common.debug('running bdd.beforeEach');
this.timeout = 120000;
// start each test with an empty kibana index
return scenarioManager.reload('emptyKibana')
return remote.setWindowSize(1200,800)
.then(function () {
// start each test with an empty kibana index
return scenarioManager.reload('emptyKibana');
})
// and load a minimal set of makelogs data
.then(function loadIfEmptyMakelogs() {
return scenarioManager.loadIfEmpty('logstashFunctional');