diff --git a/e2e-playwright/src/features/KafkaConnect.feature b/e2e-playwright/src/features/KafkaConnect.feature new file mode 100644 index 000000000..5580331b4 --- /dev/null +++ b/e2e-playwright/src/features/KafkaConnect.feature @@ -0,0 +1,58 @@ +Feature: KafkaConnect page visibility and functions + + Scenario: KafkaConnect search is working + Given Kafka Connect is visible + When click on Kafka Connect link + Then Kafka Connect heading visible + Given KafkaConnect cell element "first" is clicked + Given KafkaConnect with name: "sink_postgres_activities" visible is: "true" + Given KafkaConnect with name: "s3-sink" visible is: "true" + When KafkaConnect searchfield input is: "sink_postgres" + Given KafkaConnect with name: "sink_postgres_activities" visible is: "true" + Given KafkaConnect with name: "s3-sink" visible is: "false" + + Scenario: KafkaConnect main page functions + Given Kafka Connect is visible + When click on Kafka Connect link + Then Kafka Connect heading visible + Given KafkaConnect cell element "first" is clicked + Given KafkaConnect with name: "sink_postgres_activities" visible is: "true" + Given KafkaConnect with name: "s3-sink" visible is: "true" + When KafkaConnect searchfield input is: "sink_postgres" + Given KafkaConnect with name: "sink_postgres_activities" visible is: "true" + Given KafkaConnect with name: "s3-sink" visible is: "false" + Given KafkaConnect satus is: "RUNNING", type is: "SINK" + Given KafkaConnect row menu menu item "Stop" is clicked + Given KafkaConnect satus is: "STOPPED", type is: "SINK" + Given KafkaConnect row menu menu item "Resume" is clicked + Given KafkaConnect satus is: "RUNNING", type is: "SINK" + Given KafkaConnect row menu menu item "Pause" is clicked + Given KafkaConnect satus is: "PAUSED", type is: "SINK" + Given KafkaConnect row menu menu item "Resume" is clicked + Given KafkaConnect satus is: "RUNNING", type is: "SINK" + + Scenario: KafkaConnect connector page + Given Kafka Connect is visible + When click on Kafka Connect link + Then Kafka Connect heading visible + Given KafkaConnect cell element "first" is clicked + Given KafkaConnect with name: "sink_postgres_activities" visible is: "true" + When KafkaConnect connector named: "sink_postgres_activities" clicked + Then KafkaConnect connector page with label: "KafkaConnectsink_postgres_activities" open + + Scenario: KafkaConnect connector page functions + Given Kafka Connect is visible + When click on Kafka Connect link + Then Kafka Connect heading visible + Given KafkaConnect cell element "first" is clicked + Given KafkaConnect with name: "sink_postgres_activities" visible is: "true" + When KafkaConnect connector named: "sink_postgres_activities" clicked + Then KafkaConnect connector page with label: "KafkaConnectsink_postgres_activities" open + Given KafkaConnect connector page status is: "RUNNING" + When KafkaConnect connector menu item "Pause" clicked + Given KafkaConnect connector page status is: "PAUSED" + When KafkaConnect connector menu item "Resume" clicked + Given KafkaConnect connector page status is: "RUNNING" + When KafkaConnect connector menu item "Stop" clicked + Given KafkaConnect connector page state is: "STOPPED" + When KafkaConnect connector menu item "Resume" clicked \ No newline at end of file diff --git a/e2e-playwright/src/features/TopicsMessages.feature b/e2e-playwright/src/features/TopicsMessages.feature index 45ff29b24..1f4eebf9b 100644 --- a/e2e-playwright/src/features/TopicsMessages.feature +++ b/e2e-playwright/src/features/TopicsMessages.feature @@ -154,7 +154,6 @@ Feature: Produce Messages page Then Topics TopicName Messages filter name starts with: "Filter" visible is: "true" Then Topics TopicName Messages exist is: "true" - Given Topics TopicName Messages edit filter button click Given Topics TopicName AddFilter filterCode change value is: "3" Then Topics TopicName AddFilter EditFilter button click diff --git a/e2e-playwright/src/features/navigation.feature b/e2e-playwright/src/features/navigation.feature index f57124489..0ad39d682 100644 --- a/e2e-playwright/src/features/navigation.feature +++ b/e2e-playwright/src/features/navigation.feature @@ -28,7 +28,7 @@ Feature: Navigation panel links Given Kafka Connect is visible When click on Kafka Connect link Then Kafka Connect heading visible - Then the end of current URL should be "kafka-connect/clusters" + Then the end of current URL should be "clusters" Scenario: Navigate to KSQL DB Given KSQL DB is visible diff --git a/e2e-playwright/src/pages/Connectors/ConnectorsLocators.ts b/e2e-playwright/src/pages/Connectors/ConnectorsLocators.ts index 6e21e0b33..b66fc26e8 100644 --- a/e2e-playwright/src/pages/Connectors/ConnectorsLocators.ts +++ b/e2e-playwright/src/pages/Connectors/ConnectorsLocators.ts @@ -7,5 +7,20 @@ export default class ConnectorsLocators { this.page = page; } - get clustersTab(): Locator { return this.page.getByRole('link', { name: 'Clusters' })}; + get heading(): Locator { return this.page.getByRole('heading', { name: 'Kafka Connect' })}; + get searchBox(): Locator { return this.page.getByRole('textbox', { name: 'Search by Connect Name' })}; + get createConnectorButton(): Locator { return this.page.getByRole('button', { name: 'Create Schema' })}; + get rowMenu():Locator { return this.page.getByRole('cell', { name: 'Dropdown Toggle' })}; + get internalMenuButton(): Locator { return this.page.locator('button').filter({ hasText: 'Restart' })}; + + rowData(value:string): Locator { return this.page.getByRole('cell', { name: value })}; + rowMenuItem(value:string): Locator { return this.page.getByRole('menuitem', { name: value })}; + + cellData(value:string): Locator { return this.page.getByText(value, { exact: true })}; + + localMenuLabel(value:string): Locator { return this.page.getByText(value)}; + + internalMenuCell(value:string): Locator { return this.page.getByRole('cell', { name: value })}; + internalMenuButtonItem(value:string): Locator { return this.page.getByRole('menuitem', { name: value })}; + internalMenuState(value:string): Locator { return this.page.getByRole('group').getByText(value)}; } diff --git a/e2e-playwright/src/steps/KafkaConnect.steps.ts b/e2e-playwright/src/steps/KafkaConnect.steps.ts new file mode 100644 index 000000000..50a3cc3d4 --- /dev/null +++ b/e2e-playwright/src/steps/KafkaConnect.steps.ts @@ -0,0 +1,51 @@ + +import { Given, When, Then, setDefaultTimeout } from "@cucumber/cucumber"; +import { expectVisibility } from "../services/uiHelper"; +import { PlaywrightWorld } from "../support/PlaywrightWorld"; + +setDefaultTimeout(60 * 1000 * 2); + +Given('KafkaConnect with name: {string} visible is: {string}', async function(this: PlaywrightWorld, name: string, visible: string) { + await expectVisibility(this.locators.connectors.rowData(name), visible); +}); + +When('KafkaConnect cell element {string} is clicked', async function(this: PlaywrightWorld, value: string) { + await this.locators.connectors.cellData(value).click(); +}); + +When('KafkaConnect searchfield input is: {string}', async function(this: PlaywrightWorld, value: string) { + let inputField = this.locators.connectors.searchBox + await inputField.isVisible() + await inputField.fill(value); +}); + +Given('KafkaConnect satus is: {string}, type is: {string}', async function(this: PlaywrightWorld, status: string, type: string) { + await this.locators.connectors.cellData(status).isVisible(); + await this.locators.connectors.cellData(type).isVisible(); +}); + +Given('KafkaConnect row menu menu item {string} is clicked', async function(this: PlaywrightWorld, menuItem: string) { + await this.locators.connectors.rowMenu.click(); + await this.locators.connectors.rowMenuItem(menuItem).click(); +}); + +When('KafkaConnect connector named: {string} clicked', async function(this: PlaywrightWorld, name: string) { + await this.locators.connectors.rowData(name).click() +}); + +Then('KafkaConnect connector page with label: {string} open', async function(this: PlaywrightWorld, label: string) { + await this.locators.connectors.localMenuLabel(label).isVisible() +}); + +Given('KafkaConnect connector page status is: {string}', async function(this: PlaywrightWorld, status: string) { + await this.locators.connectors.internalMenuCell(status).isVisible(); +}); + +When('KafkaConnect connector menu item {string} clicked', async function(this: PlaywrightWorld, menuItem: string) { + await this.locators.connectors.internalMenuButton.click(); + await this.locators.connectors.internalMenuButtonItem(menuItem).click(); +}); + +Given('KafkaConnect connector page state is: {string}', async function(this: PlaywrightWorld, state: string) { + await this.locators.connectors.internalMenuState(state).isVisible(); +}); diff --git a/e2e-playwright/src/steps/navigation.steps.ts b/e2e-playwright/src/steps/navigation.steps.ts index fce37a920..b59b67b66 100644 --- a/e2e-playwright/src/steps/navigation.steps.ts +++ b/e2e-playwright/src/steps/navigation.steps.ts @@ -62,12 +62,12 @@ Given('Kafka Connect is visible', async function() { await expect(this.locators.panel.kafkaConnectLink).toBeVisible(); }); -When('click on Kafka Connect link', async function() { +When('click on Kafka Connect link', async function(this: PlaywrightWorld) { await this.locators.panel.kafkaConnectLink.click(); }); -Then('Kafka Connect heading visible', async function() { - await this.locators.connectors.clustersTab.waitFor({ state: 'visible' }); +Then('Kafka Connect heading visible', async function(this: PlaywrightWorld) { + await this.locators.connectors.heading.waitFor({ state: 'visible' }); }); Given('KSQL DB is visible', async function() {