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

[6.5] show drop partial buckets option (#25520) #26798

Merged
merged 1 commit into from
Dec 12, 2018
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
4 changes: 2 additions & 2 deletions src/ui/public/agg_types/controls/drop_partials.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="checkbox" ng-if="agg.params.field.name === agg.vis.indexPattern.timeFieldName">
<div class="checkbox" ng-if="agg.params.field.name === agg.getIndexPattern().timeFieldName">
<label>
<input ng-model="agg.params.drop_partials" type="checkbox">
<input ng-model="agg.params.drop_partials" type="checkbox" data-test-subj="dropPartialBucketsCheckbox">
Drop partial buckets
&nbsp;
<icon-tip
Expand Down
46 changes: 46 additions & 0 deletions test/functional/apps/visualize/_vertical_bar_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,56 @@ export default function ({ getService, getPageObjects }) {

await PageObjects.visualize.openInspector();
const data = await PageObjects.visualize.getInspectorTableData();
await PageObjects.visualize.closeInspector();
log.debug(data);
expect(data).to.eql(expectedChartData);
});

it('should have `drop partial buckets` option', async () => {
const fromTime = '2015-09-20 06:31:44.000';
const toTime = '2015-09-22 18:31:44.000';

await PageObjects.header.setAbsoluteRange(fromTime, toTime);

let expectedChartValues = [
82, 218, 341, 440, 480, 517, 522, 446, 403, 321, 258, 172, 95, 55, 38, 24, 3, 4,
11, 14, 17, 38, 49, 115, 152, 216, 315, 402, 446, 513, 520, 474, 421, 307, 230,
170, 99, 48, 30, 15, 10, 2, 8, 7, 17, 34, 37, 104, 153, 241, 313, 404, 492, 512,
503, 473, 379, 293, 277, 156, 56
];

// 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
await retry.try(async () => {
const data = await PageObjects.visualize.getBarChartData();
log.debug('data=' + data);
log.debug('data.length=' + data.length);
expect(data).to.eql(expectedChartValues);
});

await PageObjects.visualize.toggleOpenEditor(2);
await PageObjects.visualize.clickDropPartialBuckets();
await PageObjects.visualize.clickGo();

expectedChartValues = [
218, 341, 440, 480, 517, 522, 446, 403, 321, 258, 172, 95, 55, 38, 24, 3, 4,
11, 14, 17, 38, 49, 115, 152, 216, 315, 402, 446, 513, 520, 474, 421, 307, 230,
170, 99, 48, 30, 15, 10, 2, 8, 7, 17, 34, 37, 104, 153, 241, 313, 404, 492, 512,
503, 473, 379, 293, 277, 156
];

// 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
await retry.try(async () => {
const data = await PageObjects.visualize.getBarChartData();
log.debug('data=' + data);
log.debug('data.length=' + data.length);
expect(data).to.eql(expectedChartValues);
});
});

describe.skip('switch between Y axis scale types', () => {
before(initBarChart);
const axisId = 'ValueAxis-1';
Expand Down
4 changes: 4 additions & 0 deletions test/functional/page_objects/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
defaultFindTimeout * 2);
}

async clickDropPartialBuckets() {
return await testSubjects.click('dropPartialBucketsCheckbox');
}

async setMarkdownTxt(markdownTxt) {
const input = await testSubjects.find('markdownTextarea');
await input.clearValue();
Expand Down