[Discover] Cleanup uses of legacy table in functional tests (#134638)

* [Discover] extract doc table tests into a new folder

* [Discover] switch to data grid

* [Discover] apply suggestions

* [Discover] adapt scripted fields tests for data grid

* [Discover] apply suggestions

* [Discover] apply for another part
This commit is contained in:
Dmitry Tomashevich 2022-06-23 12:54:28 +03:00 committed by GitHub
parent db728b12a3
commit 88c25a9373
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 742 additions and 131 deletions

View file

@ -30,7 +30,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before(async () => {
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await kibanaServer.uiSettings.update({
'doc_table:legacy': false,
defaultIndex: 'logstash-*',
});
await PageObjects.common.navigateToApp('discover');

View file

@ -30,7 +30,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
'doc_table:legacy': false,
});
});

View file

@ -32,7 +32,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
'doc_table:legacy': false,
});
});

View file

@ -37,7 +37,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before(async () => {
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await kibanaServer.uiSettings.update({
'doc_table:legacy': false,
defaultIndex: 'logstash-*',
});
await PageObjects.common.navigateToApp('discover');

View file

@ -19,19 +19,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const filterBar = getService('filterBar');
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'context']);
describe('context filters', function contextSize() {
before(async function () {
await kibanaServer.uiSettings.update({ 'doc_table:legacy': false });
});
after(async function () {
await kibanaServer.uiSettings.replace({});
});
beforeEach(async function () {
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID, {
columns: TEST_COLUMN_NAMES,

View file

@ -29,7 +29,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.update({
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
'context:step': `${TEST_STEP_SIZE}`,
'doc_table:legacy': false,
});
await PageObjects.context.navigateTo(TEST_INDEX_PATTERN, TEST_ANCHOR_ID);
});

View file

@ -41,7 +41,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.common.navigateToApp('discover');
});
it('should navigate correctly when ', async () => {
it('should navigate correctly', async () => {
await PageObjects.discover.selectIndexPattern('context-encoded-param');
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.waitForDocTableLoadingComplete();

View file

@ -19,7 +19,7 @@ export default function ({
const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['common', 'discover', 'timePicker']);
const kibanaServer = getService('kibanaServer');
const defaultSettings = { defaultIndex: 'logstash-*', 'doc_table:legacy': false };
const defaultSettings = { defaultIndex: 'logstash-*' };
const testSubjects = getService('testSubjects');
before(async function () {
@ -31,10 +31,6 @@ export default function ({
await PageObjects.timePicker.setDefaultAbsoluteRange();
});
after(async function () {
await kibanaServer.uiSettings.replace({ 'doc_table:legacy': true });
});
it('can add fields to the table', async function () {
const getTitles = async () =>
(await testSubjects.getVisibleText('dataGridHeader')).replace(/\s|\r?\n|\r/g, ' ');

View file

@ -27,7 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'dashboard',
'header',
]);
const defaultSettings = { defaultIndex: 'logstash-*', 'doc_table:legacy': false };
const defaultSettings = { defaultIndex: 'logstash-*' };
const kibanaServer = getService('kibanaServer');
const esArchiver = getService('esArchiver');
const dashboardAddPanel = getService('dashboardAddPanel');

View file

@ -19,7 +19,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'dashboard']);
const defaultSettings = {
defaultIndex: 'logstash-*',
'doc_table:legacy': false,
};
describe('discover data grid supports copy to clipboard', function describeIndexTests() {

View file

@ -17,7 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const retry = getService('retry');
const kibanaServer = getService('kibanaServer');
const defaultSettings = { defaultIndex: 'logstash-*', 'doc_table:legacy': false };
const defaultSettings = { defaultIndex: 'logstash-*' };
describe('discover data grid doc link', function () {
before(async () => {

View file

@ -21,7 +21,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'dashboard']);
const defaultSettings = {
defaultIndex: 'logstash-*',
'doc_table:legacy': false,
};
const testSubjects = getService('testSubjects');

View file

@ -16,7 +16,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const toasts = getService('toasts');
const queryBar = getService('queryBar');
const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize', 'timePicker']);
const defaultSettings = { defaultIndex: 'logstash-*', 'doc_table:legacy': false };
const defaultSettings = { defaultIndex: 'logstash-*' };
const dataGrid = getService('dataGrid');
describe('discover data grid field data tests', function describeIndexTests() {

View file

@ -14,7 +14,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const dataGrid = getService('dataGrid');
const PageObjects = getPageObjects(['settings', 'common', 'discover', 'header', 'timePicker']);
const defaultSettings = { defaultIndex: 'logstash-*', 'doc_table:legacy': false };
const defaultSettings = { defaultIndex: 'logstash-*' };
const testSubjects = getService('testSubjects');
const retry = getService('retry');

View file

@ -14,11 +14,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const dataGrid = getService('dataGrid');
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'settings']);
const defaultSettings = {
defaultIndex: 'logstash-*',
'discover:searchFieldsFromSource': false,
'doc_table:legacy': true,
};
describe('discover uses fields API test', function describeIndexTests() {
before(async function () {
@ -60,7 +60,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
it('displays _source viewer in doc viewer', async function () {
await PageObjects.discover.clickDocTableRowToggle(0);
await dataGrid.clickRowToggle();
await PageObjects.discover.isShowingDocViewer();
await PageObjects.discover.clickDocViewerTab(1);
await PageObjects.discover.expectSourceViewerToExist();
@ -74,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setDefaultAbsoluteRange();
expect(await PageObjects.discover.getDocHeader()).to.have.string('_source');
expect(await PageObjects.discover.getDocHeader()).to.have.string('Document');
});
it('switches to Document column when fields API is used', async function () {

View file

@ -18,8 +18,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const queryBar = getService('queryBar');
const browser = getService('browser');
const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize', 'timePicker']);
const find = getService('find');
const testSubjects = getService('testSubjects');
describe('discover tab', function describeIndexTests() {
this.tags('includeFirefox');
@ -97,38 +95,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const marks = await PageObjects.discover.getMarks();
expect(marks.length).to.be(0);
});
describe('legacy table tests', async function () {
before(async function () {
await kibanaServer.uiSettings.update({ 'doc_table:legacy': true });
await PageObjects.common.navigateToApp('discover');
});
after(async function () {
await kibanaServer.uiSettings.replace({});
});
it('doc view should show @timestamp and _source columns', async function () {
const expectedHeader = '@timestamp\n_source';
const docHeader = await find.byCssSelector('thead > tr:nth-child(1)');
const docHeaderText = await docHeader.getVisibleText();
expect(docHeaderText).to.be(expectedHeader);
});
it('doc view should sort ascending', async function () {
const expectedTimeStamp = 'Sep 20, 2015 @ 00:00:00.000';
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
// we don't technically need this sleep here because the tryForTime will retry and the
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
// case and it can be avoided with just a few seconds sleep.
await PageObjects.common.sleep(2000);
await retry.try(async function tryingForTime() {
const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`);
const rowData = await row.getVisibleText();
expect(rowData.startsWith(expectedTimeStamp)).to.be.ok();
});
});
});
});
});
}

View file

@ -18,8 +18,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const queryBar = getService('queryBar');
const browser = getService('browser');
const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize', 'timePicker']);
const find = getService('find');
const testSubjects = getService('testSubjects');
describe('discover tab with new fields API', function describeIndexTests() {
this.tags('includeFirefox');
@ -104,33 +102,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expect(marks.length).to.be.above(0);
expect(marks).to.contain('election');
});
describe('legacy table tests', async function () {
before(async function () {
await kibanaServer.uiSettings.update({ 'doc_table:legacy': true });
await PageObjects.common.navigateToApp('discover');
});
after(async function () {
await kibanaServer.uiSettings.replace({});
});
it('doc view should sort ascending', async function () {
const expectedTimeStamp = 'Sep 20, 2015 @ 00:00:00.000';
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
// we don't technically need this sleep here because the tryForTime will retry and the
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
// case and it can be avoided with just a few seconds sleep.
await PageObjects.common.sleep(2000);
await retry.try(async function tryingForTime() {
const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`);
const rowData = await row.getVisibleText();
expect(rowData.startsWith(expectedTimeStamp)).to.be.ok();
});
});
});
});
});
}

View file

@ -8,7 +8,7 @@
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const docTable = getService('docTable');

View file

@ -0,0 +1,91 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const log = getService('log');
const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'discover', 'header', 'timePicker', 'settings']);
const defaultSettings = {
defaultIndex: 'logstash-*',
'discover:searchFieldsFromSource': false,
'doc_table:legacy': true,
};
describe('discover uses fields API test', function describeIndexTests() {
before(async function () {
log.debug('load kibana index with default index pattern');
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await kibanaServer.uiSettings.replace(defaultSettings);
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setDefaultAbsoluteRange();
});
after(async () => {
await kibanaServer.uiSettings.replace({});
});
it('should correctly display documents', async function () {
log.debug('check if Document title exists in the grid');
expect(await PageObjects.discover.getDocHeader()).to.have.string('Document');
const rowData = await PageObjects.discover.getDocTableIndex(1);
log.debug('check the newest doc timestamp in UTC (check diff timezone in last test)');
expect(rowData.startsWith('Sep 22, 2015 @ 23:50:13.253')).to.be.ok();
const expectedHitCount = '14,004';
await retry.try(async function () {
expect(await PageObjects.discover.getHitCount()).to.be(expectedHitCount);
});
});
it('adding a column removes a default column', async function () {
await PageObjects.discover.clickFieldListItemAdd('_score');
expect(await PageObjects.discover.getDocHeader()).to.have.string('_score');
expect(await PageObjects.discover.getDocHeader()).not.to.have.string('Document');
});
it('removing a column adds a default column', async function () {
await PageObjects.discover.clickFieldListItemRemove('_score');
expect(await PageObjects.discover.getDocHeader()).not.to.have.string('_score');
expect(await PageObjects.discover.getDocHeader()).to.have.string('Document');
});
it('displays _source viewer in doc viewer', async function () {
await PageObjects.discover.clickDocTableRowToggle(0);
await PageObjects.discover.isShowingDocViewer();
await PageObjects.discover.clickDocViewerTab(1);
await PageObjects.discover.expectSourceViewerToExist();
});
it('switches to _source column when fields API is no longer used', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaSettings();
await PageObjects.settings.toggleAdvancedSettingCheckbox('discover:searchFieldsFromSource');
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setDefaultAbsoluteRange();
expect(await PageObjects.discover.getDocHeader()).to.have.string('_source');
});
it('switches to Document column when fields API is used', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaSettings();
await PageObjects.settings.toggleAdvancedSettingCheckbox('discover:searchFieldsFromSource');
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setDefaultAbsoluteRange();
expect(await PageObjects.discover.getDocHeader()).to.have.string('Document');
});
});
}

View file

@ -7,7 +7,7 @@
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser');
@ -40,6 +40,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.common.navigateToApp('discover');
});
after(async function () {
await kibanaServer.uiSettings.replace({});
});
it('should show records by default', async function () {
// with the default range the number of hits is ~14000
const rows = await PageObjects.discover.getDocTableRows();

View file

@ -6,7 +6,7 @@
* Side Public License, v 1.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
@ -35,8 +35,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await security.testUser.restoreDefaults();
await esArchiver.unload('test/functional/fixtures/es_archiver/message_with_newline');
await kibanaServer.savedObjects.cleanStandardList();
await kibanaServer.uiSettings.unset('defaultIndex');
await kibanaServer.uiSettings.unset('doc_table:legacy');
await kibanaServer.uiSettings.replace({});
});
it('should break text on newlines', async function () {
@ -47,6 +46,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const heightWithoutNewline = await dscTableRows[0].getAttribute('clientHeight');
const heightWithNewline = await dscTableRows[1].getAttribute('clientHeight');
log.debug(`Without newlines: ${heightWithoutNewline}, With newlines: ${heightWithNewline}`);
await PageObjects.common.sleep(10000);
return Number(heightWithNewline) > Number(heightWithoutNewline);
});
});

View file

@ -0,0 +1,62 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize', 'timePicker']);
const find = getService('find');
const testSubjects = getService('testSubjects');
describe('discover tab', function describeIndexTests() {
this.tags('includeFirefox');
before(async function () {
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover.json');
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
await kibanaServer.uiSettings.replace({
defaultIndex: 'logstash-*',
'discover:searchFieldsFromSource': true,
'doc_table:legacy': true,
});
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
await PageObjects.common.navigateToApp('discover');
});
after(async function () {
await kibanaServer.uiSettings.replace({});
});
it('doc view should show @timestamp and _source columns', async function () {
const expectedHeader = '@timestamp\n_source';
const docHeader = await find.byCssSelector('thead > tr:nth-child(1)');
const docHeaderText = await docHeader.getVisibleText();
expect(docHeaderText).to.be(expectedHeader);
});
it('doc view should sort ascending', async function () {
const expectedTimeStamp = 'Sep 20, 2015 @ 00:00:00.000';
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
// we don't technically need this sleep here because the tryForTime will retry and the
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
// case and it can be avoided with just a few seconds sleep.
await PageObjects.common.sleep(2000);
await retry.try(async function tryingForTime() {
const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`);
const rowData = await row.getVisibleText();
expect(rowData.startsWith(expectedTimeStamp)).to.be.ok();
});
});
});
}

View file

@ -0,0 +1,46 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize', 'timePicker']);
const find = getService('find');
const testSubjects = getService('testSubjects');
describe('discover tab with new fields API', function describeIndexTests() {
before(async function () {
await kibanaServer.uiSettings.update({ 'doc_table:legacy': true });
await PageObjects.common.navigateToApp('discover');
});
after(async function () {
await kibanaServer.uiSettings.replace({});
});
it('doc view should sort ascending', async function () {
const expectedTimeStamp = 'Sep 20, 2015 @ 00:00:00.000';
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
// we don't technically need this sleep here because the tryForTime will retry and the
// results will match on the 2nd or 3rd attempt, but that debug output is huge in this
// case and it can be avoided with just a few seconds sleep.
await PageObjects.common.sleep(2000);
await retry.try(async function tryingForTime() {
const row = await find.byCssSelector(`tr.kbnDocTable__row:nth-child(1)`);
const rowData = await row.getVisibleText();
expect(rowData.startsWith(expectedTimeStamp)).to.be.ok();
});
});
});
}

View file

@ -30,21 +30,24 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_discover'));
loadTestFile(require.resolve('./_discover_accessibility'));
loadTestFile(require.resolve('./_discover_histogram'));
loadTestFile(require.resolve('./_doc_table'));
loadTestFile(require.resolve('./_doc_table_newline'));
loadTestFile(require.resolve('./classic/_doc_table'));
loadTestFile(require.resolve('./classic/_doc_table_newline'));
loadTestFile(require.resolve('./_filter_editor'));
loadTestFile(require.resolve('./_errors'));
loadTestFile(require.resolve('./_field_data'));
loadTestFile(require.resolve('./classic/_field_data'));
loadTestFile(require.resolve('./_field_data_with_fields_api'));
loadTestFile(require.resolve('./classic/_field_data_with_fields_api'));
loadTestFile(require.resolve('./_shared_links'));
loadTestFile(require.resolve('./_sidebar'));
loadTestFile(require.resolve('./_source_filters'));
loadTestFile(require.resolve('./_large_string'));
loadTestFile(require.resolve('./_inspector'));
loadTestFile(require.resolve('./_classic_table_doc_navigation'));
loadTestFile(require.resolve('./classic/_classic_table_doc_navigation'));
loadTestFile(require.resolve('./_date_nanos'));
loadTestFile(require.resolve('./_date_nanos_mixed'));
loadTestFile(require.resolve('./_indexpattern_without_timefield'));
loadTestFile(require.resolve('./classic/_discover_fields_api'));
loadTestFile(require.resolve('./_discover_fields_api'));
loadTestFile(require.resolve('./_data_grid'));
loadTestFile(require.resolve('./_data_grid_context'));

View file

@ -32,6 +32,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const filterBar = getService('filterBar');
const find = getService('find');
const dataGrid = getService('dataGrid');
const PageObjects = getPageObjects([
'common',
'header',
@ -48,7 +50,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await browser.setWindowSize(1200, 800);
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.uiSettings.replace({});
await kibanaServer.uiSettings.update({ 'doc_table:legacy': true });
});
after(async function afterAll() {
@ -56,6 +57,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await kibanaServer.uiSettings.replace({});
});
/**
* @param field field name to sort
* @param optionIndex index of the option to choose in dropdown
*/
const clickSort = async (field: string, optionIndex: number) => {
await testSubjects.click(`dataGridHeaderCell-${field}`);
const optionButtons = await find.allByCssSelector('.euiListGroupItem__button');
await optionButtons[optionIndex].click();
};
it('should not allow saving of invalid scripts', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
@ -146,29 +157,37 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916\n18');
const rowData = (await dataGrid.getRowsText())[0];
expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.91618');
});
});
// add a test to sort numeric scripted field
it('should sort scripted field value in Discover', async function () {
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName}`);
await clickSort(scriptedPainlessFieldName, 1);
await PageObjects.common.sleep(500);
// after the first click on the scripted field, it becomes secondary sort after time.
// click on the timestamp twice to make it be the secondary sort key.
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await clickSort('@timestamp', 1);
await clickSort('@timestamp', 0);
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 17, 2015 @ 10:53:14.181\n-1');
const rowData = (await dataGrid.getRowsText())[0];
expect(rowData).to.be('Sep 17, 2015 @ 10:53:14.181-1');
});
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName}`);
await clickSort(scriptedPainlessFieldName, 2);
// after the first click on the scripted field, it becomes primary sort after time.
// click on the scripted field twice then, makes it be the secondary sort key.
await clickSort(scriptedPainlessFieldName, 2);
await clickSort(scriptedPainlessFieldName, 2);
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 17, 2015 @ 06:32:29.479\n20');
const rowData = (await dataGrid.getRowsText())[0];
expect(rowData).to.be('Sep 17, 2015 @ 06:32:29.47920');
});
});
@ -233,29 +252,37 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916\ngood');
const rowData = (await dataGrid.getRowsText())[0];
expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916good');
});
});
// add a test to sort string scripted field
it('should sort scripted field value in Discover', async function () {
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`);
await clickSort(scriptedPainlessFieldName2, 1);
// await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`);
await PageObjects.common.sleep(500);
// after the first click on the scripted field, it becomes secondary sort after time.
// click on the timestamp twice to make it be the secondary sort key.
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await clickSort('@timestamp', 1);
await clickSort('@timestamp', 0);
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 17, 2015 @ 09:48:40.594\nbad');
const rowData = (await dataGrid.getRowsText())[0];
expect(rowData).to.be('Sep 17, 2015 @ 09:48:40.594bad');
});
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`);
await clickSort(scriptedPainlessFieldName2, 2);
// after the first click on the scripted field, it becomes primary sort after time.
// click on the scripted field twice then, makes it be the secondary sort key.
await clickSort(scriptedPainlessFieldName2, 2);
await clickSort(scriptedPainlessFieldName2, 2);
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 17, 2015 @ 06:32:29.479\ngood');
const rowData = (await dataGrid.getRowsText())[0];
expect(rowData).to.be('Sep 17, 2015 @ 06:32:29.479good');
});
});
@ -319,8 +346,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916\ntrue');
const rowData = (await dataGrid.getRowsText())[0];
expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916true');
});
});
@ -406,8 +433,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 18, 2015 @ 06:52:55.953\n2015-09-18 07:00');
const rowData = (await dataGrid.getRowsText())[0];
expect(rowData).to.be('Sep 18, 2015 @ 06:52:55.9532015-09-18 07:00');
});
});

View file

@ -0,0 +1,459 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
// Tests for 4 scripted fields;
// 1. Painless (number type)
// 2. Painless (string type)
// 3. Painless (boolean type)
// 4. Painless (date type)
//
// Each of these scripted fields has 4 tests (12 tests total);
// 1. Create scripted field
// 2. See the expected value of the scripted field in Discover doc view
// 3. Filter in Discover by the scripted field
// 4. Visualize with aggregation on the scripted field by clicking discover.clickFieldListItemVisualize
// NOTE: Scripted field input is managed by Ace editor, which automatically
// appends closing braces, for exmaple, if you type opening square brace [
// it will automatically insert a a closing square brace ], etc.
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer');
const log = getService('log');
const browser = getService('browser');
const retry = getService('retry');
const testSubjects = getService('testSubjects');
const filterBar = getService('filterBar');
const PageObjects = getPageObjects([
'common',
'header',
'settings',
'visualize',
'discover',
'timePicker',
]);
describe('scripted fields', function () {
this.tags(['skipFirefox']);
before(async function () {
await browser.setWindowSize(1200, 800);
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.uiSettings.replace({});
await kibanaServer.uiSettings.update({ 'doc_table:legacy': true });
});
after(async function afterAll() {
await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
await kibanaServer.uiSettings.replace({});
});
it('should not allow saving of invalid scripts', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();
await PageObjects.settings.clickScriptedFieldsTab();
await PageObjects.settings.clickAddScriptedField();
await PageObjects.settings.setScriptedFieldName('doomedScriptedField');
await PageObjects.settings.setScriptedFieldScript(`i n v a l i d s c r i p t`);
await PageObjects.settings.clickSaveScriptedField();
await retry.try(async () => {
const invalidScriptErrorExists = await testSubjects.exists('invalidScriptError');
expect(invalidScriptErrorExists).to.be(true);
});
});
describe('testing regression for issue #33251', function describeIndexTests() {
const scriptedPainlessFieldName = 'ram_Pain_reg';
it('should create and edit scripted field', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10);
await PageObjects.settings.clickScriptedFieldsTab();
await log.debug('add scripted field');
const script = `1`;
await PageObjects.settings.addScriptedField(
scriptedPainlessFieldName,
'painless',
'number',
null,
'1',
script
);
await retry.try(async function () {
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be(
startingCount + 1
);
});
for (let i = 0; i < 3; i++) {
await PageObjects.settings.editScriptedField(scriptedPainlessFieldName);
const fieldSaveButton = await testSubjects.exists('fieldSaveButton');
expect(fieldSaveButton).to.be(true);
await PageObjects.settings.clickSaveScriptedField();
}
});
});
describe('creating and using Painless numeric scripted fields', function describeIndexTests() {
const scriptedPainlessFieldName = 'ram_Pain1';
it('should create scripted field', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10);
await PageObjects.settings.clickScriptedFieldsTab();
await log.debug('add scripted field');
const script = `if (doc['machine.ram'].size() == 0) return -1;
else return doc['machine.ram'].value / (1024 * 1024 * 1024);
`;
await PageObjects.settings.addScriptedField(
scriptedPainlessFieldName,
'painless',
'number',
null,
'100',
script
);
await retry.try(async function () {
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be(
startingCount + 1
);
});
});
it('should see scripted field value in Discover', async function () {
const fromTime = 'Sep 17, 2015 @ 06:31:44.000';
const toTime = 'Sep 18, 2015 @ 18:31:44.000';
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName);
await retry.try(async function () {
await PageObjects.discover.clickFieldListItemAdd(scriptedPainlessFieldName);
});
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916\n18');
});
});
// add a test to sort numeric scripted field
it('should sort scripted field value in Discover', async function () {
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName}`);
// after the first click on the scripted field, it becomes secondary sort after time.
// click on the timestamp twice to make it be the secondary sort key.
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 17, 2015 @ 10:53:14.181\n-1');
});
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName}`);
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 17, 2015 @ 06:32:29.479\n20');
});
});
it('should filter by scripted field value in Discover', async function () {
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName);
await log.debug('filter by the first value (14) in the expanded scripted field list');
await PageObjects.discover.clickFieldListPlusFilter(scriptedPainlessFieldName, '14');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
expect(await PageObjects.discover.getHitCount()).to.be('31');
});
});
it('should visualize scripted field in vertical bar chart', async function () {
await filterBar.removeAllFilters();
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'@timestamp',
'Median of ram_Pain1'
);
});
});
describe('creating and using Painless string scripted fields', function describeIndexTests() {
const scriptedPainlessFieldName2 = 'painString';
it('should create scripted field', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10);
await PageObjects.settings.clickScriptedFieldsTab();
await log.debug('add scripted field');
await PageObjects.settings.addScriptedField(
scriptedPainlessFieldName2,
'painless',
'string',
null,
'1',
"if (doc['response.raw'].value == '200') { return 'good'} else { return 'bad'}"
);
await retry.try(async function () {
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be(
startingCount + 1
);
});
});
it('should see scripted field value in Discover', async function () {
const fromTime = 'Sep 17, 2015 @ 06:31:44.000';
const toTime = 'Sep 18, 2015 @ 18:31:44.000';
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName2);
await retry.try(async function () {
await PageObjects.discover.clickFieldListItemAdd(scriptedPainlessFieldName2);
});
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916\ngood');
});
});
// add a test to sort string scripted field
it('should sort scripted field value in Discover', async function () {
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`);
// after the first click on the scripted field, it becomes secondary sort after time.
// click on the timestamp twice to make it be the secondary sort key.
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 17, 2015 @ 09:48:40.594\nbad');
});
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`);
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 17, 2015 @ 06:32:29.479\ngood');
});
});
it('should filter by scripted field value in Discover', async function () {
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName2);
await log.debug('filter by "bad" in the expanded scripted field list');
await PageObjects.discover.clickFieldListPlusFilter(scriptedPainlessFieldName2, 'bad');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
expect(await PageObjects.discover.getHitCount()).to.be('27');
});
await filterBar.removeAllFilters();
});
it('should visualize scripted field in vertical bar chart', async function () {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Top 5 values of painString'
);
});
});
describe('creating and using Painless boolean scripted fields', function describeIndexTests() {
const scriptedPainlessFieldName2 = 'painBool';
it('should create scripted field', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10);
await PageObjects.settings.clickScriptedFieldsTab();
await log.debug('add scripted field');
await PageObjects.settings.addScriptedField(
scriptedPainlessFieldName2,
'painless',
'boolean',
null,
'1',
"doc['response.raw'].value == '200'"
);
await retry.try(async function () {
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be(
startingCount + 1
);
});
});
it('should see scripted field value in Discover', async function () {
const fromTime = 'Sep 17, 2015 @ 06:31:44.000';
const toTime = 'Sep 18, 2015 @ 18:31:44.000';
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName2);
await retry.try(async function () {
await PageObjects.discover.clickFieldListItemAdd(scriptedPainlessFieldName2);
});
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 18, 2015 @ 18:20:57.916\ntrue');
});
});
it('should filter by scripted field value in Discover', async function () {
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName2);
await log.debug('filter by "true" in the expanded scripted field list');
await PageObjects.discover.clickFieldListPlusFilter(scriptedPainlessFieldName2, 'true');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
expect(await PageObjects.discover.getHitCount()).to.be('359');
});
await filterBar.removeAllFilters();
});
// add a test to sort boolean
// existing bug: https://github.com/elastic/kibana/issues/75519 hence the issue is skipped.
it.skip('should sort scripted field value in Discover', async function () {
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`);
// after the first click on the scripted field, it becomes secondary sort after time.
// click on the timestamp twice to make it be the secondary sort key.
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('updateExpectedResultHere\ntrue');
});
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`);
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('updateExpectedResultHere\nfalse');
});
});
it('should visualize scripted field in vertical bar chart', async function () {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Top 5 values of painBool'
);
});
});
describe('creating and using Painless date scripted fields', function describeIndexTests() {
const scriptedPainlessFieldName2 = 'painDate';
it('should create scripted field', async function () {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
await PageObjects.settings.clickIndexPatternLogstash();
const startingCount = parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10);
await PageObjects.settings.clickScriptedFieldsTab();
await log.debug('add scripted field');
await PageObjects.settings.addScriptedField(
scriptedPainlessFieldName2,
'painless',
'date',
{ format: 'date', datePattern: 'YYYY-MM-DD HH:00' },
'1',
"doc['utc_time'].value.toEpochMilli() + (1000) * 60 * 60"
);
await retry.try(async function () {
expect(parseInt(await PageObjects.settings.getScriptedFieldsTabCount(), 10)).to.be(
startingCount + 1
);
});
});
it('should see scripted field value in Discover', async function () {
const fromTime = 'Sep 17, 2015 @ 19:22:00.000';
const toTime = 'Sep 18, 2015 @ 07:00:00.000';
await PageObjects.common.navigateToApp('discover');
await PageObjects.timePicker.setAbsoluteRange(fromTime, toTime);
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName2);
await retry.try(async function () {
await PageObjects.discover.clickFieldListItemAdd(scriptedPainlessFieldName2);
});
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('Sep 18, 2015 @ 06:52:55.953\n2015-09-18 07:00');
});
});
// add a test to sort date scripted field
// https://github.com/elastic/kibana/issues/75711
it.skip('should sort scripted field value in Discover', async function () {
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`);
// after the first click on the scripted field, it becomes secondary sort after time.
// click on the timestamp twice to make it be the secondary sort key.
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await testSubjects.click('docTableHeaderFieldSort_@timestamp');
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('updateExpectedResultHere\n2015-09-18 07:00');
});
await testSubjects.click(`docTableHeaderFieldSort_${scriptedPainlessFieldName2}`);
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
const rowData = await PageObjects.discover.getDocTableIndexLegacy(1);
expect(rowData).to.be('updateExpectedResultHere\n2015-09-18 07:00');
});
});
it('should filter by scripted field value in Discover', async function () {
await PageObjects.discover.clickFieldListItem(scriptedPainlessFieldName2);
await log.debug('filter by "Sep 17, 2015 @ 23:00" in the expanded scripted field list');
await PageObjects.discover.clickFieldListPlusFilter(
scriptedPainlessFieldName2,
'1442531297065'
);
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async function () {
expect(await PageObjects.discover.getHitCount()).to.be('1');
});
await filterBar.removeAllFilters();
});
it('should visualize scripted field in vertical bar chart', async function () {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain('painDate');
});
});
});
}

View file

@ -30,6 +30,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_mgmt_import_saved_objects'));
loadTestFile(require.resolve('./_index_patterns_empty'));
loadTestFile(require.resolve('./_scripted_fields'));
loadTestFile(require.resolve('./_scripted_fields_classic_table'));
loadTestFile(require.resolve('./_runtime_fields'));
loadTestFile(require.resolve('./_field_formatter'));
loadTestFile(require.resolve('./_legacy_url_redirect'));

View file

@ -13,7 +13,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const queryBar = getService('queryBar');
const filterBar = getService('filterBar');
const docTable = getService('docTable');
const dataGrid = getService('dataGrid');
const PageObjects = getPageObjects(['common', 'timePicker', 'settings', 'context']);
async function setAutocompleteUseTimeRange(value: boolean) {
@ -34,7 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'x-pack/test/functional/fixtures/kbn_archiver/dashboard_drilldowns/drilldowns'
);
await kibanaServer.uiSettings.update({
'doc_table:legacy': true,
'doc_table:legacy': false,
});
});
@ -90,9 +90,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.timePicker.setDefaultAbsoluteRange();
// navigate to context
await docTable.clickRowToggle({ rowIndex: 0 });
const rowActions = await docTable.getRowActions({ rowIndex: 0 });
await rowActions[0].click();
await dataGrid.clickRowToggle({ rowIndex: 0 });
const rowActions = await dataGrid.getRowActions({ rowIndex: 0 });
await rowActions[1].click();
await PageObjects.context.waitUntilContextLoadingHasFinished();
// Apply filter in context view

View file

@ -24,7 +24,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);
await kibanaServer.uiSettings.replace({ defaultIndex: 'without-timefield' });
await kibanaServer.uiSettings.update({
'doc_table:legacy': true,
'doc_table:legacy': false,
});
});