Merge pull request #7558 from cjcenizal/refactor/functional-tests-page-objects
Migrate all functional tests to use PageObjects module.
This commit is contained in:
commit
ce9eb95901
|
@ -1,16 +1,17 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
scenarioManager,
|
||||
common,
|
||||
consolePage
|
||||
scenarioManager
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('console app', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
common.debug('navigateTo console');
|
||||
return common.navigateToApp('console', false);
|
||||
PageObjects.common.debug('navigateTo console');
|
||||
return PageObjects.common.navigateToApp('console', false);
|
||||
});
|
||||
|
||||
bdd.it('should show the default request', function () {
|
||||
|
@ -23,13 +24,13 @@ bdd.describe('console app', function describeIndexTests() {
|
|||
'}',
|
||||
''
|
||||
];
|
||||
common.saveScreenshot('Console-help-expanded');
|
||||
PageObjects.common.saveScreenshot('Console-help-expanded');
|
||||
// collapse the help pane because we only get the VISIBLE TEXT, not the part that is scrolled
|
||||
return consolePage.collapseHelp()
|
||||
return PageObjects.console.collapseHelp()
|
||||
.then(function () {
|
||||
common.saveScreenshot('Console-help-collapsed');
|
||||
return common.try(function () {
|
||||
return consolePage.getRequest()
|
||||
PageObjects.common.saveScreenshot('Console-help-collapsed');
|
||||
return PageObjects.common.try(function () {
|
||||
return PageObjects.console.getRequest()
|
||||
.then(function (actualRequest) {
|
||||
expect(actualRequest).to.eql(expectedRequest);
|
||||
});
|
||||
|
@ -39,13 +40,13 @@ bdd.describe('console app', function describeIndexTests() {
|
|||
|
||||
bdd.it('default request response should contain .kibana' , function () {
|
||||
var expectedResponseContains = '"_index": ".kibana",';
|
||||
return consolePage.clickPlay()
|
||||
return PageObjects.console.clickPlay()
|
||||
.then(function () {
|
||||
common.saveScreenshot('Console-default-request');
|
||||
return common.try(function () {
|
||||
return consolePage.getResponse()
|
||||
PageObjects.common.saveScreenshot('Console-default-request');
|
||||
return PageObjects.common.try(function () {
|
||||
return PageObjects.console.getResponse()
|
||||
.then(function (actualResponse) {
|
||||
common.debug(actualResponse);
|
||||
PageObjects.common.debug(actualResponse);
|
||||
expect(actualResponse).to.contain(expectedResponseContains);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
import { bdd, remote, scenarioManager, defaultTimeout } from '../../../support';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
remote,
|
||||
scenarioManager,
|
||||
defaultTimeout,
|
||||
} from '../../../support';
|
||||
|
||||
bdd.describe('console app', function () {
|
||||
this.timeout = defaultTimeout;
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
dashboardPage,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
esClient,
|
||||
elasticDump
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('dashboard tab', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
common.debug('Starting dashboard before method');
|
||||
PageObjects.common.debug('Starting dashboard before method');
|
||||
var logstash = scenarioManager.loadIfEmpty('logstashFunctional');
|
||||
// delete .kibana index and update configDoc
|
||||
return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'})
|
||||
// and load a set of makelogs data
|
||||
.then(function loadkibanaVisualizations() {
|
||||
common.debug('load kibana index with visualizations');
|
||||
PageObjects.common.debug('load kibana index with visualizations');
|
||||
return elasticDump.elasticLoad('dashboard','.kibana');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('navigateToApp dashboard');
|
||||
return common.navigateToApp('dashboard');
|
||||
PageObjects.common.debug('navigateToApp dashboard');
|
||||
return PageObjects.common.navigateToApp('dashboard');
|
||||
})
|
||||
// wait for the logstash data load to finish if it hasn't already
|
||||
.then(function () {
|
||||
|
@ -42,21 +42,21 @@ bdd.describe('dashboard tab', function describeIndexTests() {
|
|||
];
|
||||
|
||||
bdd.it('should be able to add visualizations to dashboard', function addVisualizations() {
|
||||
common.saveScreenshot('Dashboard-no-visualizations');
|
||||
PageObjects.common.saveScreenshot('Dashboard-no-visualizations');
|
||||
|
||||
function addVisualizations(arr) {
|
||||
return arr.reduce(function (promise, vizName) {
|
||||
return promise
|
||||
.then(function () {
|
||||
return dashboardPage.addVisualization(vizName);
|
||||
return PageObjects.dashboard.addVisualization(vizName);
|
||||
});
|
||||
}, Promise.resolve());
|
||||
}
|
||||
|
||||
return addVisualizations(visualizations)
|
||||
.then(function () {
|
||||
common.debug('done adding visualizations');
|
||||
common.saveScreenshot('Dashboard-add-visualizations');
|
||||
PageObjects.common.debug('done adding visualizations');
|
||||
PageObjects.common.saveScreenshot('Dashboard-add-visualizations');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -65,48 +65,48 @@ bdd.describe('dashboard tab', function describeIndexTests() {
|
|||
var toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
// .then(function () {
|
||||
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime)
|
||||
PageObjects.common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime)
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
.then(function takeScreenshot() {
|
||||
common.saveScreenshot('Dashboard-set-timepicker');
|
||||
PageObjects.common.saveScreenshot('Dashboard-set-timepicker');
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should save and load dashboard', function saveAndLoadDashboard() {
|
||||
const dashboardName = 'Dashboard Test 1';
|
||||
// TODO: save time on the dashboard and test it
|
||||
return dashboardPage.saveDashboard(dashboardName)
|
||||
return PageObjects.dashboard.saveDashboard(dashboardName)
|
||||
// click New Dashboard just to clear the one we just created
|
||||
.then(function () {
|
||||
return common.try(function () {
|
||||
common.debug('saved Dashboard, now click New Dashboard');
|
||||
return dashboardPage.clickNewDashboard();
|
||||
return PageObjects.common.try(function () {
|
||||
PageObjects.common.debug('saved Dashboard, now click New Dashboard');
|
||||
return PageObjects.dashboard.clickNewDashboard();
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function () {
|
||||
common.debug('now re-load previously saved dashboard');
|
||||
return dashboardPage.loadSavedDashboard(dashboardName);
|
||||
return PageObjects.common.try(function () {
|
||||
PageObjects.common.debug('now re-load previously saved dashboard');
|
||||
return PageObjects.dashboard.loadSavedDashboard(dashboardName);
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
common.saveScreenshot('Dashboard-load-saved');
|
||||
PageObjects.common.saveScreenshot('Dashboard-load-saved');
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should have all the expected visualizations', function checkVisualizations() {
|
||||
return common.tryForTime(10000, function () {
|
||||
return dashboardPage.getPanelTitles()
|
||||
return PageObjects.common.tryForTime(10000, function () {
|
||||
return PageObjects.dashboard.getPanelTitles()
|
||||
.then(function (panelTitles) {
|
||||
common.log('visualization titles = ' + panelTitles);
|
||||
PageObjects.common.log('visualization titles = ' + panelTitles);
|
||||
expect(panelTitles).to.eql(visualizations);
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
common.saveScreenshot('Dashboard-has-visualizations');
|
||||
PageObjects.common.saveScreenshot('Dashboard-has-visualizations');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -119,11 +119,11 @@ bdd.describe('dashboard tab', function describeIndexTests() {
|
|||
{ dataCol: '4', dataRow: '3', dataSizeX: '3', dataSizeY: '2', title: 'Visualization☺ VerticalBarChart' },
|
||||
{ dataCol: '7', dataRow: '3', dataSizeX: '3', dataSizeY: '2', title: 'Visualization MetricChart' }
|
||||
];
|
||||
return common.tryForTime(10000, function () {
|
||||
return dashboardPage.getPanelData()
|
||||
return PageObjects.common.tryForTime(10000, function () {
|
||||
return PageObjects.dashboard.getPanelData()
|
||||
.then(function (panelTitles) {
|
||||
common.log('visualization titles = ' + panelTitles);
|
||||
common.saveScreenshot('Dashboard-visualization-sizes');
|
||||
PageObjects.common.log('visualization titles = ' + panelTitles);
|
||||
PageObjects.common.saveScreenshot('Dashboard-visualization-sizes');
|
||||
expect(panelTitles).to.eql(visObjects);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
import { bdd, remote, scenarioManager, defaultTimeout } from '../../../support';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
remote,
|
||||
scenarioManager,
|
||||
defaultTimeout,
|
||||
} from '../../../support';
|
||||
|
||||
bdd.describe('dashboard app', function () {
|
||||
this.timeout = defaultTimeout;
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
discoverPage,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
esClient,
|
||||
elasticDump
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('discover tab', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
|
@ -19,7 +18,7 @@ bdd.describe('discover tab', function describeIndexTests() {
|
|||
// delete .kibana index and update configDoc
|
||||
return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'})
|
||||
.then(function loadkibanaIndexPattern() {
|
||||
common.debug('load kibana index with default index pattern');
|
||||
PageObjects.common.debug('load kibana index with default index pattern');
|
||||
return elasticDump.elasticLoad('visualize','.kibana');
|
||||
})
|
||||
// and load a set of makelogs data
|
||||
|
@ -27,46 +26,46 @@ bdd.describe('discover tab', function describeIndexTests() {
|
|||
return scenarioManager.loadIfEmpty('logstashFunctional');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('discover');
|
||||
return common.navigateToApp('discover');
|
||||
PageObjects.common.debug('discover');
|
||||
return PageObjects.common.navigateToApp('discover');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('setAbsoluteRange');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('setAbsoluteRange');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
});
|
||||
});
|
||||
|
||||
bdd.describe('field data', function () {
|
||||
bdd.it('should initially be expanded', function () {
|
||||
common.saveScreenshot('Discover-sidebar-expanded');
|
||||
return discoverPage.getSidebarWidth()
|
||||
PageObjects.common.saveScreenshot('Discover-sidebar-expanded');
|
||||
return PageObjects.discover.getSidebarWidth()
|
||||
.then(function (width) {
|
||||
common.debug('expanded sidebar width = ' + width);
|
||||
PageObjects.common.debug('expanded sidebar width = ' + width);
|
||||
expect(width > 180).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should collapse when clicked', function () {
|
||||
return discoverPage.toggleSidebarCollapse()
|
||||
return PageObjects.discover.toggleSidebarCollapse()
|
||||
.then(function () {
|
||||
common.saveScreenshot('Discover-sidebar-collapsed');
|
||||
common.debug('discoverPage.getSidebarWidth()');
|
||||
return discoverPage.getSidebarWidth();
|
||||
PageObjects.common.saveScreenshot('Discover-sidebar-collapsed');
|
||||
PageObjects.common.debug('PageObjects.discover.getSidebarWidth()');
|
||||
return PageObjects.discover.getSidebarWidth();
|
||||
})
|
||||
.then(function (width) {
|
||||
common.debug('collapsed sidebar width = ' + width);
|
||||
PageObjects.common.debug('collapsed sidebar width = ' + width);
|
||||
expect(width < 20).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should expand when clicked', function () {
|
||||
return discoverPage.toggleSidebarCollapse()
|
||||
return PageObjects.discover.toggleSidebarCollapse()
|
||||
.then(function () {
|
||||
common.debug('discoverPage.getSidebarWidth()');
|
||||
return discoverPage.getSidebarWidth();
|
||||
PageObjects.common.debug('PageObjects.discover.getSidebarWidth()');
|
||||
return PageObjects.discover.getSidebarWidth();
|
||||
})
|
||||
.then(function (width) {
|
||||
common.debug('expanded sidebar width = ' + width);
|
||||
PageObjects.common.debug('expanded sidebar width = ' + width);
|
||||
expect(width > 180).to.be(true);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
discoverPage,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
esClient,
|
||||
elasticDump
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('discover app', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
|
@ -19,7 +18,7 @@ bdd.describe('discover app', function describeIndexTests() {
|
|||
// delete .kibana index and update configDoc
|
||||
return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'})
|
||||
.then(function loadkibanaIndexPattern() {
|
||||
common.debug('load kibana index with default index pattern');
|
||||
PageObjects.common.debug('load kibana index with default index pattern');
|
||||
return elasticDump.elasticLoad('visualize','.kibana');
|
||||
})
|
||||
// and load a set of makelogs data
|
||||
|
@ -27,12 +26,12 @@ bdd.describe('discover app', function describeIndexTests() {
|
|||
return scenarioManager.loadIfEmpty('logstashFunctional');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('discover');
|
||||
return common.navigateToApp('discover');
|
||||
PageObjects.common.debug('discover');
|
||||
return PageObjects.common.navigateToApp('discover');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('setAbsoluteRange');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('setAbsoluteRange');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -44,12 +43,12 @@ bdd.describe('discover app', function describeIndexTests() {
|
|||
|
||||
bdd.it('search php should show the correct hit count', function () {
|
||||
var expectedHitCount = '445';
|
||||
return discoverPage.query('php')
|
||||
return PageObjects.discover.query('php')
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return discoverPage.getHitCount()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.discover.getHitCount()
|
||||
.then(function compareData(hitCount) {
|
||||
common.saveScreenshot('Discover-field-data');
|
||||
PageObjects.common.saveScreenshot('Discover-field-data');
|
||||
expect(hitCount).to.be(expectedHitCount);
|
||||
});
|
||||
});
|
||||
|
@ -58,7 +57,7 @@ bdd.describe('discover app', function describeIndexTests() {
|
|||
|
||||
bdd.it('the search term should be highlighted in the field data', function () {
|
||||
// marks is the style that highlights the text in yellow
|
||||
return discoverPage.getMarks()
|
||||
return PageObjects.discover.getMarks()
|
||||
.then(function (marks) {
|
||||
expect(marks.length).to.be(50);
|
||||
expect(marks.indexOf('php')).to.be(0);
|
||||
|
@ -67,10 +66,10 @@ bdd.describe('discover app', function describeIndexTests() {
|
|||
|
||||
bdd.it('search _type:apache should show the correct hit count', function () {
|
||||
var expectedHitCount = '11,156';
|
||||
return discoverPage.query('_type:apache')
|
||||
return PageObjects.discover.query('_type:apache')
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return discoverPage.getHitCount()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.discover.getHitCount()
|
||||
.then(function compareData(hitCount) {
|
||||
expect(hitCount).to.be(expectedHitCount);
|
||||
});
|
||||
|
@ -80,7 +79,7 @@ bdd.describe('discover app', function describeIndexTests() {
|
|||
|
||||
bdd.it('doc view should show Time and _source columns', function () {
|
||||
var expectedHeader = 'Time _source';
|
||||
return discoverPage.getDocHeader()
|
||||
return PageObjects.discover.getDocHeader()
|
||||
.then(function (header) {
|
||||
expect(header).to.be(expectedHeader);
|
||||
});
|
||||
|
@ -131,7 +130,7 @@ bdd.describe('discover app', function describeIndexTests() {
|
|||
+ ' _type:apache _index:logstash-2015.09.22 _score: - relatedContent.article:modified_time:November 27th'
|
||||
+ ' 2014, 16:00:51.000, November 27th 2014, 16:28:42.000 relatedContent.article:published_time:July 26th'
|
||||
+ ' 2007, 19:42:30.000, December 13th 2007, 20:19:35.000';
|
||||
return discoverPage.getDocTableIndex(1)
|
||||
return PageObjects.discover.getDocTableIndex(1)
|
||||
.then(function (rowData) {
|
||||
expect(rowData).to.be(ExpectedDoc);
|
||||
});
|
||||
|
@ -211,18 +210,18 @@ bdd.describe('discover app', function describeIndexTests() {
|
|||
+ ' 16:01:03.000 relatedContent.article:published_time:October 21st 2005, 01:10:25.000, March 5th 2006,'
|
||||
+ ' 01:03:42.000, December 13th 2006, 20:12:04.000, April 4th 2008, 23:00:00.000, April 25th 2008,'
|
||||
+ ' 14:26:41.000';
|
||||
return discoverPage.clickDocSortDown()
|
||||
return PageObjects.discover.clickDocSortDown()
|
||||
.then(function () {
|
||||
// we don't technically need this sleep here because the tryForTime will retry and the
|
||||
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
|
||||
// case and it can be avoided with just a few seconds sleep.
|
||||
return common.sleep(2000);
|
||||
return PageObjects.common.sleep(2000);
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return discoverPage.getDocTableIndex(1)
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.discover.getDocTableIndex(1)
|
||||
.then(function (rowData) {
|
||||
common.saveScreenshot('Discover-sort-down');
|
||||
PageObjects.common.saveScreenshot('Discover-sort-down');
|
||||
expect(rowData).to.be(ExpectedDoc);
|
||||
});
|
||||
});
|
||||
|
@ -233,16 +232,16 @@ bdd.describe('discover app', function describeIndexTests() {
|
|||
bdd.it('a bad syntax query should show an error message', function () {
|
||||
var expectedHitCount = '1011,156';
|
||||
var expectedError = 'Discover: Failed to parse query [xxx(yyy]';
|
||||
return discoverPage.query('xxx(yyy')
|
||||
return PageObjects.discover.query('xxx(yyy')
|
||||
.then(function () {
|
||||
return headerPage.getToastMessage();
|
||||
return PageObjects.header.getToastMessage();
|
||||
})
|
||||
.then(function (toastMessage) {
|
||||
common.saveScreenshot('Discover-syntax-error-toast');
|
||||
PageObjects.common.saveScreenshot('Discover-syntax-error-toast');
|
||||
expect(toastMessage).to.be(expectedError);
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.clickToastOK();
|
||||
return PageObjects.header.clickToastOK();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
discoverPage,
|
||||
headerPage,
|
||||
settingsPage,
|
||||
scenarioManager,
|
||||
esClient,
|
||||
elasticDump
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('shared links', function describeIndexTests() {
|
||||
var baseUrl;
|
||||
|
@ -20,7 +19,7 @@ bdd.describe('shared links', function describeIndexTests() {
|
|||
var expectedToastMessage = /Share search: URL (selected\. Press Ctrl\+C to copy\.|copied to clipboard\.)/;
|
||||
|
||||
bdd.before(function () {
|
||||
baseUrl = common.getHostPort();
|
||||
baseUrl = PageObjects.common.getHostPort();
|
||||
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
var toTime = '2015-09-23 18:31:44.000';
|
||||
|
@ -28,7 +27,7 @@ bdd.describe('shared links', function describeIndexTests() {
|
|||
// delete .kibana index and update configDoc
|
||||
return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'})
|
||||
.then(function loadkibanaIndexPattern() {
|
||||
common.debug('load kibana index with default index pattern');
|
||||
PageObjects.common.debug('load kibana index with default index pattern');
|
||||
return elasticDump.elasticLoad('visualize','.kibana');
|
||||
})
|
||||
// and load a set of makelogs data
|
||||
|
@ -36,17 +35,17 @@ bdd.describe('shared links', function describeIndexTests() {
|
|||
return scenarioManager.loadIfEmpty('logstashFunctional');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('discover');
|
||||
return common.navigateToApp('discover');
|
||||
PageObjects.common.debug('discover');
|
||||
return PageObjects.common.navigateToApp('discover');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('setAbsoluteRange');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('setAbsoluteRange');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function () {
|
||||
//After hiding the time picker, we need to wait for
|
||||
//the refresh button to hide before clicking the share button
|
||||
return common.sleep(1000);
|
||||
return PageObjects.common.sleep(1000);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -54,10 +53,10 @@ bdd.describe('shared links', function describeIndexTests() {
|
|||
bdd.describe('shared link', function () {
|
||||
bdd.it('should show "Share a link" caption', function () {
|
||||
var expectedCaption = 'Share a link';
|
||||
return discoverPage.clickShare()
|
||||
return PageObjects.discover.clickShare()
|
||||
.then(function () {
|
||||
common.saveScreenshot('Discover-share-link');
|
||||
return discoverPage.getShareCaption();
|
||||
PageObjects.common.saveScreenshot('Discover-share-link');
|
||||
return PageObjects.discover.getShareCaption();
|
||||
})
|
||||
.then(function (actualCaption) {
|
||||
expect(actualCaption).to.be(expectedCaption);
|
||||
|
@ -72,7 +71,7 @@ bdd.describe('shared links', function describeIndexTests() {
|
|||
+ '-23T18:31:44.000Z\'))&_a=(columns:!(_source),index:\'logstash-'
|
||||
+ '*\',interval:auto,query:(query_string:(analyze_wildcard:!t,query'
|
||||
+ ':\'*\')),sort:!(\'@timestamp\',desc))';
|
||||
return discoverPage.getSharedUrl()
|
||||
return PageObjects.discover.getSharedUrl()
|
||||
.then(function (actualUrl) {
|
||||
// strip the timestamp out of each URL
|
||||
expect(actualUrl.replace(/_t=\d{13}/,'_t=TIMESTAMP'))
|
||||
|
@ -81,27 +80,27 @@ bdd.describe('shared links', function describeIndexTests() {
|
|||
});
|
||||
|
||||
bdd.it('should show toast message for copy to clipboard', function () {
|
||||
return discoverPage.clickCopyToClipboard()
|
||||
return PageObjects.discover.clickCopyToClipboard()
|
||||
.then(function () {
|
||||
return headerPage.getToastMessage();
|
||||
return PageObjects.header.getToastMessage();
|
||||
})
|
||||
.then(function (toastMessage) {
|
||||
common.saveScreenshot('Discover-copy-to-clipboard-toast');
|
||||
PageObjects.common.saveScreenshot('Discover-copy-to-clipboard-toast');
|
||||
expect(toastMessage).to.match(expectedToastMessage);
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.waitForToastMessageGone();
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: verify clipboard contents
|
||||
bdd.it('shorten URL button should produce a short URL', function () {
|
||||
var re = new RegExp(baseUrl + '/goto/[0-9a-f]{32}$');
|
||||
return discoverPage.clickShortenUrl()
|
||||
return PageObjects.discover.clickShortenUrl()
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
common.saveScreenshot('Discover-shorten-url-button');
|
||||
return discoverPage.getShortenedUrl()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
PageObjects.common.saveScreenshot('Discover-shorten-url-button');
|
||||
return PageObjects.discover.getShortenedUrl()
|
||||
.then(function (actualUrl) {
|
||||
expect(actualUrl).to.match(re);
|
||||
});
|
||||
|
@ -111,15 +110,15 @@ bdd.describe('shared links', function describeIndexTests() {
|
|||
|
||||
// NOTE: This test has to run immediately after the test above
|
||||
bdd.it('should show toast message for copy to clipboard', function () {
|
||||
return discoverPage.clickCopyToClipboard()
|
||||
return PageObjects.discover.clickCopyToClipboard()
|
||||
.then(function () {
|
||||
return headerPage.getToastMessage();
|
||||
return PageObjects.header.getToastMessage();
|
||||
})
|
||||
.then(function (toastMessage) {
|
||||
expect(toastMessage).to.match(expectedToastMessage);
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.waitForToastMessageGone();
|
||||
return PageObjects.header.waitForToastMessageGone();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
import { bdd, remote, scenarioManager, defaultTimeout } from '../../../support';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
remote,
|
||||
scenarioManager,
|
||||
defaultTimeout
|
||||
} from '../../../support';
|
||||
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
|
|
|
@ -1,28 +1,29 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
settingsPage,
|
||||
scenarioManager,
|
||||
esClient
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('user input reactions', function () {
|
||||
bdd.beforeEach(function () {
|
||||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
return esClient.deleteAndUpdateConfigDoc()
|
||||
.then(function () {
|
||||
return settingsPage.navigateTo();
|
||||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.clickExistingData();
|
||||
return PageObjects.settings.clickExistingData();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should hide time-based index pattern when time-based option is unchecked', function () {
|
||||
var self = this;
|
||||
return settingsPage.getTimeBasedEventsCheckbox()
|
||||
return PageObjects.settings.getTimeBasedEventsCheckbox()
|
||||
.then(function (selected) {
|
||||
// uncheck the 'time-based events' checkbox
|
||||
return selected.click();
|
||||
|
@ -30,12 +31,12 @@ bdd.describe('user input reactions', function () {
|
|||
// try to find the checkbox (this shouldn fail)
|
||||
.then(function () {
|
||||
var waitTime = 10000;
|
||||
return settingsPage.getTimeBasedIndexPatternCheckbox(waitTime);
|
||||
return PageObjects.settings.getTimeBasedIndexPatternCheckbox(waitTime);
|
||||
})
|
||||
.then(function () {
|
||||
common.saveScreenshot('Settings-indices-hide-time-based-index-pattern');
|
||||
PageObjects.common.saveScreenshot('Settings-indices-hide-time-based-index-pattern');
|
||||
// we expect the promise above to fail
|
||||
var handler = common.createErrorHandler(self);
|
||||
var handler = PageObjects.common.createErrorHandler(self);
|
||||
var msg = 'Found time based index pattern checkbox';
|
||||
handler(msg);
|
||||
})
|
||||
|
@ -47,11 +48,11 @@ bdd.describe('user input reactions', function () {
|
|||
|
||||
bdd.it('should enable creation after selecting time field', function () {
|
||||
// select a time field and check that Create button is enabled
|
||||
return settingsPage.selectTimeFieldOption('@timestamp')
|
||||
return PageObjects.settings.selectTimeFieldOption('@timestamp')
|
||||
.then(function () {
|
||||
return settingsPage.getCreateButton().isEnabled()
|
||||
return PageObjects.settings.getCreateButton().isEnabled()
|
||||
.then(function (enabled) {
|
||||
common.saveScreenshot('Settings-indices-enable-creation');
|
||||
PageObjects.common.saveScreenshot('Settings-indices-enable-creation');
|
||||
expect(enabled).to.be.ok();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,41 +1,42 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
remote,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
esClient
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('creating and deleting default index', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
return esClient.deleteAndUpdateConfigDoc()
|
||||
.then(function () {
|
||||
return settingsPage.navigateTo();
|
||||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.clickExistingData();
|
||||
return PageObjects.settings.clickExistingData();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.describe('index pattern creation', function indexPatternCreation() {
|
||||
bdd.before(function () {
|
||||
return settingsPage.createIndexPattern();
|
||||
return PageObjects.settings.createIndexPattern();
|
||||
});
|
||||
|
||||
bdd.it('should have index pattern in page header', function pageHeader() {
|
||||
return settingsPage.getIndexPageHeading().getVisibleText()
|
||||
return PageObjects.settings.getIndexPageHeading().getVisibleText()
|
||||
.then(function (patternName) {
|
||||
common.saveScreenshot('Settings-indices-new-index-pattern');
|
||||
PageObjects.common.saveScreenshot('Settings-indices-new-index-pattern');
|
||||
expect(patternName).to.be('logstash-*');
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should have index pattern in url', function url() {
|
||||
return common.try(function tryingForTime() {
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return remote.getCurrentUrl()
|
||||
.then(function (currentUrl) {
|
||||
expect(currentUrl).to.contain('logstash-*');
|
||||
|
@ -44,9 +45,9 @@ bdd.describe('creating and deleting default index', function describeIndexTests(
|
|||
});
|
||||
|
||||
bdd.it('should have expected table headers', function checkingHeader() {
|
||||
return settingsPage.getTableHeader()
|
||||
return PageObjects.settings.getTableHeader()
|
||||
.then(function (headers) {
|
||||
common.debug('header.length = ' + headers.length);
|
||||
PageObjects.common.debug('header.length = ' + headers.length);
|
||||
var expectedHeaders = [
|
||||
'name',
|
||||
'type',
|
||||
|
@ -74,25 +75,25 @@ bdd.describe('creating and deleting default index', function describeIndexTests(
|
|||
bdd.describe('index pattern deletion', function indexDelete() {
|
||||
bdd.before(function () {
|
||||
var expectedAlertText = 'Are you sure you want to remove this index pattern?';
|
||||
return settingsPage.removeIndexPattern()
|
||||
return PageObjects.settings.removeIndexPattern()
|
||||
.then(function (alertText) {
|
||||
common.saveScreenshot('Settings-indices-confirm-remove-index-pattern');
|
||||
PageObjects.common.saveScreenshot('Settings-indices-confirm-remove-index-pattern');
|
||||
expect(alertText).to.be(expectedAlertText);
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should return to index pattern creation page', function returnToPage() {
|
||||
return common.try(function tryingForTime() {
|
||||
return settingsPage.getCreateButton();
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.settings.getCreateButton();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should remove index pattern from url', function indexNotInUrl() {
|
||||
// give the url time to settle
|
||||
return common.try(function tryingForTime() {
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return remote.getCurrentUrl()
|
||||
.then(function (currentUrl) {
|
||||
common.debug('currentUrl = ' + currentUrl);
|
||||
PageObjects.common.debug('currentUrl = ' + currentUrl);
|
||||
expect(currentUrl).to.not.contain('logstash-*');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,28 +1,29 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
esClient
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('index result popularity', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
return esClient.deleteAndUpdateConfigDoc()
|
||||
.then(function () {
|
||||
return settingsPage.navigateTo();
|
||||
return PageObjects.settings.navigateTo();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.beforeEach(function be() {
|
||||
return settingsPage.createIndexPattern();
|
||||
return PageObjects.settings.createIndexPattern();
|
||||
});
|
||||
|
||||
bdd.afterEach(function ae() {
|
||||
return settingsPage.removeIndexPattern();
|
||||
return PageObjects.settings.removeIndexPattern();
|
||||
});
|
||||
|
||||
bdd.describe('change popularity', function indexPatternCreation() {
|
||||
|
@ -31,78 +32,78 @@ bdd.describe('index result popularity', function describeIndexTests() {
|
|||
// set the page size to All again, https://github.com/elastic/kibana/issues/5030
|
||||
// TODO: remove this after issue #5030 is closed
|
||||
function fix5030() {
|
||||
return settingsPage.setPageSize('All')
|
||||
return PageObjects.settings.setPageSize('All')
|
||||
.then(function () {
|
||||
return common.sleep(1000);
|
||||
return PageObjects.common.sleep(1000);
|
||||
});
|
||||
}
|
||||
|
||||
bdd.beforeEach(function () {
|
||||
// increase Popularity of geo.coordinates
|
||||
return settingsPage.setPageSize('All')
|
||||
return PageObjects.settings.setPageSize('All')
|
||||
.then(function () {
|
||||
return common.sleep(1000);
|
||||
return PageObjects.common.sleep(1000);
|
||||
})
|
||||
.then(function openControlsByName() {
|
||||
common.debug('Starting openControlsByName (' + fieldName + ')');
|
||||
return settingsPage.openControlsByName(fieldName);
|
||||
PageObjects.common.debug('Starting openControlsByName (' + fieldName + ')');
|
||||
return PageObjects.settings.openControlsByName(fieldName);
|
||||
})
|
||||
.then(function increasePopularity() {
|
||||
common.debug('increasePopularity');
|
||||
return settingsPage.increasePopularity();
|
||||
PageObjects.common.debug('increasePopularity');
|
||||
return PageObjects.settings.increasePopularity();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.afterEach(function () {
|
||||
// Cancel saving the popularity change (we didn't make a change in this case, just checking the value)
|
||||
return settingsPage.controlChangeCancel();
|
||||
return PageObjects.settings.controlChangeCancel();
|
||||
});
|
||||
|
||||
bdd.it('should update the popularity input', function () {
|
||||
return settingsPage.getPopularity()
|
||||
return PageObjects.settings.getPopularity()
|
||||
.then(function (popularity) {
|
||||
common.debug('popularity = ' + popularity);
|
||||
PageObjects.common.debug('popularity = ' + popularity);
|
||||
expect(popularity).to.be('1');
|
||||
common.saveScreenshot('Settings-indices-result-popularity-updated');
|
||||
PageObjects.common.saveScreenshot('Settings-indices-result-popularity-updated');
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should be reset on cancel', function pageHeader() {
|
||||
// Cancel saving the popularity change
|
||||
return settingsPage.controlChangeCancel()
|
||||
return PageObjects.settings.controlChangeCancel()
|
||||
.then(function () {
|
||||
return fix5030();
|
||||
})
|
||||
.then(function openControlsByName() {
|
||||
return settingsPage.openControlsByName(fieldName);
|
||||
return PageObjects.settings.openControlsByName(fieldName);
|
||||
})
|
||||
// check that its 0 (previous increase was cancelled)
|
||||
.then(function getPopularity() {
|
||||
return settingsPage.getPopularity();
|
||||
return PageObjects.settings.getPopularity();
|
||||
})
|
||||
.then(function (popularity) {
|
||||
common.debug('popularity = ' + popularity);
|
||||
PageObjects.common.debug('popularity = ' + popularity);
|
||||
expect(popularity).to.be('0');
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('can be saved', function pageHeader() {
|
||||
// Saving the popularity change
|
||||
return settingsPage.controlChangeSave()
|
||||
return PageObjects.settings.controlChangeSave()
|
||||
.then(function () {
|
||||
return fix5030();
|
||||
})
|
||||
.then(function openControlsByName() {
|
||||
return settingsPage.openControlsByName(fieldName);
|
||||
return PageObjects.settings.openControlsByName(fieldName);
|
||||
})
|
||||
// check that its 0 (previous increase was cancelled)
|
||||
.then(function getPopularity() {
|
||||
return settingsPage.getPopularity();
|
||||
return PageObjects.settings.getPopularity();
|
||||
})
|
||||
.then(function (popularity) {
|
||||
common.debug('popularity = ' + popularity);
|
||||
PageObjects.common.debug('popularity = ' + popularity);
|
||||
expect(popularity).to.be('1');
|
||||
common.saveScreenshot('Settings-indices-result-popularity-saved');
|
||||
PageObjects.common.saveScreenshot('Settings-indices-result-popularity-saved');
|
||||
});
|
||||
});
|
||||
}); // end 'change popularity'
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
defaultTimeout,
|
||||
settingsPage,
|
||||
scenarioManager,
|
||||
esClient
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('index result field sort', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
|
@ -20,55 +21,55 @@ bdd.describe('index result field sort', function describeIndexTests() {
|
|||
first: '@message',
|
||||
last: 'xss.raw',
|
||||
selector: function () {
|
||||
return settingsPage.getTableRow(0, 0).getVisibleText();
|
||||
return PageObjects.settings.getTableRow(0, 0).getVisibleText();
|
||||
}
|
||||
}, {
|
||||
heading: 'type',
|
||||
first: '_source',
|
||||
last: 'string',
|
||||
selector: function () {
|
||||
return settingsPage.getTableRow(0, 1).getVisibleText();
|
||||
return PageObjects.settings.getTableRow(0, 1).getVisibleText();
|
||||
}
|
||||
}];
|
||||
|
||||
columns.forEach(function (col) {
|
||||
bdd.describe('sort by heading - ' + col.heading, function indexPatternCreation() {
|
||||
bdd.before(function () {
|
||||
return settingsPage.navigateTo()
|
||||
return PageObjects.settings.navigateTo()
|
||||
.then(function () {
|
||||
return settingsPage.clickExistingData();
|
||||
return PageObjects.settings.clickExistingData();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.beforeEach(function () {
|
||||
return settingsPage.createIndexPattern();
|
||||
return PageObjects.settings.createIndexPattern();
|
||||
});
|
||||
|
||||
bdd.afterEach(function () {
|
||||
return settingsPage.removeIndexPattern();
|
||||
return PageObjects.settings.removeIndexPattern();
|
||||
});
|
||||
|
||||
bdd.it('should sort ascending', function pageHeader() {
|
||||
return settingsPage.sortBy(col.heading)
|
||||
return PageObjects.settings.sortBy(col.heading)
|
||||
.then(function getText() {
|
||||
return col.selector();
|
||||
})
|
||||
.then(function (rowText) {
|
||||
common.saveScreenshot(`Settings-indices-column-${col.heading}-sort-ascending`);
|
||||
PageObjects.common.saveScreenshot(`Settings-indices-column-${col.heading}-sort-ascending`);
|
||||
expect(rowText).to.be(col.first);
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should sort descending', function pageHeader() {
|
||||
return settingsPage.sortBy(col.heading)
|
||||
return PageObjects.settings.sortBy(col.heading)
|
||||
.then(function sortAgain() {
|
||||
return settingsPage.sortBy(col.heading);
|
||||
return PageObjects.settings.sortBy(col.heading);
|
||||
})
|
||||
.then(function getText() {
|
||||
return col.selector();
|
||||
})
|
||||
.then(function (rowText) {
|
||||
common.saveScreenshot(`Settings-indices-column-${col.heading}-sort-descending`);
|
||||
PageObjects.common.saveScreenshot(`Settings-indices-column-${col.heading}-sort-descending`);
|
||||
expect(rowText).to.be(col.last);
|
||||
});
|
||||
});
|
||||
|
@ -82,19 +83,19 @@ bdd.describe('index result field sort', function describeIndexTests() {
|
|||
var pages = [1, 2, 3, 4];
|
||||
|
||||
bdd.before(function () {
|
||||
return settingsPage.navigateTo()
|
||||
return PageObjects.settings.navigateTo()
|
||||
.then(function () {
|
||||
return settingsPage.createIndexPattern();
|
||||
return PageObjects.settings.createIndexPattern();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.after(function () {
|
||||
return settingsPage.removeIndexPattern();
|
||||
return PageObjects.settings.removeIndexPattern();
|
||||
});
|
||||
|
||||
bdd.it('makelogs data should have expected number of fields', function () {
|
||||
return common.try(function () {
|
||||
return settingsPage.getFieldsTabCount()
|
||||
return PageObjects.common.try(function () {
|
||||
return PageObjects.settings.getFieldsTabCount()
|
||||
.then(function (tabCount) {
|
||||
expect(tabCount).to.be('' + expectedFieldCount);
|
||||
});
|
||||
|
@ -102,7 +103,7 @@ bdd.describe('index result field sort', function describeIndexTests() {
|
|||
});
|
||||
|
||||
bdd.it('should have correct default page size selected', function () {
|
||||
return settingsPage.getPageSize()
|
||||
return PageObjects.settings.getPageSize()
|
||||
.then(function (pageSize) {
|
||||
expect(pageSize).to.be('' + expectedDefaultPageSize);
|
||||
});
|
||||
|
@ -112,22 +113,22 @@ bdd.describe('index result field sort', function describeIndexTests() {
|
|||
var pageCount = Math.ceil(expectedFieldCount / expectedDefaultPageSize);
|
||||
var chain = pages.reduce(function (chain, val) {
|
||||
return chain.then(function () {
|
||||
return settingsPage.goToPage(val)
|
||||
return PageObjects.settings.goToPage(val)
|
||||
.then(function () {
|
||||
return common.sleep(1000);
|
||||
return PageObjects.common.sleep(1000);
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.getPageFieldCount();
|
||||
return PageObjects.settings.getPageFieldCount();
|
||||
})
|
||||
.then(function (pageCount) {
|
||||
common.saveScreenshot('Settings-indices-paged');
|
||||
PageObjects.common.saveScreenshot('Settings-indices-paged');
|
||||
var expectedSize = (val < 4) ? expectedDefaultPageSize : expectedLastPageCount;
|
||||
expect(pageCount.length).to.be(expectedSize);
|
||||
});
|
||||
});
|
||||
}, Promise.resolve());
|
||||
|
||||
return chain.catch(common.createErrorHandler(this));
|
||||
return chain.catch(PageObjects.common.createErrorHandler(this));
|
||||
});
|
||||
}); // end describe pagination
|
||||
}); // end index result field sort
|
||||
|
|
|
@ -1,35 +1,36 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
esClient
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('initial state', function () {
|
||||
bdd.before(function () {
|
||||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
return esClient.deleteAndUpdateConfigDoc()
|
||||
.then(function () {
|
||||
return settingsPage.navigateTo();
|
||||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.clickExistingData();
|
||||
return PageObjects.settings.clickExistingData();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should load with time pattern checked', function () {
|
||||
return settingsPage.getTimeBasedEventsCheckbox().isSelected()
|
||||
return PageObjects.settings.getTimeBasedEventsCheckbox().isSelected()
|
||||
.then(function (selected) {
|
||||
common.saveScreenshot('Settings-initial-state');
|
||||
PageObjects.common.saveScreenshot('Settings-initial-state');
|
||||
expect(selected).to.be.ok();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should load with name pattern unchecked', function () {
|
||||
return settingsPage.getTimeBasedIndexPatternCheckbox().isSelected()
|
||||
return PageObjects.settings.getTimeBasedIndexPatternCheckbox().isSelected()
|
||||
.then(function (selected) {
|
||||
expect(selected).to.not.be.ok();
|
||||
});
|
||||
|
@ -38,22 +39,22 @@ bdd.describe('initial state', function () {
|
|||
bdd.it('should contain default index pattern', function () {
|
||||
var defaultPattern = 'logstash-*';
|
||||
|
||||
return settingsPage.getIndexPatternField().getProperty('value')
|
||||
return PageObjects.settings.getIndexPatternField().getProperty('value')
|
||||
.then(function (pattern) {
|
||||
expect(pattern).to.be(defaultPattern);
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should not select the time field', function () {
|
||||
return settingsPage.getTimeFieldNameField().isSelected()
|
||||
return PageObjects.settings.getTimeFieldNameField().isSelected()
|
||||
.then(function (timeFieldIsSelected) {
|
||||
common.debug('timeField isSelected = ' + timeFieldIsSelected);
|
||||
PageObjects.common.debug('timeField isSelected = ' + timeFieldIsSelected);
|
||||
expect(timeFieldIsSelected).to.not.be.ok();
|
||||
});
|
||||
});
|
||||
|
||||
bdd.it('should not be enable creation', function () {
|
||||
return settingsPage.getCreateButton().isEnabled()
|
||||
return PageObjects.settings.getCreateButton().isEnabled()
|
||||
.then(function (enabled) {
|
||||
expect(enabled).to.not.be.ok();
|
||||
});
|
||||
|
|
|
@ -1,42 +1,43 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
settingsPage,
|
||||
scenarioManager,
|
||||
esClient
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('creating and deleting default index', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
// delete .kibana index and then wait for Kibana to re-create it
|
||||
return esClient.deleteAndUpdateConfigDoc()
|
||||
.then(function () {
|
||||
return settingsPage.navigateTo();
|
||||
return PageObjects.settings.navigateTo();
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.clickExistingData();
|
||||
return PageObjects.settings.clickExistingData();
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.createIndexPattern();
|
||||
return PageObjects.settings.createIndexPattern();
|
||||
})
|
||||
.then(function () {
|
||||
return settingsPage.navigateTo();
|
||||
return PageObjects.settings.navigateTo();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
bdd.it('should allow setting advanced settings', function () {
|
||||
return settingsPage.clickKibanaSettings()
|
||||
return PageObjects.settings.clickKibanaSettings()
|
||||
.then(function TestCallSetAdvancedSettingsForTimezone() {
|
||||
common.saveScreenshot('Settings-advanced-tab');
|
||||
common.debug('calling setAdvancedSetting');
|
||||
return settingsPage.setAdvancedSettings('dateFormat:tz', 'America/Phoenix');
|
||||
PageObjects.common.saveScreenshot('Settings-advanced-tab');
|
||||
PageObjects.common.debug('calling setAdvancedSetting');
|
||||
return PageObjects.settings.setAdvancedSettings('dateFormat:tz', 'America/Phoenix');
|
||||
})
|
||||
.then(function GetAdvancedSetting() {
|
||||
common.saveScreenshot('Settings-set-timezone');
|
||||
return settingsPage.getAdvancedSettings('dateFormat:tz');
|
||||
PageObjects.common.saveScreenshot('Settings-set-timezone');
|
||||
return PageObjects.settings.getAdvancedSettings('dateFormat:tz');
|
||||
})
|
||||
.then(function (advancedSetting) {
|
||||
expect(advancedSetting).to.be('America/Phoenix');
|
||||
|
|
|
@ -1,62 +1,61 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
visualizePage
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('visualize app', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
var toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
common.debug('navigateToApp visualize');
|
||||
return common.navigateToApp('visualize')
|
||||
PageObjects.common.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToApp('visualize')
|
||||
.then(function () {
|
||||
common.debug('clickAreaChart');
|
||||
return visualizePage.clickAreaChart();
|
||||
PageObjects.common.debug('clickAreaChart');
|
||||
return PageObjects.visualize.clickAreaChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
common.debug('clickNewSearch');
|
||||
return visualizePage.clickNewSearch();
|
||||
PageObjects.common.debug('clickNewSearch');
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
common.debug('Click X-Axis');
|
||||
return visualizePage.clickBucket('X-Axis');
|
||||
PageObjects.common.debug('Click X-Axis');
|
||||
return PageObjects.visualize.clickBucket('X-Axis');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
common.debug('Click Date Histogram');
|
||||
return visualizePage.selectAggregation('Date Histogram');
|
||||
PageObjects.common.debug('Click Date Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
})
|
||||
.then(function getField() {
|
||||
common.debug('Check field value');
|
||||
return visualizePage.getField();
|
||||
PageObjects.common.debug('Check field value');
|
||||
return PageObjects.visualize.getField();
|
||||
})
|
||||
.then(function (fieldValue) {
|
||||
common.debug('fieldValue = ' + fieldValue);
|
||||
PageObjects.common.debug('fieldValue = ' + fieldValue);
|
||||
expect(fieldValue).to.be('@timestamp');
|
||||
})
|
||||
.then(function getInterval() {
|
||||
return visualizePage.getInterval();
|
||||
return PageObjects.visualize.getInterval();
|
||||
})
|
||||
.then(function (intervalValue) {
|
||||
common.debug('intervalValue = ' + intervalValue);
|
||||
PageObjects.common.debug('intervalValue = ' + intervalValue);
|
||||
expect(intervalValue).to.be('Auto');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function getSpinnerDone() {
|
||||
common.debug('Waiting...');
|
||||
return headerPage.getSpinnerDone();
|
||||
PageObjects.common.debug('Waiting...');
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -64,26 +63,26 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
var vizName1 = 'Visualization AreaChart';
|
||||
|
||||
bdd.it('should save and load', function pageHeader() {
|
||||
return visualizePage.saveVisualization(vizName1)
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(function (message) {
|
||||
common.debug('Saved viz message = ' + message);
|
||||
common.saveScreenshot('Visualize-area-chart-save-toast');
|
||||
PageObjects.common.debug('Saved viz message = ' + message);
|
||||
PageObjects.common.saveScreenshot('Visualize-area-chart-save-toast');
|
||||
expect(message).to.be('Visualization Editor: Saved Visualization \"' + vizName1 + '\"');
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return visualizePage.waitForToastMessageGone();
|
||||
return PageObjects.visualize.waitForToastMessageGone();
|
||||
})
|
||||
.then(function loadSavedVisualization() {
|
||||
return visualizePage.loadSavedVisualization(vizName1);
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.waitForVisualization();
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
})
|
||||
// We have to sleep sometime between loading the saved visTitle
|
||||
// and trying to access the chart below with getXAxisLabels
|
||||
// otherwise it hangs.
|
||||
.then(function sleep() {
|
||||
return common.sleep(2000);
|
||||
return PageObjects.common.sleep(2000);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -97,27 +96,27 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
683, 1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29
|
||||
];
|
||||
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getXAxisLabels()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getXAxisLabels()
|
||||
.then(function compareLabels(labels) {
|
||||
common.debug('X-Axis labels = ' + labels);
|
||||
PageObjects.common.debug('X-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(xAxisLabels);
|
||||
});
|
||||
})
|
||||
.then(function getYAxisLabels() {
|
||||
return visualizePage.getYAxisLabels();
|
||||
return PageObjects.visualize.getYAxisLabels();
|
||||
})
|
||||
.then(function (labels) {
|
||||
common.debug('Y-Axis labels = ' + labels);
|
||||
PageObjects.common.debug('Y-Axis labels = ' + labels);
|
||||
expect(labels).to.eql(yAxisLabels);
|
||||
})
|
||||
.then(function getAreaChartData() {
|
||||
return visualizePage.getAreaChartData('Count');
|
||||
return PageObjects.visualize.getAreaChartData('Count');
|
||||
})
|
||||
.then(function (paths) {
|
||||
common.debug('expectedAreaChartData = ' + expectedAreaChartData);
|
||||
common.debug('actual chart data = ' + paths);
|
||||
common.saveScreenshot('Visualize-area-chart');
|
||||
PageObjects.common.debug('expectedAreaChartData = ' + expectedAreaChartData);
|
||||
PageObjects.common.debug('actual chart data = ' + paths);
|
||||
PageObjects.common.saveScreenshot('Visualize-area-chart');
|
||||
expect(paths).to.eql(expectedAreaChartData);
|
||||
});
|
||||
});
|
||||
|
@ -149,15 +148,15 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
'September 22nd 2015, 21:00:00.000 29'
|
||||
];
|
||||
|
||||
return visualizePage.collapseChart()
|
||||
return PageObjects.visualize.collapseChart()
|
||||
.then(function setPageSize() {
|
||||
return settingsPage.setPageSize('All');
|
||||
return PageObjects.settings.setPageSize('All');
|
||||
})
|
||||
.then(function getDataTableData() {
|
||||
return visualizePage.getDataTableData();
|
||||
return PageObjects.visualize.getDataTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
common.debug('getDataTableData = ' + data.split('\n'));
|
||||
PageObjects.common.debug('getDataTableData = ' + data.split('\n'));
|
||||
expect(data.trim().split('\n')).to.eql(expectedTableData);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
visualizePage
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('visualize app', function describeIndexTests() {
|
||||
|
||||
bdd.before(function () {
|
||||
common.debug('navigateToApp visualize');
|
||||
return common.navigateToApp('visualize');
|
||||
PageObjects.common.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToApp('visualize');
|
||||
});
|
||||
|
||||
bdd.describe('chart types', function indexPatternCreation() {
|
||||
|
@ -22,11 +22,11 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
'Metric', 'Pie chart', 'Tile map', 'Vertical bar chart'
|
||||
];
|
||||
// find all the chart types and make sure there all there
|
||||
return visualizePage.getChartTypes()
|
||||
return PageObjects.visualize.getChartTypes()
|
||||
.then(function testChartTypes(chartTypes) {
|
||||
common.debug('returned chart types = ' + chartTypes);
|
||||
common.debug('expected chart types = ' + expectedChartTypes);
|
||||
common.saveScreenshot('Visualize-chart-types');
|
||||
PageObjects.common.debug('returned chart types = ' + chartTypes);
|
||||
PageObjects.common.debug('expected chart types = ' + expectedChartTypes);
|
||||
PageObjects.common.saveScreenshot('Visualize-chart-types');
|
||||
expect(chartTypes).to.eql(expectedChartTypes);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,54 +1,53 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
visualizePage
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('visualize app', function describeIndexTests() {
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
var toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
bdd.before(function () {
|
||||
common.debug('navigateToApp visualize');
|
||||
return common.navigateToApp('visualize')
|
||||
PageObjects.common.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToApp('visualize')
|
||||
.then(function () {
|
||||
common.debug('clickDataTable');
|
||||
return visualizePage.clickDataTable();
|
||||
PageObjects.common.debug('clickDataTable');
|
||||
return PageObjects.visualize.clickDataTable();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
common.debug('clickNewSearch');
|
||||
return visualizePage.clickNewSearch();
|
||||
PageObjects.common.debug('clickNewSearch');
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
common.debug('Bucket = Split Rows');
|
||||
return visualizePage.clickBucket('Split Rows');
|
||||
PageObjects.common.debug('Bucket = Split Rows');
|
||||
return PageObjects.visualize.clickBucket('Split Rows');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
common.debug('Aggregation = Histogram');
|
||||
return visualizePage.selectAggregation('Histogram');
|
||||
PageObjects.common.debug('Aggregation = Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Histogram');
|
||||
})
|
||||
.then(function selectField() {
|
||||
common.debug('Field = bytes');
|
||||
return visualizePage.selectField('bytes');
|
||||
PageObjects.common.debug('Field = bytes');
|
||||
return PageObjects.visualize.selectField('bytes');
|
||||
})
|
||||
.then(function setInterval() {
|
||||
common.debug('Interval = 2000');
|
||||
return visualizePage.setNumericInterval('2000');
|
||||
PageObjects.common.debug('Interval = 2000');
|
||||
return PageObjects.visualize.setNumericInterval('2000');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -56,19 +55,19 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
var vizName1 = 'Visualization DataTable';
|
||||
|
||||
bdd.it('should be able to save and load', function pageHeader() {
|
||||
return visualizePage.saveVisualization(vizName1)
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(function (message) {
|
||||
common.debug('Saved viz message = ' + message);
|
||||
PageObjects.common.debug('Saved viz message = ' + message);
|
||||
expect(message).to.be('Visualization Editor: Saved Visualization \"' + vizName1 + '\"');
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return visualizePage.waitForToastMessageGone();
|
||||
return PageObjects.visualize.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.loadSavedVisualization(vizName1);
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.waitForVisualization();
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -78,10 +77,10 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
'8,000 2,863', '10,000 147', '12,000 148', '14,000 129', '16,000 161', '18,000 137'
|
||||
];
|
||||
|
||||
return visualizePage.getDataTableData()
|
||||
return PageObjects.visualize.getDataTableData()
|
||||
.then(function showData(data) {
|
||||
common.debug(data.split('\n'));
|
||||
common.saveScreenshot('Visualize-data-table');
|
||||
PageObjects.common.debug(data.split('\n'));
|
||||
PageObjects.common.saveScreenshot('Visualize-data-table');
|
||||
expect(data.split('\n')).to.eql(expectedChartData);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,53 +1,52 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
visualizePage
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('visualize app', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
var toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
common.debug('navigateToApp visualize');
|
||||
return common.navigateToApp('visualize')
|
||||
PageObjects.common.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToApp('visualize')
|
||||
.then(function () {
|
||||
common.debug('clickLineChart');
|
||||
return visualizePage.clickLineChart();
|
||||
PageObjects.common.debug('clickLineChart');
|
||||
return PageObjects.visualize.clickLineChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return visualizePage.clickNewSearch();
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
common.debug('Bucket = Split Chart');
|
||||
return visualizePage.clickBucket('Split Chart');
|
||||
PageObjects.common.debug('Bucket = Split Chart');
|
||||
return PageObjects.visualize.clickBucket('Split Chart');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
common.debug('Aggregation = Terms');
|
||||
return visualizePage.selectAggregation('Terms');
|
||||
PageObjects.common.debug('Aggregation = Terms');
|
||||
return PageObjects.visualize.selectAggregation('Terms');
|
||||
})
|
||||
.then(function selectField() {
|
||||
common.debug('Field = extension');
|
||||
return visualizePage.selectField('extension.raw');
|
||||
PageObjects.common.debug('Field = extension');
|
||||
return PageObjects.visualize.selectField('extension.raw');
|
||||
})
|
||||
.then(function setInterval() {
|
||||
common.debug('switch from Rows to Columns');
|
||||
return visualizePage.clickColumns();
|
||||
PageObjects.common.debug('switch from Rows to Columns');
|
||||
return PageObjects.visualize.clickColumns();
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone(); // only matches the hidden spinner
|
||||
return PageObjects.header.getSpinnerDone(); // only matches the hidden spinner
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -57,19 +56,19 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
bdd.it('should be able to save and load', function pageHeader() {
|
||||
var remote = this.remote;
|
||||
|
||||
return visualizePage.saveVisualization(vizName1)
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(function (message) {
|
||||
common.debug('Saved viz message = ' + message);
|
||||
PageObjects.common.debug('Saved viz message = ' + message);
|
||||
expect(message).to.be('Visualization Editor: Saved Visualization \"' + vizName1 + '\"');
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return visualizePage.waitForToastMessageGone();
|
||||
return PageObjects.visualize.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.loadSavedVisualization(vizName1);
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return visualizePage.waitForVisualization();
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -83,19 +82,19 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
var expectedChartData = ['jpg 9,109', 'css 2,159', 'png 1,373', 'gif 918', 'php 445'];
|
||||
|
||||
// sleep a bit before trying to get the chart data
|
||||
return common.sleep(3000)
|
||||
return PageObjects.common.sleep(3000)
|
||||
.then(function () {
|
||||
return visualizePage.getLineChartData('fill="#57c17b"')
|
||||
return PageObjects.visualize.getLineChartData('fill="#57c17b"')
|
||||
.then(function showData(data) {
|
||||
common.saveScreenshot('Visualize-line-chart');
|
||||
PageObjects.common.saveScreenshot('Visualize-line-chart');
|
||||
var tolerance = 10; // the y-axis scale is 10000 so 10 is 0.1%
|
||||
for (var x = 0; x < data.length; x++) {
|
||||
common.debug('x=' + x + ' expectedChartData[x].split(\' \')[1] = ' +
|
||||
PageObjects.common.debug('x=' + x + ' expectedChartData[x].split(\' \')[1] = ' +
|
||||
(expectedChartData[x].split(' ')[1]).replace(',', '') + ' data[x]=' + data[x] +
|
||||
' diff=' + Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]));
|
||||
expect(Math.abs(expectedChartData[x].split(' ')[1].replace(',', '') - data[x]) < tolerance).to.be.ok();
|
||||
}
|
||||
common.debug('Done');
|
||||
PageObjects.common.debug('Done');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -105,12 +104,12 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
var remote = this.remote;
|
||||
var expectedChartData = ['jpg 9,109', 'css 2,159', 'png 1,373', 'gif 918', 'php 445'];
|
||||
|
||||
return visualizePage.collapseChart()
|
||||
return PageObjects.visualize.collapseChart()
|
||||
.then(function getDataTableData() {
|
||||
return visualizePage.getDataTableData();
|
||||
return PageObjects.visualize.getDataTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
common.debug(data.split('\n'));
|
||||
PageObjects.common.debug(data.split('\n'));
|
||||
expect(data.trim().split('\n')).to.eql(expectedChartData);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,31 +1,30 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
visualizePage
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('visualize app', function describeIndexTests() {
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
var toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
bdd.before(function () {
|
||||
common.debug('navigateToApp visualize');
|
||||
return common.navigateToApp('visualize')
|
||||
PageObjects.common.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToApp('visualize')
|
||||
.then(function () {
|
||||
common.debug('clickMetric');
|
||||
return visualizePage.clickMetric();
|
||||
PageObjects.common.debug('clickMetric');
|
||||
return PageObjects.visualize.clickMetric();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return visualizePage.clickNewSearch();
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -35,10 +34,10 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
var expectedCount = ['14,004', 'Count'];
|
||||
|
||||
// initial metric of "Count" is selected by default
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
common.saveScreenshot('Visualize-metric-chart');
|
||||
PageObjects.common.saveScreenshot('Visualize-metric-chart');
|
||||
expect(expectedCount).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
@ -46,21 +45,21 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
|
||||
bdd.it('should show Average', function pageHeader() {
|
||||
var avgMachineRam = ['13,104,036,080.615', 'Average machine.ram'];
|
||||
return visualizePage.clickMetricEditor()
|
||||
return PageObjects.visualize.clickMetricEditor()
|
||||
.then(function () {
|
||||
common.debug('Aggregation = Average');
|
||||
return visualizePage.selectAggregation('Average');
|
||||
PageObjects.common.debug('Aggregation = Average');
|
||||
return PageObjects.visualize.selectAggregation('Average');
|
||||
})
|
||||
.then(function selectField() {
|
||||
common.debug('Field = machine.ram');
|
||||
return visualizePage.selectField('machine.ram');
|
||||
PageObjects.common.debug('Field = machine.ram');
|
||||
return PageObjects.visualize.selectField('machine.ram');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(avgMachineRam).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
|
@ -70,18 +69,18 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
|
||||
bdd.it('should show Sum', function pageHeader() {
|
||||
var sumPhpMemory = ['85,865,880', 'Sum of phpmemory'];
|
||||
common.debug('Aggregation = Sum');
|
||||
return visualizePage.selectAggregation('Sum')
|
||||
PageObjects.common.debug('Aggregation = Sum');
|
||||
return PageObjects.visualize.selectAggregation('Sum')
|
||||
.then(function selectField() {
|
||||
common.debug('Field = phpmemory');
|
||||
return visualizePage.selectField('phpmemory');
|
||||
PageObjects.common.debug('Field = phpmemory');
|
||||
return PageObjects.visualize.selectField('phpmemory');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(sumPhpMemory).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
|
@ -92,18 +91,18 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
bdd.it('should show Median', function pageHeader() {
|
||||
var medianBytes = ['5,565.263', '50th percentile of bytes'];
|
||||
// For now, only comparing the text label part of the metric
|
||||
common.debug('Aggregation = Median');
|
||||
return visualizePage.selectAggregation('Median')
|
||||
PageObjects.common.debug('Aggregation = Median');
|
||||
return PageObjects.visualize.selectAggregation('Median')
|
||||
.then(function selectField() {
|
||||
common.debug('Field = bytes');
|
||||
return visualizePage.selectField('bytes');
|
||||
PageObjects.common.debug('Field = bytes');
|
||||
return PageObjects.visualize.selectField('bytes');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
// only comparing the text label!
|
||||
expect(medianBytes[1]).to.eql(metricValue.split('\n')[1]);
|
||||
|
@ -114,18 +113,18 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
|
||||
bdd.it('should show Min', function pageHeader() {
|
||||
var minTimestamp = ['September 20th 2015, 00:00:00.000', 'Min @timestamp'];
|
||||
common.debug('Aggregation = Min');
|
||||
return visualizePage.selectAggregation('Min')
|
||||
PageObjects.common.debug('Aggregation = Min');
|
||||
return PageObjects.visualize.selectAggregation('Min')
|
||||
.then(function selectField() {
|
||||
common.debug('Field = @timestamp');
|
||||
return visualizePage.selectField('@timestamp');
|
||||
PageObjects.common.debug('Field = @timestamp');
|
||||
return PageObjects.visualize.selectField('@timestamp');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(minTimestamp).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
|
@ -135,18 +134,18 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
|
||||
bdd.it('should show Max', function pageHeader() {
|
||||
var maxRelatedContentArticleModifiedTime = ['April 4th 2015, 00:54:41.000', 'Max relatedContent.article:modified_time'];
|
||||
common.debug('Aggregation = Max');
|
||||
return visualizePage.selectAggregation('Max')
|
||||
PageObjects.common.debug('Aggregation = Max');
|
||||
return PageObjects.visualize.selectAggregation('Max')
|
||||
.then(function selectField() {
|
||||
common.debug('Field = relatedContent.article:modified_time');
|
||||
return visualizePage.selectField('relatedContent.article:modified_time');
|
||||
PageObjects.common.debug('Field = relatedContent.article:modified_time');
|
||||
return PageObjects.visualize.selectField('relatedContent.article:modified_time');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(maxRelatedContentArticleModifiedTime).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
|
@ -160,18 +159,18 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
'5,727.314', 'Average of bytes',
|
||||
'12,889.766', 'Upper Standard Deviation of bytes'
|
||||
];
|
||||
common.debug('Aggregation = Standard Deviation');
|
||||
return visualizePage.selectAggregation('Standard Deviation')
|
||||
PageObjects.common.debug('Aggregation = Standard Deviation');
|
||||
return PageObjects.visualize.selectAggregation('Standard Deviation')
|
||||
.then(function selectField() {
|
||||
common.debug('Field = bytes');
|
||||
return visualizePage.selectField('bytes');
|
||||
PageObjects.common.debug('Field = bytes');
|
||||
return PageObjects.visualize.selectField('bytes');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(standardDeviationBytes).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
|
@ -181,27 +180,27 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
|
||||
bdd.it('should show Unique Count', function pageHeader() {
|
||||
var uniqueCountClientip = ['1,000', 'Unique count of clientip'];
|
||||
common.debug('Aggregation = Unique Count');
|
||||
return visualizePage.selectAggregation('Unique Count')
|
||||
PageObjects.common.debug('Aggregation = Unique Count');
|
||||
return PageObjects.visualize.selectAggregation('Unique Count')
|
||||
.then(function selectField() {
|
||||
common.debug('Field = clientip');
|
||||
return visualizePage.selectField('clientip');
|
||||
PageObjects.common.debug('Field = clientip');
|
||||
return PageObjects.visualize.selectField('clientip');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(uniqueCountClientip).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
common.debug('metricValue=' + metricValue.split('\n'));
|
||||
PageObjects.common.debug('metricValue=' + metricValue.split('\n'));
|
||||
expect(uniqueCountClientip).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
});
|
||||
|
@ -218,18 +217,18 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
'32,212,254,720', '99th percentile of machine.ram'
|
||||
];
|
||||
|
||||
common.debug('Aggregation = Percentiles');
|
||||
return visualizePage.selectAggregation('Percentiles')
|
||||
PageObjects.common.debug('Aggregation = Percentiles');
|
||||
return PageObjects.visualize.selectAggregation('Percentiles')
|
||||
.then(function selectField() {
|
||||
common.debug('Field = machine.ram');
|
||||
return visualizePage.selectField('machine.ram');
|
||||
PageObjects.common.debug('Field = machine.ram');
|
||||
return PageObjects.visualize.selectField('machine.ram');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(percentileMachineRam).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
|
@ -239,22 +238,22 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
|
||||
bdd.it('should show Percentile Ranks', function pageHeader() {
|
||||
var percentileRankBytes = [ '2.036%', 'Percentile rank 99 of "memory"'];
|
||||
common.debug('Aggregation = Percentile Ranks');
|
||||
return visualizePage.selectAggregation('Percentile Ranks')
|
||||
PageObjects.common.debug('Aggregation = Percentile Ranks');
|
||||
return PageObjects.visualize.selectAggregation('Percentile Ranks')
|
||||
.then(function selectField() {
|
||||
common.debug('Field = bytes');
|
||||
return visualizePage.selectField('memory');
|
||||
PageObjects.common.debug('Field = bytes');
|
||||
return PageObjects.visualize.selectField('memory');
|
||||
})
|
||||
.then(function selectField() {
|
||||
common.debug('Values = 99');
|
||||
return visualizePage.setValue('99');
|
||||
PageObjects.common.debug('Values = 99');
|
||||
return PageObjects.visualize.setValue('99');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.getMetric()
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.getMetric()
|
||||
.then(function (metricValue) {
|
||||
expect(percentileRankBytes).to.eql(metricValue.split('\n'));
|
||||
});
|
||||
|
|
|
@ -1,60 +1,59 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
visualizePage
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('visualize app', function describeIndexTests() {
|
||||
bdd.before(function () {
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
var toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
common.debug('navigateToApp visualize');
|
||||
return common.navigateToApp('visualize')
|
||||
PageObjects.common.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToApp('visualize')
|
||||
.then(function () {
|
||||
common.debug('clickPieChart');
|
||||
return visualizePage.clickPieChart();
|
||||
PageObjects.common.debug('clickPieChart');
|
||||
return PageObjects.visualize.clickPieChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return visualizePage.clickNewSearch();
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('select bucket Split Slices');
|
||||
return visualizePage.clickBucket('Split Slices');
|
||||
PageObjects.common.debug('select bucket Split Slices');
|
||||
return PageObjects.visualize.clickBucket('Split Slices');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('Click aggregation Histogram');
|
||||
return visualizePage.selectAggregation('Histogram');
|
||||
PageObjects.common.debug('Click aggregation Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Histogram');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('Click field memory');
|
||||
return visualizePage.selectField('memory');
|
||||
PageObjects.common.debug('Click field memory');
|
||||
return PageObjects.visualize.selectField('memory');
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
.then(function sleep() {
|
||||
return common.sleep(1003);
|
||||
return PageObjects.common.sleep(1003);
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('setNumericInterval 4000');
|
||||
return visualizePage.setNumericInterval('40000');
|
||||
PageObjects.common.debug('setNumericInterval 4000');
|
||||
return PageObjects.visualize.setNumericInterval('40000');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('clickGo');
|
||||
return visualizePage.clickGo();
|
||||
PageObjects.common.debug('clickGo');
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -65,23 +64,23 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
bdd.it('should save and load', function pageHeader() {
|
||||
var remote = this.remote;
|
||||
|
||||
return visualizePage.saveVisualization(vizName1)
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(function (message) {
|
||||
common.debug('Saved viz message = ' + message);
|
||||
PageObjects.common.debug('Saved viz message = ' + message);
|
||||
expect(message).to.be('Visualization Editor: Saved Visualization \"' + vizName1 + '\"');
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return visualizePage.waitForToastMessageGone();
|
||||
return PageObjects.visualize.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.loadSavedVisualization(vizName1);
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return visualizePage.waitForVisualization();
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
})
|
||||
// sleep a bit before trying to get the pie chart data below
|
||||
.then(function sleep() {
|
||||
return common.sleep(2000);
|
||||
return PageObjects.common.sleep(2000);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -89,11 +88,11 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
var remote = this.remote;
|
||||
var expectedPieChartSliceCount = 10;
|
||||
|
||||
return visualizePage.getPieChartData()
|
||||
return PageObjects.visualize.getPieChartData()
|
||||
.then(function (pieData) {
|
||||
var barHeightTolerance = 1;
|
||||
common.debug('pieData.length = ' + pieData.length);
|
||||
common.saveScreenshot('Visualize-pie-chart');
|
||||
PageObjects.common.debug('pieData.length = ' + pieData.length);
|
||||
PageObjects.common.saveScreenshot('Visualize-pie-chart');
|
||||
expect(pieData.length).to.be(expectedPieChartSliceCount);
|
||||
});
|
||||
});
|
||||
|
@ -104,15 +103,15 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
'160,000 44', '200,000 40', '240,000 46', '280,000 39', '320,000 40', '360,000 47'
|
||||
];
|
||||
|
||||
return visualizePage.collapseChart()
|
||||
return PageObjects.visualize.collapseChart()
|
||||
.then(function () {
|
||||
return settingsPage.setPageSize('All');
|
||||
return PageObjects.settings.setPageSize('All');
|
||||
})
|
||||
.then(function getDataTableData() {
|
||||
return visualizePage.getDataTableData();
|
||||
return PageObjects.visualize.getDataTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
common.debug(data.split('\n'));
|
||||
PageObjects.common.debug(data.split('\n'));
|
||||
expect(data.trim().split('\n')).to.eql(expectedTableData);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
visualizePage
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('visualize app', function describeIndexTests() {
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
|
@ -15,38 +14,38 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
|
||||
bdd.before(function () {
|
||||
|
||||
common.debug('navigateToApp visualize');
|
||||
return common.navigateToApp('visualize')
|
||||
PageObjects.common.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToApp('visualize')
|
||||
.then(function () {
|
||||
common.debug('clickTileMap');
|
||||
return visualizePage.clickTileMap();
|
||||
PageObjects.common.debug('clickTileMap');
|
||||
return PageObjects.visualize.clickTileMap();
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.clickNewSearch();
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('select bucket Geo Coordinates');
|
||||
return visualizePage.clickBucket('Geo Coordinates');
|
||||
PageObjects.common.debug('select bucket Geo Coordinates');
|
||||
return PageObjects.visualize.clickBucket('Geo Coordinates');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('Click aggregation Geohash');
|
||||
return visualizePage.selectAggregation('Geohash');
|
||||
PageObjects.common.debug('Click aggregation Geohash');
|
||||
return PageObjects.visualize.selectAggregation('Geohash');
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('Click field geo.coordinates');
|
||||
return common.try(function tryingForTime() {
|
||||
return visualizePage.selectField('geo.coordinates');
|
||||
PageObjects.common.debug('Click field geo.coordinates');
|
||||
return PageObjects.common.try(function tryingForTime() {
|
||||
return PageObjects.visualize.selectField('geo.coordinates');
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -55,27 +54,27 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
bdd.it('should save and load, take screenshot', function pageHeader() {
|
||||
var vizName1 = 'Visualization TileMap';
|
||||
|
||||
return visualizePage.saveVisualization(vizName1)
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(function (message) {
|
||||
common.debug('Saved viz message = ' + message);
|
||||
PageObjects.common.debug('Saved viz message = ' + message);
|
||||
expect(message).to.be('Visualization Editor: Saved Visualization \"' + vizName1 + '\"');
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return visualizePage.waitForToastMessageGone();
|
||||
return PageObjects.visualize.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.loadSavedVisualization(vizName1);
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return visualizePage.waitForVisualization();
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
})
|
||||
// sleep a bit before taking the screenshot or it won't show data
|
||||
.then(function sleep() {
|
||||
return common.sleep(4000);
|
||||
return PageObjects.common.sleep(4000);
|
||||
})
|
||||
.then(function takeScreenshot() {
|
||||
common.debug('Take screenshot');
|
||||
common.saveScreenshot('Visualize-site-map');
|
||||
PageObjects.common.debug('Take screenshot');
|
||||
PageObjects.common.saveScreenshot('Visualize-site-map');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -88,14 +87,14 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
'84 14', 'dx 9', 'bu 9', 'b1 9', 'b4 6', '9n 3', '8g 3'
|
||||
];
|
||||
|
||||
return visualizePage.collapseChart()
|
||||
return PageObjects.visualize.collapseChart()
|
||||
.then(function () {
|
||||
return settingsPage.setPageSize('All');
|
||||
return PageObjects.settings.setPageSize('All');
|
||||
})
|
||||
.then(function getDataTableData() {
|
||||
return visualizePage.getDataTableData()
|
||||
return PageObjects.visualize.getDataTableData()
|
||||
.then(function showData(data) {
|
||||
common.debug(data.split('\n'));
|
||||
PageObjects.common.debug(data.split('\n'));
|
||||
expect(data.trim().split('\n')).to.eql(expectedTableData);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,53 +1,52 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
common,
|
||||
headerPage,
|
||||
scenarioManager,
|
||||
settingsPage,
|
||||
visualizePage
|
||||
} from '../../../support';
|
||||
|
||||
var expect = require('expect.js');
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('visualize app', function describeIndexTests() {
|
||||
var fromTime = '2015-09-19 06:31:44.000';
|
||||
var toTime = '2015-09-23 18:31:44.000';
|
||||
|
||||
bdd.before(function () {
|
||||
common.debug('navigateToApp visualize');
|
||||
return common.navigateToApp('visualize')
|
||||
PageObjects.common.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToApp('visualize')
|
||||
.then(function () {
|
||||
common.debug('clickVerticalBarChart');
|
||||
return visualizePage.clickVerticalBarChart();
|
||||
PageObjects.common.debug('clickVerticalBarChart');
|
||||
return PageObjects.visualize.clickVerticalBarChart();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
return visualizePage.clickNewSearch();
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return headerPage.setAbsoluteRange(fromTime, toTime);
|
||||
PageObjects.common.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickBucket() {
|
||||
common.debug('Bucket = X-Axis');
|
||||
return visualizePage.clickBucket('X-Axis');
|
||||
PageObjects.common.debug('Bucket = X-Axis');
|
||||
return PageObjects.visualize.clickBucket('X-Axis');
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
common.debug('Aggregation = Date Histogram');
|
||||
return visualizePage.selectAggregation('Date Histogram');
|
||||
PageObjects.common.debug('Aggregation = Date Histogram');
|
||||
return PageObjects.visualize.selectAggregation('Date Histogram');
|
||||
})
|
||||
.then(function selectField() {
|
||||
common.debug('Field = @timestamp');
|
||||
return visualizePage.selectField('@timestamp');
|
||||
PageObjects.common.debug('Field = @timestamp');
|
||||
return PageObjects.visualize.selectField('@timestamp');
|
||||
})
|
||||
// leaving Interval set to Auto
|
||||
.then(function clickGo() {
|
||||
return visualizePage.clickGo();
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone(); // only matches the hidden spinner
|
||||
return PageObjects.header.getSpinnerDone(); // only matches the hidden spinner
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return visualizePage.waitForVisualization();
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -55,22 +54,22 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
var vizName1 = 'Visualization VerticalBarChart';
|
||||
|
||||
bdd.it('should save and load', function pageHeader() {
|
||||
return visualizePage.saveVisualization(vizName1)
|
||||
return PageObjects.visualize.saveVisualization(vizName1)
|
||||
.then(function (message) {
|
||||
common.debug('Saved viz message = ' + message);
|
||||
PageObjects.common.debug('Saved viz message = ' + message);
|
||||
expect(message).to.be('Visualization Editor: Saved Visualization \"' + vizName1 + '\"');
|
||||
})
|
||||
.then(function testVisualizeWaitForToastMessageGone() {
|
||||
return visualizePage.waitForToastMessageGone();
|
||||
return PageObjects.visualize.waitForToastMessageGone();
|
||||
})
|
||||
.then(function () {
|
||||
return visualizePage.loadSavedVisualization(vizName1);
|
||||
return PageObjects.visualize.loadSavedVisualization(vizName1);
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone(); // only matches the hidden spinner
|
||||
return PageObjects.header.getSpinnerDone(); // only matches the hidden spinner
|
||||
})
|
||||
.then(function waitForVisualization() {
|
||||
return visualizePage.waitForVisualization();
|
||||
return PageObjects.visualize.waitForVisualization();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -82,14 +81,14 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
// Most recent failure on Jenkins usually indicates the bar chart is still being drawn?
|
||||
// return arguments[0].getAttribute(arguments[1]);","args":[{"ELEMENT":"592"},"fill"]}] arguments[0].getAttribute is not a function
|
||||
// try sleeping a bit before getting that data
|
||||
return common.sleep(5000)
|
||||
return PageObjects.common.sleep(5000)
|
||||
.then(function () {
|
||||
return visualizePage.getBarChartData();
|
||||
return PageObjects.visualize.getBarChartData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
common.debug('data=' + data);
|
||||
common.debug('data.length=' + data.length);
|
||||
common.saveScreenshot('Visualize-vertical-bar-chart');
|
||||
PageObjects.common.debug('data=' + data);
|
||||
PageObjects.common.debug('data.length=' + data.length);
|
||||
PageObjects.common.saveScreenshot('Visualize-vertical-bar-chart');
|
||||
expect(data).to.eql(expectedChartValues);
|
||||
});
|
||||
});
|
||||
|
@ -109,12 +108,12 @@ bdd.describe('visualize app', function describeIndexTests() {
|
|||
'September 21st 2015, 03:00:00.000 202'
|
||||
];
|
||||
|
||||
return visualizePage.collapseChart()
|
||||
return PageObjects.visualize.collapseChart()
|
||||
.then(function showData(data) {
|
||||
return visualizePage.getDataTableData();
|
||||
return PageObjects.visualize.getDataTableData();
|
||||
})
|
||||
.then(function showData(data) {
|
||||
common.debug(data.split('\n'));
|
||||
PageObjects.common.debug(data.split('\n'));
|
||||
expect(data.trim().split('\n')).to.eql(expectedChartData);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
|
||||
import expect from 'expect.js';
|
||||
|
||||
import {
|
||||
bdd,
|
||||
remote,
|
||||
common,
|
||||
defaultTimeout,
|
||||
scenarioManager,
|
||||
esClient,
|
||||
elasticDump
|
||||
} from '../../../support';
|
||||
|
||||
import PageObjects from '../../../support/page_objects';
|
||||
|
||||
bdd.describe('visualize app', function () {
|
||||
this.timeout = defaultTimeout;
|
||||
|
||||
|
@ -15,12 +19,12 @@ bdd.describe('visualize app', function () {
|
|||
var self = this;
|
||||
remote.setWindowSize(1200,800);
|
||||
|
||||
common.debug('Starting visualize before method');
|
||||
PageObjects.common.debug('Starting visualize before method');
|
||||
var logstash = scenarioManager.loadIfEmpty('logstashFunctional');
|
||||
// delete .kibana index and update configDoc
|
||||
return esClient.deleteAndUpdateConfigDoc({'dateFormat:tz':'UTC', 'defaultIndex':'logstash-*'})
|
||||
.then(function loadkibanaIndexPattern() {
|
||||
common.debug('load kibana index with default index pattern');
|
||||
PageObjects.common.debug('load kibana index with default index pattern');
|
||||
return elasticDump.elasticLoad('visualize','.kibana');
|
||||
})
|
||||
// wait for the logstash data load to finish if it hasn't already
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
import {
|
||||
bdd,
|
||||
common
|
||||
} from '../../support';
|
||||
|
||||
import PageObjects from '../../support/page_objects';
|
||||
|
||||
var expect = require('expect.js');
|
||||
|
||||
bdd.describe('status page', function () {
|
||||
bdd.before(function () {
|
||||
return common.navigateToApp('status_page', false);
|
||||
return PageObjects.common.navigateToApp('status_page', false);
|
||||
});
|
||||
|
||||
bdd.it('should show the kibana plugin as ready', function () {
|
||||
var self = this;
|
||||
|
||||
return common.tryForTime(6000, function () {
|
||||
return common.findTestSubject('statusBreakdown')
|
||||
return PageObjects.common.tryForTime(6000, function () {
|
||||
return PageObjects.common.findTestSubject('statusBreakdown')
|
||||
.getVisibleText()
|
||||
.then(function (text) {
|
||||
common.saveScreenshot('Status');
|
||||
PageObjects.common.saveScreenshot('Status');
|
||||
expect(text.indexOf('plugin:kibana')).to.be.above(-1);
|
||||
});
|
||||
})
|
||||
.catch(common.createErrorHandler(self));
|
||||
.catch(PageObjects.common.createErrorHandler(self));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -31,12 +31,4 @@ exports.esClient = new EsClient(url.format(config.servers.elasticsearch));
|
|||
// over, we can delete this facade code.
|
||||
exports.init = function init(remote) {
|
||||
exports.remote = remote;
|
||||
exports.common = PageObjects.common;
|
||||
exports.consolePage = PageObjects.console;
|
||||
exports.dashboardPage = PageObjects.dashboard;
|
||||
exports.discoverPage = PageObjects.discover;
|
||||
exports.headerPage = PageObjects.header;
|
||||
exports.settingsPage = PageObjects.settings;
|
||||
exports.shieldPage = PageObjects.shield;
|
||||
exports.visualizePage = PageObjects.visualize;
|
||||
};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
import bluebird, {
|
||||
promisify
|
||||
} from 'bluebird';
|
||||
|
@ -32,9 +33,6 @@ const writeFileAsync = promisify(fs.writeFile);
|
|||
|
||||
export default class Common {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
init(remote) {
|
||||
function injectTimestampQuery(func, url) {
|
||||
var formatted = modifyQueryString(url, function (parsed) {
|
||||
|
|
|
@ -1,71 +1,59 @@
|
|||
import { remote, defaultFindTimeout } from '../';
|
||||
|
||||
// in test/support/pages/shield_page.js
|
||||
export default (function (require) {
|
||||
// the page object is created as a constructor
|
||||
// so we can provide the remote Command object
|
||||
// at runtime
|
||||
var thisTime;
|
||||
import {
|
||||
defaultFindTimeout,
|
||||
} from '../';
|
||||
|
||||
function ConsolePage() {
|
||||
export default class ConsolePage {
|
||||
|
||||
init(remote) {
|
||||
this.remote = remote;
|
||||
this.findTimeout = this.remote.setFindTimeout(defaultFindTimeout);
|
||||
}
|
||||
|
||||
ConsolePage.prototype = {
|
||||
constructor: ConsolePage,
|
||||
getServer() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('#kibana-body > div.content > div > div')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
init(remote) {
|
||||
this.remote = remote;
|
||||
thisTime = this.remote.setFindTimeout(defaultFindTimeout);
|
||||
},
|
||||
setServer(server) {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('input[aria-label="Server Name"]')
|
||||
.clearValue()
|
||||
.type(server);
|
||||
}
|
||||
|
||||
getServer: function getServer() {
|
||||
return thisTime
|
||||
.findByCssSelector('#kibana-body > div.content > div > div')
|
||||
.getVisibleText();
|
||||
},
|
||||
getRequest() {
|
||||
return this.findTimeout
|
||||
.findAllByCssSelector('div.ace_line_group')
|
||||
.then(function (editorData) {
|
||||
|
||||
setServer: function setServer(server) {
|
||||
return thisTime
|
||||
.findByCssSelector('input[aria-label="Server Name"]')
|
||||
.clearValue()
|
||||
.type(server);
|
||||
},
|
||||
function getEditorData(line) {
|
||||
return line.getVisibleText();
|
||||
}
|
||||
|
||||
getRequest: function getRequest() {
|
||||
return thisTime
|
||||
.findAllByCssSelector('div.ace_line_group')
|
||||
.then(function (editorData) {
|
||||
var getEditorDataPromises = editorData.map(getEditorData);
|
||||
return Promise.all(getEditorDataPromises);
|
||||
});
|
||||
}
|
||||
|
||||
function getEditorData(line) {
|
||||
return line.getVisibleText();
|
||||
}
|
||||
getResponse() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('#output > div.ace_scroller > div')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
var getEditorDataPromises = editorData.map(getEditorData);
|
||||
return Promise.all(getEditorDataPromises);
|
||||
});
|
||||
},
|
||||
clickPlay() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('#editor_actions > span.ng-scope > a > i')
|
||||
.click();
|
||||
}
|
||||
|
||||
getResponse: function getResponse() {
|
||||
return thisTime
|
||||
.findByCssSelector('#output > div.ace_scroller > div')
|
||||
.getVisibleText();
|
||||
},
|
||||
collapseHelp() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('div.config-close.remove > i')
|
||||
.click();
|
||||
|
||||
clickPlay: function clickPlay() {
|
||||
return thisTime
|
||||
.findByCssSelector('#editor_actions > span.ng-scope > a > i')
|
||||
.click();
|
||||
},
|
||||
}
|
||||
|
||||
collapseHelp: function collapseHelp() {
|
||||
return thisTime
|
||||
.findByCssSelector('div.config-close.remove > i')
|
||||
.click();
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
return ConsolePage;
|
||||
}());
|
||||
}
|
||||
|
|
|
@ -1,227 +1,219 @@
|
|||
import { remote, common, defaultFindTimeout, headerPage } from '../';
|
||||
|
||||
export default (function () {
|
||||
var thisTime;
|
||||
import {
|
||||
defaultFindTimeout,
|
||||
} from '../';
|
||||
|
||||
function DashboardPage() {
|
||||
import PageObjects from './';
|
||||
|
||||
export default class DashboardPage {
|
||||
|
||||
init(remote) {
|
||||
this.remote = remote;
|
||||
this.findTimeout = this.remote.setFindTimeout(defaultFindTimeout);
|
||||
}
|
||||
|
||||
DashboardPage.prototype = {
|
||||
constructor: DashboardPage,
|
||||
clickNewDashboard() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button.ng-scope[aria-label="New Dashboard"]')
|
||||
.click();
|
||||
}
|
||||
|
||||
init(remote) {
|
||||
this.remote = remote;
|
||||
thisTime = this.remote.setFindTimeout(defaultFindTimeout);
|
||||
},
|
||||
clickAddVisualization() {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button.ng-scope[aria-label="Add a panel to the dashboard"]')
|
||||
.click();
|
||||
}
|
||||
|
||||
clickNewDashboard: function clickNewDashboard() {
|
||||
return thisTime
|
||||
.findByCssSelector('button.ng-scope[aria-label="New Dashboard"]')
|
||||
.click();
|
||||
},
|
||||
filterVizNames(vizName) {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('input[placeholder="Visualizations Filter..."]')
|
||||
.click()
|
||||
.pressKeys(vizName);
|
||||
}
|
||||
|
||||
clickAddVisualization: function clickAddVisualization() {
|
||||
return thisTime
|
||||
.findByCssSelector('button.ng-scope[aria-label="Add a panel to the dashboard"]')
|
||||
.click();
|
||||
},
|
||||
clickVizNameLink(vizName) {
|
||||
return this.findTimeout
|
||||
.findByLinkText(vizName)
|
||||
.click();
|
||||
}
|
||||
|
||||
filterVizNames: function filterVizNames(vizName) {
|
||||
return thisTime
|
||||
.findByCssSelector('input[placeholder="Visualizations Filter..."]')
|
||||
closeAddVizualizationPanel() {
|
||||
PageObjects.common.debug('-------------close panel');
|
||||
return this.findTimeout
|
||||
.findByCssSelector('i.fa fa-chevron-up')
|
||||
.click();
|
||||
}
|
||||
|
||||
addVisualization(vizName) {
|
||||
return this.clickAddVisualization()
|
||||
.then(() => {
|
||||
PageObjects.common.debug('filter visualization (' + vizName + ')');
|
||||
return this.filterVizNames(vizName);
|
||||
})
|
||||
// this second wait is usually enough to avoid the
|
||||
// 'stale element reference: element is not attached to the page document'
|
||||
// on the next step
|
||||
.then(() => {
|
||||
return PageObjects.common.sleep(1000);
|
||||
})
|
||||
.then(() => {
|
||||
// but wrap in a try loop since it can still happen
|
||||
return PageObjects.common.try(() => {
|
||||
PageObjects.common.debug('click visualization (' + vizName + ')');
|
||||
return this.clickVizNameLink(vizName);
|
||||
});
|
||||
})
|
||||
// this second click of 'Add' collapses the Add Visualization pane
|
||||
.then(() => {
|
||||
return this.clickAddVisualization();
|
||||
});
|
||||
}
|
||||
|
||||
saveDashboard(dashName) {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button.ng-scope[aria-label="Save Dashboard"]')
|
||||
.click()
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.common.sleep(1000);
|
||||
})
|
||||
.then(() => {
|
||||
PageObjects.common.debug('saveButton button clicked');
|
||||
return this.findTimeout
|
||||
.findById('dashboardTitle')
|
||||
.type(dashName);
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.common.sleep(1000);
|
||||
})
|
||||
// click save button
|
||||
.then(() => {
|
||||
return PageObjects.common.try(() => {
|
||||
PageObjects.common.debug('clicking final Save button for named dashboard');
|
||||
return this.findTimeout
|
||||
.findByCssSelector('.btn-primary')
|
||||
.click();
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
// verify that green message at the top of the page.
|
||||
// it's only there for about 5 seconds
|
||||
.then(() => {
|
||||
return PageObjects.common.try(() => {
|
||||
PageObjects.common.debug('verify toast-message for saved dashboard');
|
||||
return this.findTimeout
|
||||
.findByCssSelector('kbn-truncated.toast-message.ng-isolate-scope')
|
||||
.getVisibleText();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
clickDashboardByLinkText(dashName) {
|
||||
return this.findTimeout
|
||||
.findByLinkText(dashName)
|
||||
.click();
|
||||
}
|
||||
|
||||
// use the search filter box to narrow the results down to a single
|
||||
// entry, or at least to a single page of results
|
||||
loadSavedDashboard(dashName) {
|
||||
var self = this;
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button.ng-scope[aria-label="Load Saved Dashboard"]')
|
||||
.click()
|
||||
.then(function filterDashboard() {
|
||||
PageObjects.common.debug('Load Saved Dashboard button clicked');
|
||||
return self.remote
|
||||
.findByCssSelector('input[name="filter"]')
|
||||
.click()
|
||||
.pressKeys(vizName);
|
||||
},
|
||||
.type(dashName.replace('-',' '));
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.common.sleep(1000);
|
||||
})
|
||||
.then(function clickDashboardByLinkedText() {
|
||||
return self
|
||||
.clickDashboardByLinkText(dashName);
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
}
|
||||
|
||||
clickVizNameLink: function clickVizNameLink(vizName) {
|
||||
return thisTime
|
||||
.findByLinkText(vizName)
|
||||
.click();
|
||||
},
|
||||
getPanelTitles() {
|
||||
PageObjects.common.debug('in getPanelTitles');
|
||||
return this.findTimeout
|
||||
.findAllByCssSelector('span.panel-title')
|
||||
.then(function (titleObjects) {
|
||||
|
||||
closeAddVizualizationPanel: function closeAddVizualizationPanel() {
|
||||
common.debug('-------------close panel');
|
||||
return thisTime
|
||||
.findByCssSelector('i.fa fa-chevron-up')
|
||||
.click();
|
||||
},
|
||||
function getTitles(chart) {
|
||||
return chart.getAttribute('title');
|
||||
}
|
||||
|
||||
addVisualization: function addVisualization(vizName) {
|
||||
var self = this;
|
||||
return this.clickAddVisualization()
|
||||
.then(function () {
|
||||
common.debug('filter visualization (' + vizName + ')');
|
||||
return self.filterVizNames(vizName);
|
||||
})
|
||||
// this second wait is usually enough to avoid the
|
||||
// 'stale element reference: element is not attached to the page document'
|
||||
// on the next step
|
||||
.then(function () {
|
||||
return common.sleep(1000);
|
||||
})
|
||||
.then(function () {
|
||||
// but wrap in a try loop since it can still happen
|
||||
return common.try(function () {
|
||||
common.debug('click visualization (' + vizName + ')');
|
||||
return self.clickVizNameLink(vizName);
|
||||
});
|
||||
})
|
||||
// this second click of 'Add' collapses the Add Visualization pane
|
||||
.then(function () {
|
||||
return self.clickAddVisualization();
|
||||
});
|
||||
},
|
||||
var getTitlePromises = titleObjects.map(getTitles);
|
||||
return Promise.all(getTitlePromises);
|
||||
});
|
||||
}
|
||||
|
||||
saveDashboard: function saveDashboard(dashName) {
|
||||
var self = this;
|
||||
return thisTime
|
||||
.findByCssSelector('button.ng-scope[aria-label="Save Dashboard"]')
|
||||
.click()
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
})
|
||||
.then(function () {
|
||||
return common.sleep(1000);
|
||||
})
|
||||
.then(function () {
|
||||
common.debug('saveButton button clicked');
|
||||
return thisTime
|
||||
.findById('dashboardTitle')
|
||||
.type(dashName);
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
})
|
||||
.then(function () {
|
||||
return common.sleep(1000);
|
||||
})
|
||||
// click save button
|
||||
.then(function () {
|
||||
return common.try(function () {
|
||||
common.debug('clicking final Save button for named dashboard');
|
||||
return thisTime
|
||||
.findByCssSelector('.btn-primary')
|
||||
.click();
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
})
|
||||
// verify that green message at the top of the page.
|
||||
// it's only there for about 5 seconds
|
||||
.then(function () {
|
||||
return common.try(function () {
|
||||
common.debug('verify toast-message for saved dashboard');
|
||||
return thisTime
|
||||
.findByCssSelector('kbn-truncated.toast-message.ng-isolate-scope')
|
||||
.getVisibleText();
|
||||
});
|
||||
});
|
||||
},
|
||||
getPanelData() {
|
||||
PageObjects.common.debug('in getPanelData');
|
||||
return this.findTimeout
|
||||
.findAllByCssSelector('li.gs-w')
|
||||
.then(function (titleObjects) {
|
||||
|
||||
clickDashboardByLinkText: function clickDashboardByLinkText(dashName) {
|
||||
return thisTime
|
||||
.findByLinkText(dashName)
|
||||
.click();
|
||||
},
|
||||
|
||||
// use the search filter box to narrow the results down to a single
|
||||
// entry, or at least to a single page of results
|
||||
loadSavedDashboard: function loadSavedDashboard(dashName) {
|
||||
var self = this;
|
||||
return thisTime
|
||||
.findByCssSelector('button.ng-scope[aria-label="Load Saved Dashboard"]')
|
||||
.click()
|
||||
.then(function filterDashboard() {
|
||||
common.debug('Load Saved Dashboard button clicked');
|
||||
return self.remote
|
||||
.findByCssSelector('input[name="filter"]')
|
||||
.click()
|
||||
.type(dashName.replace('-',' '));
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
})
|
||||
.then(function () {
|
||||
return common.sleep(1000);
|
||||
})
|
||||
.then(function clickDashboardByLinkedText() {
|
||||
return self
|
||||
.clickDashboardByLinkText(dashName);
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
getPanelTitles: function getPanelTitles() {
|
||||
common.debug('in getPanelTitles');
|
||||
return thisTime
|
||||
.findAllByCssSelector('span.panel-title')
|
||||
.then(function (titleObjects) {
|
||||
|
||||
function getTitles(chart) {
|
||||
return chart.getAttribute('title');
|
||||
}
|
||||
|
||||
var getTitlePromises = titleObjects.map(getTitles);
|
||||
return Promise.all(getTitlePromises);
|
||||
});
|
||||
},
|
||||
|
||||
getPanelData: function getPanelData() {
|
||||
common.debug('in getPanelData');
|
||||
return thisTime
|
||||
.findAllByCssSelector('li.gs-w')
|
||||
.then(function (titleObjects) {
|
||||
|
||||
function getTitles(chart) {
|
||||
var obj = {};
|
||||
return chart.getAttribute('data-col')
|
||||
.then(function (theData) {
|
||||
obj = {dataCol:theData};
|
||||
function getTitles(chart) {
|
||||
var obj = {};
|
||||
return chart.getAttribute('data-col')
|
||||
.then(theData => {
|
||||
obj = {dataCol:theData};
|
||||
return chart;
|
||||
})
|
||||
.then(chart => {
|
||||
return chart.getAttribute('data-row')
|
||||
.then(theData => {
|
||||
obj.dataRow = theData;
|
||||
return chart;
|
||||
})
|
||||
.then(function (chart) {
|
||||
return chart.getAttribute('data-row')
|
||||
.then(function (theData) {
|
||||
obj.dataRow = theData;
|
||||
return chart;
|
||||
});
|
||||
})
|
||||
.then(function (chart) {
|
||||
return chart.getAttribute('data-sizex')
|
||||
.then(function (theData) {
|
||||
obj.dataSizeX = theData;
|
||||
return chart;
|
||||
});
|
||||
})
|
||||
.then(function (chart) {
|
||||
return chart.getAttribute('data-sizey')
|
||||
.then(function (theData) {
|
||||
obj.dataSizeY = theData;
|
||||
return chart;
|
||||
});
|
||||
})
|
||||
.then(function (chart) {
|
||||
return chart.findByCssSelector('span.panel-title')
|
||||
.then(function (titleElement) {
|
||||
return titleElement.getAttribute('title');
|
||||
})
|
||||
.then(function (theData) {
|
||||
obj.title = theData;
|
||||
return obj;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.then(chart => {
|
||||
return chart.getAttribute('data-sizex')
|
||||
.then(theData => {
|
||||
obj.dataSizeX = theData;
|
||||
return chart;
|
||||
});
|
||||
})
|
||||
.then(chart => {
|
||||
return chart.getAttribute('data-sizey')
|
||||
.then(theData => {
|
||||
obj.dataSizeY = theData;
|
||||
return chart;
|
||||
});
|
||||
})
|
||||
.then(chart => {
|
||||
return chart.findByCssSelector('span.panel-title')
|
||||
.then(function (titleElement) {
|
||||
return titleElement.getAttribute('title');
|
||||
})
|
||||
.then(theData => {
|
||||
obj.title = theData;
|
||||
return obj;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var getTitlePromises = titleObjects.map(getTitles);
|
||||
return Promise.all(getTitlePromises);
|
||||
});
|
||||
}
|
||||
var getTitlePromises = titleObjects.map(getTitles);
|
||||
return Promise.all(getTitlePromises);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return DashboardPage;
|
||||
}());
|
||||
}
|
||||
|
|
|
@ -1,38 +1,35 @@
|
|||
|
||||
import Common from './common.js';
|
||||
import { defaultFindTimeout } from '../';
|
||||
import {
|
||||
defaultFindTimeout
|
||||
} from '../';
|
||||
|
||||
let thisTime;
|
||||
import PageObjects from './';
|
||||
|
||||
export default class DiscoverPage extends Common {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
export default class DiscoverPage {
|
||||
|
||||
init(remote) {
|
||||
super.init(remote);
|
||||
thisTime = this.remote.setFindTimeout(defaultFindTimeout);
|
||||
this.remote = remote;
|
||||
this.findTimeout = this.remote.setFindTimeout(defaultFindTimeout);
|
||||
}
|
||||
|
||||
getQueryField() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('input[ng-model=\'state.query\']');
|
||||
}
|
||||
|
||||
getQuerySearchButton() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button[aria-label=\'Search\']');
|
||||
}
|
||||
|
||||
getTimespanText() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('.kibana-nav-options .navbar-timepicker-time-desc pretty-duration')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
getChartTimespan() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('center.small > span:nth-child(1)')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
@ -40,50 +37,49 @@ export default class DiscoverPage extends Common {
|
|||
saveSearch(searchName) {
|
||||
return this.clickSaveSearchButton()
|
||||
.then(() => {
|
||||
this.debug('--saveSearch button clicked');
|
||||
return thisTime.findDisplayedById('SaveSearch')
|
||||
PageObjects.common.debug('--saveSearch button clicked');
|
||||
return this.findTimeout.findDisplayedById('SaveSearch')
|
||||
.pressKeys(searchName);
|
||||
})
|
||||
.then(() => {
|
||||
this.debug('--find save button');
|
||||
return this.findTestSubject('discover-save-search-btn').click();
|
||||
PageObjects.common.debug('--find save button');
|
||||
return PageObjects.common.findTestSubject('discover-save-search-btn').click();
|
||||
});
|
||||
}
|
||||
|
||||
loadSavedSearch(searchName) {
|
||||
var self = this;
|
||||
return self.clickLoadSavedSearchButton()
|
||||
.then(function () {
|
||||
thisTime.findByLinkText(searchName).click();
|
||||
return this.clickLoadSavedSearchButton()
|
||||
.then(() => {
|
||||
this.findTimeout.findByLinkText(searchName).click();
|
||||
});
|
||||
}
|
||||
|
||||
clickNewSearchButton() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button[aria-label="New Search"]')
|
||||
.click();
|
||||
}
|
||||
|
||||
clickSaveSearchButton() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button[aria-label="Save Search"]')
|
||||
.click();
|
||||
}
|
||||
|
||||
clickLoadSavedSearchButton() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findDisplayedByCssSelector('button[aria-label="Load Saved Search"]')
|
||||
.click();
|
||||
}
|
||||
|
||||
getCurrentQueryName() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('span.kibana-nav-info-title span')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
getBarChartData() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findAllByCssSelector('rect[data-label="Count"]')
|
||||
.then(function (chartData) {
|
||||
|
||||
|
@ -101,18 +97,18 @@ export default class DiscoverPage extends Common {
|
|||
}
|
||||
|
||||
getChartInterval() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('a[ng-click="toggleInterval()"]')
|
||||
.getVisibleText()
|
||||
.then(function (intervalText) {
|
||||
.then(intervalText => {
|
||||
if (intervalText.length > 0) {
|
||||
return intervalText;
|
||||
} else {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('select[ng-model="state.interval"]')
|
||||
.getProperty('value') // this gets 'string:d' for Daily
|
||||
.then(function (selectedValue) {
|
||||
return thisTime
|
||||
.then(selectedValue => {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('option[value="' + selectedValue + '"]')
|
||||
.getVisibleText();
|
||||
});
|
||||
|
@ -124,121 +120,120 @@ export default class DiscoverPage extends Common {
|
|||
return this.remote.setFindTimeout(5000)
|
||||
.findByCssSelector('a[ng-click="toggleInterval()"]')
|
||||
.click()
|
||||
.catch(function () {
|
||||
.catch(() => {
|
||||
// in some cases we have the link above, but after we've made a
|
||||
// selection we just have a select list.
|
||||
})
|
||||
.then(function () {
|
||||
return thisTime
|
||||
.then(() => {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('option[label="' + interval + '"]')
|
||||
.click();
|
||||
});
|
||||
}
|
||||
|
||||
getHitCount() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('strong.discover-info-hits')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
query(queryString) {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('input[aria-label="Search input"]')
|
||||
.clearValue()
|
||||
.type(queryString)
|
||||
.then(function () {
|
||||
return thisTime
|
||||
.then(() => {
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button[aria-label="Search"]')
|
||||
.click();
|
||||
});
|
||||
}
|
||||
|
||||
getDocHeader() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('thead.ng-isolate-scope > tr:nth-child(1)')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
getDocTableIndex(index) {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('tr.discover-table-row:nth-child(' + (index) + ')')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
clickDocSortDown() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('.fa-sort-down')
|
||||
.click();
|
||||
}
|
||||
|
||||
clickDocSortUp() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('.fa-sort-up')
|
||||
.click();
|
||||
}
|
||||
|
||||
getMarks() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findAllByCssSelector('mark')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
clickShare() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button[aria-label="Share Search"]')
|
||||
.click();
|
||||
}
|
||||
|
||||
clickShortenUrl() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('button.shorten-button')
|
||||
.click();
|
||||
}
|
||||
|
||||
clickCopyToClipboard() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findDisplayedByCssSelector('button.clipboard-button')
|
||||
.click();
|
||||
}
|
||||
|
||||
getShareCaption() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('.vis-share label')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
getSharedUrl() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('.url')
|
||||
.getProperty('value');
|
||||
}
|
||||
|
||||
getShortenedUrl() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByCssSelector('.url')
|
||||
.getProperty('value');
|
||||
}
|
||||
|
||||
toggleSidebarCollapse() {
|
||||
return thisTime.findDisplayedByCssSelector('.sidebar-collapser .chevron-cont')
|
||||
return this.findTimeout.findDisplayedByCssSelector('.sidebar-collapser .chevron-cont')
|
||||
.click();
|
||||
}
|
||||
|
||||
getSidebarWidth() {
|
||||
return thisTime
|
||||
return this.findTimeout
|
||||
.findByClassName('sidebar-list')
|
||||
.getProperty('clientWidth');
|
||||
}
|
||||
|
||||
hasNoResults() {
|
||||
return this
|
||||
.findTestSubject('discoverNoResults')
|
||||
return PageObjects.common.findTestSubject('discoverNoResults')
|
||||
.then(() => true)
|
||||
.catch(() => false);
|
||||
}
|
||||
|
||||
getNoResultsTimepicker() {
|
||||
return this.findTestSubject('discoverNoResultsTimefilter');
|
||||
return PageObjects.common.findTestSubject('discoverNoResultsTimefilter');
|
||||
}
|
||||
|
||||
hasNoResultsTimepicker() {
|
||||
|
|
|
@ -1,50 +1,47 @@
|
|||
|
||||
import Common from './common.js';
|
||||
import { defaultFindTimeout } from '../';
|
||||
import {
|
||||
defaultFindTimeout
|
||||
} from '../';
|
||||
|
||||
export default class HeaderPage extends Common {
|
||||
import PageObjects from './';
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
export default class HeaderPage {
|
||||
|
||||
init(remote) {
|
||||
super.init(remote);
|
||||
this.remote = remote;
|
||||
}
|
||||
|
||||
clickSelector(selector) {
|
||||
var self = this;
|
||||
return this.try(function () {
|
||||
return self.remote.setFindTimeout(defaultFindTimeout)
|
||||
return this.try(() => {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector(selector)
|
||||
.then(function (tab) {
|
||||
.then(tab => {
|
||||
return tab.click();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
clickDiscover() {
|
||||
this.debug('click Discover tab');
|
||||
PageObjects.common.debug('click Discover tab');
|
||||
this.clickSelector('a[href*=\'discover\']');
|
||||
}
|
||||
|
||||
clickVisualize() {
|
||||
this.debug('click Visualize tab');
|
||||
PageObjects.common.debug('click Visualize tab');
|
||||
this.clickSelector('a[href*=\'visualize\']');
|
||||
}
|
||||
|
||||
clickDashboard() {
|
||||
this.debug('click Dashboard tab');
|
||||
PageObjects.common.debug('click Dashboard tab');
|
||||
this.clickSelector('a[href*=\'dashboard\']');
|
||||
}
|
||||
|
||||
clickSettings() {
|
||||
this.debug('click Settings tab');
|
||||
PageObjects.common.debug('click Settings tab');
|
||||
this.clickSelector('a[href*=\'settings\']');
|
||||
}
|
||||
|
||||
clickTimepicker() {
|
||||
var self = this;
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findDisplayedByClassName('navbar-timepicker-time-desc').click();
|
||||
}
|
||||
|
@ -57,7 +54,6 @@ export default class HeaderPage extends Common {
|
|||
}
|
||||
|
||||
clickAbsoluteButton() {
|
||||
var self = this;
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByLinkText('Absolute').click();
|
||||
}
|
||||
|
@ -86,20 +82,19 @@ export default class HeaderPage extends Common {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
setAbsoluteRange(fromTime, toTime) {
|
||||
this.debug('clickTimepicker');
|
||||
PageObjects.common.debug('clickTimepicker');
|
||||
return this.clickTimepicker()
|
||||
.then(() => {
|
||||
this.debug('--Clicking Absolute button');
|
||||
PageObjects.common.debug('--Clicking Absolute button');
|
||||
return this.clickAbsoluteButton();
|
||||
})
|
||||
.then(() => {
|
||||
this.debug('--Setting From Time : ' + fromTime);
|
||||
PageObjects.common.debug('--Setting From Time : ' + fromTime);
|
||||
return this.setFromTime(fromTime);
|
||||
})
|
||||
.then(() => {
|
||||
this.debug('--Setting To Time : ' + toTime);
|
||||
PageObjects.common.debug('--Setting To Time : ' + toTime);
|
||||
return this.setToTime(toTime);
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -114,7 +109,6 @@ export default class HeaderPage extends Common {
|
|||
}
|
||||
|
||||
collapseTimepicker() {
|
||||
var self = this;
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('.fa.fa-chevron-circle-up')
|
||||
.click();
|
||||
|
@ -127,22 +121,18 @@ export default class HeaderPage extends Common {
|
|||
}
|
||||
|
||||
waitForToastMessageGone() {
|
||||
var self = this;
|
||||
return self.remote.setFindTimeout(defaultFindTimeout)
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.waitForDeletedByCssSelector('kbn-truncated.toast-message');
|
||||
}
|
||||
|
||||
clickToastOK() {
|
||||
return this.remote
|
||||
.setFindTimeout(defaultFindTimeout)
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button[ng-if="notif.accept"]')
|
||||
.click();
|
||||
}
|
||||
|
||||
getSpinnerDone() {
|
||||
var self = this;
|
||||
return this.remote
|
||||
.setFindTimeout(defaultFindTimeout * 10)
|
||||
return this.remote.setFindTimeout(defaultFindTimeout * 10)
|
||||
.findByCssSelector('.spinner.ng-hide');
|
||||
}
|
||||
|
||||
|
|
|
@ -1,387 +1,381 @@
|
|||
import Bluebird from 'bluebird';
|
||||
import { common, remote, defaultFindTimeout, headerPage } from '../';
|
||||
|
||||
export default (function () {
|
||||
function SettingsPage() {
|
||||
import Bluebird from 'bluebird';
|
||||
|
||||
import {
|
||||
defaultFindTimeout,
|
||||
} from '../';
|
||||
|
||||
import PageObjects from './';
|
||||
|
||||
export default class SettingsPage {
|
||||
|
||||
init(remote) {
|
||||
this.remote = remote;
|
||||
}
|
||||
|
||||
SettingsPage.prototype = {
|
||||
constructor: SettingsPage,
|
||||
clickNavigation() {
|
||||
// TODO: find better way to target the element
|
||||
return this.remote.findDisplayedByCssSelector('.app-link:nth-child(5) a').click();
|
||||
}
|
||||
|
||||
init(remote) {
|
||||
this.remote = remote;
|
||||
},
|
||||
clickLinkText(text) {
|
||||
return this.remote.findDisplayedByLinkText(text).click();
|
||||
}
|
||||
|
||||
clickNavigation: function () {
|
||||
// TODO: find better way to target the element
|
||||
return this.remote.findDisplayedByCssSelector('.app-link:nth-child(5) a').click();
|
||||
},
|
||||
clickKibanaSettings() {
|
||||
return this.clickLinkText('Advanced Settings');
|
||||
}
|
||||
|
||||
clickLinkText: function (text) {
|
||||
return this.remote.findDisplayedByLinkText(text).click();
|
||||
},
|
||||
clickKibanaIndicies() {
|
||||
return this.clickLinkText('Index Patterns');
|
||||
}
|
||||
|
||||
clickKibanaSettings: function () {
|
||||
return this.clickLinkText('Advanced Settings');
|
||||
},
|
||||
clickExistingData() {
|
||||
return this.clickLinkText('Existing Data');
|
||||
}
|
||||
|
||||
clickKibanaIndicies: function () {
|
||||
return this.clickLinkText('Index Patterns');
|
||||
},
|
||||
getAdvancedSettings(propertyName) {
|
||||
PageObjects.common.debug('in setAdvancedSettings');
|
||||
return PageObjects.common.findTestSubject('advancedSetting&' + propertyName + ' currentValue')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
clickExistingData: function () {
|
||||
return this.clickLinkText('Existing Data');
|
||||
},
|
||||
setAdvancedSettings(propertyName, propertyValue) {
|
||||
var self = this;
|
||||
|
||||
getAdvancedSettings: function getAdvancedSettings(propertyName) {
|
||||
common.debug('in setAdvancedSettings');
|
||||
return common.findTestSubject('advancedSetting&' + propertyName + ' currentValue')
|
||||
.getVisibleText();
|
||||
},
|
||||
return PageObjects.common.findTestSubject('advancedSetting&' + propertyName + ' editButton')
|
||||
.click()
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.common.sleep(1000);
|
||||
})
|
||||
.then(function setAdvancedSettingsClickPropertyValue(selectList) {
|
||||
return self.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('option[label="' + propertyValue + '"]')
|
||||
.click();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
.then(function setAdvancedSettingsClickSaveButton() {
|
||||
return PageObjects.common.findTestSubject('advancedSetting&' + propertyName + ' saveButton')
|
||||
.click();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
}
|
||||
|
||||
setAdvancedSettings: function setAdvancedSettings(propertyName, propertyValue) {
|
||||
var self = this;
|
||||
getAdvancedSettings(propertyName) {
|
||||
var self = this;
|
||||
PageObjects.common.debug('in setAdvancedSettings');
|
||||
return PageObjects.common.findTestSubject('advancedSetting&' + propertyName + ' currentValue')
|
||||
.getVisibleText();
|
||||
}
|
||||
|
||||
return common.findTestSubject('advancedSetting&' + propertyName + ' editButton')
|
||||
.click()
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
})
|
||||
.then(function () {
|
||||
return common.sleep(1000);
|
||||
})
|
||||
.then(function setAdvancedSettingsClickPropertyValue(selectList) {
|
||||
return self.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('option[label="' + propertyValue + '"]')
|
||||
.click();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
})
|
||||
.then(function setAdvancedSettingsClickSaveButton() {
|
||||
return common.findTestSubject('advancedSetting&' + propertyName + ' saveButton')
|
||||
.click();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
});
|
||||
},
|
||||
navigateTo() {
|
||||
return PageObjects.common.navigateToApp('settings');
|
||||
}
|
||||
|
||||
getAdvancedSettings: function getAdvancedSettings(propertyName) {
|
||||
var self = this;
|
||||
common.debug('in setAdvancedSettings');
|
||||
return common.findTestSubject('advancedSetting&' + propertyName + ' currentValue')
|
||||
.getVisibleText();
|
||||
},
|
||||
getTimeBasedEventsCheckbox() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('input[ng-model="index.isTimeBased"]');
|
||||
}
|
||||
|
||||
navigateTo: function () {
|
||||
return common.navigateToApp('settings');
|
||||
},
|
||||
getTimeBasedIndexPatternCheckbox(timeout) {
|
||||
timeout = timeout || defaultFindTimeout;
|
||||
// fail faster since we're sometimes checking that it doesn't exist
|
||||
return this.remote.setFindTimeout(timeout)
|
||||
.findByCssSelector('input[ng-model="index.nameIsPattern"]');
|
||||
}
|
||||
|
||||
getTimeBasedEventsCheckbox: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('input[ng-model="index.isTimeBased"]');
|
||||
},
|
||||
getIndexPatternField() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('[ng-model="index.name"]');
|
||||
}
|
||||
|
||||
getTimeBasedIndexPatternCheckbox: function (timeout) {
|
||||
timeout = timeout || defaultFindTimeout;
|
||||
// fail faster since we're sometimes checking that it doesn't exist
|
||||
return this.remote.setFindTimeout(timeout)
|
||||
.findByCssSelector('input[ng-model="index.nameIsPattern"]');
|
||||
},
|
||||
getTimeFieldNameField() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findDisplayedByCssSelector('select[ng-model="index.timeField"]');
|
||||
}
|
||||
|
||||
getIndexPatternField: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('[ng-model="index.name"]');
|
||||
},
|
||||
|
||||
getTimeFieldNameField: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findDisplayedByCssSelector('select[ng-model="index.timeField"]');
|
||||
},
|
||||
|
||||
selectTimeFieldOption: function (selection) {
|
||||
var self = this;
|
||||
|
||||
// open dropdown
|
||||
return self.getTimeFieldNameField().click()
|
||||
.then(function () {
|
||||
// close dropdown, keep focus
|
||||
return self.getTimeFieldNameField().click();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function () {
|
||||
return self.getTimeFieldOption(selection).click()
|
||||
.then(function () {
|
||||
return self.getTimeFieldOption(selection).isSelected();
|
||||
})
|
||||
.then(function (selected) {
|
||||
if (!selected) throw new Error('option not selected: ' + selected);
|
||||
});
|
||||
selectTimeFieldOption(selection) {
|
||||
// open dropdown
|
||||
return this.getTimeFieldNameField().click()
|
||||
.then(() => {
|
||||
// close dropdown, keep focus
|
||||
return this.getTimeFieldNameField().click();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.common.try(() => {
|
||||
return this.getTimeFieldOption(selection).click()
|
||||
.then(() => {
|
||||
return this.getTimeFieldOption(selection).isSelected();
|
||||
})
|
||||
.then(selected => {
|
||||
if (!selected) throw new Error('option not selected: ' + selected);
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
getTimeFieldOption: function (selection) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findDisplayedByCssSelector('option[label="' + selection + '"]').click();
|
||||
},
|
||||
getTimeFieldOption(selection) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findDisplayedByCssSelector('option[label="' + selection + '"]').click();
|
||||
}
|
||||
|
||||
getCreateButton: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findDisplayedByCssSelector('[type="submit"]');
|
||||
},
|
||||
getCreateButton() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findDisplayedByCssSelector('[type="submit"]');
|
||||
}
|
||||
|
||||
clickDefaultIndexButton: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-warning.ng-scope').click()
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
});
|
||||
},
|
||||
clickDefaultIndexButton() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-warning.ng-scope').click()
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
}
|
||||
|
||||
clickDeletePattern: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-danger.ng-scope').click();
|
||||
},
|
||||
clickDeletePattern() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-danger.ng-scope').click();
|
||||
}
|
||||
|
||||
getIndexPageHeading: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('h1.title.ng-binding.ng-isolate-scope');
|
||||
},
|
||||
getIndexPageHeading() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('h1.title.ng-binding.ng-isolate-scope');
|
||||
}
|
||||
|
||||
getConfigureHeader: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('h1');
|
||||
},
|
||||
getTableHeader: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findAllByCssSelector('table.table.table-condensed thead tr th');
|
||||
},
|
||||
getConfigureHeader() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('h1');
|
||||
}
|
||||
getTableHeader() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findAllByCssSelector('table.table.table-condensed thead tr th');
|
||||
}
|
||||
|
||||
sortBy: function (columnName) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findAllByCssSelector('table.table.table-condensed thead tr th span')
|
||||
.then(function (chartTypes) {
|
||||
function getChartType(chart) {
|
||||
return chart.getVisibleText()
|
||||
.then(function (chartString) {
|
||||
if (chartString === columnName) {
|
||||
return chart.click()
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var getChartTypesPromises = chartTypes.map(getChartType);
|
||||
return Bluebird.all(getChartTypesPromises);
|
||||
});
|
||||
},
|
||||
|
||||
getTableRow: function (rowNumber, colNumber) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
// passing in zero-based index, but adding 1 for css 1-based indexes
|
||||
.findByCssSelector('div.agg-table-paginated table.table.table-condensed tbody tr:nth-child(' +
|
||||
(rowNumber + 1) + ') td.ng-scope:nth-child(' +
|
||||
(colNumber + 1) + ') span.ng-binding'
|
||||
);
|
||||
},
|
||||
|
||||
getFieldsTabCount: function () {
|
||||
var self = this;
|
||||
var selector = 'li.kbn-management-tab.active a small';
|
||||
|
||||
return common.try(function () {
|
||||
return self.remote.setFindTimeout(defaultFindTimeout / 10)
|
||||
.findByCssSelector(selector).getVisibleText()
|
||||
.then(function (theText) {
|
||||
// the value has () around it, remove them
|
||||
return theText.replace(/\((.*)\)/, '$1');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
getPageSize: function () {
|
||||
var selectedItemLabel = '';
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findAllByCssSelector('select.ng-pristine.ng-valid.ng-untouched option')
|
||||
.then(function (chartTypes) {
|
||||
function getChartType(chart) {
|
||||
var thisChart = chart;
|
||||
return chart.isSelected()
|
||||
.then(function (isSelected) {
|
||||
if (isSelected === true) {
|
||||
return thisChart.getProperty('label')
|
||||
.then(function (theLabel) {
|
||||
selectedItemLabel = theLabel;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var getChartTypesPromises = chartTypes.map(getChartType);
|
||||
return Bluebird.all(getChartTypesPromises);
|
||||
})
|
||||
.then(function () {
|
||||
return selectedItemLabel;
|
||||
});
|
||||
},
|
||||
|
||||
getPageFieldCount: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findAllByCssSelector('div.agg-table-paginated table.table.table-condensed tbody tr td.ng-scope:nth-child(1) span.ng-binding');
|
||||
},
|
||||
|
||||
goToPage: function (pageNum) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('ul.pagination-other-pages-list.pagination-sm.ng-scope li.ng-scope:nth-child(' +
|
||||
(pageNum + 1) + ') a.ng-binding'
|
||||
)
|
||||
.then(function (page) {
|
||||
return page.click();
|
||||
});
|
||||
},
|
||||
|
||||
openControlsRow: function (row) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('table.table.table-condensed tbody tr:nth-child(' +
|
||||
(row + 1) + ') td.ng-scope div.actions a.btn.btn-xs.btn-default i.fa.fa-pencil'
|
||||
)
|
||||
.then(function (page) {
|
||||
return page.click();
|
||||
});
|
||||
},
|
||||
|
||||
openControlsByName: function (name) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('div.actions a.btn.btn-xs.btn-default[href$="/' + name + '"]')
|
||||
.then(function (button) {
|
||||
return button.click();
|
||||
});
|
||||
},
|
||||
|
||||
increasePopularity: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-default[aria-label="Plus"]')
|
||||
.then(function (button) {
|
||||
return button.click();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
});
|
||||
},
|
||||
|
||||
getPopularity: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('input[ng-model="editor.field.count"]')
|
||||
.then(function (input) {
|
||||
return input.getProperty('value');
|
||||
});
|
||||
},
|
||||
|
||||
controlChangeCancel: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-primary[aria-label="Cancel"]')
|
||||
.then(function (button) {
|
||||
return button.click();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
});
|
||||
},
|
||||
|
||||
controlChangeSave: function () {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-success.ng-binding[aria-label="Update Field"]')
|
||||
.then(function (button) {
|
||||
return button.click();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
});
|
||||
},
|
||||
|
||||
setPageSize: function (size) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('form.form-inline.pagination-size.ng-scope.ng-pristine.ng-valid div.form-group option[label="' + size + '"]')
|
||||
.then(function (button) {
|
||||
return button.click();
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
});
|
||||
},
|
||||
|
||||
createIndexPattern: function () {
|
||||
var self = this;
|
||||
|
||||
return common.try(function () {
|
||||
return self.navigateTo()
|
||||
.then(function () {
|
||||
return self.clickExistingData();
|
||||
})
|
||||
.then(function () {
|
||||
return self.selectTimeFieldOption('@timestamp');
|
||||
})
|
||||
.then(function () {
|
||||
return self.getCreateButton().click();
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return headerPage.getSpinnerDone();
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function () {
|
||||
return self.remote.getCurrentUrl()
|
||||
.then(function (currentUrl) {
|
||||
common.log('currentUrl', currentUrl);
|
||||
|
||||
if (!currentUrl.match(/indices\/.+\?/)) {
|
||||
throw new Error('Index pattern not created');
|
||||
} else {
|
||||
common.debug('Index pattern created: ' + currentUrl);
|
||||
}
|
||||
sortBy(columnName) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findAllByCssSelector('table.table.table-condensed thead tr th span')
|
||||
.then(function (chartTypes) {
|
||||
function getChartType(chart) {
|
||||
return chart.getVisibleText()
|
||||
.then(function (chartString) {
|
||||
if (chartString === columnName) {
|
||||
return chart.click()
|
||||
.then(function () {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var getChartTypesPromises = chartTypes.map(getChartType);
|
||||
return Bluebird.all(getChartTypesPromises);
|
||||
});
|
||||
}
|
||||
|
||||
getTableRow(rowNumber, colNumber) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
// passing in zero-based index, but adding 1 for css 1-based indexes
|
||||
.findByCssSelector('div.agg-table-paginated table.table.table-condensed tbody tr:nth-child(' +
|
||||
(rowNumber + 1) + ') td.ng-scope:nth-child(' +
|
||||
(colNumber + 1) + ') span.ng-binding'
|
||||
);
|
||||
}
|
||||
|
||||
getFieldsTabCount() {
|
||||
var self = this;
|
||||
var selector = 'li.kbn-management-tab.active a small';
|
||||
|
||||
return PageObjects.common.try(function () {
|
||||
return self.remote.setFindTimeout(defaultFindTimeout / 10)
|
||||
.findByCssSelector(selector).getVisibleText()
|
||||
.then(function (theText) {
|
||||
// the value has () around it, remove them
|
||||
return theText.replace(/\((.*)\)/, '$1');
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
removeIndexPattern: function () {
|
||||
var self = this;
|
||||
var alertText;
|
||||
|
||||
return common.try(function () {
|
||||
return self.clickDeletePattern()
|
||||
.then(function () {
|
||||
return self.remote.getAlertText();
|
||||
})
|
||||
.then(function (text) {
|
||||
alertText = text;
|
||||
})
|
||||
.then(function () {
|
||||
return self.remote.acceptAlert();
|
||||
getPageSize() {
|
||||
var selectedItemLabel = '';
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findAllByCssSelector('select.ng-pristine.ng-valid.ng-untouched option')
|
||||
.then(function (chartTypes) {
|
||||
function getChartType(chart) {
|
||||
var thisChart = chart;
|
||||
return chart.isSelected()
|
||||
.then(function (isSelected) {
|
||||
if (isSelected === true) {
|
||||
return thisChart.getProperty('label')
|
||||
.then(function (theLabel) {
|
||||
selectedItemLabel = theLabel;
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return common.try(function () {
|
||||
return self.remote.getCurrentUrl()
|
||||
}
|
||||
|
||||
var getChartTypesPromises = chartTypes.map(getChartType);
|
||||
return Bluebird.all(getChartTypesPromises);
|
||||
})
|
||||
.then(() => {
|
||||
return selectedItemLabel;
|
||||
});
|
||||
}
|
||||
|
||||
getPageFieldCount() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findAllByCssSelector('div.agg-table-paginated table.table.table-condensed tbody tr td.ng-scope:nth-child(1) span.ng-binding');
|
||||
}
|
||||
|
||||
goToPage(pageNum) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('ul.pagination-other-pages-list.pagination-sm.ng-scope li.ng-scope:nth-child(' +
|
||||
(pageNum + 1) + ') a.ng-binding'
|
||||
)
|
||||
.then(page => {
|
||||
return page.click();
|
||||
});
|
||||
}
|
||||
|
||||
openControlsRow(row) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('table.table.table-condensed tbody tr:nth-child(' +
|
||||
(row + 1) + ') td.ng-scope div.actions a.btn.btn-xs.btn-default i.fa.fa-pencil'
|
||||
)
|
||||
.then(page => {
|
||||
return page.click();
|
||||
});
|
||||
}
|
||||
|
||||
openControlsByName(name) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('div.actions a.btn.btn-xs.btn-default[href$="/' + name + '"]')
|
||||
.then(button => {
|
||||
return button.click();
|
||||
});
|
||||
}
|
||||
|
||||
increasePopularity() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-default[aria-label="Plus"]')
|
||||
.then(button => {
|
||||
return button.click();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
}
|
||||
|
||||
getPopularity() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('input[ng-model="editor.field.count"]')
|
||||
.then(input => {
|
||||
return input.getProperty('value');
|
||||
});
|
||||
}
|
||||
|
||||
controlChangeCancel() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-primary[aria-label="Cancel"]')
|
||||
.then(button => {
|
||||
return button.click();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
}
|
||||
|
||||
controlChangeSave() {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('button.btn.btn-success.ng-binding[aria-label="Update Field"]')
|
||||
.then(button => {
|
||||
return button.click();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
}
|
||||
|
||||
setPageSize(size) {
|
||||
return this.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('form.form-inline.pagination-size.ng-scope.ng-pristine.ng-valid div.form-group option[label="' + size + '"]')
|
||||
.then(button => {
|
||||
return button.click();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
});
|
||||
}
|
||||
|
||||
createIndexPattern() {
|
||||
return PageObjects.common.try(() => {
|
||||
return this.navigateTo()
|
||||
.then(() => {
|
||||
return this.clickExistingData();
|
||||
})
|
||||
.then(() => {
|
||||
return this.selectTimeFieldOption('@timestamp');
|
||||
})
|
||||
.then(() => {
|
||||
return this.getCreateButton().click();
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.header.getSpinnerDone();
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.common.try(() => {
|
||||
return this.remote.getCurrentUrl()
|
||||
.then(function (currentUrl) {
|
||||
if (currentUrl.match(/indices\/.+\?/)) {
|
||||
throw new Error('Index pattern not removed');
|
||||
PageObjects.common.log('currentUrl', currentUrl);
|
||||
|
||||
if (!currentUrl.match(/indices\/.+\?/)) {
|
||||
throw new Error('Index pattern not created');
|
||||
} else {
|
||||
PageObjects.common.debug('Index pattern created: ' + currentUrl);
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(function () {
|
||||
return alertText;
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
return SettingsPage;
|
||||
}());
|
||||
removeIndexPattern() {
|
||||
var alertText;
|
||||
|
||||
return PageObjects.common.try(() => {
|
||||
return this.clickDeletePattern()
|
||||
.then(() => {
|
||||
return this.remote.getAlertText();
|
||||
})
|
||||
.then(function (text) {
|
||||
alertText = text;
|
||||
})
|
||||
.then(() => {
|
||||
return this.remote.acceptAlert();
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
return PageObjects.common.try(() => {
|
||||
return this.remote.getCurrentUrl()
|
||||
.then(function (currentUrl) {
|
||||
if (currentUrl.match(/indices\/.+\?/)) {
|
||||
throw new Error('Index pattern not removed');
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
return alertText;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,37 +1,27 @@
|
|||
import { remote, defaultFindTimeout } from '../';
|
||||
|
||||
// in test/support/pages/shield_page.js
|
||||
export default (function (require) {
|
||||
// the page object is created as a constructor
|
||||
// so we can provide the remote Command object
|
||||
// at runtime
|
||||
function ShieldPage() {
|
||||
import {
|
||||
defaultFindTimeout,
|
||||
} from '../';
|
||||
|
||||
export default class ShieldPage {
|
||||
|
||||
init(remote) {
|
||||
this.remote = remote;
|
||||
}
|
||||
|
||||
ShieldPage.prototype = {
|
||||
constructor: ShieldPage,
|
||||
login(user, pwd) {
|
||||
var remote = this.remote;
|
||||
return remote.setFindTimeout(defaultFindTimeout)
|
||||
.findById('username')
|
||||
.type(user)
|
||||
.then(function () {
|
||||
return remote.findById('password')
|
||||
.type(pwd);
|
||||
})
|
||||
.then(function () {
|
||||
return remote.findByCssSelector('.btn')
|
||||
.click();
|
||||
});
|
||||
}
|
||||
|
||||
init(remote) {
|
||||
this.remote = remote;
|
||||
},
|
||||
|
||||
login: function login(user, pwd) {
|
||||
var remote = this.remote;
|
||||
return remote.setFindTimeout(defaultFindTimeout)
|
||||
.findById('username')
|
||||
.type(user)
|
||||
.then(function () {
|
||||
return remote.findById('password')
|
||||
.type(pwd);
|
||||
})
|
||||
.then(function () {
|
||||
return remote.findByCssSelector('.btn')
|
||||
.click();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
return ShieldPage;
|
||||
}());
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue