mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Cloud Security] wait for action button to be present before clicking to fix flacky FTR tests (#164054)
## Summary Fixing flaky FTR test where we need to navigate to the integrations page from our onboarding views. Confirmed in the flaky test runner that with the fix tests are not flaky anymore https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2901 fixes: - https://github.com/elastic/kibana/issues/163950 --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
ce93a1f871
commit
9aba253d56
2 changed files with 13 additions and 4 deletions
|
@ -15,7 +15,7 @@ const FINDINGS_LATEST_INDEX = 'logs-cloud_security_posture.findings_latest-defau
|
|||
|
||||
export function FindingsPageProvider({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const testSubjects = getService('testSubjects');
|
||||
const PageObjects = getPageObjects(['common']);
|
||||
const PageObjects = getPageObjects(['common', 'header']);
|
||||
const retry = getService('retry');
|
||||
const es = getService('es');
|
||||
const supertest = getService('supertest');
|
||||
|
@ -92,7 +92,15 @@ export function FindingsPageProvider({ getService, getPageObjects }: FtrProvider
|
|||
},
|
||||
|
||||
async navigateToAction(actionTestSubject: string) {
|
||||
await testSubjects.click(actionTestSubject);
|
||||
return await retry.try(async () => {
|
||||
await testSubjects.click(actionTestSubject);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const result = await testSubjects.exists('createPackagePolicy_pageTitle');
|
||||
|
||||
if (!result) {
|
||||
throw new Error('Integration installation page not found');
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -12,8 +12,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
|
|||
export default ({ getPageObjects }: FtrProviderContext) => {
|
||||
const PageObjects = getPageObjects(['common', 'findings', 'header']);
|
||||
|
||||
// Failing: See https://github.com/elastic/kibana/issues/163950
|
||||
describe.skip('Findings Page onboarding', function () {
|
||||
describe('Findings Page onboarding', function () {
|
||||
this.tags(['cloud_security_posture_findings_onboarding']);
|
||||
let findings: typeof PageObjects.findings;
|
||||
let notInstalledVulnerabilities: typeof findings.notInstalledVulnerabilities;
|
||||
|
@ -34,6 +33,7 @@ export default ({ getPageObjects }: FtrProviderContext) => {
|
|||
expect(element).to.not.be(null);
|
||||
|
||||
await notInstalledVulnerabilities.navigateToAction('cnvm-not-installed-action');
|
||||
|
||||
await PageObjects.common.waitUntilUrlIncludes('add-integration/vuln_mgmt');
|
||||
});
|
||||
|
||||
|
@ -44,6 +44,7 @@ export default ({ getPageObjects }: FtrProviderContext) => {
|
|||
expect(element).to.not.be(null);
|
||||
|
||||
await notInstalledCSP.navigateToAction('cspm-not-installed-action');
|
||||
|
||||
await PageObjects.common.waitUntilUrlIncludes('add-integration/cspm');
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue