Skip to content

Commit 567b4d5

Browse files
authored
fix(streams): wired scout test (elastic#221838)
## Summary Update scout test according to latest change with normalized fields: elastic#205113
1 parent cf46b2d commit 567b4d5

2 files changed

Lines changed: 13 additions & 18 deletions

File tree

x-pack/platform/plugins/shared/streams_app/ui_tests/tests/classic.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ test.describe('Classic Streams', { tag: ['@ess', '@svlOblt'] }, () => {
6767
await pageObjects.streams.gotoExtractFieldTab(DATA_STREAM_NAME);
6868
await page.getByText('Add a processor').click();
6969

70-
await page.locator('input[name="field"]').fill('message');
70+
await page.locator('input[name="field"]').fill('body.text');
7171
await page
7272
.locator('input[name="patterns\\.0\\.value"]')
73-
.fill('%{WORD:method} %{URIPATH:request}');
73+
.fill('%{WORD:attributes.method} %{URIPATH:attributes.request}');
7474
await page.getByRole('button', { name: 'Add processor' }).click();
7575
await page.getByRole('button', { name: 'Save changes' }).click();
7676

x-pack/platform/plugins/shared/streams_app/ui_tests/tests/wired.spec.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test.describe('Wired Streams', { tag: ['@ess', '@svlOblt'] }, () => {
2525
await pageObjects.streams.gotoCreateChildStream('logs');
2626

2727
await page.getByLabel('Stream name').fill('logs.nginx');
28-
await page.getByPlaceholder('Field').fill('agent.name');
28+
await page.getByPlaceholder('Field').fill('attributes.custom_field');
2929
await page.getByPlaceholder('Value').fill('nginx');
3030
await page.getByRole('button', { name: 'Save' }).click();
3131
await expect(page.getByRole('link', { name: 'logs.nginx', exact: true })).toBeVisible();
@@ -47,44 +47,39 @@ test.describe('Wired Streams', { tag: ['@ess', '@svlOblt'] }, () => {
4747
index: 'logs',
4848
document: {
4949
'@timestamp': '2025-05-01T00:00:00.000Z',
50-
message: JSON.stringify({
51-
'log.level': 'info',
52-
'log.logger': 'nginx',
53-
message: 'GET /search HTTP/1.1 200 1070000',
54-
}),
55-
'agent.name': 'nginx',
56-
'other.field': 'important',
50+
'log.level': 'warn',
51+
message: 'GET /search HTTP/1.1 200 1070000',
52+
custom_field: 'nginx',
5753
},
5854
refresh: 'wait_for',
5955
});
6056

6157
await pageObjects.streams.gotoExtractFieldTab('logs.nginx');
6258
await page.getByText('Add a processor').click();
6359

64-
await page.locator('input[name="field"]').fill('message');
60+
await page.locator('input[name="field"]').fill('body.text');
6561
await page
6662
.locator('input[name="patterns\\.0\\.value"]')
67-
.fill('%{WORD:method} %{URIPATH:request}');
63+
.fill('%{WORD:attributes.method} %{URIPATH:attributes.request}');
6864
await page.getByRole('button', { name: 'Add processor' }).click();
6965
await page.getByRole('button', { name: 'Save changes' }).click();
7066
await expect(page.getByText("Stream's processors updated")).toBeVisible();
7167
await page.getByTestId('toastCloseButton').click();
7268

7369
// Update "logs.nginx" mapping
7470
await pageObjects.streams.gotoSchemaEditorTab('logs.nginx');
71+
await page.getByPlaceholder('Search...').fill('attributes');
72+
await page.getByTestId('streamsAppContentRefreshButton').click();
7573

7674
await page
77-
.getByRole('row', { name: 'agent.name ----- ----- logs.' })
78-
.getByLabel('Open actions menu')
79-
.click();
80-
await page
81-
.getByRole('row', { name: 'agent.name ----- ----- logs.' })
75+
.getByRole('row', { name: 'attributes.custom_field' })
8276
.getByLabel('Open actions menu')
8377
.click();
78+
8479
await page.getByRole('button', { name: 'Map field' }).click();
8580
await page.getByRole('combobox').selectOption('keyword');
8681
await page.getByRole('button', { name: 'Save changes' }).click();
87-
await page.getByRole('heading', { name: 'agent.name' }).waitFor({ state: 'hidden' });
82+
await page.getByRole('heading', { name: 'logs.foo' }).waitFor({ state: 'hidden' });
8883

8984
await expect(page.getByText('Mapped', { exact: true })).toBeVisible();
9085
await page.getByTestId('toastCloseButton').click();

0 commit comments

Comments
 (0)