Skip to content

Commit

Permalink
[Infra UI] Hosts view test: fix apm services link (#162147)
Browse files Browse the repository at this point in the history
Closes #162051
Closes #159368
## Summary

This PR aims to make the APM services link test more stable. For some
reason, some of the query parameters are not present in the URL the
moment we navigate but we can see in the screenshot that the correct
dates are applied (it could be that the moment we load APM the URL is
not updated - when checking locally those parameters exist in the URL)
<img width="1612" alt="image"
src="https://github.com/elastic/kibana/assets/14139027/2363108a-329e-4f28-a0d8-9f177d01d4ef">

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
jennypavlova and kibanamachine authored Jul 19, 2023
1 parent 0a6b5e9 commit e98abd0
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions x-pack/test/functional/apps/infra/hosts_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const returnTo = async (path: string, timeout = 2000) =>
retry.waitForWithTimeout('returned to hosts view', timeout, async () => {
await browser.goBack();
await pageObjects.header.waitUntilLoadingHasFinished();
const currentUrl = await browser.getCurrentUrl();
return !!currentUrl.match(path);
});
Expand Down Expand Up @@ -245,9 +246,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/162051
// FLAKY: https://github.com/elastic/kibana/issues/159368
describe.skip('#Single host Flyout', () => {
describe('#Single host Flyout', () => {
before(async () => {
await setHostViewEnabled(true);
await pageObjects.common.navigateToApp(HOSTS_VIEW_PATH);
Expand Down Expand Up @@ -419,22 +418,18 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});
});

it('should navigate to APM services after click', async () => {
await pageObjects.infraHostsView.clickFlyoutApmServicesLink();
const url = parse(await browser.getCurrentUrl());

const query = decodeURIComponent(url.query ?? '');

const kuery = 'kuery=host.hostname:"Jennys-MBP.fritz.box"';
const rangeFrom = 'rangeFrom=2023-03-28T18:20:00.000Z';
const rangeTo = 'rangeTo=2023-03-28T18:21:00.000Z';
describe('Flyout links', () => {
it('should navigate to APM services after click', async () => {
await pageObjects.infraHostsView.clickFlyoutApmServicesLink();
const url = parse(await browser.getCurrentUrl());
const query = decodeURIComponent(url.query ?? '');
const kuery = 'kuery=host.hostname:"Jennys-MBP.fritz.box"';

expect(url.pathname).to.eql('/app/apm/services');
expect(query).to.contain(kuery);
expect(query).to.contain(rangeFrom);
expect(query).to.contain(rangeTo);
expect(url.pathname).to.eql('/app/apm/services');
expect(query).to.contain(kuery);

await returnTo(HOSTS_VIEW_PATH);
await returnTo(HOSTS_VIEW_PATH);
});
});
});

Expand Down

0 comments on commit e98abd0

Please sign in to comment.