Skip to content

Commit 869a666

Browse files
authored
E2E Playwright: Topic message menu fix (#1225)
1 parent d73595a commit 869a666

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

e2e-playwright/src/features/TopicsMessages.feature

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ Feature: Produce Messages page
4747
When TopicCreate Time to retain data one day
4848
When TopicCreate Create topic clicked
4949
Then Header starts with: "ANewAutoTopic"
50-
Given TopicName menu button clicked
50+
Given TopicName menu button clicked for topic starts with: "ANewAutoTopic"
5151
Then TopicNameMenu clear messages active is: "true"
5252
When TopicNameMenu edit settings clicked
5353
When TopicName cleanup policy set to: "Compact"
5454
When TopicName UpdateTopic button clicked
5555
Then Header starts with: "ANewAutoTopic"
56-
Given TopicName menu button clicked
57-
When TopicNameMenu edit settings clicked
56+
Given TopicName menu button clicked for topic starts with: "ANewAutoTopic"
57+
When TopicNameMenu edit settings clicked
5858
When TopicName cleanup policy set to: "Delete"
5959
When TopicName UpdateTopic button clicked
6060
Then Header starts with: "ANewAutoTopic"
61-
Given TopicName menu button clicked
61+
Given TopicName menu button clicked for topic starts with: "ANewAutoTopic"
6262
Then TopicNameMenu clear messages active is: "true"
6363

6464
Scenario: Produce messages clear messages
@@ -103,7 +103,7 @@ Feature: Produce Messages page
103103
Given ProduceMessage Headers input key is: "headerKey4", value is: "headerValue4"
104104
Given ProduceMessage Produce Message button clicked
105105
Then TopicName messages count is "2"
106-
When TopicName menu button clicked
106+
When TopicName menu button clicked for topic starts with: "ANewAutoTopic"
107107
When TopicName menu clear messages clicked
108108
Then TopicName messages count is "0"
109109
Given Produce message clicked
@@ -118,7 +118,7 @@ Feature: Produce Messages page
118118
Given ProduceMessage Headers input key is: "headerKey6", value is: "headerValue6"
119119
Given ProduceMessage Produce Message button clicked
120120
Then TopicName messages count is "2"
121-
When TopicName menu button clicked
121+
When TopicName menu button clicked for topic starts with: "ANewAutoTopic"
122122
When TopicName menu RecreateTopic clicked
123123
Then TopicName messages count is "0"
124124
Given Produce message clicked
@@ -161,6 +161,3 @@ Feature: Produce Messages page
161161

162162
Then Topics TopicName Messages filter name starts with: "Filter" visible is: "true"
163163
Then Topics TopicName Messages exist is: "false"
164-
165-
166-

e2e-playwright/src/pages/Topics/TopicsTopickNameLocators.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default class TopicsTopickNameLocators {
3939
get editFilter():Locator { return this.page.getByTestId('activeSmartFilter').getByRole('button', { name: 'Edit' }) }
4040
get editFilterButton():Locator { return this.page.getByRole('button', { name: 'Edit Filter' }) }
4141

42+
dotsMenuForTopic(value: string):Locator {return this.page.getByRole('main').locator('div').filter({ hasText: `localTopics${value}Produce Message Edit settingsPay attention!` }).getByLabel('Dropdown Toggle')}
4243
heading(topicName: string): Locator { return this.page.getByText(`Topics${topicName}`); }
4344
partitions(value: string):Locator { return this.page.getByRole('group').getByText(value).first(); }
4445
messageKey(value: string):Locator { return this.page.getByText(value, { exact: true }); }

e2e-playwright/src/steps/ProduceMessages.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ When('TopicName menu clear messages clicked', async function(this: PlaywrightWor
141141
}
142142
);
143143

144+
Given('TopicName menu button clicked for topic starts with: {string}', async function(this: PlaywrightWorld, prefix: string) {
145+
const topicName = this.getValue<string>(`topicName-${prefix}`);
146+
await this.locators.topicTopicName.dotsMenuForTopic(topicName).click();
147+
});
148+
149+
144150
When('TopicName menu RecreateTopic clicked', async function(this: PlaywrightWorld) {
145151
await this.locators.topicTopicName.menuItemRecreateTopic.click();
146152
await this.locators.topicTopicName.confirm.click();

0 commit comments

Comments
 (0)