Skip to content

Commit

Permalink
Fix functional tests for Visualize, to work with new landing page.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Feb 4, 2017
1 parent 6a66f6f commit 5a720c9
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1 class="kuiTitle">
class="wizard-type-heading-icon fa fa-fw"
ng-class="type.icon"
></i>
<h4 class="wizard-type-heading-text">{{type.title}}</h4>
<h4 data-test-subj="visualizeWizardChartTypeTitle" class="wizard-type-heading-text">{{type.title}}</h4>
</div>
<p class="wizard-type-description">{{type.description}}</p>
</a>
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_area_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() {
const toTime = '2015-09-23 18:31:44.000';

PageObjects.common.debug('navigateToApp visualize');
return PageObjects.common.navigateToApp('visualize')
return PageObjects.common.navigateToUrl('visualize', 'step/1')
.then(function () {
PageObjects.common.debug('clickAreaChart');
return PageObjects.visualize.clickAreaChart();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_chart_types.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bdd.describe('visualize app', function describeIndexTests() {

bdd.before(function () {
PageObjects.common.debug('navigateToApp visualize');
return PageObjects.common.navigateToApp('visualize');
return PageObjects.common.navigateToUrl('visualize', 'step/1');
});

bdd.describe('chart types', function indexPatternCreation() {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_data_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() {

bdd.before(function () {
PageObjects.common.debug('navigateToApp visualize');
return PageObjects.common.navigateToApp('visualize')
return PageObjects.common.navigateToUrl('visualize', 'step/1')
.then(function () {
PageObjects.common.debug('clickDataTable');
return PageObjects.visualize.clickDataTable();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_line_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() {
const toTime = '2015-09-23 18:31:44.000';

PageObjects.common.debug('navigateToApp visualize');
return PageObjects.common.navigateToApp('visualize')
return PageObjects.common.navigateToUrl('visualize', 'step/1')
.then(function () {
PageObjects.common.debug('clickLineChart');
return PageObjects.visualize.clickLineChart();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_metric_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() {

bdd.before(function () {
PageObjects.common.debug('navigateToApp visualize');
return PageObjects.common.navigateToApp('visualize')
return PageObjects.common.navigateToUrl('visualize', 'step/1')
.then(function () {
PageObjects.common.debug('clickMetric');
return PageObjects.visualize.clickMetric();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_pie_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() {
const toTime = '2015-09-23 18:31:44.000';

PageObjects.common.debug('navigateToApp visualize');
return PageObjects.common.navigateToApp('visualize')
return PageObjects.common.navigateToUrl('visualize', 'step/1')
.then(function () {
PageObjects.common.debug('clickPieChart');
return PageObjects.visualize.clickPieChart();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_tile_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bdd.describe('visualize app', function describeIndexTests() {
bdd.before(function () {

PageObjects.common.debug('navigateToApp visualize');
return PageObjects.common.navigateToApp('visualize')
return PageObjects.common.navigateToUrl('visualize', 'step/1')
.then(function () {
PageObjects.common.debug('clickTileMap');
return PageObjects.visualize.clickTileMap();
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/visualize/_vertical_bar_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bdd.describe('visualize app', function describeIndexTests() {

bdd.before(function () {
PageObjects.common.debug('navigateToApp visualize');
return PageObjects.common.navigateToApp('visualize')
return PageObjects.common.navigateToUrl('visualize', 'step/1')
.then(function () {
PageObjects.common.debug('clickVerticalBarChart');
return PageObjects.visualize.clickVerticalBarChart();
Expand Down
9 changes: 9 additions & 0 deletions test/support/page_objects/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ export default class Common {
return getUrl.baseUrl(config.servers.elasticsearch);
}

navigateToUrl(appName, subUrl) {
const appConfig = Object.assign({}, config.apps[appName], {
// Overwrite the default hash with the URL we really want.
hash: `${appName}/${subUrl}`,
});
const appUrl = getUrl.noAuth(config.servers.kibana, appConfig);
return this.remote.get(appUrl);
}

navigateToApp(appName, testStatusPage) {
const self = this;
const appUrl = getUrl.noAuth(config.servers.kibana, config.apps[appName]);
Expand Down
14 changes: 2 additions & 12 deletions test/support/page_objects/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ export default class VisualizePage {
}

getChartTypes() {

return this.remote
.setFindTimeout(defaultFindTimeout)
.findAllByCssSelector('.wizard-type-heading h4')
return PageObjects.common.findAllTestSubjects('visualizeWizardChartTypeTitle')
.then(function (chartTypes) {
function getChartType(chart) {
return chart.getVisibleText();
Expand Down Expand Up @@ -379,14 +376,7 @@ export default class VisualizePage {
// this is for starting on the
// bottom half of the "Create a new visualization Step 1" page
openSavedVisualization(vizName) {
const self = this;
return self.filterVisByName(vizName)
.then(() => {
return PageObjects.common.sleep(1000);
})
.then(function clickDashboardByLinkedText() {
return self.clickVisualizationByLinkText(vizName);
});
return this.clickVisualizationByLinkText(vizName);
}

getXAxisLabels() {
Expand Down

0 comments on commit 5a720c9

Please sign in to comment.