Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cloud Security] wait for action button to be present before clicking to fix flacky FTR tests #164054

Merged
merged 14 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
}
});
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
});

Expand All @@ -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');
});

Expand Down