-
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.
[ObsUX] Enable Hosts advanced setting on serverless (#170035)
Closes #169198 ## Summary * Adds Hosts advanced setting to the observability settings allowlist * Adds tests for Hosts sidenav item visibility https://github.com/elastic/kibana/assets/793851/3c9252c8-a4cb-4da8-aa60-23a8aeb60d4c # How to test * Run locally in serverless mode * Make sure "Observability Hosts view" toggle is visible on the Advanced Settings screen * Toggle the setting on and off, make sure sidenav properly reacts to the changes * Go to Infra settings screen * Toggle the same setting on and off, and also make sure sidenav properly reacts to the changes
- Loading branch information
1 parent
b9f347b
commit e804ef2
Showing
4 changed files
with
76 additions
and
0 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
63 changes: 63 additions & 0 deletions
63
x-pack/test_serverless/functional/test_suites/observability/infra/navigation.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,63 @@ | ||
/* | ||
* 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 { enableInfrastructureHostsView } from '@kbn/observability-plugin/common'; | ||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default ({ getPageObjects, getService }: FtrProviderContext) => { | ||
const kibanaServer = getService('kibanaServer'); | ||
const svlObltNavigation = getService('svlObltNavigation'); | ||
const browser = getService('browser'); | ||
const pageObjects = getPageObjects(['svlCommonPage', 'svlCommonNavigation', 'header']); | ||
|
||
const setHostsSetting = async (value: boolean) => { | ||
await kibanaServer.uiSettings.update({ [enableInfrastructureHostsView]: value }); | ||
await browser.refresh(); | ||
await pageObjects.svlCommonNavigation.expectExists(); | ||
}; | ||
|
||
const openInfraSection = async () => { | ||
await pageObjects.svlCommonNavigation.sidenav.openSection('observability_project_nav.metrics'); | ||
}; | ||
|
||
describe('Infra Side Navigation', () => { | ||
before(async () => { | ||
await pageObjects.svlCommonPage.login(); | ||
await svlObltNavigation.navigateToLandingPage(); | ||
}); | ||
|
||
after(async () => { | ||
await pageObjects.svlCommonPage.forceLogout(); | ||
}); | ||
|
||
describe('when Hosts settings is on', () => { | ||
before(async () => { | ||
await setHostsSetting(true); | ||
await openInfraSection(); | ||
}); | ||
|
||
it("shows the 'Hosts' nav item", async () => { | ||
await pageObjects.svlCommonNavigation.sidenav.expectLinkExists({ | ||
deepLinkId: 'metrics:hosts', | ||
}); | ||
}); | ||
}); | ||
|
||
describe('when Hosts settings is off', () => { | ||
before(async () => { | ||
await setHostsSetting(false); | ||
await openInfraSection(); | ||
}); | ||
|
||
it("hides the 'Hosts' nav item", async () => { | ||
await pageObjects.svlCommonNavigation.sidenav.expectLinkMissing({ | ||
deepLinkId: 'metrics:hosts', | ||
}); | ||
}); | ||
}); | ||
}); | ||
}; |