diff --git a/e2e-playwright/src/features/TopicsMessages.feature b/e2e-playwright/src/features/TopicsMessages.feature index c8feffe09..45ff29b24 100644 --- a/e2e-playwright/src/features/TopicsMessages.feature +++ b/e2e-playwright/src/features/TopicsMessages.feature @@ -47,18 +47,18 @@ Feature: Produce Messages page When TopicCreate Time to retain data one day When TopicCreate Create topic clicked Then Header starts with: "ANewAutoTopic" - Given TopicName menu button clicked + Given TopicName menu button clicked for topic starts with: "ANewAutoTopic" Then TopicNameMenu clear messages active is: "true" When TopicNameMenu edit settings clicked When TopicName cleanup policy set to: "Compact" When TopicName UpdateTopic button clicked Then Header starts with: "ANewAutoTopic" - Given TopicName menu button clicked - When TopicNameMenu edit settings clicked + Given TopicName menu button clicked for topic starts with: "ANewAutoTopic" + When TopicNameMenu edit settings clicked When TopicName cleanup policy set to: "Delete" When TopicName UpdateTopic button clicked Then Header starts with: "ANewAutoTopic" - Given TopicName menu button clicked + Given TopicName menu button clicked for topic starts with: "ANewAutoTopic" Then TopicNameMenu clear messages active is: "true" Scenario: Produce messages clear messages @@ -103,7 +103,7 @@ Feature: Produce Messages page Given ProduceMessage Headers input key is: "headerKey4", value is: "headerValue4" Given ProduceMessage Produce Message button clicked Then TopicName messages count is "2" - When TopicName menu button clicked + When TopicName menu button clicked for topic starts with: "ANewAutoTopic" When TopicName menu clear messages clicked Then TopicName messages count is "0" Given Produce message clicked @@ -118,7 +118,7 @@ Feature: Produce Messages page Given ProduceMessage Headers input key is: "headerKey6", value is: "headerValue6" Given ProduceMessage Produce Message button clicked Then TopicName messages count is "2" - When TopicName menu button clicked + When TopicName menu button clicked for topic starts with: "ANewAutoTopic" When TopicName menu RecreateTopic clicked Then TopicName messages count is "0" Given Produce message clicked @@ -161,6 +161,3 @@ Feature: Produce Messages page Then Topics TopicName Messages filter name starts with: "Filter" visible is: "true" Then Topics TopicName Messages exist is: "false" - - - diff --git a/e2e-playwright/src/pages/Topics/TopicsTopickNameLocators.ts b/e2e-playwright/src/pages/Topics/TopicsTopickNameLocators.ts index a17d9ef57..357539432 100644 --- a/e2e-playwright/src/pages/Topics/TopicsTopickNameLocators.ts +++ b/e2e-playwright/src/pages/Topics/TopicsTopickNameLocators.ts @@ -18,7 +18,7 @@ export default class TopicsTopickNameLocators { get headersButton():Locator { return this.page.getByRole('button', { name: 'Headers' }); } get dotsMenu():Locator {return this.page.locator('#root div').filter({ hasText: 'Edit settingsPay attention!' }).nth(3)} - get menuItemEditSettings():Locator { return this.page.getByRole('menuitem', { name: 'Edit settings Pay attention!' }) } + get menuItemEditSettings():Locator { return this.page.getByText('Pay attention!') } get menuItemClearMessages():Locator { return this.page.getByText('Clear messagesClearing') } get menuItemRecreateTopic():Locator { return this.page.getByText('Recreate Topic') } get confirm():Locator { return this.page.getByRole('button', { name: 'Confirm' }) } @@ -39,6 +39,7 @@ export default class TopicsTopickNameLocators { get editFilter():Locator { return this.page.getByTestId('activeSmartFilter').getByRole('button', { name: 'Edit' }) } get editFilterButton():Locator { return this.page.getByRole('button', { name: 'Edit Filter' }) } + dotsMenuForTopic(value: string):Locator {return this.page.getByRole('main').locator('div').filter({ hasText: `localTopics${value}Produce Message Edit settingsPay attention!` }).getByLabel('Dropdown Toggle')} heading(topicName: string): Locator { return this.page.getByText(`Topics${topicName}`); } partitions(value: string):Locator { return this.page.getByRole('group').getByText(value).first(); } messageKey(value: string):Locator { return this.page.getByText(value, { exact: true }); } diff --git a/e2e-playwright/src/steps/TopicsCreate.steps.ts b/e2e-playwright/src/steps/TopicsCreate.steps.ts index 68c4f0acf..42af5fdcb 100644 --- a/e2e-playwright/src/steps/TopicsCreate.steps.ts +++ b/e2e-playwright/src/steps/TopicsCreate.steps.ts @@ -105,6 +105,11 @@ Then('Header starts with: {string}', async function(this: PlaywrightWorld, prefi await expect(header).toBeVisible(); }); +Given('TopicName menu button clicked for topic starts with: {string}', async function(this: PlaywrightWorld, prefix: string) { + const topicName = this.getValue(`topicName-${prefix}`); + await this.locators.topicTopicName.dotsMenuForTopic(topicName).click(); +}); + Then('Topic name started with: {string} visible is: {string}', async function(this: PlaywrightWorld, prefix: string, visible: string) { const topicName = this.getValue(`topicName-${prefix}`); await expectVisibility(this.locators.topics.nameLink(topicName), visible);