Skip to content

Commit

Permalink
Add data-test-subj to options
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenaStoeva committed Oct 16, 2024
1 parent 9d0f5ac commit 2643391
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ export const DATABASE_TYPE_OPTIONS = [
text: i18n.translate('xpack.ingestPipelines.manageProcessors.geoip.maxmindDatabaseType', {
defaultMessage: 'MaxMind',
}),
'data-test-subj': 'maxMindOption',
},
{
value: 'ipinfo',
text: i18n.translate('xpack.ingestPipelines.manageProcessors.geoip.ipinfoDatabaseType', {
defaultMessage: 'IPInfo',
}),
'data-test-subj': 'ipInfoOption',
},
];
export const GEOIP_NAME_OPTIONS = [
Expand All @@ -30,12 +32,14 @@ export const GEOIP_NAME_OPTIONS = [
text: i18n.translate('xpack.ingestPipelines.manageProcessors.geoip.anonymousIPDatabaseName', {
defaultMessage: 'GeoIP2 Anonymous IP',
}),
'data-test-subj': 'geoIpAnonymousOption',
},
{
value: 'GeoIP2-City',
text: i18n.translate('xpack.ingestPipelines.manageProcessors.geoip.cityDatabaseName', {
defaultMessage: 'GeoIP2 City',
}),
'data-test-subj': 'geoIpCityOption',
},
{
value: 'GeoIP2-Connection-Type',
Expand All @@ -45,30 +49,35 @@ export const GEOIP_NAME_OPTIONS = [
defaultMessage: 'GeoIP2 Connection Type',
}
),
'data-test-subj': 'geoIpConnectionOption',
},
{
value: 'GeoIP2-Country',
text: i18n.translate('xpack.ingestPipelines.manageProcessors.geoip.countryDatabaseName', {
defaultMessage: 'GeoIP2 Country',
}),
'data-test-subj': 'geoIpCountryOption',
},
{
value: 'GeoIP2-Domain',
text: i18n.translate('xpack.ingestPipelines.manageProcessors.geoip.domainDatabaseName', {
defaultMessage: 'GeoIP2 Domain',
}),
'data-test-subj': 'geoIpDomainOption',
},
{
value: 'GeoIP2-Enterprise',
text: i18n.translate('xpack.ingestPipelines.manageProcessors.geoip.enterpriseDatabaseName', {
defaultMessage: 'GeoIP2 Enterprise',
}),
'data-test-subj': 'geoIpEnterpriseOption',
},
{
value: 'GeoIP2-ISP',
text: i18n.translate('xpack.ingestPipelines.manageProcessors.geoip.ispDatabaseName', {
defaultMessage: 'GeoIP2 ISP',
}),
'data-test-subj': 'geoIpIspOption',
},
];
export const IPINFO_NAME_OPTIONS = [
Expand All @@ -77,18 +86,21 @@ export const IPINFO_NAME_OPTIONS = [
text: i18n.translate('xpack.ingestPipelines.manageProcessors.ipinfo.freeAsnDatabaseName', {
defaultMessage: 'Free IP to ASN',
}),
'data-test-subj': 'asnOption',
},
{
value: 'country',
text: i18n.translate('xpack.ingestPipelines.manageProcessors.ipinfo.freeCountryDatabaseName', {
defaultMessage: 'Free IP to Country',
}),
'data-test-subj': 'countryOption',
},
{
value: 'standard_asn',
text: i18n.translate('xpack.ingestPipelines.manageProcessors.ipinfo.asnDatabaseName', {
defaultMessage: 'ASN',
}),
'data-test-subj': 'standardAsnOption',
},
{
value: 'standard_location',
Expand All @@ -98,6 +110,7 @@ export const IPINFO_NAME_OPTIONS = [
defaultMessage: 'IP Geolocation',
}
),
'data-test-subj': 'locationOption',
},
{
value: 'standard_privacy',
Expand All @@ -107,6 +120,7 @@ export const IPINFO_NAME_OPTIONS = [
defaultMessage: 'Privacy Detection',
}
),
'data-test-subj': 'privacyOption',
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
it('Create a MaxMind database', async () => {
await pageObjects.ingestPipelines.openCreateDatabaseModal();
await pageObjects.ingestPipelines.fillAddDatabaseForm(
'maxmind',
maxMindDatabaseName,
'maxMindOption',
'geoIpAnonymousOption',
'123456'
);
await pageObjects.ingestPipelines.clickAddDatabaseButton();
Expand All @@ -54,7 +54,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

it('Create an IPInfo database', async () => {
await pageObjects.ingestPipelines.openCreateDatabaseModal();
await pageObjects.ingestPipelines.fillAddDatabaseForm('ipinfo', 'asn');
await pageObjects.ingestPipelines.fillAddDatabaseForm('ipInfoOption', 'asnOption');
await pageObjects.ingestPipelines.clickAddDatabaseButton();

// Wait for new row to gets displayed
Expand Down
9 changes: 7 additions & 2 deletions x-pack/test/functional/page_objects/ingest_pipelines_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ export function IngestPipelinesPageProvider({ getService, getPageObjects }: FtrP
},

async fillAddDatabaseForm(databaseType: string, databaseName: string, maxmind?: string) {
await testSubjects.setValue('databaseTypeSelect', databaseType);
await testSubjects.click('databaseTypeSelect');
await pageObjects.common.sleep(1000);
await testSubjects.click(databaseType);

// Wait for the rest of the fields to get displayed
await pageObjects.common.sleep(1000);
Expand All @@ -141,7 +143,10 @@ export function IngestPipelinesPageProvider({ getService, getPageObjects }: FtrP
if (maxmind) {
await testSubjects.setValue('maxmindField', maxmind);
}
await testSubjects.setValue('databaseNameSelect', databaseName);

await testSubjects.click('databaseNameSelect');
await pageObjects.common.sleep(1000);
await testSubjects.click(databaseName);
},

async clickAddDatabaseButton() {
Expand Down

0 comments on commit 2643391

Please sign in to comment.