Skip to content

Commit

Permalink
Add functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof committed Jun 23, 2020
1 parent 516a01b commit bc3d710
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function DefaultEditorAggGroup({
<EuiSpacer size="s" />
{bucketsError && (
<>
<EuiFormErrorText>{bucketsError}</EuiFormErrorText>
<EuiFormErrorText data-test-subj="bucketsError">{bucketsError}</EuiFormErrorText>
<EuiSpacer size="s" />
</>
)}
Expand Down
41 changes: 41 additions & 0 deletions test/functional/apps/visualize/_line_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,46 @@ export default function ({ getService, getPageObjects }) {
expect(labels).to.eql(expectedLabels);
});
});

describe('pipeline aggregations', () => {
before(async () => {
log.debug('navigateToApp visualize');
await PageObjects.visualize.navigateToNewVisualization();
log.debug('clickLineChart');
await PageObjects.visualize.clickLineChart();
await PageObjects.visualize.clickNewSearch();
await PageObjects.timePicker.setDefaultAbsoluteRange();
});

it('should have an error if bucket is not selected', async () => {
await PageObjects.visEditor.clickMetricEditor();
log.debug('Metrics agg = Serial diff');
await PageObjects.visEditor.selectAggregation('Serial diff', 'metrics');
await testSubjects.existOrFail('bucketsError');
});

it('should apply with selected bucket', async () => {
log.debug('Bucket = X-axis');
await PageObjects.visEditor.clickBucket('X-axis');
log.debug('Aggregation = Date Histogram');
await PageObjects.visEditor.selectAggregation('Date Histogram');
await PageObjects.visEditor.clickGo();
const title = await PageObjects.visChart.getYAxisTitle();
expect(title).to.be('Serial Diff of Count');
});

it('should change y-axis label to custom', async () => {
log.debug('set custom label of y-axis to "test"');
await PageObjects.visEditor.setCustomLabel('test', 1);
await PageObjects.visEditor.clickGo();
const title = await PageObjects.visChart.getYAxisTitle();
expect(title).to.be('test');
});

it('should have advanced accordion and json input', async () => {
await testSubjects.click('advancedParams-1');
await testSubjects.existOrFail('advancedParams-1 > codeEditorContainer');
});
});
});
}

0 comments on commit bc3d710

Please sign in to comment.