|
@@ -2,14 +2,12 @@ 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.helpers.Helpers;
|
|
|
|
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.MainPage;
|
|
-import com.provectus.kafka.ui.pages.schema.SchemaEditView;
|
|
|
|
import com.provectus.kafka.ui.pages.schema.SchemaView;
|
|
import com.provectus.kafka.ui.pages.schema.SchemaView;
|
|
-import com.provectus.kafka.ui.utilities.qaseIoUtils.enums.Status;
|
|
|
|
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 io.qase.api.annotation.CaseId;
|
|
import io.qase.api.annotation.CaseId;
|
|
import lombok.SneakyThrows;
|
|
import lombok.SneakyThrows;
|
|
import org.junit.jupiter.api.*;
|
|
import org.junit.jupiter.api.*;
|
|
@@ -19,7 +17,7 @@ import java.util.List;
|
|
|
|
|
|
import static com.provectus.kafka.ui.utilities.FileUtils.fileToString;
|
|
import static com.provectus.kafka.ui.utilities.FileUtils.fileToString;
|
|
|
|
|
|
-
|
|
|
|
|
|
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
public class SchemasTests extends BaseTest {
|
|
public class SchemasTests extends BaseTest {
|
|
private static final long SUITE_ID = 11;
|
|
private static final long SUITE_ID = 11;
|
|
@@ -31,9 +29,9 @@ public class SchemasTests extends BaseTest {
|
|
|
|
|
|
@BeforeAll
|
|
@BeforeAll
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
- public static void beforeAll() {
|
|
|
|
|
|
+ public void beforeAll() {
|
|
SCHEMA_LIST.addAll(List.of(AVRO_API, JSON_API, PROTOBUF_API));
|
|
SCHEMA_LIST.addAll(List.of(AVRO_API, JSON_API, PROTOBUF_API));
|
|
- SCHEMA_LIST.forEach(schema -> Helpers.INSTANCE.apiHelper.createSchema(CLUSTER_NAME, schema));
|
|
|
|
|
|
+ SCHEMA_LIST.forEach(schema -> apiHelper.createSchema(CLUSTER_NAME, schema));
|
|
}
|
|
}
|
|
|
|
|
|
@DisplayName("should create AVRO schema")
|
|
@DisplayName("should create AVRO schema")
|
|
@@ -44,17 +42,17 @@ public class SchemasTests extends BaseTest {
|
|
@Order(1)
|
|
@Order(1)
|
|
void createSchemaAvro() {
|
|
void createSchemaAvro() {
|
|
Schema schemaAvro = Schema.createSchemaAvro();
|
|
Schema schemaAvro = Schema.createSchemaAvro();
|
|
- pages.openMainPage()
|
|
|
|
|
|
+ mainPage.goTo()
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
- pages.schemaRegistry.clickCreateSchema()
|
|
|
|
|
|
+ schemaRegistryList.clickCreateSchema()
|
|
.setSubjectName(schemaAvro.getName())
|
|
.setSubjectName(schemaAvro.getName())
|
|
.setSchemaField(fileToString(schemaAvro.getValuePath()))
|
|
.setSchemaField(fileToString(schemaAvro.getValuePath()))
|
|
.selectSchemaTypeFromDropdown(schemaAvro.getType())
|
|
.selectSchemaTypeFromDropdown(schemaAvro.getType())
|
|
.clickSubmit()
|
|
.clickSubmit()
|
|
.waitUntilScreenReady();
|
|
.waitUntilScreenReady();
|
|
- pages.mainPage
|
|
|
|
|
|
+ mainPage.goTo()
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
- Assertions.assertTrue(pages.schemaRegistry.isSchemaVisible(schemaAvro.getName()),"isSchemaVisible()");
|
|
|
|
|
|
+ Assertions.assertTrue(schemaRegistryList.isSchemaVisible(schemaAvro.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.add(schemaAvro);
|
|
SCHEMA_LIST.add(schemaAvro);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -66,13 +64,13 @@ 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");
|
|
- pages.openMainPage()
|
|
|
|
|
|
+ mainPage.goTo()
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
- pages.schemaRegistry.openSchema(AVRO_API.getName())
|
|
|
|
|
|
+ schemaRegistryList.openSchema(AVRO_API.getName())
|
|
.waitUntilScreenReady()
|
|
.waitUntilScreenReady()
|
|
.openEditSchema();
|
|
.openEditSchema();
|
|
- Assertions.assertTrue(new SchemaEditView().isSchemaDropDownDisabled(),"isSchemaDropDownDisabled()");
|
|
|
|
- new SchemaEditView().selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
|
|
|
|
|
|
+ Assertions.assertTrue(schemaEditView.isSchemaDropDownDisabled(),"isSchemaDropDownDisabled()");
|
|
|
|
+ schemaEditView.selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
|
|
.setNewSchemaValue(fileToString(AVRO_API.getValuePath()))
|
|
.setNewSchemaValue(fileToString(AVRO_API.getValuePath()))
|
|
.clickSubmit()
|
|
.clickSubmit()
|
|
.waitUntilScreenReady();
|
|
.waitUntilScreenReady();
|
|
@@ -86,12 +84,12 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(3)
|
|
@Order(3)
|
|
void deleteSchemaAvro() {
|
|
void deleteSchemaAvro() {
|
|
- pages.openMainPage()
|
|
|
|
|
|
+ mainPage.goTo()
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
- pages.schemaRegistry.openSchema(AVRO_API.getName())
|
|
|
|
|
|
+ schemaRegistryList.openSchema(AVRO_API.getName())
|
|
.waitUntilScreenReady()
|
|
.waitUntilScreenReady()
|
|
.removeSchema();
|
|
.removeSchema();
|
|
- Assertions.assertFalse(pages.schemaRegistry.isSchemaVisible(AVRO_API.getName()),"isSchemaVisible()");
|
|
|
|
|
|
+ Assertions.assertFalse(schemaRegistryList.isSchemaVisible(AVRO_API.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.remove(AVRO_API);
|
|
SCHEMA_LIST.remove(AVRO_API);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -103,17 +101,16 @@ public class SchemasTests extends BaseTest {
|
|
@Order(4)
|
|
@Order(4)
|
|
void createSchemaJson() {
|
|
void createSchemaJson() {
|
|
Schema schemaJson = Schema.createSchemaJson();
|
|
Schema schemaJson = Schema.createSchemaJson();
|
|
- pages.openMainPage()
|
|
|
|
|
|
+ mainPage.goTo()
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
- pages.schemaRegistry.clickCreateSchema()
|
|
|
|
|
|
+ schemaRegistryList.clickCreateSchema()
|
|
.setSubjectName(schemaJson.getName())
|
|
.setSubjectName(schemaJson.getName())
|
|
.setSchemaField(fileToString(schemaJson.getValuePath()))
|
|
.setSchemaField(fileToString(schemaJson.getValuePath()))
|
|
.selectSchemaTypeFromDropdown(schemaJson.getType())
|
|
.selectSchemaTypeFromDropdown(schemaJson.getType())
|
|
.clickSubmit()
|
|
.clickSubmit()
|
|
.waitUntilScreenReady();
|
|
.waitUntilScreenReady();
|
|
- pages.mainPage
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- Assertions.assertTrue(pages.schemaRegistry.isSchemaVisible(schemaJson.getName()),"isSchemaVisible()");
|
|
|
|
|
|
+ mainPage.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
+ Assertions.assertTrue(schemaRegistryList.isSchemaVisible(schemaJson.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.add(schemaJson);
|
|
SCHEMA_LIST.add(schemaJson);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -124,12 +121,12 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(5)
|
|
@Order(5)
|
|
void deleteSchemaJson() {
|
|
void deleteSchemaJson() {
|
|
- pages.openMainPage()
|
|
|
|
|
|
+ mainPage.goTo()
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
- pages.schemaRegistry.openSchema(JSON_API.getName())
|
|
|
|
|
|
+ schemaRegistryList.openSchema(JSON_API.getName())
|
|
.waitUntilScreenReady()
|
|
.waitUntilScreenReady()
|
|
.removeSchema();
|
|
.removeSchema();
|
|
- Assertions.assertFalse(pages.schemaRegistry.isSchemaVisible(JSON_API.getName()),"isSchemaVisible()");
|
|
|
|
|
|
+ Assertions.assertFalse(schemaRegistryList.isSchemaVisible(JSON_API.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.remove(JSON_API);
|
|
SCHEMA_LIST.remove(JSON_API);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -141,17 +138,16 @@ public class SchemasTests extends BaseTest {
|
|
@Order(6)
|
|
@Order(6)
|
|
void createSchemaProtobuf() {
|
|
void createSchemaProtobuf() {
|
|
Schema schemaProtobuf = Schema.createSchemaProtobuf();
|
|
Schema schemaProtobuf = Schema.createSchemaProtobuf();
|
|
- pages.openMainPage()
|
|
|
|
|
|
+ mainPage.goTo()
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
- pages.schemaRegistry.clickCreateSchema()
|
|
|
|
|
|
+ schemaRegistryList.clickCreateSchema()
|
|
.setSubjectName(schemaProtobuf.getName())
|
|
.setSubjectName(schemaProtobuf.getName())
|
|
.setSchemaField(fileToString(schemaProtobuf.getValuePath()))
|
|
.setSchemaField(fileToString(schemaProtobuf.getValuePath()))
|
|
.selectSchemaTypeFromDropdown(schemaProtobuf.getType())
|
|
.selectSchemaTypeFromDropdown(schemaProtobuf.getType())
|
|
.clickSubmit()
|
|
.clickSubmit()
|
|
.waitUntilScreenReady();
|
|
.waitUntilScreenReady();
|
|
- pages.mainPage
|
|
|
|
- .goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- Assertions.assertTrue(pages.schemaRegistry.isSchemaVisible(schemaProtobuf.getName()),"isSchemaVisible()");
|
|
|
|
|
|
+ mainPage.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
+ Assertions.assertTrue(schemaRegistryList.isSchemaVisible(schemaProtobuf.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.add(schemaProtobuf);
|
|
SCHEMA_LIST.add(schemaProtobuf);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -162,17 +158,17 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(7)
|
|
@Order(7)
|
|
void deleteSchemaProtobuf() {
|
|
void deleteSchemaProtobuf() {
|
|
- pages.openMainPage()
|
|
|
|
|
|
+ mainPage.goTo()
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
.goToSideMenu(CLUSTER_NAME, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
- pages.schemaRegistry.openSchema(PROTOBUF_API.getName())
|
|
|
|
|
|
+ schemaRegistryList.openSchema(PROTOBUF_API.getName())
|
|
.waitUntilScreenReady()
|
|
.waitUntilScreenReady()
|
|
.removeSchema();
|
|
.removeSchema();
|
|
- Assertions.assertFalse(pages.schemaRegistry.isSchemaVisible(PROTOBUF_API.getName()),"isSchemaVisible()");
|
|
|
|
|
|
+ Assertions.assertFalse(schemaRegistryList.isSchemaVisible(PROTOBUF_API.getName()),"isSchemaVisible()");
|
|
SCHEMA_LIST.remove(PROTOBUF_API);
|
|
SCHEMA_LIST.remove(PROTOBUF_API);
|
|
}
|
|
}
|
|
|
|
|
|
@AfterAll
|
|
@AfterAll
|
|
- public static void afterAll() {
|
|
|
|
- SCHEMA_LIST.forEach(schema -> Helpers.INSTANCE.apiHelper.deleteSchema(CLUSTER_NAME, schema.getName()));
|
|
|
|
|
|
+ public void afterAll() {
|
|
|
|
+ SCHEMA_LIST.forEach(schema -> apiHelper.deleteSchema(CLUSTER_NAME, schema.getName()));
|
|
}
|
|
}
|
|
}
|
|
}
|