|
@@ -1,20 +1,19 @@
|
|
package com.provectus.kafka.ui.tests;
|
|
package com.provectus.kafka.ui.tests;
|
|
|
|
|
|
-import com.provectus.kafka.ui.api.model.CompatibilityLevel;
|
|
|
|
import com.provectus.kafka.ui.api.model.SchemaType;
|
|
import com.provectus.kafka.ui.api.model.SchemaType;
|
|
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.helpers.Helpers;
|
|
-import com.provectus.kafka.ui.pages.MainPage;
|
|
|
|
-import com.provectus.kafka.ui.pages.schema.SchemaCreateView;
|
|
|
|
|
|
+import com.provectus.kafka.ui.steps.kafka.schemasteps.SchemaFactory;
|
|
|
|
+import com.provectus.kafka.ui.steps.kafka.schemasteps.SchemaSteps;
|
|
import com.provectus.kafka.ui.utils.qaseIO.Status;
|
|
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.AutomationStatus;
|
|
|
|
+import com.provectus.kafka.ui.utils.qaseIO.annotation.Suite;
|
|
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.*;
|
|
-import com.provectus.kafka.ui.utils.qaseIO.annotation.Suite;
|
|
|
|
-
|
|
|
|
-import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
+import static com.provectus.kafka.ui.pages.MainPage.SideMenuOptions.SCHEMA_REGISTRY;
|
|
|
|
+import static com.provectus.kafka.ui.steps.kafka.schemasteps.SchemaConstance.*;
|
|
import static org.apache.kafka.common.utils.Utils.readFileAsString;
|
|
import static org.apache.kafka.common.utils.Utils.readFileAsString;
|
|
|
|
|
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
@@ -22,18 +21,6 @@ public class SchemasTests extends BaseTest {
|
|
|
|
|
|
private final long suiteId = 11;
|
|
private final long suiteId = 11;
|
|
private final String suiteTitle = "Schema Registry";
|
|
private final String suiteTitle = "Schema Registry";
|
|
- public static final String SECOND_LOCAL = "secondLocal";
|
|
|
|
- public static final String SCHEMA_AVRO_CREATE = "avro_schema";
|
|
|
|
- public static final String SCHEMA_JSON_CREATE = "json_schema";
|
|
|
|
- public static final String SCHEMA_PROTOBUF_CREATE = "protobuf_schema";
|
|
|
|
- public static final String SCHEMA_AVRO_API_UPDATE = "avro_schema_for_update_api";
|
|
|
|
- public static final String SCHEMA_AVRO_API = "avro_schema_api";
|
|
|
|
- public static final String SCHEMA_JSON_API = "json_schema_api";
|
|
|
|
- public static final String SCHEMA_PROTOBUF_API = "protobuf_schema_api";
|
|
|
|
- private static final String PATH_AVRO_VALUE = System.getProperty("user.dir") + "/src/test/resources/schema_avro_value.json";
|
|
|
|
- private static final String PATH_AVRO_FOR_UPDATE = System.getProperty("user.dir") + "/src/test/resources/schema_avro_for_update.json";
|
|
|
|
- private static final String PATH_PROTOBUF_VALUE = System.getProperty("user.dir") + "/src/test/resources/schema_protobuf_value.txt";
|
|
|
|
- private static final String PATH_JSON_VALUE = System.getProperty("user.dir") + "/src/test/resources/schema_Json_Value.json";
|
|
|
|
|
|
|
|
@BeforeAll
|
|
@BeforeAll
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@@ -63,18 +50,10 @@ public class SchemasTests extends BaseTest {
|
|
@CaseId(43)
|
|
@CaseId(43)
|
|
@Test
|
|
@Test
|
|
@Order(1)
|
|
@Order(1)
|
|
- void createSchemaAvro() throws IOException {
|
|
|
|
- pages.openMainPage()
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.clickCreateSchema()
|
|
|
|
- .setSubjectName(SCHEMA_AVRO_CREATE)
|
|
|
|
- .setSchemaField(readFileAsString(PATH_AVRO_VALUE))
|
|
|
|
- .selectSchemaTypeFromDropdown(SchemaCreateView.SchemaType.AVRO)
|
|
|
|
- .clickSubmit()
|
|
|
|
- .isOnSchemaViewPage();
|
|
|
|
- pages.mainPage
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.isSchemaVisible(SCHEMA_AVRO_CREATE);
|
|
|
|
|
|
+ void createSchemaAvro() {
|
|
|
|
+ SchemaSteps.INSTANCE.openPage(SCHEMA_REGISTRY);
|
|
|
|
+ SchemaSteps.createSchema(SchemaFactory.getSchema("AVRO"))
|
|
|
|
+ .isSchemaVisible(SCHEMA_AVRO_CREATE);
|
|
}
|
|
}
|
|
|
|
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@@ -85,16 +64,8 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(2)
|
|
@Order(2)
|
|
void updateSchemaAvro() {
|
|
void updateSchemaAvro() {
|
|
- pages.openMainPage()
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.openSchema(SCHEMA_AVRO_API_UPDATE)
|
|
|
|
- .isOnSchemaViewPage()
|
|
|
|
- .openEditSchema()
|
|
|
|
- .selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
|
|
|
|
- .setNewSchemaValue(readFileAsString(PATH_AVRO_FOR_UPDATE))
|
|
|
|
- .clickSubmit()
|
|
|
|
- .isOnSchemaViewPage()
|
|
|
|
- .isCompatibility(CompatibilityLevel.CompatibilityEnum.NONE);
|
|
|
|
|
|
+ SchemaSteps.INSTANCE.openPage(SCHEMA_REGISTRY);
|
|
|
|
+ SchemaSteps.updateSchemaAvro(SCHEMA_AVRO_API_UPDATE, PATH_AVRO_FOR_UPDATE);
|
|
}
|
|
}
|
|
|
|
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@@ -105,12 +76,9 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(3)
|
|
@Order(3)
|
|
void deleteSchemaAvro() {
|
|
void deleteSchemaAvro() {
|
|
- pages.openMainPage()
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.openSchema(SCHEMA_AVRO_API)
|
|
|
|
- .isOnSchemaViewPage()
|
|
|
|
- .removeSchema()
|
|
|
|
- .isNotVisible(SCHEMA_AVRO_API);
|
|
|
|
|
|
+ SchemaSteps.INSTANCE.openPage(SCHEMA_REGISTRY);
|
|
|
|
+ SchemaSteps.deleteSchema(SCHEMA_AVRO_API);
|
|
|
|
+ Assertions.assertTrue(SchemaSteps.schemaIsNotVisible(SCHEMA_AVRO_API));
|
|
}
|
|
}
|
|
|
|
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@@ -121,17 +89,9 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(4)
|
|
@Order(4)
|
|
void createSchemaJson() {
|
|
void createSchemaJson() {
|
|
- pages.openMainPage()
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.clickCreateSchema()
|
|
|
|
- .setSubjectName(SCHEMA_JSON_CREATE)
|
|
|
|
- .setSchemaField(readFileAsString(PATH_JSON_VALUE))
|
|
|
|
- .selectSchemaTypeFromDropdown(SchemaCreateView.SchemaType.JSON)
|
|
|
|
- .clickSubmit()
|
|
|
|
- .isOnSchemaViewPage();
|
|
|
|
- pages.mainPage
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.isSchemaVisible(SCHEMA_JSON_CREATE);
|
|
|
|
|
|
+ SchemaSteps.INSTANCE.openPage(SCHEMA_REGISTRY);
|
|
|
|
+ SchemaSteps.createSchema(SchemaFactory.getSchema("JSON"))
|
|
|
|
+ .isSchemaVisible(SCHEMA_JSON_CREATE);
|
|
}
|
|
}
|
|
|
|
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@@ -142,12 +102,9 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(5)
|
|
@Order(5)
|
|
void deleteSchemaJson() {
|
|
void deleteSchemaJson() {
|
|
- pages.openMainPage()
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.openSchema(SCHEMA_JSON_API)
|
|
|
|
- .isOnSchemaViewPage()
|
|
|
|
- .removeSchema()
|
|
|
|
- .isNotVisible(SCHEMA_JSON_API);
|
|
|
|
|
|
+ SchemaSteps.INSTANCE.openPage(SCHEMA_REGISTRY);
|
|
|
|
+ SchemaSteps.deleteSchema(SCHEMA_JSON_API);
|
|
|
|
+ Assertions.assertTrue(SchemaSteps.schemaIsNotVisible(SCHEMA_JSON_API));
|
|
}
|
|
}
|
|
|
|
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@@ -158,17 +115,9 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(6)
|
|
@Order(6)
|
|
void createSchemaProtobuf() {
|
|
void createSchemaProtobuf() {
|
|
- pages.openMainPage()
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.clickCreateSchema()
|
|
|
|
- .setSubjectName(SCHEMA_PROTOBUF_CREATE)
|
|
|
|
- .setSchemaField(readFileAsString(PATH_PROTOBUF_VALUE))
|
|
|
|
- .selectSchemaTypeFromDropdown(SchemaCreateView.SchemaType.PROTOBUF)
|
|
|
|
- .clickSubmit()
|
|
|
|
- .isOnSchemaViewPage();
|
|
|
|
- pages.mainPage
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.isSchemaVisible(SCHEMA_PROTOBUF_CREATE);
|
|
|
|
|
|
+ SchemaSteps.INSTANCE.openPage(SCHEMA_REGISTRY);
|
|
|
|
+ SchemaSteps.createSchema(SchemaFactory.getSchema("PROTOBUF"))
|
|
|
|
+ .isSchemaVisible(SCHEMA_PROTOBUF_CREATE);
|
|
}
|
|
}
|
|
|
|
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@@ -179,11 +128,8 @@ public class SchemasTests extends BaseTest {
|
|
@Test
|
|
@Test
|
|
@Order(7)
|
|
@Order(7)
|
|
void deleteSchemaProtobuf() {
|
|
void deleteSchemaProtobuf() {
|
|
- pages.openMainPage()
|
|
|
|
- .goToSideMenu(SECOND_LOCAL, MainPage.SideMenuOptions.SCHEMA_REGISTRY);
|
|
|
|
- pages.schemaRegistry.openSchema(SCHEMA_PROTOBUF_API)
|
|
|
|
- .isOnSchemaViewPage()
|
|
|
|
- .removeSchema()
|
|
|
|
- .isNotVisible(SCHEMA_PROTOBUF_API);
|
|
|
|
|
|
+ SchemaSteps.INSTANCE.openPage(SCHEMA_REGISTRY);
|
|
|
|
+ SchemaSteps.deleteSchema(SCHEMA_PROTOBUF_API);
|
|
|
|
+ Assertions.assertTrue(SchemaSteps.schemaIsNotVisible(SCHEMA_PROTOBUF_API));
|
|
}
|
|
}
|
|
}
|
|
}
|