From 88131efd529e5e4380ea41dd813ebc9247279936 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:46:28 +1100 Subject: [PATCH] [8.16] [Ingest Pipelines] Fix functional tests for GeoIP databases (#196544) (#196889) # Backport This will backport the following commits from `main` to `8.16`: - [[Ingest Pipelines] Fix functional tests for GeoIP databases (#196544)](https://github.com/elastic/kibana/pull/196544) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com> --- .../apps/ingest_pipelines/manage_processors.ts | 11 +++++------ .../page_objects/ingest_pipelines_page.ts | 17 +++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/x-pack/test/functional/apps/ingest_pipelines/manage_processors.ts b/x-pack/test/functional/apps/ingest_pipelines/manage_processors.ts index a4951a2829fd0..5697f57c37038 100644 --- a/x-pack/test/functional/apps/ingest_pipelines/manage_processors.ts +++ b/x-pack/test/functional/apps/ingest_pipelines/manage_processors.ts @@ -12,10 +12,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const pageObjects = getPageObjects(['common', 'ingestPipelines', 'savedObjects']); const security = getService('security'); const maxMindDatabaseName = 'GeoIP2-Anonymous-IP'; - const ipInfoDatabaseName = 'ASN'; + const ipInfoDatabaseName = 'Free IP to ASN'; - // TODO: Fix flaky tests - describe.skip('Ingest Pipelines: Manage Processors', function () { + describe('Ingest Pipelines: Manage Processors', function () { this.tags('smoke'); before(async () => { await security.testUser.setRoles(['manage_processors_user']); @@ -36,8 +35,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('Create a MaxMind database', async () => { await pageObjects.ingestPipelines.openCreateDatabaseModal(); await pageObjects.ingestPipelines.fillAddDatabaseForm( - 'MaxMind', - 'GeoIP2 Anonymous IP', + 'maxmind', + maxMindDatabaseName, '123456' ); await pageObjects.ingestPipelines.clickAddDatabaseButton(); @@ -55,7 +54,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { it('Create an IPInfo database', async () => { await pageObjects.ingestPipelines.openCreateDatabaseModal(); - await pageObjects.ingestPipelines.fillAddDatabaseForm('IPInfo', ipInfoDatabaseName); + await pageObjects.ingestPipelines.fillAddDatabaseForm('ipinfo', 'asn'); await pageObjects.ingestPipelines.clickAddDatabaseButton(); // Wait for new row to gets displayed diff --git a/x-pack/test/functional/page_objects/ingest_pipelines_page.ts b/x-pack/test/functional/page_objects/ingest_pipelines_page.ts index b62d34b114f4b..efbc86128c224 100644 --- a/x-pack/test/functional/page_objects/ingest_pipelines_page.ts +++ b/x-pack/test/functional/page_objects/ingest_pipelines_page.ts @@ -7,7 +7,6 @@ import path from 'path'; import { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services'; -import expect from '@kbn/expect'; import { FtrProviderContext } from '../ftr_provider_context'; export function IngestPipelinesPageProvider({ getService, getPageObjects }: FtrProviderContext) { @@ -132,21 +131,23 @@ export function IngestPipelinesPageProvider({ getService, getPageObjects }: FtrP }, async fillAddDatabaseForm(databaseType: string, databaseName: string, maxmind?: string) { - await testSubjects.setValue('databaseTypeSelect', databaseType); + await testSubjects.selectValue('databaseTypeSelect', databaseType); - // Wait for the rest of the fields to get displayed - await pageObjects.common.sleep(1000); - expect(await testSubjects.exists('databaseNameSelect')).to.be(true); + await retry.waitFor('Database name field to be displayed', async () => { + return await testSubjects.isDisplayed('databaseNameSelect'); + }); if (maxmind) { await testSubjects.setValue('maxmindField', maxmind); } - await testSubjects.setValue('databaseNameSelect', databaseName); + + await testSubjects.selectValue('databaseNameSelect', databaseName); }, async clickAddDatabaseButton() { - // Wait for button to get enabled - await pageObjects.common.sleep(1000); + await retry.waitFor('Add button to be enabled', async () => { + return await testSubjects.isEnabled('addGeoipDatabaseSubmit'); + }); await testSubjects.click('addGeoipDatabaseSubmit'); },