|
@@ -3,8 +3,6 @@ package com.provectus.kafka.ui.tests;
|
|
import com.provectus.kafka.ui.api.model.CompatibilityLevel;
|
|
import com.provectus.kafka.ui.api.model.CompatibilityLevel;
|
|
import com.provectus.kafka.ui.base.BaseTest;
|
|
import com.provectus.kafka.ui.base.BaseTest;
|
|
import com.provectus.kafka.ui.models.Schema;
|
|
import com.provectus.kafka.ui.models.Schema;
|
|
-import com.provectus.kafka.ui.pages.MainPage;
|
|
|
|
-import com.provectus.kafka.ui.pages.schema.SchemaDetails;
|
|
|
|
import com.provectus.kafka.ui.utilities.qaseIoUtils.annotations.AutomationStatus;
|
|
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.annotations.Suite;
|
|
import com.provectus.kafka.ui.utilities.qaseIoUtils.enums.Status;
|
|
import com.provectus.kafka.ui.utilities.qaseIoUtils.enums.Status;
|
|
@@ -15,6 +13,8 @@ import org.junit.jupiter.api.*;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
+import static com.provectus.kafka.ui.pages.NaviSideBar.SideMenuOption.SCHEMA_REGISTRY;
|
|
|
|
+import static com.provectus.kafka.ui.settings.Source.CLUSTER_NAME;
|
|
import static com.provectus.kafka.ui.utilities.FileUtils.fileToString;
|
|
import static com.provectus.kafka.ui.utilities.FileUtils.fileToString;
|
|
|
|
|
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
|
@@ -42,16 +42,22 @@ public class SchemasTests extends BaseTest {
|
|
@Order(1)
|
|
@Order(1)
|
|
void createSchemaAvro() {
|
|
void createSchemaAvro() {
|
|
Schema schemaAvro = Schema.createSchemaAvro();
|
|
Schema schemaAvro = Schema.createSchemaAvro();
|
|
- mainPage.goTo()
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- schemaRegistryList.clickCreateSchema()
|
|
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady()
|
|
|
|
+ .clickCreateSchema();
|
|
|
|
+ schemaCreateForm
|
|
.setSubjectName(schemaAvro.getName())
|
|
.setSubjectName(schemaAvro.getName())
|
|
.setSchemaField(fileToString(schemaAvro.getValuePath()))
|
|
.setSchemaField(fileToString(schemaAvro.getValuePath()))
|
|
.selectSchemaTypeFromDropdown(schemaAvro.getType())
|
|
.selectSchemaTypeFromDropdown(schemaAvro.getType())
|
|
- .clickSubmit()
|
|
|
|
|
|
+ .clickSubmit();
|
|
|
|
+ schemaDetails
|
|
|
|
+ .waitUntilScreenReady();
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
.waitUntilScreenReady();
|
|
.waitUntilScreenReady();
|
|
- mainPage.goTo()
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
Assertions.assertTrue(schemaRegistryList.isSchemaVisible(schemaAvro.getName()),"isSchemaVisible()");
|
|
Assertions.assertTrue(schemaRegistryList.isSchemaVisible(schemaAvro.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.add(schemaAvro);
|
|
SCHEMA_LIST.add(schemaAvro);
|
|
}
|
|
}
|
|
@@ -64,17 +70,24 @@ public class SchemasTests extends BaseTest {
|
|
@Order(2)
|
|
@Order(2)
|
|
void updateSchemaAvro() {
|
|
void updateSchemaAvro() {
|
|
AVRO_API.setValuePath(System.getProperty("user.dir") + "/src/main/resources/testData/schema_avro_for_update.json");
|
|
AVRO_API.setValuePath(System.getProperty("user.dir") + "/src/main/resources/testData/schema_avro_for_update.json");
|
|
- mainPage.goTo()
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- schemaRegistryList.openSchema(AVRO_API.getName())
|
|
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady()
|
|
|
|
+ .openSchema(AVRO_API.getName());
|
|
|
|
+ schemaDetails
|
|
.waitUntilScreenReady()
|
|
.waitUntilScreenReady()
|
|
.openEditSchema();
|
|
.openEditSchema();
|
|
|
|
+ schemaCreateForm
|
|
|
|
+ .waitUntilScreenReady();
|
|
Assertions.assertTrue(schemaCreateForm.isSchemaDropDownDisabled(),"isSchemaDropDownDisabled()");
|
|
Assertions.assertTrue(schemaCreateForm.isSchemaDropDownDisabled(),"isSchemaDropDownDisabled()");
|
|
- schemaCreateForm.selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
|
|
|
|
|
|
+ schemaCreateForm
|
|
|
|
+ .selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
|
|
.setNewSchemaValue(fileToString(AVRO_API.getValuePath()))
|
|
.setNewSchemaValue(fileToString(AVRO_API.getValuePath()))
|
|
- .clickSubmit()
|
|
|
|
|
|
+ .clickSubmit();
|
|
|
|
+ schemaDetails
|
|
.waitUntilScreenReady();
|
|
.waitUntilScreenReady();
|
|
- Assertions.assertEquals(CompatibilityLevel.CompatibilityEnum.NONE.toString(), new SchemaDetails().getCompatibility(), "getCompatibility()");
|
|
|
|
|
|
+ Assertions.assertEquals(CompatibilityLevel.CompatibilityEnum.NONE.toString(), schemaDetails.getCompatibility(), "getCompatibility()");
|
|
}
|
|
}
|
|
|
|
|
|
@DisplayName("should delete AVRO schema")
|
|
@DisplayName("should delete AVRO schema")
|
|
@@ -84,11 +97,16 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(3)
|
|
@Order(3)
|
|
void deleteSchemaAvro() {
|
|
void deleteSchemaAvro() {
|
|
- mainPage.goTo()
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- schemaRegistryList.openSchema(AVRO_API.getName())
|
|
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady()
|
|
|
|
+ .openSchema(AVRO_API.getName());
|
|
|
|
+ schemaDetails
|
|
.waitUntilScreenReady()
|
|
.waitUntilScreenReady()
|
|
.removeSchema();
|
|
.removeSchema();
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady();
|
|
Assertions.assertFalse(schemaRegistryList.isSchemaVisible(AVRO_API.getName()),"isSchemaVisible()");
|
|
Assertions.assertFalse(schemaRegistryList.isSchemaVisible(AVRO_API.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.remove(AVRO_API);
|
|
SCHEMA_LIST.remove(AVRO_API);
|
|
}
|
|
}
|
|
@@ -101,15 +119,22 @@ public class SchemasTests extends BaseTest {
|
|
@Order(4)
|
|
@Order(4)
|
|
void createSchemaJson() {
|
|
void createSchemaJson() {
|
|
Schema schemaJson = Schema.createSchemaJson();
|
|
Schema schemaJson = Schema.createSchemaJson();
|
|
- mainPage.goTo()
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- schemaRegistryList.clickCreateSchema()
|
|
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady()
|
|
|
|
+ .clickCreateSchema();
|
|
|
|
+ schemaCreateForm
|
|
.setSubjectName(schemaJson.getName())
|
|
.setSubjectName(schemaJson.getName())
|
|
.setSchemaField(fileToString(schemaJson.getValuePath()))
|
|
.setSchemaField(fileToString(schemaJson.getValuePath()))
|
|
.selectSchemaTypeFromDropdown(schemaJson.getType())
|
|
.selectSchemaTypeFromDropdown(schemaJson.getType())
|
|
- .clickSubmit()
|
|
|
|
|
|
+ .clickSubmit();
|
|
|
|
+ schemaDetails
|
|
|
|
+ .waitUntilScreenReady();
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
.waitUntilScreenReady();
|
|
.waitUntilScreenReady();
|
|
- mainPage.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
Assertions.assertTrue(schemaRegistryList.isSchemaVisible(schemaJson.getName()),"isSchemaVisible()");
|
|
Assertions.assertTrue(schemaRegistryList.isSchemaVisible(schemaJson.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.add(schemaJson);
|
|
SCHEMA_LIST.add(schemaJson);
|
|
}
|
|
}
|
|
@@ -121,11 +146,16 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(5)
|
|
@Order(5)
|
|
void deleteSchemaJson() {
|
|
void deleteSchemaJson() {
|
|
- mainPage.goTo()
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- schemaRegistryList.openSchema(JSON_API.getName())
|
|
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady()
|
|
|
|
+ .openSchema(JSON_API.getName());
|
|
|
|
+ schemaDetails
|
|
.waitUntilScreenReady()
|
|
.waitUntilScreenReady()
|
|
.removeSchema();
|
|
.removeSchema();
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady();
|
|
Assertions.assertFalse(schemaRegistryList.isSchemaVisible(JSON_API.getName()),"isSchemaVisible()");
|
|
Assertions.assertFalse(schemaRegistryList.isSchemaVisible(JSON_API.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.remove(JSON_API);
|
|
SCHEMA_LIST.remove(JSON_API);
|
|
}
|
|
}
|
|
@@ -138,15 +168,22 @@ public class SchemasTests extends BaseTest {
|
|
@Order(6)
|
|
@Order(6)
|
|
void createSchemaProtobuf() {
|
|
void createSchemaProtobuf() {
|
|
Schema schemaProtobuf = Schema.createSchemaProtobuf();
|
|
Schema schemaProtobuf = Schema.createSchemaProtobuf();
|
|
- mainPage.goTo()
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- schemaRegistryList.clickCreateSchema()
|
|
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady()
|
|
|
|
+ .clickCreateSchema();
|
|
|
|
+ schemaCreateForm
|
|
.setSubjectName(schemaProtobuf.getName())
|
|
.setSubjectName(schemaProtobuf.getName())
|
|
.setSchemaField(fileToString(schemaProtobuf.getValuePath()))
|
|
.setSchemaField(fileToString(schemaProtobuf.getValuePath()))
|
|
.selectSchemaTypeFromDropdown(schemaProtobuf.getType())
|
|
.selectSchemaTypeFromDropdown(schemaProtobuf.getType())
|
|
- .clickSubmit()
|
|
|
|
|
|
+ .clickSubmit();
|
|
|
|
+ schemaDetails
|
|
|
|
+ .waitUntilScreenReady();
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
.waitUntilScreenReady();
|
|
.waitUntilScreenReady();
|
|
- mainPage.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
Assertions.assertTrue(schemaRegistryList.isSchemaVisible(schemaProtobuf.getName()),"isSchemaVisible()");
|
|
Assertions.assertTrue(schemaRegistryList.isSchemaVisible(schemaProtobuf.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.add(schemaProtobuf);
|
|
SCHEMA_LIST.add(schemaProtobuf);
|
|
}
|
|
}
|
|
@@ -158,11 +195,16 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(7)
|
|
@Order(7)
|
|
void deleteSchemaProtobuf() {
|
|
void deleteSchemaProtobuf() {
|
|
- mainPage.goTo()
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- schemaRegistryList.openSchema(PROTOBUF_API.getName())
|
|
|
|
|
|
+ naviSideBar
|
|
|
|
+ .openSideMenu(SCHEMA_REGISTRY);
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady()
|
|
|
|
+ .openSchema(PROTOBUF_API.getName());
|
|
|
|
+ schemaDetails
|
|
.waitUntilScreenReady()
|
|
.waitUntilScreenReady()
|
|
.removeSchema();
|
|
.removeSchema();
|
|
|
|
+ schemaRegistryList
|
|
|
|
+ .waitUntilScreenReady();
|
|
Assertions.assertFalse(schemaRegistryList.isSchemaVisible(PROTOBUF_API.getName()),"isSchemaVisible()");
|
|
Assertions.assertFalse(schemaRegistryList.isSchemaVisible(PROTOBUF_API.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.remove(PROTOBUF_API);
|
|
SCHEMA_LIST.remove(PROTOBUF_API);
|
|
}
|
|
}
|