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 @@ -34,28 +34,24 @@ export class StreamsApp {
await this.page.getByRole('tab', { name: 'Dashboards' }).click();
}

async gotoManageStream(stream: string) {
this.gotoStream(stream);
await this.page.getByRole('link', { name: 'Manage stream' }).click();
}

async gotoCreateChildStream(parent: string) {
await this.gotoManageStream(parent);
async gotoCreateChildStream(stream: string) {
await this.gotoStream(stream);
await this.page.getByRole('tab', { name: 'Partitioning' }).click();
await this.page.getByRole('button', { name: 'Create child stream' }).click();
}

async gotoDataRetentionTab(stream: string) {
await this.gotoManageStream(stream);
await this.gotoStream(stream);
await this.page.getByRole('tab', { name: 'Data retention' }).click();
}

async gotoExtractFieldTab(stream: string) {
await this.gotoManageStream(stream);
await this.page.getByRole('tab', { name: 'Extract field' }).click();
async gotoProcessingTab(stream: string) {
await this.gotoStream(stream);
await this.page.getByRole('tab', { name: 'Processing' }).click();
}

async gotoSchemaEditorTab(stream: string) {
await this.gotoManageStream(stream);
await this.gotoStream(stream);
await this.page.getByRole('tab', { name: 'Schema editor' }).click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test.describe('Classic Streams', { tag: ['@ess', '@svlOblt'] }, () => {
await page.getByTestId('toastCloseButton').click();

// Update field extraction
await pageObjects.streams.gotoExtractFieldTab(DATA_STREAM_NAME);
await pageObjects.streams.gotoProcessingTab(DATA_STREAM_NAME);
await page.getByText('Add a processor').click();

await page.locator('input[name="field"]').fill('body.text');
Expand All @@ -75,36 +75,5 @@ test.describe('Classic Streams', { tag: ['@ess', '@svlOblt'] }, () => {

await expect(page.getByText("Stream's processors updated")).toBeVisible();
await page.getByTestId('toastCloseButton').click();

// Add dashboard
await pageObjects.streams.gotoStreamDashboard(DATA_STREAM_NAME);
await page.getByRole('button', { name: 'Add a dashboard' }).click();
await expect(
page
.getByTestId('streamsAppAddDashboardFlyoutDashboardsTable')
.getByRole('button', { name: 'Some Dashboard' })
).toBeVisible();
// eslint-disable-next-line playwright/no-nth-methods
await page.getByRole('cell', { name: 'Select row' }).locator('div').first().click();
await page.getByRole('button', { name: 'Add dashboard' }).click();
await expect(
page
.getByTestId('streamsAppStreamDetailDashboardsTable')
.getByTestId('streamsAppDashboardColumnsLink')
).toHaveText('Some Dashboard');

// remove dashboard
await page
.getByTestId('streamsAppStreamDetailDashboardsTable')
.getByRole('cell', { name: 'Select row' })
.locator('div')
// eslint-disable-next-line playwright/no-nth-methods
.first()
.click();

await page.getByRole('button', { name: 'Unlink selected' }).click();
await expect(
page.getByTestId('streamsAppStreamDetailDashboardsTable').getByText('No items found')
).toBeVisible();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test.describe('Wired Streams', { tag: ['@ess', '@svlOblt'] }, () => {
refresh: 'wait_for',
});

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

await page.locator('input[name="field"]').fill('body.text');
Expand Down Expand Up @@ -82,36 +82,5 @@ test.describe('Wired Streams', { tag: ['@ess', '@svlOblt'] }, () => {

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

// Add dashboard
await pageObjects.streams.gotoStreamDashboard('logs.nginx');
await page.getByRole('button', { name: 'Add a dashboard' }).click();
await expect(
page
.getByTestId('streamsAppAddDashboardFlyoutDashboardsTable')
.getByRole('button', { name: 'Some Dashboard' })
).toBeVisible();
// eslint-disable-next-line playwright/no-nth-methods
await page.getByRole('cell', { name: 'Select row' }).locator('div').first().click();
await page.getByRole('button', { name: 'Add dashboard' }).click();
await expect(
page
.getByTestId('streamsAppStreamDetailDashboardsTable')
.getByTestId('streamsAppDashboardColumnsLink')
).toHaveText('Some Dashboard');

// remove dashboard
await page
.getByTestId('streamsAppStreamDetailDashboardsTable')
.getByRole('cell', { name: 'Select row' })
.locator('div')
// eslint-disable-next-line playwright/no-nth-methods
.first()
.click();

await page.getByRole('button', { name: 'Unlink selected' }).click();
await expect(
page.getByTestId('streamsAppStreamDetailDashboardsTable').getByText('No items found')
).toBeVisible();
});
});