From 45b0c251913b6978195291a5d317972fe8c83ddb Mon Sep 17 00:00:00 2001 From: Rickyanto Ang Date: Tue, 9 Jul 2024 13:01:00 -0700 Subject: [PATCH] [Cloud Security]Fix for flaky FTRs caused by duplicate names (#187784) ## Summary This PR is to address the following flaky FTRs https://github.com/elastic/kibana/issues/186302 https://github.com/elastic/kibana/issues/186315 https://github.com/elastic/kibana/issues/186387 https://github.com/elastic/kibana/issues/186389 The flakiness are being caused by having duplicate names for the integration when adding them. We tried adding wait before clicking on the Save button however that doesn't seem to work as it starts failing in the flaky test runner This PR gives the Integration a specific name (not relying on auto naming) --- .../add_cis_integration_form_page.ts | 8 ++++ .../cnvm/cis_integration_cnvm.ts | 11 ++++-- .../cspm/cis_integration_aws.ts | 36 ++++++++--------- .../cspm/cis_integration_azure.ts | 24 ++++++------ .../cspm/cis_integration_gcp.ts | 26 ++++++------- .../kspm/cis_integration_eks.ts | 39 ++++++++++--------- .../kspm/cis_integration_k8s.ts | 2 +- .../pages/findings.ts | 12 +++--- 8 files changed, 86 insertions(+), 72 deletions(-) diff --git a/x-pack/test/cloud_security_posture_functional/page_objects/add_cis_integration_form_page.ts b/x-pack/test/cloud_security_posture_functional/page_objects/add_cis_integration_form_page.ts index 1b2eda553dba2..bf555e7fe72e4 100644 --- a/x-pack/test/cloud_security_posture_functional/page_objects/add_cis_integration_form_page.ts +++ b/x-pack/test/cloud_security_posture_functional/page_objects/add_cis_integration_form_page.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { v4 as uuidv4 } from 'uuid'; import type { FtrProviderContext } from '../ftr_provider_context'; export function AddCisIntegrationFormPageProvider({ @@ -282,6 +283,12 @@ export function AddCisIntegrationFormPageProvider({ return await testSubjects.find(`button-replace-${secretField}`); }; + const inputUniqueIntegrationName = async () => { + const flyout = await testSubjects.find('createPackagePolicy_page'); + const nameField = await flyout.findAllByCssSelector('input[id="name"]'); + await nameField[0].type(uuidv4()); + }; + return { cisAzure, cisAws, @@ -316,5 +323,6 @@ export function AddCisIntegrationFormPageProvider({ isOptionChecked, checkIntegrationPliAuthBlockExists, getReplaceSecretButton, + inputUniqueIntegrationName, }; } diff --git a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts index 1b57e9a65d41e..a91d35ea668be 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts @@ -23,12 +23,13 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.navigateToAddIntegrationCspmPage(); }); - // FLAKY: https://github.com/elastic/kibana/issues/186302 - describe.skip('CNVM AWS', () => { + describe('CNVM AWS', () => { it('Hyperlink on PostInstallation Modal should have the correct URL', async () => { await cisIntegration.navigateToAddIntegrationCnvmPage(); + await cisIntegration.inputUniqueIntegrationName(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect( (await cisIntegration.getUrlOnPostInstallModal()) === 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-howdoesitwork.html' @@ -50,8 +51,10 @@ export default function (providerContext: FtrProviderContext) { it('Clicking on Launch CloudFormation on post intall modal should lead user to Cloud Formation page', async () => { await cisIntegration.navigateToAddIntegrationCnvmPage(); + await cisIntegration.inputUniqueIntegrationName(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect( ( await cisIntegration.clickLaunchAndGetCurrentUrl( diff --git a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts index 5523e05120912..10c2f0560237c 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts @@ -48,11 +48,11 @@ export default function (providerContext: FtrProviderContext) { it('Hyperlink on PostInstallation Modal should have the correct URL', async () => { await cisIntegration.clickOptionButton(CIS_AWS_OPTION_TEST_ID); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegrationAws.getPostInstallCloudFormationModal()) !== undefined).to.be( true ); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect( (await cisIntegration.getUrlOnPostInstallModal()) === 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-howdoesitwork.html' @@ -73,7 +73,7 @@ export default function (providerContext: FtrProviderContext) { it('Clicking on Launch CloudFormation on post intall modal should lead user to Cloud Formation page', async () => { await cisIntegration.clickOptionButton(CIS_AWS_OPTION_TEST_ID); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect( ( await cisIntegration.clickLaunchAndGetCurrentUrl( @@ -92,7 +92,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.fillInTextField(ROLE_ARN_TEST_ID, roleArn); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect((await cisIntegration.getFieldValueInEditPage(ROLE_ARN_TEST_ID)) === roleArn).to.be( @@ -109,7 +109,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.clickOptionButton(AWS_CREDENTIAL_SELECTOR); await cisIntegration.selectValue(AWS_CREDENTIAL_SELECTOR, 'direct_access_keys'); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.fillInTextField(DIRECT_ACCESS_KEY_ID_TEST_ID, directAccessKeyId); await cisIntegration.fillInTextField( @@ -117,7 +117,7 @@ export default function (providerContext: FtrProviderContext) { directAccessSecretKey ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect( @@ -137,7 +137,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.clickOptionButton(AWS_CREDENTIAL_SELECTOR); await cisIntegration.selectValue(AWS_CREDENTIAL_SELECTOR, 'temporary_keys'); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.fillInTextField(TEMP_ACCESS_KEY_ID_TEST_ID, accessKeyId); await cisIntegration.fillInTextField( @@ -149,7 +149,7 @@ export default function (providerContext: FtrProviderContext) { tempAccessSessionToken ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); @@ -172,7 +172,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.clickOptionButton(AWS_CREDENTIAL_SELECTOR); await cisIntegration.selectValue(AWS_CREDENTIAL_SELECTOR, 'shared_credentials'); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.fillInTextField(SHARED_CREDENTIALS_FILE_TEST_ID, sharedCredentialFile); await cisIntegration.fillInTextField( @@ -180,7 +180,7 @@ export default function (providerContext: FtrProviderContext) { sharedCredentialProfileName ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); @@ -200,7 +200,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(CIS_AWS_OPTION_TEST_ID); await cisIntegration.clickOptionButton(AWS_SINGLE_ACCOUNT_TEST_ID); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect( (await cisIntegration.getUrlOnPostInstallModal()) === 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-howdoesitwork.html' @@ -216,7 +216,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.fillInTextField(ROLE_ARN_TEST_ID, roleArn); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect((await cisIntegration.getFieldValueInEditPage(ROLE_ARN_TEST_ID)) === roleArn).to.be( @@ -234,7 +234,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.clickOptionButton(AWS_CREDENTIAL_SELECTOR); await cisIntegration.selectValue(AWS_CREDENTIAL_SELECTOR, 'direct_access_keys'); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.fillInTextField(DIRECT_ACCESS_KEY_ID_TEST_ID, directAccessKeyId); await cisIntegration.fillInTextField( @@ -242,7 +242,7 @@ export default function (providerContext: FtrProviderContext) { directAccessSecretKey ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect( @@ -263,7 +263,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.clickOptionButton(AWS_CREDENTIAL_SELECTOR); await cisIntegration.selectValue(AWS_CREDENTIAL_SELECTOR, 'temporary_keys'); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.fillInTextField(TEMP_ACCESS_KEY_ID_TEST_ID, accessKeyId); await cisIntegration.fillInTextField( @@ -275,7 +275,7 @@ export default function (providerContext: FtrProviderContext) { tempAccessSessionToken ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); @@ -299,7 +299,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.clickOptionButton(AWS_CREDENTIAL_SELECTOR); await cisIntegration.selectValue(AWS_CREDENTIAL_SELECTOR, 'shared_credentials'); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickOptionButton(AWS_MANUAL_TEST_ID); await cisIntegration.fillInTextField(SHARED_CREDENTIALS_FILE_TEST_ID, sharedCredentialFile); await cisIntegration.fillInTextField( @@ -307,7 +307,7 @@ export default function (providerContext: FtrProviderContext) { sharedCredentialProfileName ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); diff --git a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts index 99cc57905d46e..4415ec5a34160 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts @@ -53,7 +53,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(CIS_AZURE_OPTION_TEST_ID); await cisIntegration.clickOptionButton(CIS_AZURE_SETUP_FORMAT_TEST_SUBJECTS.ARM_TEMPLATE); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegrationAzure.getPostInstallArmTemplateModal()) !== undefined).to.be( true ); @@ -70,7 +70,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(CIS_AZURE_SETUP_FORMAT_TEST_SUBJECTS.MANUAL); await cisIntegration.selectValue(AZURE_CREDENTIAL_SELECTOR, 'managed_identity'); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); }); }); @@ -83,7 +83,7 @@ export default function (providerContext: FtrProviderContext) { AZURE_CREDENTIAL_SELECTOR, 'service_principal_with_client_secret' ); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.fillInTextField( CIS_AZURE_INPUT_FIELDS_TEST_SUBJECTS.CLIENT_ID, clientId @@ -97,7 +97,7 @@ export default function (providerContext: FtrProviderContext) { clientSecret ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); @@ -123,7 +123,7 @@ export default function (providerContext: FtrProviderContext) { AZURE_CREDENTIAL_SELECTOR, 'service_principal_with_client_certificate' ); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.fillInTextField( CIS_AZURE_INPUT_FIELDS_TEST_SUBJECTS.CLIENT_ID, clientId @@ -137,7 +137,7 @@ export default function (providerContext: FtrProviderContext) { clientCertificatePath ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); @@ -164,7 +164,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(CIS_AZURE_OPTION_TEST_ID); await cisIntegration.clickOptionButton(CIS_AZURE_SINGLE_SUB_TEST_ID); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegrationAzure.getPostInstallArmTemplateModal()) !== undefined).to.be( true ); @@ -182,7 +182,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(CIS_AZURE_SETUP_FORMAT_TEST_SUBJECTS.MANUAL); await cisIntegration.selectValue(AZURE_CREDENTIAL_SELECTOR, 'managed_identity'); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); }); }); @@ -195,7 +195,7 @@ export default function (providerContext: FtrProviderContext) { AZURE_CREDENTIAL_SELECTOR, 'service_principal_with_client_secret' ); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.fillInTextField( CIS_AZURE_INPUT_FIELDS_TEST_SUBJECTS.CLIENT_ID, clientId @@ -209,7 +209,7 @@ export default function (providerContext: FtrProviderContext) { clientSecret ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); @@ -235,7 +235,7 @@ export default function (providerContext: FtrProviderContext) { AZURE_CREDENTIAL_SELECTOR, 'service_principal_with_client_certificate' ); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.fillInTextField( CIS_AZURE_INPUT_FIELDS_TEST_SUBJECTS.CLIENT_ID, clientId @@ -249,7 +249,7 @@ export default function (providerContext: FtrProviderContext) { clientCertificatePath ); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); diff --git a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts index 121bf7cc2e574..6ce0c8fed5749 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts @@ -63,7 +63,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(GCP_ORGANIZATION_TEST_ID); await cisIntegration.clickOptionButton(GCP_CLOUD_SHELL_TEST_ID); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegrationGcp.isPostInstallGoogleCloudShellModal(true)) === true).to.be( true ); @@ -79,7 +79,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.fillInTextField('organization_id_test_id', organizationName); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect( (await cisIntegrationGcp.isPostInstallGoogleCloudShellModal( true, @@ -102,7 +102,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(GCP_CLOUD_SHELL_TEST_ID); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegrationGcp.isPostInstallGoogleCloudShellModal(false)) === true).to.be( true ); @@ -111,7 +111,7 @@ export default function (providerContext: FtrProviderContext) { it('Hyperlink on PostInstallation Modal should have the correct URL', async () => { await cisIntegration.clickOptionButton(CIS_GCP_OPTION_TEST_ID); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect( (await cisIntegration.getUrlOnPostInstallModal()) === 'https://cloud.google.com/shell/docs' @@ -121,7 +121,7 @@ export default function (providerContext: FtrProviderContext) { it('Clicking on Launch CloudShell on post intall modal should lead user to CloudShell page', async () => { await cisIntegration.clickOptionButton(CIS_GCP_OPTION_TEST_ID); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect( ( await cisIntegration.clickLaunchAndGetCurrentUrl( @@ -143,7 +143,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.fillInTextField(PRJ_ID_TEST_ID, projectName); await cisIntegration.fillInTextField(CREDENTIALS_FILE_TEST_ID, credentialFileName); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect( @@ -167,7 +167,7 @@ export default function (providerContext: FtrProviderContext) { ); await cisIntegration.fillInTextField(CREDENTIALS_JSON_TEST_ID, credentialJsonName); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect( @@ -183,7 +183,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(GCP_SINGLE_ACCOUNT_TEST_ID); await cisIntegration.clickOptionButton(GCP_CLOUD_SHELL_TEST_ID); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegrationGcp.isPostInstallGoogleCloudShellModal(false)) === true).to.be( true ); @@ -195,7 +195,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.clickOptionButton(GCP_CLOUD_SHELL_TEST_ID); await cisIntegration.fillInTextField('project_id_test_id', projectName); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect( (await cisIntegrationGcp.isPostInstallGoogleCloudShellModal(false, '', projectName)) === true @@ -230,7 +230,7 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.fillInTextField(PRJ_ID_TEST_ID, projectName); await cisIntegration.fillInTextField(CREDENTIALS_FILE_TEST_ID, credentialFileName); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect( @@ -248,7 +248,7 @@ export default function (providerContext: FtrProviderContext) { ); await cisIntegration.fillInTextField(CREDENTIALS_JSON_TEST_ID, credentialJsonName); await cisIntegration.clickSaveIntegrationButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.navigateToIntegrationCspList(); expect( (await cisIntegration.getFieldValueInEditPage(CREDENTIALS_JSON_TEST_ID)) === @@ -268,7 +268,7 @@ export default function (providerContext: FtrProviderContext) { ); await cisIntegration.fillInTextField(CREDENTIALS_JSON_TEST_ID, credentialJsonName); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect( @@ -286,7 +286,7 @@ export default function (providerContext: FtrProviderContext) { ); await cisIntegration.fillInTextField(CREDENTIALS_FILE_TEST_ID, credentialFileName); await cisIntegration.clickSaveIntegrationButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.navigateToIntegrationCspList(); expect( (await cisIntegration.getFieldValueInEditPage(CREDENTIALS_FILE_TEST_ID)) === diff --git a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts index db567d335b0ff..f8d7736938f92 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts @@ -35,14 +35,14 @@ export default function (providerContext: FtrProviderContext) { await cisIntegration.navigateToAddIntegrationKspmPage(); }); - // FLAKY: https://github.com/elastic/kibana/issues/186306 - describe.skip('KSPM EKS Assume Role', async () => { + describe('KSPM EKS Assume Role', async () => { it('KSPM EKS Assume Role workflow', async () => { const roleArn = 'RoleArnTestValue'; await cisIntegration.clickOptionButton(CIS_EKS_OPTION_TEST_ID); + await cisIntegration.inputUniqueIntegrationName(); await cisIntegration.fillInTextField(ROLE_ARN_TEST_ID, roleArn); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect((await cisIntegration.getFieldValueInEditPage(ROLE_ARN_TEST_ID)) === roleArn).to.be( @@ -51,22 +51,23 @@ export default function (providerContext: FtrProviderContext) { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/186315 - describe.skip('KSPM EKS Direct Access', async () => { + describe('KSPM EKS Direct Access', async () => { it('KSPM EKS Direct Access Workflow', async () => { const directAccessKeyId = 'directAccessKeyIdTest'; const directAccessSecretKey = 'directAccessSecretKeyTest'; await cisIntegration.clickOptionButton(CIS_EKS_OPTION_TEST_ID); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickOptionButton(EKS_DIRECT_ACCESS_TEST_ID); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); + await cisIntegration.inputUniqueIntegrationName(); await cisIntegration.fillInTextField(DIRECT_ACCESS_KEY_ID_TEST_ID, directAccessKeyId); await cisIntegration.fillInTextField( DIRECT_ACCESS_SECRET_KEY_TEST_ID, directAccessSecretKey ); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); expect( @@ -77,16 +78,16 @@ export default function (providerContext: FtrProviderContext) { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/186389 - describe.skip('KSPM EKS Temporary Keys', () => { + describe('KSPM EKS Temporary Keys', () => { it('KSPM EKS Temporary Keys Workflow', async () => { const accessKeyId = 'accessKeyIdTest'; const accessKeySecretKey = 'accessKeySecretKeyTest'; const tempAccessSessionToken = 'tempAccessSessionTokenTest'; await cisIntegration.clickOptionButton(CIS_EKS_OPTION_TEST_ID); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickOptionButton(EKS_TEMPORARY_KEYS_TEST_ID); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); + await cisIntegration.inputUniqueIntegrationName(); await cisIntegration.fillInTextField(TEMP_ACCESS_KEY_ID_TEST_ID, accessKeyId); await cisIntegration.fillInTextField( TEMP_ACCESS_KEY_SECRET_KEY_TEST_ID, @@ -96,8 +97,9 @@ export default function (providerContext: FtrProviderContext) { TEMP_ACCESS_SESSION_TOKEN_TEST_ID, tempAccessSessionToken ); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); @@ -112,22 +114,23 @@ export default function (providerContext: FtrProviderContext) { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/186387 - describe.skip('KSPM EKS Shared Credentials', () => { + describe('KSPM EKS Shared Credentials', () => { it('KSPM EKS Shared Credentials Workflow', async () => { const sharedCredentialFile = 'sharedCredentialFileTest'; const sharedCredentialProfileName = 'sharedCredentialProfileNameTest'; await cisIntegration.clickOptionButton(CIS_EKS_OPTION_TEST_ID); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickOptionButton(EKS_SHARED_CREDENTIAL_TEST_ID); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); + await cisIntegration.inputUniqueIntegrationName(); await cisIntegration.fillInTextField(SHARED_CREDENTIALS_FILE_TEST_ID, sharedCredentialFile); await cisIntegration.fillInTextField( SHARED_CREDETIALS_PROFILE_NAME_TEST_ID, sharedCredentialProfileName ); + await pageObjects.header.waitUntilLoadingHasFinished(); await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); diff --git a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts index ae2ede4046d11..872c786e3ce28 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts @@ -25,7 +25,7 @@ export default function (providerContext: FtrProviderContext) { describe('KSPM K8S', () => { it('KSPM K8S Workflow', async () => { await cisIntegration.clickSaveButton(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect((await cisIntegration.getPostInstallModal()) !== undefined).to.be(true); await cisIntegration.navigateToIntegrationCspList(); await cisIntegration.clickFirstElementOnIntegrationTable(); diff --git a/x-pack/test/cloud_security_posture_functional/pages/findings.ts b/x-pack/test/cloud_security_posture_functional/pages/findings.ts index 16e63fac3491e..3ea3475b85763 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/findings.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/findings.ts @@ -139,7 +139,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { 'Findings table to be loaded', async () => (await latestFindingsTable.getRowsCount()) === data.length ); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); }); afterEach(async () => { @@ -172,7 +172,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { for (const [columnName, dir, sortingMethod] of testCases) { await latestFindingsTable.toggleColumnSort(columnName, dir); /* This sleep or delay is added to allow some time for the column to settle down before we get the value and to prevent the test from getting the wrong value*/ - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); const values = (await latestFindingsTable.getColumnValues(columnName)).filter(Boolean); expect(values).to.not.be.empty(); const sorted = values @@ -297,7 +297,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { 'Findings table to be loaded', async () => (await latestFindingsTable.getRowsCount()) === data.length + 1 ); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await distributionBar.filterBy('passed'); @@ -328,7 +328,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { 'Findings table to be loaded', async () => (await latestFindingsTable.getRowsCount()) === data.length ); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); await distributionBar.filterBy('passed'); @@ -346,7 +346,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await cspSecurity.logout(); await cspSecurity.login('csp_read_user'); await findings.navigateToLatestFindingsPage(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect(await latestFindingsTable.getRowsCount()).to.be.greaterThan(0); }); @@ -356,7 +356,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await findings.navigateToLatestFindingsPage(); - pageObjects.header.waitUntilLoadingHasFinished(); + await pageObjects.header.waitUntilLoadingHasFinished(); expect(await findings.getUnprivilegedPrompt()); }); });