Repository: provectus/kafka-ui
Issue: [e2e] Create method with common steps inside test classes
Labels: scope/QA
scope/AQA

Almost every test in concrete class starts from the same steps. In case they aren't main goal of those tests let's create private void method with Step annotation containing common steps and reuse it.

Issue comments:

Pull request review comments:
navigateToConnectorsAndOpenConnectorsDetails -> navigateToConnectorsAndOpenDetails
here u can also reuse created navigateToConnectors()
navigateToSchema -> navigateToSchemaRegistry
navigateToSchemaAndOpenSchemaDetails -> navigateToSchemaRegistryAndOpenDetails
here u can also reuse created navigateToSchema()
seems here u forgot to use navigateToTopics()
Fixed.
Fixed.
Fixed.
Fixed.
Fixed.
Fixed
navigateToSchemaRegistryAndOpenSchemaDetails -> navigateToSchemaRegistryAndOpenDetails
use here also verifyEnabledElements()
use at 89 line also verifyVisibleElements()
suggest to update verifyElementsCondition() and reuse here
let's merge this two methods by using Condition as an argument
Fixed.
Fixed.
Fixed.
Fixed.
Fixed.
getAllMenuButtons() list should be visible and enabled at same time
just add it in 16 and 17 line
Fixed.

Patch that resolved the issue:
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 3df1a09304b..98ed497e422 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
@@ -30,7 +30,7 @@ public BrokersList openBroker(String brokerId) {
   }
 
   private List<SelenideElement> getUptimeSummaryCells() {
-    return Stream.of("Broker Count", "Active Controllers", "Version")
+    return Stream.of("Broker Count", "Active Controller", "Version")
         .map(name -> $x(String.format(summaryCellLocator, name)))
         .collect(Collectors.toList());
   }
@@ -87,7 +87,7 @@ public BrokerGridItem(SelenideElement element) {
     }
 
     private SelenideElement getIdElm() {
-      return element.$x("./td[1]/a");
+      return element.$x("./td[1]/div/a");
     }
 
     @Step


Test patch:
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/base/BaseTest.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/base/BaseTest.java
index 11cf07c622e..d3a279cc713 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/base/BaseTest.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/base/BaseTest.java
@@ -1,13 +1,17 @@
 package com.provectus.kafka.ui.base;
 
+import com.codeborne.selenide.Condition;
 import com.codeborne.selenide.Selenide;
+import com.codeborne.selenide.SelenideElement;
 import com.codeborne.selenide.WebDriverRunner;
 import com.provectus.kafka.ui.utilities.qaseIoUtils.DisplayNameGenerator;
 import com.provectus.kafka.ui.utilities.qaseIoUtils.TestCaseGenerator;
 import io.github.cdimascio.dotenv.Dotenv;
 import io.qameta.allure.Allure;
+import io.qase.api.annotation.Step;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FileUtils;
+import org.assertj.core.api.SoftAssertions;
 import org.junit.jupiter.api.*;
 import org.openqa.selenium.Dimension;
 import org.openqa.selenium.OutputType;
@@ -22,8 +26,10 @@
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
+import java.util.List;
 
 import static com.provectus.kafka.ui.base.Setup.*;
+import static com.provectus.kafka.ui.pages.NaviSideBar.SideMenuOption.TOPICS;
 import static com.provectus.kafka.ui.settings.Source.BASE_WEB_URL;
 
 @Slf4j
@@ -110,4 +116,31 @@ public void afterMethod() {
             ((TakesScreenshot) webDriverContainer.getWebDriver()).getScreenshotAs(OutputType.BYTES)));
     browserClear();
   }
+
+  @Step
+  protected void navigateToTopics(){
+    naviSideBar
+        .openSideMenu(TOPICS);
+    topicsList
+        .waitUntilScreenReady();
+  }
+
+  @Step
+  protected void navigateToTopicsAndOpenDetails(String topicName){
+    naviSideBar
+        .openSideMenu(TOPICS);
+    topicsList
+        .waitUntilScreenReady()
+        .openTopic(topicName);
+    topicDetails
+        .waitUntilScreenReady();
+  }
+
+  @Step
+  protected void verifyElementsCondition(List<SelenideElement> elementList, Condition expectedCondition) {
+    SoftAssertions softly = new SoftAssertions();
+    elementList.forEach(element -> softly.assertThat(element.is(expectedCondition))
+        .as(element.getSearchCriteria() + " is " + expectedCondition).isTrue());
+    softly.assertAll();
+  }
 }
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/SmokeTests.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/SmokeTests.java
index ed7d901fe4b..ac5f5c57557 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/SmokeTests.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/SmokeTests.java
@@ -5,7 +5,8 @@
 import com.provectus.kafka.ui.utilities.qaseIoUtils.annotations.AutomationStatus;
 import com.provectus.kafka.ui.utilities.qaseIoUtils.enums.Status;
 import io.qase.api.annotation.CaseId;
