Repository: provectus/kafka-ui
Issue: [e2e] Update case "Checking the information of used Broker in a cluster"
Labels: scope/QA
scope/AQA

Autotest implementation for:

https://app.qase.io/case/KAFKAUI-85


Needs to add two steps :
2)Click on Broker
3) Click on Configs tab

Expected result :
2)The Broker's profile should open with following information:
Segment Size
Segment Count
Port
Host
Log directories tab:
Name
Error
Topics
Partitions
Enabled Configs tab
Enabled Metrics tab
3) Should be displayed configs list with following information:
Key, Value (with edit functionality), Source and Search by Key input field

Issue comments:

Pull request review comments:
openBrokersTab -> openDetailsTab
Condition.visible?
extra space
in previous implementation we checked that getAllVisibleElements() list is also enabled. seems here this assertion is missed
u already have this waiting at 44 line
page wasn't changed, so why do we need waitUntilScreenReady() again? 
seems u've missed define here new screen brokersConfigTabPanel
Fixed.
Fixed.
Fixed.
Fixed.
Fixed.
There was extra assertion.
what about 37, 69, 70, 71 lines?
getBrokersTabs -> getDetailsTabs
BrokerMenu -> DetailsTab
Stream.of("Log directories", "Configs", "Metrics") -> DetailsTab.values()
Fixed.
Fixed.
Fixed.
Fixed.

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 d7b342b0254..cf559af1e2c 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
@@ -21,7 +21,7 @@ public abstract class BasePage extends WebUtils {
   protected ElementsCollection allGridItems = $$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']";
+  protected String columnHeaderLocator = "//table//tr/th//div[text()='%s']";
 
   protected void waitUntilSpinnerDisappear() {
     log.debug("\nwaitUntilSpinnerDisappear");
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersConfigTabPanel.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersConfigTabPanel.java
new file mode 100644
index 00000000000..b7f1402a57e
--- /dev/null
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersConfigTabPanel.java
@@ -0,0 +1,40 @@
+package com.provectus.kafka.ui.pages.brokers;
+
+import static com.codeborne.selenide.Selenide.$$x;
+import static com.codeborne.selenide.Selenide.$x;
+
+import com.codeborne.selenide.Condition;
+import com.codeborne.selenide.SelenideElement;
+import com.provectus.kafka.ui.pages.BasePage;
+import io.qameta.allure.Step;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class BrokersConfigTabPanel extends BasePage {
+
+  protected List<SelenideElement> editBtn = $$x("//button[@aria-label='editAction']");
+  protected SelenideElement searchByKeyField = $x("//input[@placeholder='Search by Key']");
+
+  @Step
+  public BrokersConfigTabPanel waitUntilScreenReady(){
+    waitUntilSpinnerDisappear();
+    searchByKeyField.shouldBe(Condition.visible);
+    return this;
+  }
+
+  @Step
+  public boolean isSearchByKeyVisible() {
+   return isVisible(searchByKeyField);
+  }
+
+  public List<SelenideElement> getColumnHeaders() {
+    return Stream.of("Key", "Value", "Source")
+        .map(name -> $x(String.format(columnHeaderLocator, name)))
+        .collect(Collectors.toList());
+  }
+
+  public List<SelenideElement> getEditButtons() {
+    return editBtn;
+  }
+}
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersDetails.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersDetails.java
index 77fc9e0b41c..4eca65f1f47 100644
--- a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersDetails.java
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/brokers/BrokersDetails.java
@@ -1,5 +1,6 @@
 package com.provectus.kafka.ui.pages.brokers;
 
+import static com.codeborne.selenide.Selenide.$;
 import static com.codeborne.selenide.Selenide.$x;
 
 import com.codeborne.selenide.Condition;
@@ -11,11 +12,13 @@
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
+import org.openqa.selenium.By;
 
 public class BrokersDetails extends BasePage {
 
   protected SelenideElement logDirectoriesTab = $x("//a[text()='Log directories']");
   protected SelenideElement metricsTab = $x("//a[text()='Metrics']");
+  protected String brokersTabLocator = "//a[text()='%s']";
 
   @Step
   public BrokersDetails waitUntilScreenReady() {
@@ -24,6 +27,13 @@ public BrokersDetails waitUntilScreenReady() {
     return this;
   }
 
+  @Step
+  public BrokersDetails openDetailsTab(DetailsTab menu) {
+    $(By.linkText(menu.toString())).shouldBe(Condition.enabled).click();
+    waitUntilSpinnerDisappear();
+    return this;
+  }
+
   private List<SelenideElement> getVisibleColumnHeaders() {
     return Stream.of("Name", "Topics", "Error", "Partitions")
         .map(name -> $x(String.format(columnHeaderLocator, name)))
@@ -42,15 +52,40 @@ private List<SelenideElement> getVisibleSummaryCells() {
         .collect(Collectors.toList());
   }
 
+  private List<SelenideElement> getDetailsTabs() {
+    return Stream.of(DetailsTab.values())
+        .map(name -> $x(String.format(brokersTabLocator, name)))
+        .collect(Collectors.toList());
+  }
+
   @Step
   public List<SelenideElement> getAllEnabledElements() {
-    return getEnabledColumnHeaders();
+    List<SelenideElement> enabledElements = new ArrayList<>(getEnabledColumnHeaders());
+    enabledElements.addAll(getDetailsTabs());
+    return enabledElements;
   }
 
   @Step
   public List<SelenideElement> getAllVisibleElements() {
     List<SelenideElement> visibleElements = new ArrayList<>(getVisibleSummaryCells());
     visibleElements.addAll(getVisibleColumnHeaders());
+    visibleElements.addAll(getDetailsTabs());
     return visibleElements;
   }
+
+  public enum DetailsTab {
+    LOG_DIRECTORIES("Log directories"),
+    CONFIGS("Configs"),
+    METRICS("Metrics");
+
+    private final String value;
+
+    DetailsTab(String value) {
+      this.value = value;
+    }
+
+    public String toString() {
+      return value;
+    }
+  }
 }
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 98ed497e422..239a6359343 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
@@ -24,7 +24,7 @@ public BrokersList waitUntilScreenReady() {
   }
 
   @Step
-  public BrokersList openBroker(String brokerId) {
+  public BrokersList openBroker(int brokerId) {
     getBrokerItem(brokerId).openItem();
     return this;
   }
@@ -67,9 +67,9 @@ private List<BrokersList.BrokerGridItem> initGridItems() {
   }
 
   @Step
-  public BrokerGridItem getBrokerItem(String id){
+  public BrokerGridItem getBrokerItem(int id){
     return initGridItems().stream()
-        .filter(e ->e.getId().equals(id))
+        .filter(e ->e.getId() == id)
         .findFirst().orElse(null);
   }
 
@@ -91,8 +91,8 @@ private SelenideElement getIdElm() {
     }
 
     @Step
-    public String getId() {
-      return getIdElm().getText().trim();
+    public int getId() {
+      return Integer.parseInt(getIdElm().getText().trim());
     }
 
     @Step


Test patch:
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/base/Facade.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/base/Facade.java
index 279704b8b95..1e3ea4d630f 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/base/Facade.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/base/Facade.java
@@ -3,6 +3,7 @@
 import com.provectus.kafka.ui.helpers.ApiHelper;
 import com.provectus.kafka.ui.pages.NaviSideBar;
 import com.provectus.kafka.ui.pages.TopPanel;
+import com.provectus.kafka.ui.pages.brokers.BrokersConfigTabPanel;
 import com.provectus.kafka.ui.pages.brokers.BrokersDetails;
 import com.provectus.kafka.ui.pages.brokers.BrokersList;
 import com.provectus.kafka.ui.pages.connector.ConnectorCreateForm;
@@ -36,4 +37,5 @@ public abstract class Facade {
     protected TopPanel topPanel = new TopPanel();
     protected BrokersList brokersList = new BrokersList();
     protected BrokersDetails brokersDetails = new BrokersDetails();
+    protected BrokersConfigTabPanel brokersConfigTabPanel = new BrokersConfigTabPanel();
 }
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/brokers/BrokersTests.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/brokers/BrokersTests.java
index 0b54a4015ce..2fc2adce35c 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/brokers/BrokersTests.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/brokers/BrokersTests.java
@@ -1,6 +1,7 @@
 package com.provectus.kafka.ui.suite.brokers;
 
 import static com.provectus.kafka.ui.pages.NaviSideBar.SideMenuOption.BROKERS;
+import static com.provectus.kafka.ui.pages.brokers.BrokersDetails.DetailsTab.CONFIGS;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import com.codeborne.selenide.Condition;
@@ -38,11 +39,18 @@ public void checkExistingBrokersInCluster(){
     navigateToBrokers();
     assertThat(brokersList.getAllBrokers()).as("getAllBrokers()").size().isGreaterThan(0);
     brokersList
-        .openBroker("1");
+        .openBroker(1);
     brokersDetails
         .waitUntilScreenReady();
     verifyElementsCondition(brokersDetails.getAllVisibleElements(), Condition.visible);
-    verifyElementsCondition(brokersDetails.getAllVisibleElements(), Condition.enabled);
+    verifyElementsCondition(brokersDetails.getAllEnabledElements(), Condition.enabled);
+    brokersDetails
+        .openDetailsTab(CONFIGS);
+    brokersConfigTabPanel
+        .waitUntilScreenReady();
+    verifyElementsCondition(brokersConfigTabPanel.getColumnHeaders(), Condition.visible);
+    verifyElementsCondition(brokersConfigTabPanel.getEditButtons(), Condition.enabled);
+    assertThat(brokersConfigTabPanel.isSearchByKeyVisible()).as("isSearchByKeyVisible()").isTrue();
   }
 
   @Step