Skip to content

Commit eea43c2

Browse files
[9.1] Test fix: Close popover before clicking on the tab (#226116) (#226347)
# Backport This will backport the following commits from `main` to `9.1`: - [Test fix: Close popover before clicking on the tab (#226116)](#226116) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"jennypavlova","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T08:16:20Z","message":"Test fix: Close popover before clicking on the tab (#226116)\n\nCloses #225181\n\n## Summary\n\nThis PR tries to fix a failing test by closing all popovers that cover\nthe tab button using the escape key.","sha":"d5f6e40ef663b7a3bab5858b4b5eaa4506c5f691","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","backport:prev-major","Team:obs-ux-infra_services","v9.2.0"],"title":"Test fix: Close popover before clicking on the tab","number":226116,"url":"https://github.com/elastic/kibana/pull/226116","mergeCommit":{"message":"Test fix: Close popover before clicking on the tab (#226116)\n\nCloses #225181\n\n## Summary\n\nThis PR tries to fix a failing test by closing all popovers that cover\nthe tab button using the escape key.","sha":"d5f6e40ef663b7a3bab5858b4b5eaa4506c5f691"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226116","number":226116,"mergeCommit":{"message":"Test fix: Close popover before clicking on the tab (#226116)\n\nCloses #225181\n\n## Summary\n\nThis PR tries to fix a failing test by closing all popovers that cover\nthe tab button using the escape key.","sha":"d5f6e40ef663b7a3bab5858b4b5eaa4506c5f691"}}]}] BACKPORT--> Co-authored-by: jennypavlova <[email protected]>
1 parent be90722 commit eea43c2

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
642642

643643
describe('Overview Tab', () => {
644644
before(async () => {
645-
await pageObjects.assetDetails.clickOverviewTab();
645+
// Close the metric popover if it is open
646+
await browser.pressKeys(browser.keys.ESCAPE);
647+
const overviewTab = await pageObjects.assetDetails.getOverviewTab();
648+
// Use clickMouseButton to ensure the tab is visible
649+
await overviewTab.clickMouseButton();
646650
});
647651

648652
[
@@ -820,7 +824,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
820824

821825
describe('Metadata Tab', () => {
822826
before(async () => {
823-
await pageObjects.assetDetails.clickMetadataTab();
827+
// Close the metric popover if it is open
828+
await browser.pressKeys(browser.keys.ESCAPE);
829+
const metadataTab = await pageObjects.assetDetails.getMetadataTab();
830+
// Use clickMouseButton to ensure the tab is visible
831+
await metadataTab.clickMouseButton();
824832
});
825833

826834
it('should show metadata table', async () => {

x-pack/test/functional/page_objects/asset_details.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ export function AssetDetailsProvider({ getService }: FtrProviderContext) {
170170
},
171171

172172
// Metadata
173+
async getMetadataTab() {
174+
return testSubjects.find('infraAssetDetailsMetadataTab');
175+
},
176+
173177
async clickMetadataTab() {
174178
return testSubjects.click('infraAssetDetailsMetadataTab');
175179
},

0 commit comments

Comments
 (0)