Skip to content

Commit

Permalink
[8.x] [Dataset Quality] Fix tests for degraded fields flyout (#202288) (
Browse files Browse the repository at this point in the history
#202432)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dataset Quality] Fix tests for degraded fields flyout
(#202288)](#202288)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco Antonio
Ghiani","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-02T11:04:48Z","message":"[Dataset
Quality] Fix tests for degraded fields flyout (#202288)\n\n## 📓
Summary\r\n\r\nCloses #198849 \r\nCloses #200287 \r\nCloses #201273
\r\nCloses #201975 \r\n\r\nThe above issues were raised with similar
conditions which converged in\r\nthe following assumptions:\r\n- They
are raised due to timeout identifying a visual element on
the\r\ndegraded fields flyout.\r\n- They are raised due to a missing UI
element, which is part of a common\r\nsub-tree conditionally rendered
when the data analysis is completed.\r\n- They are raised in serverless
tests, where the latency might be\r\nrandomly higher.\r\n\r\nGiven the
nature of these tests, which locally always pass correctly\r\ngiven the
fastest nature of a local setup, I assume these random\r\nfailures are
due to latency on the common request gating the rendering\r\nof these
sections.\r\n\r\nAs a fix, I added a wait on the global loading
indicator before the\r\nassertions, which should wait for the data
loading to be completed\r\nbefore running the assertions on the UI
elements.\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<[email protected]>","sha":"d13904eb6596edd51e4d52aa74c24c070be3ce5c","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","Team:obs-ux-logs"],"title":"[Dataset
Quality] Fix tests for degraded fields
flyout","number":202288,"url":"https://github.com/elastic/kibana/pull/202288","mergeCommit":{"message":"[Dataset
Quality] Fix tests for degraded fields flyout (#202288)\n\n## 📓
Summary\r\n\r\nCloses #198849 \r\nCloses #200287 \r\nCloses #201273
\r\nCloses #201975 \r\n\r\nThe above issues were raised with similar
conditions which converged in\r\nthe following assumptions:\r\n- They
are raised due to timeout identifying a visual element on
the\r\ndegraded fields flyout.\r\n- They are raised due to a missing UI
element, which is part of a common\r\nsub-tree conditionally rendered
when the data analysis is completed.\r\n- They are raised in serverless
tests, where the latency might be\r\nrandomly higher.\r\n\r\nGiven the
nature of these tests, which locally always pass correctly\r\ngiven the
fastest nature of a local setup, I assume these random\r\nfailures are
due to latency on the common request gating the rendering\r\nof these
sections.\r\n\r\nAs a fix, I added a wait on the global loading
indicator before the\r\nassertions, which should wait for the data
loading to be completed\r\nbefore running the assertions on the UI
elements.\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<[email protected]>","sha":"d13904eb6596edd51e4d52aa74c24c070be3ce5c"}},"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/202288","number":202288,"mergeCommit":{"message":"[Dataset
Quality] Fix tests for degraded fields flyout (#202288)\n\n## 📓
Summary\r\n\r\nCloses #198849 \r\nCloses #200287 \r\nCloses #201273
\r\nCloses #201975 \r\n\r\nThe above issues were raised with similar
conditions which converged in\r\nthe following assumptions:\r\n- They
are raised due to timeout identifying a visual element on
the\r\ndegraded fields flyout.\r\n- They are raised due to a missing UI
element, which is part of a common\r\nsub-tree conditionally rendered
when the data analysis is completed.\r\n- They are raised in serverless
tests, where the latency might be\r\nrandomly higher.\r\n\r\nGiven the
nature of these tests, which locally always pass correctly\r\ngiven the
fastest nature of a local setup, I assume these random\r\nfailures are
due to latency on the common request gating the rendering\r\nof these
sections.\r\n\r\nAs a fix, I added a wait on the global loading
indicator before the\r\nassertions, which should wait for the data
loading to be completed\r\nbefore running the assertions on the UI
elements.\r\n\r\nCo-authored-by: Marco Antonio Ghiani
<[email protected]>","sha":"d13904eb6596edd51e4d52aa74c24c070be3ce5c"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <[email protected]>
  • Loading branch information
kibanamachine and tonyghiani authored Dec 2, 2024
1 parent 2d09fbb commit 8b44bc2
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { logsNginxMappings } from './custom_mappings/custom_integration_mappings
export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects([
'common',
'header',
'navigationalSearch',
'observabilityLogsExplorer',
'datasetQuality',
Expand Down Expand Up @@ -452,6 +453,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'test_field',
});

await PageObjects.header.waitUntilLoadingHasFinished();

await retry.tryForTime(5000, async () => {
const fieldIgnoredMessageExists = await PageObjects.datasetQuality.doesTextExist(
'datasetQualityDetailsDegradedFieldFlyoutFieldValue-cause',
Expand All @@ -469,6 +472,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'test_field',
});

await PageObjects.header.waitUntilLoadingHasFinished();

await retry.tryForTime(5000, async () => {
const testFieldValue1Exists = await PageObjects.datasetQuality.doesTextExist(
'datasetQualityDetailsDegradedFieldFlyoutFieldValue-values',
Expand All @@ -491,6 +496,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'test_field',
});

await PageObjects.header.waitUntilLoadingHasFinished();

await retry.tryForTime(5000, async () => {
const limitValueExists = await PageObjects.datasetQuality.doesTextExist(
'datasetQualityDetailsDegradedFieldFlyoutFieldValue-characterLimit',
Expand All @@ -508,6 +515,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'test_field',
});

await PageObjects.header.waitUntilLoadingHasFinished();

// Possible Mitigation Section should exist
await testSubjects.existOrFail(
'datasetQualityDetailsDegradedFieldFlyoutPossibleMitigationTitle'
Expand Down Expand Up @@ -567,6 +576,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'test_field',
});

await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.datasetQuality.waitUntilPossibleMitigationsLoaded();

// Possible Mitigation Section should exist
Expand Down Expand Up @@ -632,6 +642,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'cloud',
});

await PageObjects.header.waitUntilLoadingHasFinished();

await retry.tryForTime(5000, async () => {
const fieldLimitMessageExists = await PageObjects.datasetQuality.doesTextExist(
'datasetQualityDetailsDegradedFieldFlyoutFieldValue-cause',
Expand All @@ -649,6 +661,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'cloud',
});

await PageObjects.header.waitUntilLoadingHasFinished();

await retry.tryForTime(5000, async () => {
const limitExists = await PageObjects.datasetQuality.doesTextExist(
'datasetQualityDetailsDegradedFieldFlyoutFieldValue-mappingLimit',
Expand All @@ -666,6 +680,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'cloud',
});

await PageObjects.header.waitUntilLoadingHasFinished();

await testSubjects.existOrFail(
PageObjects.datasetQuality.testSubjectSelectors
.datasetQualityDetailsDegradedFieldFlyoutIssueDoesNotExist
Expand All @@ -680,6 +696,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'cloud.project.id',
});

await PageObjects.header.waitUntilLoadingHasFinished();

// Field Limit Mitigation Section should exist
await testSubjects.existOrFail(
'datasetQualityDetailsDegradedFieldFlyoutFieldLimitMitigationAccordion'
Expand Down Expand Up @@ -710,6 +728,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'cloud.project',
});

await PageObjects.header.waitUntilLoadingHasFinished();

// Field Limit Mitigation Section should exist
await testSubjects.existOrFail(
'datasetQualityDetailsDegradedFieldFlyoutFieldLimitMitigationAccordion'
Expand All @@ -732,6 +752,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'cloud.project.id',
});

await PageObjects.header.waitUntilLoadingHasFinished();

// Should display current field limit
await testSubjects.existOrFail('datasetQualityIncreaseFieldMappingCurrentLimitFieldText');

Expand Down Expand Up @@ -782,6 +804,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'cloud.project.id',
});

await PageObjects.header.waitUntilLoadingHasFinished();

// Should not allow values less than current limit of 44
await testSubjects.setValue(
'datasetQualityIncreaseFieldMappingProposedLimitFieldText',
Expand Down Expand Up @@ -816,6 +840,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'cloud.project.id',
});

await PageObjects.header.waitUntilLoadingHasFinished();

await retry.tryForTime(5000, async () => {
const applyButton = await testSubjects.find(
'datasetQualityIncreaseFieldMappingLimitButtonButton'
Expand All @@ -835,6 +861,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
expandedDegradedField: 'cloud.project.id',
});

await PageObjects.header.waitUntilLoadingHasFinished();

const applyButton = await testSubjects.find(
'datasetQualityIncreaseFieldMappingLimitButtonButton'
);
Expand Down

0 comments on commit 8b44bc2

Please sign in to comment.