Skip to content

Commit 9ddac7f

Browse files
[9.0] [Infra] Fix infra home_page test (elastic#234447) (elastic#234887)
# Backport This will backport the following commits from `main` to `9.0`: - [[Infra] Fix infra home_page test (elastic#234447)](elastic#234447) <!--- Backport version: 10.0.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Carlos Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-09-11T13:25:43Z","message":"[Infra] Fix infra home_page test (elastic#234447)\n\nfixes [elastic#233920](https://github.com/elastic/kibana/issues/233920)\n\n## Summary\n\nit failed when it runs on firefox","sha":"44f09f79886749fed4fc98c60db616aa38709e5a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:obs-ux-infra_services","backport:version","v8.18.0","v9.1.0","v8.19.0","v9.2.0"],"title":"[Infra] Fix infra home_page test","number":234447,"url":"https://github.com/elastic/kibana/pull/234447","mergeCommit":{"message":"[Infra] Fix infra home_page test (elastic#234447)\n\nfixes [elastic#233920](https://github.com/elastic/kibana/issues/233920)\n\n## Summary\n\nit failed when it runs on firefox","sha":"44f09f79886749fed4fc98c60db616aa38709e5a"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","9.1","8.19"],"targetPullRequestStates":[{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234447","number":234447,"mergeCommit":{"message":"[Infra] Fix infra home_page test (elastic#234447)\n\nfixes [elastic#233920](https://github.com/elastic/kibana/issues/233920)\n\n## Summary\n\nit failed when it runs on firefox","sha":"44f09f79886749fed4fc98c60db616aa38709e5a"}}]}] BACKPORT--> Co-authored-by: Elastic Machine <[email protected]>
1 parent b1a2bf3 commit 9ddac7f

File tree

3 files changed

+43
-40
lines changed

3 files changed

+43
-40
lines changed

x-pack/solutions/observability/plugins/infra/public/pages/metrics/inventory_view/components/kubernetes_tour.tsx

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,46 @@ interface Props {
1717

1818
export const KUBERNETES_TOUR_STORAGE_KEY = 'isKubernetesTourSeen';
1919

20+
const dismissLabel = i18n.translate('xpack.infra.homePage.kubernetesTour.dismiss', {
21+
defaultMessage: 'Dismiss',
22+
});
23+
2024
export const KubernetesTour = ({ children }: Props) => {
2125
const [isTourSeen, setIsTourSeen] = useLocalStorage(KUBERNETES_TOUR_STORAGE_KEY, false);
2226
const markTourAsSeen = () => setIsTourSeen(true);
2327

2428
return (
25-
<div>
26-
<EuiTourStep
27-
content={
28-
<EuiText size="s" color="subdued" data-test-subj="infra-kubernetesTour-text">
29-
{i18n.translate('xpack.infra.homePage.kubernetesTour.text', {
30-
defaultMessage:
31-
'Click here to see your infrastructure in different ways, including Kubernetes pods.',
32-
})}
33-
</EuiText>
34-
}
35-
isStepOpen={!isTourSeen}
36-
maxWidth={350}
37-
onFinish={markTourAsSeen}
38-
step={1}
39-
stepsTotal={1}
40-
title={i18n.translate('xpack.infra.homePage.kubernetesTour.title', {
41-
defaultMessage: 'Want a different view?',
42-
})}
43-
anchorPosition="downCenter"
44-
footerAction={
45-
<EuiButtonEmpty
46-
data-test-subj="infra-kubernetesTour-dismiss"
47-
size="s"
48-
color="text"
49-
onClick={markTourAsSeen}
50-
>
51-
{i18n.translate('xpack.infra.homePage.kubernetesTour.dismiss', {
52-
defaultMessage: 'Dismiss',
53-
})}
54-
</EuiButtonEmpty>
55-
}
56-
>
57-
{children}
58-
</EuiTourStep>
59-
</div>
29+
<EuiTourStep
30+
content={
31+
<EuiText size="s" color="subdued" data-test-subj="infra-kubernetesTour-text">
32+
{i18n.translate('xpack.infra.homePage.kubernetesTour.text', {
33+
defaultMessage:
34+
'Click here to see your infrastructure in different ways, including Kubernetes pods.',
35+
})}
36+
</EuiText>
37+
}
38+
isStepOpen={!isTourSeen}
39+
maxWidth={350}
40+
onFinish={markTourAsSeen}
41+
step={1}
42+
stepsTotal={1}
43+
title={i18n.translate('xpack.infra.homePage.kubernetesTour.title', {
44+
defaultMessage: 'Want a different view?',
45+
})}
46+
anchorPosition="downCenter"
47+
footerAction={
48+
<EuiButtonEmpty
49+
aria-label={dismissLabel}
50+
data-test-subj="infra-kubernetesTour-dismiss"
51+
size="s"
52+
color="text"
53+
onClick={markTourAsSeen}
54+
>
55+
{dismissLabel}
56+
</EuiButtonEmpty>
57+
}
58+
>
59+
{children}
60+
</EuiTourStep>
6061
);
6162
};

x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const DATE_WITH_DATA = DATES.metricsAndLogs.hosts.withData;
1313
export default function ({ getPageObjects, getService }: FtrProviderContext) {
1414
const esArchiver = getService('esArchiver');
1515
const security = getService('security');
16-
const PageObjects = getPageObjects(['common', 'error', 'infraHome', 'security']);
16+
const PageObjects = getPageObjects(['common', 'error', 'infraHome', 'security', 'header']);
1717
const testSubjects = getService('testSubjects');
1818
const appsMenu = getService('appsMenu');
1919
const globalNav = getService('globalNav');
@@ -95,7 +95,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
9595
ensureCurrentUrl: true,
9696
shouldLoginIfPrompted: false,
9797
});
98-
await retry.try(async () => {
98+
await retry.tryForTime(5000, async () => {
9999
await PageObjects.infraHome.goToTime(DATE_WITH_DATA);
100100
await testSubjects.existOrFail('~waffleMap');
101101
});
@@ -195,7 +195,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
195195
ensureCurrentUrl: true,
196196
shouldLoginIfPrompted: false,
197197
});
198-
await retry.try(async () => {
198+
199+
await PageObjects.header.waitUntilLoadingHasFinished();
200+
201+
await retry.tryForTime(5000, async () => {
199202
await PageObjects.infraHome.goToTime(DATE_WITH_DATA);
200203
await testSubjects.existOrFail('~waffleMap');
201204
});

x-pack/test/functional/apps/infra/home_page.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
166166

167167
// Persist after refresh
168168
await browser.refresh();
169-
await pageObjects.infraHome.waitForLoading();
170-
169+
await pageObjects.header.awaitGlobalLoadingIndicatorHidden();
171170
expect(ensureKubernetesTourVisible).to.contain(kubernetesTourText);
172171

173172
await pageObjects.infraHome.clickDismissKubernetesTourButton();

0 commit comments

Comments
 (0)