-
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.
fix(discover-log-explorer): update tests
- Loading branch information
Marco Antonio Ghiani
committed
Aug 10, 2023
1 parent
62929b8
commit 1a8bfff
Showing
5 changed files
with
837 additions
and
75 deletions.
There are no files selected for viewing
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
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
57 changes: 57 additions & 0 deletions
57
...erverless/functional/test_suites/observability/discover_log_explorer/columns_selection.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,57 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
const defaultLogColumns = ['@timestamp', 'message']; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const retry = getService('retry'); | ||
const PageObjects = getPageObjects(['common', 'discover', 'discoverLogExplorer']); | ||
|
||
describe('Columns selection initialization and update', () => { | ||
before(async () => { | ||
await esArchiver.load( | ||
'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' | ||
); | ||
}); | ||
|
||
after(async () => { | ||
await esArchiver.unload( | ||
'x-pack/test/functional/es_archives/discover_log_explorer/data_streams' | ||
); | ||
}); | ||
|
||
describe('when the log explorer profile loads', () => { | ||
it("should initialize the table columns to logs' default selection", async () => { | ||
await PageObjects.common.navigateToApp('discover', { hash: '/p/log-explorer' }); | ||
|
||
await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage(); | ||
|
||
await retry.try(async () => { | ||
expect(await PageObjects.discover.getColumnHeaders()).to.eql(defaultLogColumns); | ||
}); | ||
}); | ||
|
||
it('should restore the table columns from the URL state if exists', async () => { | ||
await PageObjects.common.navigateToApp('discover', { | ||
hash: '/p/log-explorer?_a=(columns:!(message,data_stream.namespace))', | ||
}); | ||
|
||
await PageObjects.discover.expandTimeRangeAsSuggestedInNoResultsMessage(); | ||
|
||
await retry.try(async () => { | ||
expect(await PageObjects.discover.getColumnHeaders()).to.eql([ | ||
...defaultLogColumns, | ||
'data_stream.namespace', | ||
]); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.