Repository: provectus/kafka-ui
Issue: [e2e]Checking available custom parameters with Topic editing
Labels: scope/QA
scope/AQA

Autotest implementation for:

https://app.qase.io/case/KAFKAUI-268

Pre-conditions:
-Login to kafka-ui
-Create a Topic
-Add any custom parameter or let as a default

Post-conditions:
Not set

Steps:
-Navigate to Topics
-Open the Topic
-Edit settings from 3dot menu
-Add Custom Parameter
-Press the Custom Parameter dropdown

Expected results:
-created in pre-condition
-Custom Parameter and Value should appear
-All values should be available to add as a Custom parameter

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/BasePage.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/BasePage.java
index daea5c0d54a..e51942a39ce 100644
--- a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/BasePage.java
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/BasePage.java
@@ -23,7 +23,8 @@ public abstract class BasePage extends WebUtils {
     protected SelenideElement confirmationMdl = $x("//div[text()= 'Confirm the action']/..");
     protected SelenideElement confirmBtn = $x("//button[contains(text(),'Confirm')]");
     protected SelenideElement cancelBtn = $x("//button[contains(text(),'Cancel')]");
-    protected ElementsCollection allGridItems = $$x("//tr[@class]");
+    protected ElementsCollection ddlOptions = $$x("//li[@value]");
+    protected ElementsCollection gridItems = $$x("//tr[@class]");
     protected String summaryCellLocator = "//div[contains(text(),'%s')]";
     protected String tableElementNameLocator = "//tbody//a[contains(text(),'%s')]";
     protected String columnHeaderLocator = "//table//tr/th//div[text()='%s']";
@@ -44,6 +45,10 @@ protected SelenideElement getTableElement(String elementName) {
         return $x(String.format(tableElementNameLocator, elementName));
     }
 
+    protected ElementsCollection getDdlOptions() {
+        return ddlOptions;
+    }
+
     protected String getAlertHeader() {
         log.debug("\ngetAlertHeader");
         String result = alertHeader.shouldBe(Condition.visible).getText();
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersList.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersList.java
index 6db2d20ad65..3d3a58f355e 100644
--- a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersList.java
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersList.java
@@ -62,7 +62,7 @@ public List<SelenideElement> getAllEnabledElements() {
 
     private List<BrokersList.BrokerGridItem> initGridItems() {
         List<BrokersList.BrokerGridItem> gridItemList = new ArrayList<>();
-        allGridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
+        gridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
                 .forEach(item -> gridItemList.add(new BrokersList.BrokerGridItem(item)));
         return gridItemList;
     }
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/ksqlDb/KsqlDbList.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/ksqlDb/KsqlDbList.java
index 84c23d0ac3f..25246a86ed5 100644
--- a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/ksqlDb/KsqlDbList.java
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/ksqlDb/KsqlDbList.java
@@ -41,7 +41,7 @@ public KsqlDbList openDetailsTab(KsqlMenuTabs menu) {
 
   private List<KsqlDbList.KsqlTablesGridItem> initTablesItems() {
     List<KsqlDbList.KsqlTablesGridItem> gridItemList = new ArrayList<>();
-    allGridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
+    gridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
         .forEach(item -> gridItemList.add(new KsqlDbList.KsqlTablesGridItem(item)));
     return gridItemList;
   }
@@ -89,7 +89,7 @@ public String getIsWindowed() {
 
   private List<KsqlDbList.KsqlStreamsGridItem> initStreamsItems() {
     List<KsqlDbList.KsqlStreamsGridItem> gridItemList = new ArrayList<>();
-    allGridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
+    gridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
         .forEach(item -> gridItemList.add(new KsqlDbList.KsqlStreamsGridItem(item)));
     return gridItemList;
   }
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicCreateEditForm.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicCreateEditForm.java
index 7deed1b7fde..f60bd6d431e 100644
--- a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicCreateEditForm.java
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicCreateEditForm.java
@@ -1,9 +1,6 @@
 package com.provectus.kafka.ui.pages.topics;
 
-import com.codeborne.selenide.ClickOptions;
-import com.codeborne.selenide.Condition;
-import com.codeborne.selenide.ElementsCollection;
-import com.codeborne.selenide.SelenideElement;
+import com.codeborne.selenide.*;
 import com.provectus.kafka.ui.pages.BasePage;
 import com.provectus.kafka.ui.pages.topics.enums.CleanupPolicyValue;
 import com.provectus.kafka.ui.pages.topics.enums.CustomParameterType;
@@ -91,8 +88,20 @@ public TopicCreateEditForm clickAddCustomParameterTypeButton() {
     }
 
     @Step
-    public TopicCreateEditForm setCustomParameterType(CustomParameterType customParameterType) {
+    public TopicCreateEditForm openCustomParameterTypeDdl() {
         customParameterDdl.shouldBe(Condition.visible).click();
+        ddlOptions.shouldHave(CollectionCondition.sizeGreaterThan(0));
+        return this;
+    }
+
+    @Step
+    public ElementsCollection getAllDdlOptions() {
+        return getDdlOptions();
+    }
+
+    @Step
+    public TopicCreateEditForm setCustomParameterType(CustomParameterType customParameterType) {
+        openCustomParameterTypeDdl();
         $x(String.format(ddlElementLocator, customParameterType.getOptionValue())).shouldBe(Condition.visible).click();
         return this;
     }
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicDetails.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicDetails.java
index 78ec2cef14e..980a66b791d 100644
--- a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicDetails.java
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicDetails.java
@@ -337,7 +337,7 @@ public int getMessageCountAmount() {
 
     private List<TopicDetails.MessageGridItem> initItems() {
         List<TopicDetails.MessageGridItem> gridItemList = new ArrayList<>();
-        allGridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
+        gridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
                 .forEach(item -> gridItemList.add(new TopicDetails.MessageGridItem(item)));
         return gridItemList;
     }
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicSettingsTab.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicSettingsTab.java
index 2b00c97c40f..3c0fcac211d 100644
--- a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicSettingsTab.java
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicSettingsTab.java
@@ -24,7 +24,7 @@ public TopicSettingsTab waitUntilScreenReady() {
 
     private List<SettingsGridItem> initGridItems() {
         List<SettingsGridItem> gridItemList = new ArrayList<>();
-        allGridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
+        gridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
                 .forEach(item -> gridItemList.add(new SettingsGridItem(item)));
         return gridItemList;
     }
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicsList.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicsList.java
index 291c94667fb..499d5fe965a 100644
--- a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicsList.java
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/topics/TopicsList.java
@@ -163,7 +163,7 @@ public List<SelenideElement> getAllEnabledElements() {
 
     private List<TopicGridItem> initGridItems() {
         List<TopicGridItem> gridItemList = new ArrayList<>();
-        allGridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
+        gridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
                 .forEach(item -> gridItemList.add(new TopicGridItem(item)));
         return gridItemList;
     }


Test patch:
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/smokeSuite/topics/TopicsTest.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/smokeSuite/topics/TopicsTest.java
index 62fb0b04488..8b86d82c9e6 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/smokeSuite/topics/TopicsTest.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/smokeSuite/topics/TopicsTest.java
@@ -108,11 +108,32 @@ void checkAvailableOperations() {
     }
 
     @Ignore
-    @Issue("https://github.com/provectus/kafka-ui/issues/2625")
+    @Issue("https://github.com/provectus/kafka-ui/issues/3071")
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
-    @CaseId(197)
+    @CaseId(268)
     @Test(priority = 3)
+    public void checkCustomParametersWithinEditExistingTopic() {
+        navigateToTopicsAndOpenDetails(TOPIC_TO_UPDATE_AND_DELETE.getName());
+        topicDetails
+                .openDotMenu()
+                .clickEditSettingsMenu();
+        SoftAssert softly = new SoftAssert();
+        topicCreateEditForm
+                .waitUntilScreenReady()
+                .clickAddCustomParameterTypeButton()
+                .openCustomParameterTypeDdl()
+                .getAllDdlOptions()
+                .forEach(option ->
+                        softly.assertTrue(!option.is(Condition.attribute("disabled")),
+                                option.getText() + " is enabled:"));
+        softly.assertAll();
+    }
+
+    @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
+    @AutomationStatus(status = Status.AUTOMATED)
+    @CaseId(197)
+    @Test(priority = 4)
     public void updateTopic() {
         navigateToTopicsAndOpenDetails(TOPIC_TO_UPDATE_AND_DELETE.getName());
         topicDetails
@@ -166,7 +187,7 @@ public void updateTopic() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(242)
-    @Test(priority = 4)
+    @Test(priority = 5)
     public void removeTopicFromTopicList() {
         navigateToTopics();
         topicsList
@@ -182,7 +203,7 @@ public void removeTopicFromTopicList() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(207)
-    @Test(priority = 5)
+    @Test(priority = 6)
     public void deleteTopic() {
         navigateToTopicsAndOpenDetails(TOPIC_FOR_DELETE.getName());
         topicDetails
@@ -197,7 +218,7 @@ public void deleteTopic() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(20)
-    @Test(priority = 6)
+    @Test(priority = 7)
     public void redirectToConsumerFromTopic() {
         String topicName = "source-activities";
         String consumerGroupId = "connect-sink_postgres_activities";
@@ -218,7 +239,7 @@ public void redirectToConsumerFromTopic() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(4)
-    @Test(priority = 7)
+    @Test(priority = 8)
     public void checkTopicCreatePossibility() {
         navigateToTopics();
         topicsList
@@ -241,7 +262,7 @@ public void checkTopicCreatePossibility() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(266)
-    @Test(priority = 8)
+    @Test(priority = 9)
     public void checkTimeToRetainDataCustomValueWithEditingTopic() {
         Topic topicToRetainData = new Topic()
                 .setName("topic-to-retain-data-" + randomAlphabetic(5))
@@ -274,7 +295,7 @@ public void checkTimeToRetainDataCustomValueWithEditingTopic() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(6)
-    @Test(priority = 9)
+    @Test(priority = 10)
     public void checkCustomParametersWithinCreateNewTopic() {
         navigateToTopics();
         topicsList
@@ -295,7 +316,7 @@ public void checkCustomParametersWithinCreateNewTopic() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(2)
-    @Test(priority = 10)
+    @Test(priority = 11)
     public void checkTopicListElements() {
         navigateToTopics();
         verifyElementsCondition(topicsList.getAllVisibleElements(), Condition.visible);
@@ -305,7 +326,7 @@ public void checkTopicListElements() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(12)
-    @Test(priority = 11)
+    @Test(priority = 12)
     public void addingNewFilterWithinTopic() {
         String filterName = randomAlphabetic(5);
         navigateToTopicsAndOpenDetails(TOPIC_FOR_CHECK_FILTERS.getName());
@@ -327,7 +348,7 @@ public void addingNewFilterWithinTopic() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(13)
-    @Test(priority = 12)
+    @Test(priority = 13)
     public void checkFilterSavingWithinSavedFilters() {
         String displayName = randomAlphabetic(5);
         navigateToTopicsAndOpenDetails(TOPIC_FOR_CHECK_FILTERS.getName());
@@ -350,7 +371,7 @@ public void checkFilterSavingWithinSavedFilters() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(14)
-    @Test(priority = 13)
+    @Test(priority = 14)
     public void checkApplyingSavedFilterWithinTopicMessages() {
         String displayName = randomAlphabetic(5);
         navigateToTopicsAndOpenDetails(TOPIC_FOR_CHECK_FILTERS.getName());
@@ -371,7 +392,7 @@ public void checkApplyingSavedFilterWithinTopicMessages() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(11)
-    @Test(priority = 14)
+    @Test(priority = 15)
     public void checkShowInternalTopicsButtonFunctionality() {
         navigateToTopics();
         SoftAssert softly = new SoftAssert();
@@ -389,7 +410,7 @@ public void checkShowInternalTopicsButtonFunctionality() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(56)
-    @Test(priority = 15)
+    @Test(priority = 16)
     public void checkRetentionBytesAccordingToMaxSizeOnDisk() {
         navigateToTopics();
         topicsList
@@ -439,7 +460,7 @@ public void checkRetentionBytesAccordingToMaxSizeOnDisk() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(247)
-    @Test(priority = 16)
+    @Test(priority = 17)
     public void recreateTopicFromTopicProfile() {
         Topic topicToRecreate = new Topic()
                 .setName("topic-to-recreate-" + randomAlphabetic(5))
@@ -469,7 +490,7 @@ public void recreateTopicFromTopicProfile() {
     @Suite(suiteId = SUITE_ID, title = SUITE_TITLE)
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(8)
-    @Test(priority = 17)
+    @Test(priority = 18)
     public void checkCopyTopicPossibility() {
         Topic topicToCopy = new Topic()
                 .setName("topic-to-copy-" + randomAlphabetic(5))