forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Log Explorer] Add test suite for Dataset Selector (elastic#163079)
## π Summary Closes elastic#160627 This implementation adds the majority of the tests listed down here for the Log Explorer current implementation. β [**Flaky Test Runner - x50 executions**](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2844#_) ``` β³ Discover Log-Explorer profile β³ Columns selection initialization and update β³ when the log explorer profile loads β³ should initialize the table columns to logs' default selection β³ should restore the table columns from the URL state if exists β³ Customizations β³ when Discover is loaded with the log-explorer profile β³ DatasetSelector should replace the DataViewPicker β³ the TopNav bar should hide the New, Open and Save options β³ should add a searchable deep link to the profile page β³ should render a filter controls section as part of the unified search bar β³ DatasetSelection initialization and update β³ when the "index" query param does not exist β³ should initialize the "All log datasets" selection β³ when the "index" query param exists β³ should decode and restore the selection from a valid encoded index β³ should fallback to the "All log datasets" selection and notify the user of an invalid encoded index β³ when navigating back and forth on the page history β³ should decode and restore the selection for the current index β³ Dataset Selector β³ without installed integrations or uncategorized data streams β³ when open on the first navigation level β³ should always display the "All log datasets" entry as the first item β³ should always display the unmanaged datasets entry as the second item β³ should display an error prompt if could not retrieve the integrations β³ should display an empty prompt for no integrations β³ when navigating into Uncategorized data streams β³ should display a loading skeleton while loading β³ should display an error prompt if could not retrieve the data streams β³ should display an empty prompt for no data streams β³ with installed integrations and uncategorized data streams β³ when open on the first navigation level β³ should always display the "All log datasets" entry as the first item β³ should always display the unmanaged datasets entry as the second item β³ should display a list of installed integrations β³ should sort the integrations list by the clicked sorting option β³ should filter the integrations list by the typed integration name β³ should display an empty prompt when the search does not match any result β³ should load more integrations by scrolling to the end of the list β³ when clicking on integration and moving into the second navigation level β³ should display a list of available datasets β³ should sort the datasets list by the clicked sorting option β³ should filter the datasets list by the typed dataset name β³ should update the current selection with the clicked dataset β³ when navigating into Uncategorized data streams β³ should display a list of available datasets β³ should sort the datasets list by the clicked sorting option β³ should filter the datasets list by the typed dataset name β³ should update the current selection with the clicked dataset β³ when open/close the selector β³ should restore the latest navigation panel β³ should restore the latest search results β³ when switching between integration panels β³ should remember the latest search and restore its results for each integration ``` ## Note on serverless tests suite For testing the feature in a serverless environment, we are copying all the tests into the `x-pack/test_serverless` folder until elastic#161574 is merged, which will provide a new space to write tests independently from the deployment type, avoiding then tests duplication. ## New `browser` service utils for Network conditions simulation To properly test that this feature works correctly under poor network conditions or offline scenarios, the `browser` service now exposes some new methods for altering network conditions on demand. Also, network profiles to match the [network profiles provided by Chrome debugger](https://github.com/ChromeDevTools/devtools-frontend/blob/da276a3faec9769cb55e442f0db77ebdce5cd178/front_end/core/sdk/NetworkManager.ts#L363-L393) have been created. In case the browser is not of `chromium` type and the driver does not support the network simulation, these methods throw an error that can be caught for skipping the affected test. --------- Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
27c394c
commit f09a5c9
Showing
20 changed files
with
2,198 additions
and
15 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
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
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
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
x-pack/test/functional/apps/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']); | ||
|
||
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', | ||
]); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} |
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
Oops, something went wrong.