[Cloud Security] Fix Detection Rule flaky FTR (#189768)

## Summary

It closes https://github.com/elastic/kibana/issues/172312

This PR fixed the flaky FTR test by adding a retry method to the title
checking.
This commit is contained in:
Paulo Henrique 2024-08-02 10:42:13 -07:00 committed by GitHub
parent 964fb66a25
commit d4dc118ffa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -195,7 +195,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await testSubjects.click('csp:toast-success-link');
await pageObjects.header.waitUntilLoadingHasFinished();
const rulePageTitle = await testSubjects.find('header-page-title');
expect(await rulePageTitle.getVisibleText()).to.be(ruleName1);
// Rule page title is not immediately available, so we need to retry until it is
await retry.try(async () => {
expect(await rulePageTitle.getVisibleText()).to.be(ruleName1);
});
});
});
describe('Rule details', () => {