-
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.
Browse files
Browse the repository at this point in the history
# Backport This will backport the following commits from `main` to `8.x`: - [[Data Usage] functional tests (#203166)](#203166) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sandra G","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-12T13:08:08Z","message":"[Data Usage] functional tests (#203166)\n\n## Summary\r\n\r\nFunctional tests for data usage UI.\r\n\r\n- `data_streams` route is intercepted, due to filtering out zero size\r\ndata streams which will happen because metering api needs time to\r\naggregate data\r\n- `autoops_api` is using the mock server as there will be no data for it\r\nto return\r\n- tests will only run in local serverless and not MKI due to using the\r\nautoops mock server that won't return data for created data streams\r\n- adds `interceptRequest` functionality to FTR `browser` service\r\n\r\n## Tests\r\n- data stream filter dropdown renders with created data streams of\r\n`data_streams` response and are checked\r\n- data stream filter dropdown renders badge with correct number of\r\nselected data streams\r\n- charts render from `data_streams` route response\r\n- chart legends render with correct items\r\n- popover renders for legend items\r\n- links in popovers correctly navigate and update navigation between\r\ndifferent data stream items","sha":"ba945c98510dc6de460b297beaa55e980456fc30","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"title":"[Data Usage] functional tests","number":203166,"url":"https://github.com/elastic/kibana/pull/203166","mergeCommit":{"message":"[Data Usage] functional tests (#203166)\n\n## Summary\r\n\r\nFunctional tests for data usage UI.\r\n\r\n- `data_streams` route is intercepted, due to filtering out zero size\r\ndata streams which will happen because metering api needs time to\r\naggregate data\r\n- `autoops_api` is using the mock server as there will be no data for it\r\nto return\r\n- tests will only run in local serverless and not MKI due to using the\r\nautoops mock server that won't return data for created data streams\r\n- adds `interceptRequest` functionality to FTR `browser` service\r\n\r\n## Tests\r\n- data stream filter dropdown renders with created data streams of\r\n`data_streams` response and are checked\r\n- data stream filter dropdown renders badge with correct number of\r\nselected data streams\r\n- charts render from `data_streams` route response\r\n- chart legends render with correct items\r\n- popover renders for legend items\r\n- links in popovers correctly navigate and update navigation between\r\ndifferent data stream items","sha":"ba945c98510dc6de460b297beaa55e980456fc30"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203166","number":203166,"mergeCommit":{"message":"[Data Usage] functional tests (#203166)\n\n## Summary\r\n\r\nFunctional tests for data usage UI.\r\n\r\n- `data_streams` route is intercepted, due to filtering out zero size\r\ndata streams which will happen because metering api needs time to\r\naggregate data\r\n- `autoops_api` is using the mock server as there will be no data for it\r\nto return\r\n- tests will only run in local serverless and not MKI due to using the\r\nautoops mock server that won't return data for created data streams\r\n- adds `interceptRequest` functionality to FTR `browser` service\r\n\r\n## Tests\r\n- data stream filter dropdown renders with created data streams of\r\n`data_streams` response and are checked\r\n- data stream filter dropdown renders badge with correct number of\r\nselected data streams\r\n- charts render from `data_streams` route response\r\n- chart legends render with correct items\r\n- popover renders for legend items\r\n- links in popovers correctly navigate and update navigation between\r\ndifferent data stream items","sha":"ba945c98510dc6de460b297beaa55e980456fc30"}}]}] BACKPORT--> Co-authored-by: Sandra G <[email protected]>
- Loading branch information
1 parent
9a26089
commit 8dcbb64
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.