Skip to content
Closed
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
54 changes: 54 additions & 0 deletions e2e-playwright/src/features/Connectors.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Feature: Connectors page visibility and functions

Scenario: Connectors search is working
Given Kafka Connect is visible
When click on Kafka Connect link
Then Kafka Connect heading visible
Given Connectors with name: "sink_postgres_activities" visible is: "true"
Given Connectors with name: "s3-sink" visible is: "true"
When Connectors searchfield input is: "sink_postgres"
Given Connectors with name: "sink_postgres_activities" visible is: "true"
Given Connectors with name: "s3-sink" visible is: "false"

Scenario: Connectors main page functions
Given Kafka Connect is visible
When click on Kafka Connect link
Then Kafka Connect heading visible
Given Connectors with name: "sink_postgres_activities" visible is: "true"
Given Connectors with name: "s3-sink" visible is: "true"
When Connectors searchfield input is: "sink_postgres"
Given Connectors with name: "sink_postgres_activities" visible is: "true"
Given Connectors with name: "s3-sink" visible is: "false"
Given Connectors satus is: "RUNNING", type is: "SINK"
Given Connectors row menu menu item "Stop" is clicked
Given Connectors satus is: "STOPPED", type is: "SINK"
Given Connectors row menu menu item "Resume" is clicked
Given Connectors satus is: "RUNNING", type is: "SINK"
Given Connectors row menu menu item "Pause" is clicked
Given Connectors satus is: "PAUSED", type is: "SINK"
Given Connectors row menu menu item "Resume" is clicked
Given Connectors satus is: "RUNNING", type is: "SINK"

Scenario: Connectors connector page
Given Kafka Connect is visible
When click on Kafka Connect link
Then Kafka Connect heading visible
Given Connectors with name: "sink_postgres_activities" visible is: "true"
When Connectors connector named: "sink_postgres_activities" clicked
Then Connectors connector page with label: "Connectorssink_postgres_activities" open

Scenario: Connectors connector page functions
Given Kafka Connect is visible
When click on Kafka Connect link
Then Kafka Connect heading visible
Given Connectors with name: "sink_postgres_activities" visible is: "true"
When Connectors connector named: "sink_postgres_activities" clicked
Then Connectors connector page with label: "Connectorssink_postgres_activities" open
Given Connectors connector page status is: "RUNNING"
When Connectors connector menu item "Pause" clicked
Given Connectors connector page status is: "PAUSED"
When Connectors connector menu item "Resume" clicked
Given Connectors connector page status is: "RUNNING"
When Connectors connector menu item "Stop" clicked
Given Connectors connector page state is: "STOPPED"
When Connectors connector menu item "Resume" clicked
2 changes: 1 addition & 1 deletion e2e-playwright/src/features/navigation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 "connectors"

Scenario: Navigate to KSQL DB
Given KSQL DB is visible
Expand Down
18 changes: 17 additions & 1 deletion e2e-playwright/src/pages/Connectors/ConnectorsLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,21 @@ 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: 'Connectors' })};
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 searchButton():Locator { return this.page.locator('.sc-eXzmLu > div > .sc-eAKtBH > svg')};
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)};
}
49 changes: 49 additions & 0 deletions e2e-playwright/src/steps/Connectors.steps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* eslint-disable no-unused-vars */
import { Given, When, Then, setDefaultTimeout } from "@cucumber/cucumber";
import { expectVisibility, ensureCheckboxState } from "../services/uiHelper";
import { PlaywrightWorld } from "../support/PlaywrightWorld";

setDefaultTimeout(60 * 1000 * 2);

Given('Connectors with name: {string} visible is: {string}', async function(this: PlaywrightWorld, name: string, visible: string) {
await expectVisibility(this.locators.connectors.rowData(name), visible);
});

When('Connectors searchfield input is: {string}', async function(this: PlaywrightWorld, value: string) {
let inputField = this.locators.connectors.searchBox
await inputField.isVisible()
await inputField.fill(value);
await this.locators.connectors.searchButton.click()

});

Given('Connectors 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('Connectors 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('Connectors connector named: {string} clicked', async function(this: PlaywrightWorld, name: string) {
await this.locators.connectors.rowData(name).click()
});

Then('Connectors connector page with label: {string} open', async function(this: PlaywrightWorld, label: string) {
await this.locators.connectors.localMenuLabel(label).isVisible()
});

Given('Connectors connector page status is: {string}', async function(this: PlaywrightWorld, status: string) {
await this.locators.connectors.internalMenuCell(status).isVisible();
});

When('Connectors 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('Connectors connector page state is: {string}', async function(this: PlaywrightWorld, state: string) {
await this.locators.connectors.internalMenuState(state).isVisible();
});
6 changes: 3 additions & 3 deletions e2e-playwright/src/steps/navigation.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading