[Infra UI] Test fix: add retry to metadata remove pin button check after refresh (#161736)

Closes #161514

## Summary

This PR fixes the flyout test, it seems there was a timeout before the
check (in the screenshot is visible that the button is there so could be
that the check happened before the loading finished) I added a retry
there.
This commit is contained in:
jennypavlova 2023-07-13 12:13:53 +02:00 committed by GitHub
parent 5b89675835
commit c8a451e45a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -154,8 +154,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
return !!currentUrl.match(path);
});
// Failing: See https://github.com/elastic/kibana/issues/161514
describe.skip('Hosts View', function () {
describe('Hosts View', function () {
before(async () => {
await Promise.all([
esArchiver.load('x-pack/test/functional/es_archives/infra/alerts'),
@ -309,8 +308,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
// Persist pin after refresh
await browser.refresh();
await pageObjects.infraHome.waitForLoading();
expect(await pageObjects.infraHostsView.getRemovePinExist()).to.be(true);
await retry.try(async () => {
await pageObjects.infraHome.waitForLoading();
const removePinExist = await pageObjects.infraHostsView.getRemovePinExist();
expect(removePinExist).to.be(true);
});
// Remove Pin
await pageObjects.infraHostsView.clickRemoveMetadataPin();