-import org.assertj.core.api.SoftAssertions;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 import org.junit.jupiter.api.Test;
 
 public class SmokeTests extends BaseTest {
@@ -14,19 +15,9 @@ public class SmokeTests extends BaseTest {
     @AutomationStatus(status = Status.AUTOMATED)
     @CaseId(198)
     public void checkBasePageElements(){
-        SoftAssertions softly = new SoftAssertions();
-        topPanel.getAllVisibleElements()
-                .forEach(element ->
-                        softly.assertThat(element.is(Condition.visible))
-                                .as(element.getSearchCriteria() + " isVisible()").isTrue());
-        topPanel.getAllEnabledElements()
-                .forEach(element ->
-                        softly.assertThat(element.is(Condition.enabled))
-                                .as(element.getSearchCriteria() + " isEnabled()").isTrue());
-        naviSideBar.getAllMenuButtons()
-                .forEach(element ->
-                        softly.assertThat(element.is(Condition.enabled) && element.is(Condition.visible))
-                                .as(element.getSearchCriteria() + " isEnabled()").isTrue());
-        softly.assertAll();
+      verifyElementsCondition(Stream.concat(topPanel.getAllVisibleElements().stream(), naviSideBar.getAllMenuButtons().stream())
+          .collect(Collectors.toList()),Condition.visible);
+      verifyElementsCondition(Stream.concat(topPanel.getAllEnabledElements().stream(), naviSideBar.getAllMenuButtons().stream())
+          .collect(Collectors.toList()),Condition.enabled);
     }
 }
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 dcff92bc28c..0b54a4015ce 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
@@ -8,8 +8,8 @@
 import com.provectus.kafka.ui.utilities.qaseIoUtils.annotations.AutomationStatus;
 import com.provectus.kafka.ui.utilities.qaseIoUtils.annotations.Suite;
 import com.provectus.kafka.ui.utilities.qaseIoUtils.enums.Status;
+import io.qameta.allure.Step;
 import io.qase.api.annotation.CaseId;
-import org.assertj.core.api.SoftAssertions;
 import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.api.Test;
 
@@ -23,17 +23,10 @@ public class BrokersTests extends BaseTest {
   @CaseId(1)
   @Test
   public void checkBrokersOverview(){
-    naviSideBar
-        .openSideMenu(BROKERS);
-    brokersList
-        .waitUntilScreenReady();
-    SoftAssertions softly = new SoftAssertions();
-    softly.assertThat(brokersList.getAllBrokers()).as("getAllBrokers()").size().isGreaterThan(0);
-    brokersList.getAllVisibleElements().forEach(element -> softly.assertThat(element.is(Condition.visible))
-        .as(element.getSearchCriteria() + " isVisible()").isTrue());
-    brokersList.getAllEnabledElements().forEach(element -> softly.assertThat(element.is(Condition.enabled))
-        .as(element.getSearchCriteria() + " isEnabled()").isTrue());
-    softly.assertAll();
+    navigateToBrokers();
+    assertThat(brokersList.getAllBrokers()).as("getAllBrokers()").size().isGreaterThan(0);
+    verifyElementsCondition(brokersList.getAllVisibleElements(), Condition.visible);
+    verifyElementsCondition(brokersList.getAllEnabledElements(), Condition.enabled);
   }
 
   @DisplayName("Checking the existing Broker's profile in a cluster")
@@ -42,20 +35,21 @@ public void checkBrokersOverview(){
   @CaseId(85)
   @Test
   public void checkExistingBrokersInCluster(){
-    naviSideBar
-        .openSideMenu(BROKERS);
-    brokersList
-        .waitUntilScreenReady();
+    navigateToBrokers();
     assertThat(brokersList.getAllBrokers()).as("getAllBrokers()").size().isGreaterThan(0);
     brokersList
         .openBroker("1");
     brokersDetails
         .waitUntilScreenReady();
-    SoftAssertions softly = new SoftAssertions();
-    brokersDetails.getAllVisibleElements().forEach(element -> softly.assertThat(element.is(Condition.visible))
-        .as(element.getSearchCriteria() + " isVisible()").isTrue());
-    brokersDetails.getAllEnabledElements().forEach(element -> softly.assertThat(element.is(Condition.enabled))
-        .as(element.getSearchCriteria() + " isEnabled()").isTrue());
-    softly.assertAll();
+    verifyElementsCondition(brokersDetails.getAllVisibleElements(), Condition.visible);
+    verifyElementsCondition(brokersDetails.getAllVisibleElements(), Condition.enabled);
+  }
+
+  @Step
+  private void navigateToBrokers(){
+    naviSideBar
+        .openSideMenu(BROKERS);
+    brokersList
+        .waitUntilScreenReady();
   }
 }
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/connectors/ConnectorsTests.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/connectors/ConnectorsTests.java
index 5e8ed9157ab..980c2d9d48b 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/connectors/ConnectorsTests.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/connectors/ConnectorsTests.java
@@ -12,6 +12,7 @@
 import com.provectus.kafka.ui.utilities.qaseIoUtils.annotations.AutomationStatus;
 import com.provectus.kafka.ui.utilities.qaseIoUtils.annotations.Suite;
 import com.provectus.kafka.ui.utilities.qaseIoUtils.enums.Status;
+import io.qameta.allure.Step;
 import io.qase.api.annotation.CaseId;
 import java.util.ArrayList;
 import java.util.List;
@@ -68,10 +69,8 @@ public void createConnector() {
         Connector connectorForCreate = new Connector()
                 .setName("sink_postgres_activities_e2e_checks-" + randomAlphabetic(5))
                 .setConfig(getResourceAsString("config_for_create_connector.json"));
-        naviSideBar
-                .openSideMenu(KAFKA_CONNECT);
-        kafkaConnectList
-                .waitUntilScreenReady()
+        navigateToConnectors();
+      kafkaConnectList
                 .clickCreateConnectorBtn();
         connectorCreateForm
                 .waitUntilScreenReady()
@@ -79,18 +78,9 @@ public void createConnector() {
                 .clickSubmitButton();
         connectorDetails
                 .waitUntilScreenReady();
-        naviSideBar
-                .openSideMenu(KAFKA_CONNECT);
-        kafkaConnectList
-                .waitUntilScreenReady()
-                .openConnector(connectorForCreate.getName());
-        connectorDetails
-                .waitUntilScreenReady();
+        navigateToConnectorsAndOpenDetails(connectorForCreate.getName());
         Assertions.assertTrue(connectorDetails.isConnectorHeaderVisible(connectorForCreate.getName()),"isConnectorTitleVisible()");
-        naviSideBar
-                .openSideMenu(KAFKA_CONNECT);
-        kafkaConnectList
-                .waitUntilScreenReady();
+        navigateToConnectors();
         Assertions.assertTrue(kafkaConnectList.isConnectorVisible(CONNECTOR_FOR_DELETE.getName()), "isConnectorVisible()");
         CONNECTOR_LIST.add(connectorForCreate);
     }
@@ -101,21 +91,13 @@ public void createConnector() {
     @CaseId(196)
     @Test
     public void updateConnector() {
-        naviSideBar
-                .openSideMenu(KAFKA_CONNECT);
-        kafkaConnectList
-                .waitUntilScreenReady()
-                .openConnector(CONNECTOR_FOR_UPDATE.getName());
-        connectorDetails
-                .waitUntilScreenReady()
+      navigateToConnectorsAndOpenDetails(CONNECTOR_FOR_UPDATE.getName());
+      connectorDetails
                 .openConfigTab()
                 .setConfig(CONNECTOR_FOR_UPDATE.getConfig())
                 .clickSubmitButton();
         Assertions.assertTrue(connectorDetails.isAlertWithMessageVisible(SUCCESS,"Config successfully updated."),"isAlertWithMessageVisible()");
-        naviSideBar
-                .openSideMenu(KAFKA_CONNECT);
-        kafkaConnectList
-                .waitUntilScreenReady();
+        navigateToConnectors();
         Assertions.assertTrue(kafkaConnectList.isConnectorVisible(CONNECTOR_FOR_UPDATE.getName()), "isConnectorVisible()");
     }
 
@@ -125,20 +107,12 @@ public void updateConnector() {
     @CaseId(195)
     @Test
     public void deleteConnector() {
-        naviSideBar
-                .openSideMenu(KAFKA_CONNECT);
-        kafkaConnectList
-                .waitUntilScreenReady()
-                .openConnector(CONNECTOR_FOR_DELETE.getName());
-        connectorDetails
-                .waitUntilScreenReady()
+      navigateToConnectorsAndOpenDetails(CONNECTOR_FOR_DELETE.getName());
+      connectorDetails
                 .openDotMenu()
                 .clickDeleteBtn()
                 .clickConfirmBtn();
-        naviSideBar
-                .openSideMenu(KAFKA_CONNECT);
-        kafkaConnectList
-                .waitUntilScreenReady();
+      navigateToConnectors();
         Assertions.assertFalse(kafkaConnectList.isConnectorVisible(CONNECTOR_FOR_DELETE.getName()), "isConnectorVisible()");
         CONNECTOR_LIST.remove(CONNECTOR_FOR_DELETE);
     }
@@ -149,4 +123,21 @@ public void afterAll() {
                 apiHelper.deleteConnector(CLUSTER_NAME, CONNECT_NAME, connector.getName()));
         TOPIC_LIST.forEach(topic -> apiHelper.deleteTopic(CLUSTER_NAME, topic.getName()));
     }
+
+    @Step
+    private void navigateToConnectors(){
+      naviSideBar
+          .openSideMenu(KAFKA_CONNECT);
+      kafkaConnectList
+          .waitUntilScreenReady();
+    }
+
+    @Step
+    private void navigateToConnectorsAndOpenDetails(String connectorName){
+      navigateToConnectors();
+      kafkaConnectList
+          .openConnector(connectorName);
+      connectorDetails
+          .waitUntilScreenReady();
+    }
 }
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/schemas/SchemasTests.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/schemas/SchemasTests.java
index f112c7b5881..92daffd2495 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/schemas/SchemasTests.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/schemas/SchemasTests.java
@@ -11,6 +11,7 @@
 import com.provectus.kafka.ui.utilities.qaseIoUtils.annotations.AutomationStatus;
 import com.provectus.kafka.ui.utilities.qaseIoUtils.annotations.Suite;
 import com.provectus.kafka.ui.utilities.qaseIoUtils.enums.Status;
+import io.qameta.allure.Step;
 import io.qase.api.annotation.CaseId;
 import java.util.ArrayList;
 import java.util.List;
@@ -51,10 +52,8 @@ public void beforeAll() {
     @Order(1)
     void createSchemaAvro() {
         Schema schemaAvro = Schema.createSchemaAvro();
-        naviSideBar
-                .openSideMenu(SCHEMA_REGISTRY);
+        navigateToSchemaRegistry();
         schemaRegistryList
-                .waitUntilScreenReady()
                 .clickCreateSchema();
         schemaCreateForm
                 .setSubjectName(schemaAvro.getName())
@@ -68,10 +67,7 @@ void createSchemaAvro() {
         softly.assertThat(schemaDetails.getSchemaType()).as("getSchemaType()").isEqualTo(schemaAvro.getType().getValue());
         softly.assertThat(schemaDetails.getCompatibility()).as("getCompatibility()").isEqualTo(CompatibilityLevel.CompatibilityEnum.BACKWARD.getValue());
         softly.assertAll();
-        naviSideBar
-                .openSideMenu(SCHEMA_REGISTRY);
-        schemaRegistryList
-                .waitUntilScreenReady();
+        navigateToSchemaRegistry();
         Assertions.assertTrue(schemaRegistryList.isSchemaVisible(AVRO_API.getName()),"isSchemaVisible()");
         SCHEMA_LIST.add(schemaAvro);
     }
@@ -84,20 +80,13 @@ void createSchemaAvro() {
     @Order(2)
     void updateSchemaAvro() {
         AVRO_API.setValuePath(System.getProperty("user.dir") + "/src/main/resources/testData/schema_avro_for_update.json");
-        naviSideBar
-                .openSideMenu(SCHEMA_REGISTRY);
-        schemaRegistryList
-                .waitUntilScreenReady()
-                .openSchema(AVRO_API.getName());
+        navigateToSchemaRegistryAndOpenDetails(AVRO_API.getName());
         schemaDetails
-                .waitUntilScreenReady()
                 .openEditSchema();
         schemaCreateForm
                 .waitUntilScreenReady();
-        SoftAssertions softly = new SoftAssertions();
-        schemaCreateForm.getAllDetailsPageElements()
-            .forEach(element -> softly.assertThat(element.is(Condition.visible))
-                .as(element.getSearchCriteria() + " isVisible").isTrue());
+      verifyElementsCondition(schemaCreateForm.getAllDetailsPageElements(), Condition.visible);
+      SoftAssertions softly = new SoftAssertions();
         softly.assertThat(schemaCreateForm.isSubmitBtnEnabled()).as("isSubmitBtnEnabled()").isFalse();
         softly.assertThat(schemaCreateForm.isSchemaDropDownEnabled()).as("isSchemaDropDownEnabled()").isFalse();
         softly.assertAll();
@@ -117,11 +106,7 @@ void updateSchemaAvro() {
     @Test
     @Order(3)
     void compareVersionsOperation() {
-      naviSideBar
-          .openSideMenu(SCHEMA_REGISTRY);
-      schemaRegistryList
-          .waitUntilScreenReady()
-          .openSchema(AVRO_API.getName());
+      navigateToSchemaRegistryAndOpenDetails(AVRO_API.getName());
       int latestVersion = schemaDetails
           .waitUntilScreenReady()
           .getLatestVersion();
@@ -144,13 +129,8 @@ void compareVersionsOperation() {
     @Test
     @Order(4)
     void deleteSchemaAvro() {
-      naviSideBar
-          .openSideMenu(SCHEMA_REGISTRY);
-      schemaRegistryList
-          .waitUntilScreenReady()
-          .openSchema(AVRO_API.getName());
+      navigateToSchemaRegistryAndOpenDetails(AVRO_API.getName());
       schemaDetails
-          .waitUntilScreenReady()
           .removeSchema();
       schemaRegistryList
           .waitUntilScreenReady();
@@ -166,10 +146,8 @@ void deleteSchemaAvro() {
     @Order(5)
     void createSchemaJson() {
         Schema schemaJson = Schema.createSchemaJson();
-        naviSideBar
-                .openSideMenu(SCHEMA_REGISTRY);
+        navigateToSchemaRegistry();
         schemaRegistryList
-                .waitUntilScreenReady()
                 .clickCreateSchema();
         schemaCreateForm
                 .setSubjectName(schemaJson.getName())
@@ -183,10 +161,7 @@ void createSchemaJson() {
         softly.assertThat(schemaDetails.getSchemaType()).as("getSchemaType()").isEqualTo(schemaJson.getType().getValue());
         softly.assertThat(schemaDetails.getCompatibility()).as("getCompatibility()").isEqualTo(CompatibilityLevel.CompatibilityEnum.BACKWARD.getValue());
         softly.assertAll();
-        naviSideBar
-                .openSideMenu(SCHEMA_REGISTRY);
-        schemaRegistryList
-                .waitUntilScreenReady();
+        navigateToSchemaRegistry();
         Assertions.assertTrue(schemaRegistryList.isSchemaVisible(JSON_API.getName()),"isSchemaVisible()");
         SCHEMA_LIST.add(schemaJson);
     }
@@ -198,13 +173,8 @@ void createSchemaJson() {
     @Test
     @Order(6)
     void deleteSchemaJson() {
-        naviSideBar
-                .openSideMenu(SCHEMA_REGISTRY);
-        schemaRegistryList
-                .waitUntilScreenReady()
-                .openSchema(JSON_API.getName());
-        schemaDetails
-                .waitUntilScreenReady()
+      navigateToSchemaRegistryAndOpenDetails(JSON_API.getName());
+      schemaDetails
                 .removeSchema();
         schemaRegistryList
                 .waitUntilScreenReady();
@@ -220,10 +190,8 @@ void deleteSchemaJson() {
     @Order(7)
     void createSchemaProtobuf() {
         Schema schemaProtobuf = Schema.createSchemaProtobuf();
-        naviSideBar
-                .openSideMenu(SCHEMA_REGISTRY);
+        navigateToSchemaRegistry();
         schemaRegistryList
-                .waitUntilScreenReady()
                 .clickCreateSchema();
         schemaCreateForm
                 .setSubjectName(schemaProtobuf.getName())
@@ -237,10 +205,7 @@ void createSchemaProtobuf() {
         softly.assertThat(schemaDetails.getSchemaType()).as("getSchemaType()").isEqualTo(schemaProtobuf.getType().getValue());
         softly.assertThat(schemaDetails.getCompatibility()).as("getCompatibility()").isEqualTo(CompatibilityLevel.CompatibilityEnum.BACKWARD.getValue());
         softly.assertAll();
-        naviSideBar
-                .openSideMenu(SCHEMA_REGISTRY);
-        schemaRegistryList
-                .waitUntilScreenReady();
+        navigateToSchemaRegistry();
         Assertions.assertTrue(schemaRegistryList.isSchemaVisible(PROTOBUF_API.getName()),"isSchemaVisible()");
         SCHEMA_LIST.add(schemaProtobuf);
     }
@@ -252,13 +217,8 @@ void createSchemaProtobuf() {
     @Test
     @Order(8)
     void deleteSchemaProtobuf() {
-        naviSideBar
-                .openSideMenu(SCHEMA_REGISTRY);
-        schemaRegistryList
-                .waitUntilScreenReady()
-                .openSchema(PROTOBUF_API.getName());
-        schemaDetails
-                .waitUntilScreenReady()
+      navigateToSchemaRegistryAndOpenDetails(PROTOBUF_API.getName());
+      schemaDetails
                 .removeSchema();
         schemaRegistryList
                 .waitUntilScreenReady();
@@ -270,4 +230,21 @@ void deleteSchemaProtobuf() {
     public void afterAll() {
         SCHEMA_LIST.forEach(schema -> apiHelper.deleteSchema(CLUSTER_NAME, schema.getName()));
     }
+
+    @Step
+    private void navigateToSchemaRegistry(){
+      naviSideBar
+          .openSideMenu(SCHEMA_REGISTRY);
+      schemaRegistryList
+          .waitUntilScreenReady();
+    }
+
+    @Step
+    private void navigateToSchemaRegistryAndOpenDetails(String schemaName){
+      navigateToSchemaRegistry();
+      schemaRegistryList
+          .openSchema(schemaName);
+      schemaDetails
+          .waitUntilScreenReady();
+    }
 }
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/topics/TopicMessagesTests.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/topics/TopicMessagesTests.java
index f3da20747be..8fbf915d543 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/topics/TopicMessagesTests.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/topics/TopicMessagesTests.java
@@ -47,13 +47,8 @@ public void beforeAll() {
   @CaseId(222)
   @Test
   void produceMessage() {
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic(TOPIC_FOR_MESSAGES.getName());
+    navigateToTopicsAndOpenDetails(TOPIC_FOR_MESSAGES.getName());
     topicDetails
-        .waitUntilScreenReady()
         .openDetailsTab(TopicDetails.TopicMenu.MESSAGES)
         .clickProduceMessageBtn();
     produceMessagePanel
@@ -77,13 +72,8 @@ void produceMessage() {
   @CaseId(19)
   @Test
   void clearMessage() {
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic(TOPIC_FOR_MESSAGES.getName());
+    navigateToTopicsAndOpenDetails(TOPIC_FOR_MESSAGES.getName());
     topicDetails
-        .waitUntilScreenReady()
         .openDetailsTab(TopicDetails.TopicMenu.OVERVIEW)
         .clickProduceMessageBtn();
     int messageAmount = topicDetails.getMessageCountAmount();
@@ -111,13 +101,8 @@ void clearMessage() {
   @Test
   void copyMessageFromTopicProfile() {
     String topicName = "_schemas";
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic(topicName);
+    navigateToTopicsAndOpenDetails(topicName);
     topicDetails
-        .waitUntilScreenReady()
         .openDetailsTab(TopicDetails.TopicMenu.MESSAGES)
         .getRandomMessage()
         .openDotMenu()
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/topics/TopicsTests.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/topics/TopicsTests.java
index fbee8c82610..e75c39f7e97 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/topics/TopicsTests.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/suite/topics/TopicsTests.java
@@ -1,6 +1,5 @@
 package com.provectus.kafka.ui.suite.topics;
 
-import static com.provectus.kafka.ui.pages.NaviSideBar.SideMenuOption.TOPICS;
 import static com.provectus.kafka.ui.pages.topic.TopicDetails.TopicMenu.MESSAGES;
 import static com.provectus.kafka.ui.pages.topic.TopicDetails.TopicMenu.SETTINGS;
 import static com.provectus.kafka.ui.pages.topic.enums.CleanupPolicyValue.COMPACT;
@@ -72,10 +71,8 @@ public void beforeAll() {
   @Test
   @Order(1)
   public void createTopic() {
-    naviSideBar
-        .openSideMenu(TOPICS);
+    navigateToTopics();
     topicsList
-        .waitUntilScreenReady()
         .clickAddTopicBtn();
     topicCreateEditForm
         .waitUntilScreenReady()
@@ -83,13 +80,7 @@ public void createTopic() {
         .setNumberOfPartitions(TOPIC_TO_CREATE.getNumberOfPartitions())
         .selectCleanupPolicy(TOPIC_TO_CREATE.getCleanupPolicyValue())
         .clickCreateTopicBtn();
-    topicDetails
-        .waitUntilScreenReady();
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic(TOPIC_TO_CREATE.getName());
+    navigateToTopicsAndOpenDetails(TOPIC_TO_CREATE.getName());
     SoftAssertions softly = new SoftAssertions();
     softly.assertThat(topicDetails.isTopicHeaderVisible(TOPIC_TO_CREATE.getName())).as("isTopicHeaderVisible()")
         .isTrue();
@@ -98,10 +89,7 @@ public void createTopic() {
     softly.assertThat(topicDetails.getPartitions()).as("getPartitions()")
         .isEqualTo(TOPIC_TO_CREATE.getNumberOfPartitions());
     softly.assertAll();
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady();
+    navigateToTopics();
     Assertions.assertTrue(topicsList.isTopicVisible(TOPIC_TO_CREATE.getName()), "isTopicVisible");
     TOPIC_LIST.add(TOPIC_TO_CREATE);
   }
@@ -113,16 +101,11 @@ public void createTopic() {
   @Test
   @Order(2)
   void checkAvailableOperations() {
-    naviSideBar
-        .openSideMenu(TOPICS);
+    navigateToTopics();
     topicsList
-        .waitUntilScreenReady()
         .getTopicItem("my_ksql_1ksql_processing_log")
         .selectItem(true);
-    topicsList
-        .getActionButtons()
-        .forEach(element -> assertThat(element.is(Condition.enabled))
-            .as(element.getSearchCriteria() + " isEnabled()").isTrue());
+    verifyElementsCondition(topicsList.getActionButtons(),Condition.enabled);
     topicsList
         .getTopicItem("_confluent-ksql-my_ksql_1_command_topic")
         .selectItem(true);
@@ -138,13 +121,8 @@ void checkAvailableOperations() {
   @Test
   @Order(3)
   public void updateTopic() {
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic(TOPIC_FOR_UPDATE.getName());
+    navigateToTopicsAndOpenDetails(TOPIC_FOR_UPDATE.getName());
     topicDetails
-        .waitUntilScreenReady()
         .openDotMenu()
         .clickEditSettingsMenu();
     topicCreateEditForm
@@ -157,13 +135,8 @@ public void updateTopic() {
         .clickCreateTopicBtn();
     topicDetails
         .waitUntilScreenReady();
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic(TOPIC_FOR_UPDATE.getName());
+    navigateToTopicsAndOpenDetails(TOPIC_FOR_UPDATE.getName());
     topicDetails
-        .waitUntilScreenReady()
         .openDotMenu()
         .clickEditSettingsMenu();
     SoftAssertions softly = new SoftAssertions();
@@ -185,20 +158,12 @@ public void updateTopic() {
   @Test
   @Order(4)
   public void deleteTopic() {
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic(TOPIC_FOR_DELETE.getName());
+    navigateToTopicsAndOpenDetails(TOPIC_FOR_DELETE.getName());
     topicDetails
-        .waitUntilScreenReady()
         .openDotMenu()
         .clickDeleteTopicMenu()
         .clickConfirmDeleteBtn();
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady();
+    navigateToTopics();
     Assertions.assertFalse(topicsList.isTopicVisible(TOPIC_FOR_DELETE.getName()), "isTopicVisible");
     TOPIC_LIST.remove(TOPIC_FOR_DELETE);
   }
@@ -212,13 +177,8 @@ public void deleteTopic() {
   void redirectToConsumerFromTopic() {
     String topicName = "source-activities";
     String consumerGroupId = "connect-sink_postgres_activities";
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic(topicName);
+    navigateToTopicsAndOpenDetails(topicName);
     topicDetails
-        .waitUntilScreenReady()
         .openDetailsTab(TopicDetails.TopicMenu.CONSUMERS)
         .openConsumerGroup(consumerGroupId);
     consumersDetails
@@ -236,10 +196,8 @@ void redirectToConsumerFromTopic() {
   @Test
   @Order(6)
   void checkTopicCreatePossibility() {
-    naviSideBar
-        .openSideMenu(TOPICS);
+    navigateToTopics();
     topicsList
-        .waitUntilScreenReady()
         .clickAddTopicBtn();
     topicCreateEditForm
         .waitUntilScreenReady();
@@ -266,14 +224,14 @@ void checkTimeToRetainDataCustomValueWithEditingTopic() {
     Topic topicToRetainData = new Topic()
         .setName("topic-to-retain-data-" + randomAlphabetic(5))
         .setTimeToRetainData("86400000");
-    naviSideBar
-        .openSideMenu(TOPICS);
+    navigateToTopics();
     topicsList
-        .waitUntilScreenReady()
         .clickAddTopicBtn();
     topicCreateEditForm
         .waitUntilScreenReady()
-        .setTopicName(topicToRetainData.getName());
+        .setTopicName(topicToRetainData.getName())
+        .setNumberOfPartitions(1)
+        .setTimeToRetainDataInMs("604800000");
     assertThat(topicCreateEditForm.getTimeToRetain()).as("getTimeToRetain()").isEqualTo("604800000");
     topicCreateEditForm
         .setTimeToRetainDataInMs(topicToRetainData.getTimeToRetainData())
@@ -298,8 +256,7 @@ void checkTimeToRetainDataCustomValueWithEditingTopic() {
   @Test
   @Order(8)
   void checkCustomParametersWithinCreateNewTopic() {
-    naviSideBar
-        .openSideMenu(TOPICS);
+    navigateToTopics();
     topicsList
         .waitUntilScreenReady()
         .clickAddTopicBtn();
@@ -323,18 +280,9 @@ void checkCustomParametersWithinCreateNewTopic() {
   @Test
   @Order(9)
   void checkTopicListElements() {
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady();
-    SoftAssertions softly = new SoftAssertions();
-    topicsList.getAllVisibleElements().forEach(
-        element -> softly.assertThat(element.is(Condition.visible)).as(element.getSearchCriteria() + " isVisible()")
-            .isTrue());
-    topicsList.getAllEnabledElements().forEach(
-        element -> softly.assertThat(element.is(Condition.enabled)).as(element.getSearchCriteria() + " isEnabled()")
-            .isTrue());
-    softly.assertAll();
+    navigateToTopics();
+    verifyElementsCondition(topicsList.getAllVisibleElements(), Condition.visible);
+    verifyElementsCondition(topicsList.getAllEnabledElements(), Condition.enabled);
   }
 
   @DisplayName("Filter adding within Topic")
@@ -345,29 +293,16 @@ void checkTopicListElements() {
   @Order(10)
   void addingNewFilterWithinTopic() {
     String filterName = randomAlphabetic(5);
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic("_schemas");
+    navigateToTopicsAndOpenDetails("_schemas");
     topicDetails
-        .waitUntilScreenReady()
         .openDetailsTab(MESSAGES)
         .clickMessagesAddFiltersBtn()
         .waitUntilAddFiltersMdlVisible();
-    SoftAssertions softly = new SoftAssertions();
-    topicDetails.getAllAddFilterModalVisibleElements().forEach(element ->
-        softly.assertThat(element.is(Condition.visible))
-            .as(element.getSearchCriteria() + " isVisible()").isTrue());
-    topicDetails.getAllAddFilterModalEnabledElements().forEach(element ->
-        softly.assertThat(element.is(Condition.enabled))
-            .as(element.getSearchCriteria() + " isEnabled()").isTrue());
-    topicDetails.getAllAddFilterModalDisabledElements().forEach(element ->
-        softly.assertThat(element.is(Condition.enabled))
-            .as(element.getSearchCriteria() + " isEnabled()").isFalse());
-    softly.assertThat(topicDetails.isSaveThisFilterCheckBoxSelected()).as("isSaveThisFilterCheckBoxSelected()")
+    verifyElementsCondition(topicDetails.getAllAddFilterModalVisibleElements(), Condition.visible);
+    verifyElementsCondition(topicDetails.getAllAddFilterModalEnabledElements(), Condition.enabled);
+    verifyElementsCondition(topicDetails.getAllAddFilterModalDisabledElements(), Condition.disabled);
+    assertThat(topicDetails.isSaveThisFilterCheckBoxSelected()).as("isSaveThisFilterCheckBoxSelected()")
         .isFalse();
-    softly.assertAll();
     topicDetails
         .setFilterCodeFieldAddFilterMdl(filterName);
     assertThat(topicDetails.isAddFilterBtnAddFilterMdlEnabled()).as("isAddFilterBtnAddFilterMdlEnabled()")
@@ -385,13 +320,8 @@ void addingNewFilterWithinTopic() {
   @Order(11)
   void checkFilterSavingWithinSavedFilters() {
     String displayName = randomAlphabetic(5);
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic("my_ksql_1ksql_processing_log");
+    navigateToTopicsAndOpenDetails("my_ksql_1ksql_processing_log");
     topicDetails
-        .waitUntilScreenReady()
         .openDetailsTab(MESSAGES)
         .clickMessagesAddFiltersBtn()
         .waitUntilAddFiltersMdlVisible()
@@ -415,13 +345,8 @@ void checkFilterSavingWithinSavedFilters() {
   @Order(12)
   void checkingApplyingSavedFilterWithinTopicMessages() {
     String displayName = randomAlphabetic(5);
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady()
-        .openTopic("my_ksql_1ksql_processing_log");
+    navigateToTopicsAndOpenDetails("my_ksql_1ksql_processing_log");
     topicDetails
-        .waitUntilScreenReady()
         .openDetailsTab(MESSAGES)
         .clickMessagesAddFiltersBtn()
         .waitUntilAddFiltersMdlVisible()
@@ -443,10 +368,7 @@ void checkingApplyingSavedFilterWithinTopicMessages() {
   @Test
   @Order(13)
   void checkShowInternalTopicsButtonFunctionality(){
-    naviSideBar
-        .openSideMenu(TOPICS);
-    topicsList
-        .waitUntilScreenReady();
+    navigateToTopics();
     SoftAssertions softly = new SoftAssertions();
     softly.assertThat(topicsList.isShowInternalRadioBtnSelected()).as("isInternalRadioBtnSelected()").isTrue();
     softly.assertThat(topicsList.getInternalTopics()).as("getInternalTopics()").size().isGreaterThan(0);