Skip to content

Commit 651e8ae

Browse files
committed
connectors e-2-e functions
1 parent f4c6692 commit 651e8ae

File tree

3 files changed

+120
-1
lines changed

3 files changed

+120
-1
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Feature: Connectors page visibility and functions
2+
3+
Scenario: Connectors search is working
4+
Given Kafka Connect is visible
5+
When click on Kafka Connect link
6+
Then Kafka Connect heading visible
7+
Given Connectors with name: "sink_postgres_activities" visible is: "true"
8+
Given Connectors with name: "s3-sink" visible is: "true"
9+
When Connectors searchfield input is: "sink_postgres"
10+
Given Connectors with name: "sink_postgres_activities" visible is: "true"
11+
Given Connectors with name: "s3-sink" visible is: "false"
12+
13+
Scenario: Connectors main page functions
14+
Given Kafka Connect is visible
15+
When click on Kafka Connect link
16+
Then Kafka Connect heading visible
17+
Given Connectors with name: "sink_postgres_activities" visible is: "true"
18+
Given Connectors with name: "s3-sink" visible is: "true"
19+
When Connectors searchfield input is: "sink_postgres"
20+
Given Connectors with name: "sink_postgres_activities" visible is: "true"
21+
Given Connectors with name: "s3-sink" visible is: "false"
22+
Given Connectors satus is: "RUNNING", type is: "SINK"
23+
Given Connectors row menu menu item "Stop" is clicked
24+
Given Connectors satus is: "STOPPED", type is: "SINK"
25+
Given Connectors row menu menu item "Resume" is clicked
26+
Given Connectors satus is: "RUNNING", type is: "SINK"
27+
Given Connectors row menu menu item "Pause" is clicked
28+
Given Connectors satus is: "PAUSED", type is: "SINK"
29+
Given Connectors row menu menu item "Resume" is clicked
30+
Given Connectors satus is: "RUNNING", type is: "SINK"
31+
32+
Scenario: Connectors connector page
33+
Given Kafka Connect is visible
34+
When click on Kafka Connect link
35+
Then Kafka Connect heading visible
36+
Given Connectors with name: "sink_postgres_activities" visible is: "true"
37+
When Connectors connector named: "sink_postgres_activities" clicked
38+
Then Connectors connector page with label: "Connectorssink_postgres_activities" open
39+
40+
Scenario: Connectors connector page functions
41+
Given Kafka Connect is visible
42+
When click on Kafka Connect link
43+
Then Kafka Connect heading visible
44+
Given Connectors with name: "sink_postgres_activities" visible is: "true"
45+
When Connectors connector named: "sink_postgres_activities" clicked
46+
Then Connectors connector page with label: "Connectorssink_postgres_activities" open
47+
Given Connectors connector page status is: "RUNNING"
48+
When Connectors connector menu item "Pause" clicked
49+
Given Connectors connector page status is: "PAUSED"
50+
When Connectors connector menu item "Resume" clicked
51+
Given Connectors connector page status is: "RUNNING"
52+
When Connectors connector menu item "Stop" clicked
53+
Given Connectors connector page state is: "STOPPED"
54+
When Connectors connector menu item "Resume" clicked

e2e-playwright/src/pages/Connectors/ConnectorsLocators.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,21 @@ export default class ConnectorsLocators {
77
this.page = page;
88
}
99

10-
get clustersTab(): Locator { return this.page.getByRole('link', { name: 'Clusters' })};
10+
get heading(): Locator { return this.page.getByRole('heading', { name: 'Connectors' })};
11+
get searchBox(): Locator { return this.page.getByRole('textbox', { name: 'Search by Connect Name' })};
12+
get createConnectorButton(): Locator { return this.page.getByRole('button', { name: 'Create Schema' })};
13+
get searchButton():Locator { return this.page.locator('.sc-eXzmLu > div > .sc-eAKtBH > svg')};
14+
get rowMenu():Locator { return this.page.getByRole('cell', { name: 'Dropdown Toggle' })};
15+
get internalMenuButton(): Locator { return this.page.locator('button').filter({ hasText: 'Restart' })};
16+
17+
rowData(value:string): Locator { return this.page.getByRole('cell', { name: value })};
18+
rowMenuItem(value:string): Locator { return this.page.getByRole('menuitem', { name: value })};
19+
20+
cellData(value:string): Locator { return this.page.getByText(value, { exact: true })};
21+
22+
localMenuLabel(value:string): Locator { return this.page.getByText(value)};
23+
24+
internalMenuCell(value:string): Locator { return this.page.getByRole('cell', { name: value })};
25+
internalMenuButtonItem(value:string): Locator { return this.page.getByRole('menuitem', { name: value })};
26+
internalMenuState(value:string): Locator { return this.page.getByRole('group').getByText(value)};
1127
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* eslint-disable no-unused-vars */
2+
import { Given, When, Then, setDefaultTimeout } from "@cucumber/cucumber";
3+
import { expectVisibility, ensureCheckboxState } from "../services/uiHelper";
4+
import { PlaywrightWorld } from "../support/PlaywrightWorld";
5+
6+
setDefaultTimeout(60 * 1000 * 2);
7+
8+
Given('Connectors with name: {string} visible is: {string}', async function(this: PlaywrightWorld, name: string, visible: string) {
9+
await expectVisibility(this.locators.connectors.rowData(name), visible);
10+
});
11+
12+
When('Connectors searchfield input is: {string}', async function(this: PlaywrightWorld, value: string) {
13+
let inputField = this.locators.connectors.searchBox
14+
await inputField.isVisible()
15+
await inputField.fill(value);
16+
await this.locators.connectors.searchButton.click()
17+
18+
});
19+
20+
Given('Connectors satus is: {string}, type is: {string}', async function(this: PlaywrightWorld, status: string, type: string) {
21+
await this.locators.connectors.cellData(status).isVisible();
22+
await this.locators.connectors.cellData(type).isVisible();
23+
});
24+
25+
Given('Connectors row menu menu item {string} is clicked', async function(this: PlaywrightWorld, menuItem: string) {
26+
await this.locators.connectors.rowMenu.click();
27+
await this.locators.connectors.rowMenuItem(menuItem).click();
28+
});
29+
30+
When('Connectors connector named: {string} clicked', async function(this: PlaywrightWorld, name: string) {
31+
await this.locators.connectors.rowData(name).click()
32+
});
33+
34+
Then('Connectors connector page with label: {string} open', async function(this: PlaywrightWorld, label: string) {
35+
await this.locators.connectors.localMenuLabel(label).isVisible()
36+
});
37+
38+
Given('Connectors connector page status is: {string}', async function(this: PlaywrightWorld, status: string) {
39+
await this.locators.connectors.internalMenuCell(status).isVisible();
40+
});
41+
42+
When('Connectors connector menu item {string} clicked', async function(this: PlaywrightWorld, menuItem: string) {
43+
await this.locators.connectors.internalMenuButton.click();
44+
await this.locators.connectors.internalMenuButtonItem(menuItem).click();
45+
});
46+
47+
Given('Connectors connector page state is: {string}', async function(this: PlaywrightWorld, state: string) {
48+
await this.locators.connectors.internalMenuState(state).isVisible();
49+
});

0 commit comments

Comments
 (0)