Repository: provectus/kafka-ui
Issue: [e2e] Need to update com.provectus.kafka.ui.tests.SchemasTests#updateSchemaAvro
Labels: scope/QA

According to https://github.com/provectus/kafka-ui/issues/2152#issuecomment-1247454408 flow was updated

Issue comments:

Pull request review comments:
no need to do this way. you can call method from this class using 'new SchemaEditView()'
'private static final' - really??
the best practice in this case to use 'protected' modifier only
Done)
corrected 

Patch that resolved the issue:
diff --git a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/schema/SchemaEditView.java b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/schema/SchemaEditView.java
index b4e2ca419e6..716e7ef80c1 100644
--- a/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/schema/SchemaEditView.java
+++ b/kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/pages/schema/SchemaEditView.java
@@ -14,7 +14,8 @@
 
 public class SchemaEditView {
 
-    SelenideElement newSchemaTextArea = $("#newSchema [wrap]");
+    protected SelenideElement newSchemaTextArea = $("#newSchema [wrap]");
+    protected SelenideElement schemaTypeDropDown = $x("//ul[@name='schemaType']");
 
     @Step
     public SchemaEditView selectSchemaTypeFromDropdown(SchemaCreateView.SchemaType schemaType) {
@@ -49,4 +50,16 @@ public SchemaRegistryList removeSchema() {
         $(By.xpath("//*[text()='Confirm']")).shouldBe(Condition.visible).click();
         return new SchemaRegistryList();
     }
+
+    @Step
+    public boolean isSchemaDropDownDisabled(){
+        boolean disabled = false;
+        try{
+           String attribute = schemaTypeDropDown.getAttribute("disabled");
+           disabled = true;
+        }
+        catch (Throwable ignored){
+        }
+       return disabled;
+    }
 }


Test patch:
diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/tests/SchemasTests.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/tests/SchemasTests.java
index da14264ec39..22c8db453d9 100644
--- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/tests/SchemasTests.java
+++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/tests/SchemasTests.java
@@ -6,6 +6,7 @@
 import com.provectus.kafka.ui.helpers.Helpers;
 import com.provectus.kafka.ui.pages.MainPage;
 import com.provectus.kafka.ui.pages.schema.SchemaCreateView;
+import com.provectus.kafka.ui.pages.schema.SchemaEditView;
 import com.provectus.kafka.ui.utils.qaseIO.Status;
 import com.provectus.kafka.ui.utils.qaseIO.annotation.AutomationStatus;
 import com.provectus.kafka.ui.utils.qaseIO.annotation.Suite;
@@ -82,8 +83,9 @@ void updateSchemaAvro() {
                 .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
         pages.schemaRegistry.openSchema(SCHEMA_AVRO_API_UPDATE)
                 .waitUntilScreenReady()
-                .openEditSchema()
-                .selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
+                .openEditSchema();
+        Assertions.assertTrue(new SchemaEditView().isSchemaDropDownDisabled(),"isSchemaDropDownDisabled()");
+        new SchemaEditView().selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
                 .setNewSchemaValue(fileToString(PATH_AVRO_FOR_UPDATE))
                 .clickSubmit()
                 .waitUntilScreenReady()