Skip to content
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 @@ -754,6 +754,13 @@ export class StreamsApp {
await expect(this.page.getByTestId('streamsAppSchemaEditorFieldsTableLoaded')).toBeVisible();
}

async typeFieldName(value: string) {
await this.page.testSubj.typeWithDelay('streamsAppSchemaEditorAddFieldFlyoutFieldName', value, {
delay: 75,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

75 ms simulates user typing experience

});
await this.page.keyboard.press('Enter');
}

async searchFields(searchTerm: string) {
const searchBox = this.page
.getByTestId('streamsAppSchemaEditorControls')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ test.describe(
).toBeVisible();

const targetFieldName = 'grouped_fields';
await page.getByTestId('streamsAppSchemaEditorAddFieldFlyoutFieldName').click();
await page.keyboard.type(targetFieldName);
await page.keyboard.press('Enter');
await pageObjects.streams.typeFieldName(targetFieldName);
await pageObjects.streams.setFieldMappingType('keyword');
await page.getByTestId('streamsAppSchemaEditorAddFieldButton').click();

Expand All @@ -72,9 +70,7 @@ test.describe(
).toBeVisible();

const sourceFieldName = 'attributes.source_field';
await page.getByTestId('streamsAppSchemaEditorAddFieldFlyoutFieldName').click();
await page.keyboard.type(sourceFieldName);
await page.keyboard.press('Enter');
await pageObjects.streams.typeFieldName(sourceFieldName);
await pageObjects.streams.setFieldMappingType('keyword');

// Expand advanced options and add copy_to
Expand Down Expand Up @@ -137,10 +133,7 @@ test.describe(
).toBeVisible();

const fieldName = 'attributes.geo_test';
await page.getByTestId('streamsAppSchemaEditorAddFieldFlyoutFieldName').click();
await page.keyboard.type(fieldName);
await page.keyboard.press('Enter');

await pageObjects.streams.typeFieldName(fieldName);
await pageObjects.streams.setFieldMappingType('geo_point');

await page.getByTestId('streamsAppSchemaEditorAddFieldButton').click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,7 @@ test.describe('Stream data mapping - schema editor', { tag: ['@ess', '@svlOblt']

// Fill in the field name
const fieldName = 'attributes.id';
await page.getByTestId('streamsAppSchemaEditorAddFieldFlyoutFieldName').click();
await page.keyboard.type(fieldName);
await page.keyboard.press('Enter');

await pageObjects.streams.typeFieldName(fieldName);
// Select field type
await pageObjects.streams.setFieldMappingType('keyword');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ test.describe(
).toBeVisible();

const parentFieldName = 'attributes.parent_field';
await page.getByTestId('streamsAppSchemaEditorAddFieldFlyoutFieldName').click();
await page.keyboard.type(parentFieldName);
await page.keyboard.press('Enter');
await pageObjects.streams.typeFieldName(parentFieldName);
await pageObjects.streams.setFieldMappingType('keyword');
await page.getByTestId('streamsAppSchemaEditorAddFieldButton').click();
await pageObjects.streams.reviewStagedFieldMappingChanges();
Expand Down Expand Up @@ -103,9 +101,7 @@ test.describe(

// Add an Otel field that should have type recommendation (IP type)
const ecsFieldName = 'resource.attributes.host.ip';
await page.getByTestId('streamsAppSchemaEditorAddFieldFlyoutFieldName').click();
await page.keyboard.type(ecsFieldName);
await page.keyboard.press('Enter');
await pageObjects.streams.typeFieldName(ecsFieldName);

// Wait for ECS/Otel recommendation to load and field type to be pre-selected
await expect(pageObjects.streams.fieldTypeSuperSelect.valueInputLocator).toHaveValue('ip');
Expand Down Expand Up @@ -146,9 +142,7 @@ test.describe(

const ecsFieldName = 'attributes.process_id';
const aliasFieldName = 'process_id';
await page.getByTestId('streamsAppSchemaEditorAddFieldFlyoutFieldName').click();
await page.keyboard.type(ecsFieldName);
await page.keyboard.press('Enter');
await pageObjects.streams.typeFieldName(ecsFieldName);
await pageObjects.streams.setFieldMappingType('keyword');

// Check if the add button is enabled (form should be valid)
Expand Down
Loading