Skip to content

Commit

Permalink
[8.16] [Ingest Pipelines] Fix functional tests for GeoIP databases (#…
Browse files Browse the repository at this point in the history
…196544) (#196889)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Ingest Pipelines] Fix functional tests for GeoIP databases
(#196544)](#196544)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Elena
Stoeva","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-18T13:54:10Z","message":"[Ingest
Pipelines] Fix functional tests for GeoIP databases
(#196544)\n\nFollow-up to
https://github.com/elastic/kibana/pull/190830\r\n\r\n##
Summary\r\n\r\nThis PR fixes the functional tests for GeoIP databases.
Before, the\r\ntests were failing because a value could not be selected
in the Type\r\nfield and the Name field in the add database modal (these
fields use\r\nEuiSelect for `testsubjects.setValue` did not work). This
is fixed by\r\nassigning a data-test-subj to every option in the
dropdown and clicking\r\non the field and then on the corresponding
option.\r\n\r\nFlaky test
runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7165","sha":"37b57a3772e36a933920ebac5de77fd765b235b4","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","Team:Kibana
Management","release_note:skip","v9.0.0","Feature:Ingest Node
Pipelines","backport:prev-minor","v8.16.0","v8.17.0"],"title":"[Ingest
Pipelines] Fix functional tests for GeoIP
databases","number":196544,"url":"https://github.com/elastic/kibana/pull/196544","mergeCommit":{"message":"[Ingest
Pipelines] Fix functional tests for GeoIP databases
(#196544)\n\nFollow-up to
https://github.com/elastic/kibana/pull/190830\r\n\r\n##
Summary\r\n\r\nThis PR fixes the functional tests for GeoIP databases.
Before, the\r\ntests were failing because a value could not be selected
in the Type\r\nfield and the Name field in the add database modal (these
fields use\r\nEuiSelect for `testsubjects.setValue` did not work). This
is fixed by\r\nassigning a data-test-subj to every option in the
dropdown and clicking\r\non the field and then on the corresponding
option.\r\n\r\nFlaky test
runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7165","sha":"37b57a3772e36a933920ebac5de77fd765b235b4"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196544","number":196544,"mergeCommit":{"message":"[Ingest
Pipelines] Fix functional tests for GeoIP databases
(#196544)\n\nFollow-up to
https://github.com/elastic/kibana/pull/190830\r\n\r\n##
Summary\r\n\r\nThis PR fixes the functional tests for GeoIP databases.
Before, the\r\ntests were failing because a value could not be selected
in the Type\r\nfield and the Name field in the add database modal (these
fields use\r\nEuiSelect for `testsubjects.setValue` did not work). This
is fixed by\r\nassigning a data-test-subj to every option in the
dropdown and clicking\r\non the field and then on the corresponding
option.\r\n\r\nFlaky test
runner:\r\nhttps://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7165","sha":"37b57a3772e36a933920ebac5de77fd765b235b4"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Elena Stoeva <[email protected]>
  • Loading branch information
kibanamachine and ElenaStoeva authored Oct 18, 2024
1 parent e300e28 commit 88131ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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();
Expand All @@ -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
Expand Down
17 changes: 9 additions & 8 deletions x-pack/test/functional/page_objects/ingest_pipelines_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
},

Expand Down

0 comments on commit 88131ef

Please sign in to comment.