mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
Sanity test for table viz in TSVB
This commit is contained in:
parent
76722b0b8a
commit
496e94a88e
4 changed files with 58 additions and 4 deletions
|
@ -50,7 +50,7 @@ class TablePanelConfig extends Component {
|
|||
</div>
|
||||
<div className="vis_editor__vis_config-row">
|
||||
<label className="vis_editor__label" htmlFor={htmlId('field')}>Group By Field</label>
|
||||
<div className="vis_editor__row_item">
|
||||
<div className="vis_editor__row_item" data-test-subj="groupByField">
|
||||
<FieldSelect
|
||||
id={htmlId('field')}
|
||||
fields={this.props.fields}
|
||||
|
@ -63,6 +63,7 @@ class TablePanelConfig extends Component {
|
|||
<input
|
||||
id={htmlId('pivotLabelInput')}
|
||||
className="vis_editor__input-grows"
|
||||
data-test-subj="columnLabelName"
|
||||
type="text"
|
||||
onChange={handleTextChange('pivot_label')}
|
||||
value={model.pivot_label}
|
||||
|
@ -156,4 +157,3 @@ TablePanelConfig.propTypes = {
|
|||
};
|
||||
|
||||
export default TablePanelConfig;
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ class TableVis extends Component {
|
|||
);
|
||||
}
|
||||
return(
|
||||
<div className={`dashboard__visualization ${reversedClass}`}>
|
||||
<div className={`dashboard__visualization ${reversedClass}`} data-test-subj="tableView">
|
||||
<table className="table">
|
||||
<thead>
|
||||
{header}
|
||||
|
|
|
@ -103,6 +103,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
|
||||
|
||||
|
||||
describe('markdown', () => {
|
||||
|
||||
before(async () => {
|
||||
|
@ -122,7 +123,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
expect(text).to.be('6');
|
||||
});
|
||||
|
||||
describe.skip('allow time offsets', () => {
|
||||
describe('allow time offsets', () => {
|
||||
before(async () => {
|
||||
await PageObjects.visualBuilder.enterMarkdown('{{ count.data.raw.[0].[0] }}#{{ count.data.raw.[0].[1] }}');
|
||||
await PageObjects.visualBuilder.clickMarkdownData();
|
||||
|
@ -147,5 +148,31 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
|
||||
});
|
||||
// add a table sanity timestamp
|
||||
describe('table', () => {
|
||||
before(async () => {
|
||||
await PageObjects.visualBuilder.clickTable();
|
||||
await PageObjects.header.setAbsoluteRange('2015-09-22 06:00:00.000', '2015-09-22 11:00:00.000');
|
||||
log.debug('clicked on Table');
|
||||
});
|
||||
|
||||
it('should be able to set values for group by field and column name', async () => {
|
||||
await PageObjects.visualBuilder.selectGroupByField('machine.os.raw');
|
||||
await PageObjects.visualBuilder.setLabelValue('OS');
|
||||
log.debug('finished setting field and column name');
|
||||
});
|
||||
|
||||
it('should be able verify that values are displayed in the table', async () => {
|
||||
const tableData = await PageObjects.visualBuilder.getViewTable();
|
||||
log.debug(`Values on ${tableData}`);
|
||||
const expectedData = 'OS Count\nwin 8 13\nwin xp 10\nwin 7 12\nios 5\nosx 3';
|
||||
expect(tableData).to.be(expectedData);
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
@ -100,6 +100,33 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }) {
|
|||
return await gaugeCount.getVisibleText();
|
||||
}
|
||||
|
||||
async clickTable() {
|
||||
await testSubjects.click('tableTsvbTypeBtn');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
}
|
||||
|
||||
|
||||
async selectGroupByField(fieldName) {
|
||||
const element = await testSubjects.find('groupByField');
|
||||
const input = await element.findByCssSelector('.Select-input input');
|
||||
await input.type(fieldName);
|
||||
const option = await element.findByCssSelector('.Select-option');
|
||||
await option.click();
|
||||
}
|
||||
|
||||
async setLabelValue(value) {
|
||||
const el = await testSubjects.find('columnLabelName');
|
||||
await el.clearValue();
|
||||
await el.type(value);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
}
|
||||
|
||||
async getViewTable() {
|
||||
const tableView = await testSubjects.find('tableView');
|
||||
return await tableView.getVisibleText();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return new VisualBuilderPage();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue