-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42d9800
commit 1be22ed
Showing
20 changed files
with
1,076 additions
and
1,558 deletions.
There are no files selected for viewing
242 changes: 0 additions & 242 deletions
242
test/functional/apps/discover/context_awareness/_data_source_profile.ts
This file was deleted.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
test/functional/apps/discover/context_awareness/_framework.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import kbnRison from '@kbn/rison'; | ||
import expect from '@kbn/expect'; | ||
import type { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const { common, discover } = getPageObjects(['common', 'discover']); | ||
const testSubjects = getService('testSubjects'); | ||
const dataViews = getService('dataViews'); | ||
const dataGrid = getService('dataGrid'); | ||
const retry = getService('retry'); | ||
|
||
describe('framework', () => { | ||
describe('ES|QL mode', () => { | ||
describe('custom context', () => { | ||
it('should render formatted record in doc viewer using formatter from custom context', async () => { | ||
const state = kbnRison.encode({ | ||
dataSource: { type: 'esql' }, | ||
query: { esql: 'from my-example-logs | sort @timestamp desc' }, | ||
}); | ||
await common.navigateToActualUrl('discover', `?_a=${state}`, { | ||
ensureCurrentUrl: false, | ||
}); | ||
await discover.waitUntilSearchingHasFinished(); | ||
await dataGrid.clickRowToggle({ rowIndex: 0, defaultTabId: 'doc_view_example' }); | ||
await retry.try(async () => { | ||
const formattedRecord = await testSubjects.find( | ||
'exampleDataSourceProfileDocViewRecord' | ||
); | ||
expect(await formattedRecord.getVisibleText()).to.be( | ||
JSON.stringify( | ||
{ | ||
'@timestamp': '2024-06-10T16:00:00.000Z', | ||
'agent.name': 'java', | ||
'agent.name.text': 'java', | ||
'data_stream.type': 'logs', | ||
'log.level': 'debug', | ||
message: 'This is a debug log', | ||
'service.name': 'product', | ||
'service.name.text': 'product', | ||
}, | ||
null, | ||
2 | ||
) | ||
); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('data view mode', () => { | ||
describe('custom context', () => { | ||
it('should render formatted record in doc viewer using formatter from custom context', async () => { | ||
await common.navigateToActualUrl('discover', undefined, { | ||
ensureCurrentUrl: false, | ||
}); | ||
await dataViews.switchTo('my-example-logs'); | ||
await discover.waitUntilSearchingHasFinished(); | ||
await dataGrid.clickRowToggle({ rowIndex: 0, defaultTabId: 'doc_view_example' }); | ||
await retry.try(async () => { | ||
const formattedRecord = await testSubjects.find( | ||
'exampleDataSourceProfileDocViewRecord' | ||
); | ||
expect(await formattedRecord.getVisibleText()).to.be( | ||
JSON.stringify( | ||
{ | ||
'@timestamp': ['2024-06-10T16:00:00.000Z'], | ||
'agent.name': ['java'], | ||
'agent.name.text': ['java'], | ||
'data_stream.type': ['logs'], | ||
'log.level': ['debug'], | ||
message: ['This is a debug log'], | ||
'service.name': ['product'], | ||
'service.name.text': ['product'], | ||
_id: 'XdQFDpABfGznVC1bCHLo', | ||
_index: 'my-example-logs', | ||
_score: null, | ||
}, | ||
null, | ||
2 | ||
) | ||
); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} |
55 changes: 0 additions & 55 deletions
55
test/functional/apps/discover/context_awareness/_root_profile.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.