Prepare steps for Schema Registry and Connector fixed #2288
This commit is contained in:
parent
5849f02770
commit
cfeb224e99
13 changed files with 290 additions and 128 deletions
|
@ -3,6 +3,7 @@ package com.provectus.kafka.ui.pages;
|
|||
import com.provectus.kafka.ui.pages.connector.ConnectorsList;
|
||||
import com.provectus.kafka.ui.pages.connector.ConnectorsView;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaRegistryList;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaView;
|
||||
import com.provectus.kafka.ui.pages.topic.TopicView;
|
||||
import com.provectus.kafka.ui.pages.topic.TopicsList;
|
||||
|
||||
|
@ -17,6 +18,7 @@ public class Pages {
|
|||
public ConnectorsList connectorsList = new ConnectorsList();
|
||||
public ConnectorsView connectorsView = new ConnectorsView();
|
||||
public SchemaRegistryList schemaRegistry = new SchemaRegistryList();
|
||||
public SchemaView schemaView = SchemaView.INSTANCE;
|
||||
|
||||
public MainPage open() {
|
||||
return openMainPage();
|
||||
|
|
|
@ -30,15 +30,15 @@ public class ConnectorsList {
|
|||
}
|
||||
|
||||
@Step("Click on button 'Create Connector'")
|
||||
public ConnectorCreateView clickCreateConnectorButton() {
|
||||
public static ConnectorCreateView clickCreateConnectorButton() {
|
||||
BrowserUtils.javaExecutorClick($x("//button[text()='Create Connector']"));
|
||||
return new ConnectorCreateView();
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public ConnectorsList openConnector(String connectorName) {
|
||||
public static ConnectorsList openConnector(String connectorName) {
|
||||
$(By.linkText(connectorName)).click();
|
||||
return this;
|
||||
return new ConnectorsList();
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
|
|
|
@ -21,7 +21,7 @@ public class SchemaCreateView {
|
|||
|
||||
public SchemaView clickSubmit() {
|
||||
BrowserUtils.javaExecutorClick(submitSchemaButton);
|
||||
return new SchemaView();
|
||||
return SchemaView.INSTANCE;
|
||||
}
|
||||
|
||||
public SchemaCreateView setSubjectName(String name) {
|
||||
|
|
|
@ -31,7 +31,7 @@ public class SchemaEditView {
|
|||
|
||||
public SchemaView clickSubmit() {
|
||||
BrowserUtils.javaExecutorClick($(By.xpath("//button[@type='submit']")));
|
||||
return new SchemaView();
|
||||
return SchemaView.INSTANCE;
|
||||
}
|
||||
|
||||
@Step("Set new schema value")
|
||||
|
|
|
@ -20,21 +20,20 @@ public class SchemaRegistryList {
|
|||
|
||||
public SchemaView openSchema(String schemaName) {
|
||||
$(By.xpath("//*[contains(text(),'" + schemaName + "')]")).click();
|
||||
return new SchemaView();
|
||||
return SchemaView.INSTANCE;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public SchemaRegistryList isNotVisible(String schemaName) {
|
||||
$x(String.format("//*[contains(text(),'%s')]",schemaName)).shouldNotBe(Condition.visible);
|
||||
return this;
|
||||
public boolean isNotVisible(String schemaName) {
|
||||
return $x(String.format("//*[contains(text(),'%s')]", schemaName)).is(Condition.not(Condition.visible));
|
||||
}
|
||||
|
||||
@Step
|
||||
public SchemaRegistryList isSchemaVisible(String schemaName) {
|
||||
public void isSchemaVisible(String schemaName) {
|
||||
$$("tbody td>a")
|
||||
.find(Condition.exactText(schemaName))
|
||||
.shouldBe(Condition.visible);
|
||||
return this;
|
||||
.find(Condition.exactText(schemaName)).is(Condition.visible);
|
||||
// element.shouldBe(Condition.visible);
|
||||
// return element.is(Condition.visible);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,9 @@ import static com.codeborne.selenide.Selenide.$x;
|
|||
|
||||
public class SchemaView {
|
||||
|
||||
public static final SchemaView INSTANCE = new SchemaView();
|
||||
private SchemaView(){};
|
||||
|
||||
@Step
|
||||
public SchemaView isOnSchemaViewPage() {
|
||||
$("div#schema").shouldBe(Condition.visible);
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.provectus.kafka.ui.steps.kafka.connectorssteps;
|
||||
|
||||
public final class ConnectorConstance {
|
||||
public static final String LOCAL_CLUSTER = "local";
|
||||
public static final String SINK_CONNECTOR = "sink_postgres_activities_e2e_checks";
|
||||
public static final String TOPIC_FOR_CONNECTOR = "topic_for_connector";
|
||||
public static final String TOPIC_FOR_DELETE_CONNECTOR = "topic_for_delete_connector";
|
||||
public static final String TOPIC_FOR_UPDATE_CONNECTOR = "topic_for_update_connector";
|
||||
public static final String FIRST_CONNECTOR = "first";
|
||||
public static final String CONNECTOR_FOR_DELETE = "sink_postgres_activities_e2e_checks_for_delete";
|
||||
public static final String CONNECTOR_FOR_UPDATE = "sink_postgres_activities_e2e_checks_for_update";
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.provectus.kafka.ui.steps.kafka.connectorssteps;
|
||||
|
||||
import com.provectus.kafka.ui.extensions.FileUtils;
|
||||
import com.provectus.kafka.ui.pages.Pages;
|
||||
import com.provectus.kafka.ui.pages.connector.ConnectorsList;
|
||||
import io.qase.api.annotation.Step;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static com.provectus.kafka.ui.steps.kafka.connectorssteps.ConnectorConstance.LOCAL_CLUSTER;
|
||||
import static com.provectus.kafka.ui.steps.kafka.connectorssteps.ConnectorConstance.SINK_CONNECTOR;
|
||||
|
||||
public class ConnectorsSteps extends Pages {
|
||||
public static final ConnectorsSteps INSTANCE = new ConnectorsSteps();
|
||||
|
||||
private ConnectorsSteps() {}
|
||||
|
||||
@Step("open connector page")
|
||||
public ConnectorsSteps openPage(String clusterName) {
|
||||
openConnectorsList(clusterName);
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@Step("open connector with name {connectorName}")
|
||||
public ConnectorsSteps openConnector(String connectorName) {
|
||||
ConnectorsList.openConnector(connectorName);
|
||||
connectorsView.connectorIsVisibleOnOverview();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step("should create a connector")
|
||||
public ConnectorsSteps createConnector() throws IOException, InterruptedException {
|
||||
ConnectorsList.clickCreateConnectorButton()
|
||||
.isOnConnectorCreatePage()
|
||||
.setConnectorConfig(
|
||||
SINK_CONNECTOR,
|
||||
FileUtils.getResourceAsString("config_for_create_connector.json"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step("connector should be visible in the list")
|
||||
public void isConnectorVisible(String connectorName, String connectorTopic) {
|
||||
openConnectorsList(LOCAL_CLUSTER);
|
||||
connectorsList.isOnPage()
|
||||
.connectorIsVisibleInList(connectorName, connectorTopic);
|
||||
}
|
||||
|
||||
@Step("should update a connector")
|
||||
public ConnectorsSteps updateConnector() throws IOException {
|
||||
connectorsView.openEditConfig()
|
||||
.updConnectorConfig(FileUtils.getResourceAsString("config_for_update_connector.json"));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step("connector should not be visible")
|
||||
public void connectorIsNotVisible(String connectorName) {
|
||||
openConnectorsList(LOCAL_CLUSTER)
|
||||
.isNotVisible(connectorName);
|
||||
}
|
||||
|
||||
@Step("should delete connector")
|
||||
public ConnectorsSteps deleteConnector() {
|
||||
connectorsView.clickDeleteButton();
|
||||
return this;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.provectus.kafka.ui.steps.kafka.schemasteps;
|
||||
|
||||
public class SchemaConstance {
|
||||
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";
|
||||
public static final String PATH_AVRO_VALUE = System.getProperty("user.dir") + "/src/test/resources/schema_avro_value.json";
|
||||
public static final String PATH_AVRO_FOR_UPDATE = System.getProperty("user.dir") + "/src/test/resources/schema_avro_for_update.json";
|
||||
public static final String PATH_PROTOBUF_VALUE = System.getProperty("user.dir") + "/src/test/resources/schema_protobuf_value.txt";
|
||||
public static final String PATH_JSON_VALUE = System.getProperty("user.dir") + "/src/test/resources/schema_Json_Value.json";
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.provectus.kafka.ui.steps.kafka.schemasteps;
|
||||
|
||||
import com.provectus.kafka.ui.pages.Pages;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaCreateView;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaView;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static com.provectus.kafka.ui.steps.kafka.schemasteps.SchemaConstance.*;
|
||||
import static org.apache.kafka.common.utils.Utils.readFileAsString;
|
||||
|
||||
public class SchemaFactory {
|
||||
|
||||
private static final Supplier<SchemaView> schemaAvro = () -> {
|
||||
try {
|
||||
return Pages.INSTANCE.schemaRegistry.clickCreateSchema()
|
||||
.setSubjectName(SCHEMA_AVRO_CREATE)
|
||||
.setSchemaField(readFileAsString(PATH_AVRO_VALUE))
|
||||
.selectSchemaTypeFromDropdown(SchemaCreateView.SchemaType.AVRO)
|
||||
.clickSubmit();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return SchemaView.INSTANCE;
|
||||
}
|
||||
};
|
||||
|
||||
private static final Supplier<SchemaView> schemaJson = () -> {
|
||||
try {
|
||||
return Pages.INSTANCE.schemaRegistry.clickCreateSchema()
|
||||
.setSubjectName(SCHEMA_JSON_CREATE)
|
||||
.setSchemaField(readFileAsString(PATH_JSON_VALUE))
|
||||
.selectSchemaTypeFromDropdown(SchemaCreateView.SchemaType.JSON)
|
||||
.clickSubmit();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return SchemaView.INSTANCE;
|
||||
}
|
||||
};
|
||||
|
||||
private static final Supplier<SchemaView> schemaProtobuf = () -> {
|
||||
try {
|
||||
return Pages.INSTANCE.schemaRegistry.clickCreateSchema()
|
||||
.setSubjectName(SCHEMA_PROTOBUF_CREATE)
|
||||
.setSchemaField(readFileAsString(PATH_PROTOBUF_VALUE))
|
||||
.selectSchemaTypeFromDropdown(SchemaCreateView.SchemaType.PROTOBUF)
|
||||
.clickSubmit();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return SchemaView.INSTANCE;
|
||||
}
|
||||
};
|
||||
|
||||
public static Map<String, Supplier<SchemaView>> MAP = Map.of(
|
||||
"AVRO", schemaAvro,
|
||||
"JSON", schemaJson,
|
||||
"PROTOBUF", schemaProtobuf);
|
||||
|
||||
public static Supplier<SchemaView> getSchema(String schemaType){
|
||||
return MAP.get(schemaType);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.provectus.kafka.ui.steps.kafka.schemasteps;
|
||||
|
||||
import com.provectus.kafka.ui.api.model.CompatibilityLevel;
|
||||
import com.provectus.kafka.ui.pages.MainPage;
|
||||
import com.provectus.kafka.ui.pages.Pages;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaRegistryList;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaView;
|
||||
import com.provectus.kafka.ui.tests.SchemasTests;
|
||||
import io.qase.api.annotation.Step;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static com.provectus.kafka.ui.steps.kafka.schemasteps.SchemaConstance.SCHEMA_AVRO_API_UPDATE;
|
||||
import static com.provectus.kafka.ui.steps.kafka.schemasteps.SchemaConstance.SECOND_LOCAL;
|
||||
import static org.apache.kafka.common.utils.Utils.readFileAsString;
|
||||
|
||||
|
||||
public class SchemaSteps extends Pages {
|
||||
public static final SchemaSteps INSTANCE = new SchemaSteps();
|
||||
public static SchemasTests schemasTests = new SchemasTests();
|
||||
public static MainPage mainPage = new MainPage();
|
||||
|
||||
private SchemaSteps() {}
|
||||
|
||||
@Step("Open page schema")
|
||||
public void openPage(MainPage.SideMenuOptions sideMenuOptions) throws IllegalArgumentException {
|
||||
openMainPage()
|
||||
.goToSideMenu(SECOND_LOCAL, sideMenuOptions);
|
||||
}
|
||||
|
||||
@Step("Create schema")
|
||||
public static SchemaSteps createSchema(Supplier<SchemaView> schemaType) {
|
||||
schemaType.get();
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@Step("Is on schema view page")
|
||||
public void isOnSchemaPage() {
|
||||
schemaView.isOnSchemaViewPage();
|
||||
}
|
||||
|
||||
@Step("Is schema visible")
|
||||
public void isSchemaVisible(String schemaName) {
|
||||
schemaRegistry.isSchemaVisible(schemaName);
|
||||
}
|
||||
|
||||
@Step("Update schema avro")
|
||||
public static void updateSchemaAvro(String schemaAvroApiUpdate, String pathAvroForUpdate) throws IOException {
|
||||
new SchemaRegistryList().openSchema(SCHEMA_AVRO_API_UPDATE)
|
||||
.openEditSchema()
|
||||
.selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
|
||||
.setNewSchemaValue(readFileAsString(pathAvroForUpdate))
|
||||
.clickSubmit()
|
||||
.isCompatibility(CompatibilityLevel.CompatibilityEnum.NONE);
|
||||
new SchemaSteps();
|
||||
}
|
||||
|
||||
@Step("Delete schema with type")
|
||||
public static void deleteSchema(String schemaAvroApi) {
|
||||
Pages.INSTANCE.schemaRegistry
|
||||
.openSchema(schemaAvroApi)
|
||||
.removeSchema();
|
||||
}
|
||||
|
||||
@Step("Schema is not visible")
|
||||
public static boolean schemaIsNotVisible(String schemaAvroApi) {
|
||||
return Pages.INSTANCE.schemaRegistry
|
||||
.isNotVisible(schemaAvroApi);
|
||||
}
|
||||
}
|
|
@ -4,28 +4,23 @@ import com.provectus.kafka.ui.base.BaseTest;
|
|||
import com.provectus.kafka.ui.extensions.FileUtils;
|
||||
import com.provectus.kafka.ui.helpers.ApiHelper;
|
||||
import com.provectus.kafka.ui.helpers.Helpers;
|
||||
import com.provectus.kafka.ui.steps.kafka.connectorssteps.ConnectorsSteps;
|
||||
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;
|
||||
import io.qase.api.annotation.CaseId;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import com.provectus.kafka.ui.utils.qaseIO.annotation.Suite;
|
||||
|
||||
import static com.provectus.kafka.ui.steps.kafka.connectorssteps.ConnectorConstance.*;
|
||||
|
||||
public class ConnectorsTests extends BaseTest {
|
||||
|
||||
private final long suiteId = 10;
|
||||
private final String suiteTitle = "Kafka Connect";
|
||||
public static final String LOCAL_CLUSTER = "local";
|
||||
public static final String SINK_CONNECTOR = "sink_postgres_activities_e2e_checks";
|
||||
public static final String TOPIC_FOR_CONNECTOR = "topic_for_connector";
|
||||
public static final String TOPIC_FOR_DELETE_CONNECTOR = "topic_for_delete_connector";
|
||||
public static final String TOPIC_FOR_UPDATE_CONNECTOR = "topic_for_update_connector";
|
||||
public static final String FIRST_CONNECTOR = "first";
|
||||
public static final String CONNECTOR_FOR_DELETE = "sink_postgres_activities_e2e_checks_for_delete";
|
||||
public static final String CONNECTOR_FOR_UPDATE = "sink_postgres_activities_e2e_checks_for_update";
|
||||
|
||||
@BeforeAll
|
||||
@SneakyThrows
|
||||
|
@ -69,16 +64,9 @@ public class ConnectorsTests extends BaseTest {
|
|||
@CaseId(42)
|
||||
@Test
|
||||
public void createConnector() {
|
||||
pages.openConnectorsList(LOCAL_CLUSTER)
|
||||
.isOnPage()
|
||||
.clickCreateConnectorButton()
|
||||
.isOnConnectorCreatePage()
|
||||
.setConnectorConfig(
|
||||
SINK_CONNECTOR,
|
||||
FileUtils.getResourceAsString("config_for_create_connector.json"));
|
||||
pages.openConnectorsList(LOCAL_CLUSTER)
|
||||
.isOnPage()
|
||||
.connectorIsVisibleInList(SINK_CONNECTOR, TOPIC_FOR_CONNECTOR);
|
||||
ConnectorsSteps.INSTANCE.openPage(LOCAL_CLUSTER)
|
||||
.createConnector()
|
||||
.isConnectorVisible(SINK_CONNECTOR, TOPIC_FOR_CONNECTOR);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
|
@ -88,14 +76,10 @@ public class ConnectorsTests extends BaseTest {
|
|||
@CaseId(196)
|
||||
@Test
|
||||
public void updateConnector() {
|
||||
pages.openConnectorsList(LOCAL_CLUSTER)
|
||||
.isOnPage()
|
||||
.openConnector(CONNECTOR_FOR_UPDATE);
|
||||
pages.connectorsView.connectorIsVisibleOnOverview();
|
||||
pages.connectorsView.openEditConfig()
|
||||
.updConnectorConfig(FileUtils.getResourceAsString("config_for_update_connector.json"));
|
||||
pages.openConnectorsList(LOCAL_CLUSTER)
|
||||
.connectorIsVisibleInList(CONNECTOR_FOR_UPDATE, TOPIC_FOR_UPDATE_CONNECTOR);
|
||||
ConnectorsSteps.INSTANCE.openPage(LOCAL_CLUSTER)
|
||||
.openConnector(CONNECTOR_FOR_UPDATE)
|
||||
.updateConnector()
|
||||
.isConnectorVisible(CONNECTOR_FOR_UPDATE, TOPIC_FOR_UPDATE_CONNECTOR);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
|
@ -105,11 +89,9 @@ public class ConnectorsTests extends BaseTest {
|
|||
@CaseId(195)
|
||||
@Test
|
||||
public void deleteConnector() {
|
||||
pages.openConnectorsList(LOCAL_CLUSTER)
|
||||
.isOnPage()
|
||||
.openConnector(CONNECTOR_FOR_DELETE);
|
||||
pages.connectorsView.clickDeleteButton();
|
||||
pages.openConnectorsList(LOCAL_CLUSTER)
|
||||
.isNotVisible(CONNECTOR_FOR_DELETE);
|
||||
ConnectorsSteps.INSTANCE.openPage(LOCAL_CLUSTER)
|
||||
.openConnector(CONNECTOR_FOR_DELETE)
|
||||
.deleteConnector()
|
||||
.connectorIsNotVisible(CONNECTOR_FOR_DELETE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
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.base.BaseTest;
|
||||
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.annotation.AutomationStatus;
|
||||
import com.provectus.kafka.ui.utils.qaseIO.annotation.Suite;
|
||||
import io.qase.api.annotation.CaseId;
|
||||
import lombok.SneakyThrows;
|
||||
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;
|
||||
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
@ -22,18 +21,6 @@ public class SchemasTests extends BaseTest {
|
|||
|
||||
private final long suiteId = 11;
|
||||
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
|
||||
@SneakyThrows
|
||||
|
@ -63,18 +50,10 @@ public class SchemasTests extends BaseTest {
|
|||
@CaseId(43)
|
||||
@Test
|
||||
@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
|
||||
|
@ -85,16 +64,8 @@ public class SchemasTests extends BaseTest {
|
|||
@Test
|
||||
@Order(2)
|
||||
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
|
||||
|
@ -105,12 +76,9 @@ public class SchemasTests extends BaseTest {
|
|||
@Test
|
||||
@Order(3)
|
||||
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
|
||||
|
@ -121,17 +89,9 @@ public class SchemasTests extends BaseTest {
|
|||
@Test
|
||||
@Order(4)
|
||||
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
|
||||
|
@ -142,12 +102,9 @@ public class SchemasTests extends BaseTest {
|
|||
@Test
|
||||
@Order(5)
|
||||
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
|
||||
|
@ -158,17 +115,9 @@ public class SchemasTests extends BaseTest {
|
|||
@Test
|
||||
@Order(6)
|
||||
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
|
||||
|
@ -179,11 +128,8 @@ public class SchemasTests extends BaseTest {
|
|||
@Test
|
||||
@Order(7)
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue