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.
[Data Usage] functional tests (elastic#203166)
## Summary Functional tests for data usage UI. - `data_streams` route is intercepted, due to filtering out zero size data streams which will happen because metering api needs time to aggregate data - `autoops_api` is using the mock server as there will be no data for it to return - tests will only run in local serverless and not MKI due to using the autoops mock server that won't return data for created data streams - adds `interceptRequest` functionality to FTR `browser` service ## Tests - data stream filter dropdown renders with created data streams of `data_streams` response and are checked - data stream filter dropdown renders badge with correct number of selected data streams - charts render from `data_streams` route response - chart legends render with correct items - popover renders for legend items - links in popovers correctly navigate and update navigation between different data stream items
- Loading branch information
Showing
12 changed files
with
329 additions
and
12 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
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
55 changes: 55 additions & 0 deletions
55
x-pack/test_serverless/functional/page_objects/svl_data_usage.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,55 @@ | ||
/* | ||
* 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 { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services'; | ||
import { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
export function SvlDataUsagePageProvider({ getService }: FtrProviderContext) { | ||
const testSubjects = getService('testSubjects'); | ||
|
||
return { | ||
async assertDataUsagePageExists(): Promise<boolean> { | ||
return await testSubjects.exists('DataUsagePage'); | ||
}, | ||
async clickDatastreamsDropdown() { | ||
await testSubjects.click('data-usage-metrics-filter-dataStreams-popoverButton'); | ||
}, | ||
async findDatastreamsDropdownOptions() { | ||
return await testSubjects.findAll('dataStreams-filter-option'); | ||
}, | ||
async findDatastreamsDropdownFilterButton() { | ||
return await testSubjects.find('data-usage-metrics-filter-dataStreams-popoverButton'); | ||
}, | ||
async findIngestRateChart() { | ||
return await testSubjects.find('ingest_rate-chart'); | ||
}, | ||
async storageRetainedChart() { | ||
return await testSubjects.find('storage_retained-chart'); | ||
}, | ||
async findLegendItemsInChart(chartElement: WebElementWrapper) { | ||
return await chartElement.findAllByCssSelector('li.echLegendItem'); | ||
}, | ||
async findLegendActionButton(legendItemElement: WebElementWrapper) { | ||
return legendItemElement.findByTestSubject('legendActionButton'); | ||
}, | ||
async clickLegendActionButtonAtIndex(chartElement: WebElementWrapper, index: number) { | ||
const legendItems = await this.findLegendItemsInChart(chartElement); | ||
if (index < 0 || index >= legendItems.length) { | ||
throw new Error( | ||
`Invalid legend item index: ${index}. There are only ${legendItems.length} legend items.` | ||
); | ||
} | ||
const legendItem = legendItems[index]; | ||
const actionButton = await this.findLegendActionButton(legendItem); | ||
await actionButton.click(); | ||
}, | ||
|
||
async assertLegendActionPopoverExists() { | ||
await testSubjects.existOrFail('legendActionPopover'); | ||
}, | ||
}; | ||
} |
Oops, something went wrong.