Skip to content

Commit

Permalink
[8.16] [Infra] Fix anomalies flyout navigation failing test (#197999) (
Browse files Browse the repository at this point in the history
…#198115)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Infra] Fix anomalies flyout navigation failing test
(#197999)](#197999)

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

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

<!--BACKPORT
[{"author":{"name":"jennypavlova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-29T08:42:43Z","message":"[Infra]
Fix anomalies flyout navigation failing test (#197999)\n\nCloses #192882
\r\n\r\nThe issue was that the url was checked too early which resulted
in\r\nchecking the locator url instead of the page url after navigating
so I\r\nadded a check for loading before the URL check and this solved
the\r\nissue.\r\n\r\n\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7284","sha":"3131dd9bfa1ee28fa12f90bb6ae8060da9e44665","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-infra_services","v8.16.0","backport:version"],"title":"[Infra]
Fix anomalies flyout navigation failing
test","number":197999,"url":"https://github.com/elastic/kibana/pull/197999","mergeCommit":{"message":"[Infra]
Fix anomalies flyout navigation failing test (#197999)\n\nCloses #192882
\r\n\r\nThe issue was that the url was checked too early which resulted
in\r\nchecking the locator url instead of the page url after navigating
so I\r\nadded a check for loading before the URL check and this solved
the\r\nissue.\r\n\r\n\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7284","sha":"3131dd9bfa1ee28fa12f90bb6ae8060da9e44665"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197999","number":197999,"mergeCommit":{"message":"[Infra]
Fix anomalies flyout navigation failing test (#197999)\n\nCloses #192882
\r\n\r\nThe issue was that the url was checked too early which resulted
in\r\nchecking the locator url instead of the page url after navigating
so I\r\nadded a check for loading before the URL check and this solved
the\r\nissue.\r\n\r\n\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7284","sha":"3131dd9bfa1ee28fa12f90bb6ae8060da9e44665"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: jennypavlova <[email protected]>
  • Loading branch information
kibanamachine and jennypavlova authored Oct 29, 2024
1 parent 512cabc commit 7dc8539
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion x-pack/test/functional/apps/infra/metrics_anomalies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ import { HOSTS_VIEW_PATH, ML_JOB_IDS } from './constants';
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const pageObjects = getPageObjects(['assetDetails', 'common', 'infraHome', 'infraHostsView']);
const pageObjects = getPageObjects([
'assetDetails',
'common',
'infraHome',
'infraHostsView',
'header',
]);
const infraSourceConfigurationForm = getService('infraSourceConfigurationForm');
const testSubjects = getService('testSubjects');
const browser = getService('browser');
Expand Down Expand Up @@ -144,6 +150,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await pageObjects.infraHome.setAnomaliesDate('Apr 21, 2021 @ 00:00:00.000');
const hostName = await pageObjects.infraHome.getAnomalyHostName();
await pageObjects.infraHome.clickShowAffectedHostsButton();
await pageObjects.header.waitUntilLoadingHasFinished();
const currentUrl = await browser.getCurrentUrl();
expect(currentUrl).to.contain(
encodeURIComponent(`query:(terms:(host.name:!(${hostName})))`)
Expand Down

0 comments on commit 7dc8539

Please sign in to comment.