Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Introduce tests for add new visualization link (#10785) #10869

Merged
merged 1 commit into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ui/public/partials/saved_object_finder.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<span>{{finder.hitCount}} of {{finder.hitCount}}</span>
</div>
<div class="finder-manage-object col-md-2" ng-if="onAddNew">
<a class="small" ng-click="onAddNew()">
<a class="small" ng-click="onAddNew()" data-test-subj="addNewSavedObjectLink">
Add new {{finder.properties.noun}}
</a>
</div>
Expand Down
17 changes: 16 additions & 1 deletion test/functional/apps/dashboard/_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ bdd.describe('dashboard tab', function describeIndexTests() {
});
});


bdd.it('filters when a pie chart slice is clicked', async function () {
let descriptions = await PageObjects.dashboard.getFilterDescriptions(1000);
expect(descriptions.length).to.equal(0);
Expand Down Expand Up @@ -123,4 +122,20 @@ bdd.describe('dashboard tab', function describeIndexTests() {
});
});
});

bdd.it('add new visualization link', async function checkTitles() {
await PageObjects.dashboard.clickAddVisualization();
await PageObjects.dashboard.clickAddNewVisualizationLink();
await PageObjects.visualize.clickAreaChart();
await PageObjects.visualize.clickNewSearch();
await PageObjects.visualize.saveVisualization('visualization from add new link');

const visualizations = PageObjects.dashboard.getTestVisualizations();
return PageObjects.common.tryForTime(10000, async function () {
const panelTitles = await PageObjects.dashboard.getPanelSizeData();
PageObjects.common.log('visualization titles = ' + panelTitles.map(item => item.title));
PageObjects.common.saveScreenshot('Dashboard-visualization-sizes');
expect(panelTitles.length).to.eql(visualizations.length + 1);
});
});
});
4 changes: 4 additions & 0 deletions test/support/page_objects/dashboard_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ export default class DashboardPage {
}, Promise.resolve());
}

clickAddNewVisualizationLink() {
return PageObjects.common.clickTestSubject('addNewSavedObjectLink');
}

async setTimepickerInDataRange() {
const fromTime = '2015-09-19 06:31:44.000';
const toTime = '2015-09-23 18:31:44.000';
Expand Down