|
@@ -4,6 +4,7 @@ import com.codeborne.selenide.ClickOptions;
|
|
|
import com.codeborne.selenide.Condition;
|
|
|
import com.codeborne.selenide.ElementsCollection;
|
|
|
import com.codeborne.selenide.SelenideElement;
|
|
|
+import io.qameta.allure.Step;
|
|
|
import org.openqa.selenium.By;
|
|
|
import com.provectus.kafka.ui.utils.BrowserUtils;
|
|
|
|
|
@@ -14,43 +15,43 @@ public class TopicCreateEditSettingsView {
|
|
|
|
|
|
private final SelenideElement timeToRetain = $(By.cssSelector("input#timeToRetain"));
|
|
|
private final SelenideElement maxMessageBytes = $(By.name("maxMessageBytes"));
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView setTopicName(String topicName) {
|
|
|
$("input#topicFormName").setValue(topicName);
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView setMinInsyncReplicas(Integer minInsyncReplicas) {
|
|
|
- $("input[name=minInsyncReplicas]").setValue(minInsyncReplicas.toString());
|
|
|
+ $("input[name=minInSyncReplicas]").setValue(minInsyncReplicas.toString());
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView setTimeToRetainDataInMs(Long ms) {
|
|
|
timeToRetain.setValue(ms.toString());
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView setTimeToRetainDataInMs(String ms) {
|
|
|
timeToRetain.setValue(ms);
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView setMaxSizeOnDiskInGB(String value) {
|
|
|
KafkaUISelectElement kafkaUISelectElement = new KafkaUISelectElement("retentionBytes");
|
|
|
kafkaUISelectElement.selectByVisibleText(value);
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView setMaxMessageBytes(Long bytes) {
|
|
|
maxMessageBytes.setValue(bytes.toString());
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView setMaxMessageBytes(String bytes) {
|
|
|
return setMaxMessageBytes(Long.parseLong(bytes));
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView setTimeToRetainDataInMsUsingButtons(String value) {
|
|
|
timeToRetain
|
|
|
.parent()
|
|
@@ -61,31 +62,31 @@ public class TopicCreateEditSettingsView {
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView selectCleanupPolicy(CleanupPolicyValue cleanupPolicyValue) {
|
|
|
return selectFromDropDownByOptionValue("cleanupPolicy",
|
|
|
cleanupPolicyValue.getOptionValue());
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView selectCleanupPolicy(String cleanupPolicyOptionValue) {
|
|
|
$("ul#topicFormCleanupPolicy").click();
|
|
|
$x("//li[text()='" + cleanupPolicyOptionValue + "']").click();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView selectRetentionBytes(String visibleValue) {
|
|
|
return selectFromDropDownByVisibleText("retentionBytes", visibleValue);
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView selectRetentionBytes(Long optionValue) {
|
|
|
return selectFromDropDownByOptionValue("retentionBytes", optionValue.toString());
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicView sendData() {
|
|
|
BrowserUtils.javaExecutorClick($x("//button[@type='submit']"));
|
|
|
return new TopicView();
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView addCustomParameter(String customParameterName,
|
|
|
String customParameterValue) {
|
|
|
ElementsCollection customParametersElements =
|
|
@@ -109,7 +110,7 @@ public class TopicCreateEditSettingsView {
|
|
|
.setValue(customParameterValue);
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView updateCustomParameter(String customParameterName,
|
|
|
String customParameterValue) {
|
|
|
SelenideElement selenideElement = $$("ul[role=listbox][name^=customParams][name$=name]")
|
|
@@ -121,7 +122,7 @@ public class TopicCreateEditSettingsView {
|
|
|
$(String.format("input[name^=%s]", name)).setValue(customParameterValue);
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView cleanupPolicyIs(String value) {
|
|
|
String cleanupPolicy = new KafkaUISelectElement("cleanupPolicy")
|
|
|
.getCurrentValue();
|
|
@@ -130,7 +131,7 @@ public class TopicCreateEditSettingsView {
|
|
|
.isEqualToIgnoringCase(value);
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView timeToRetainIs(String time) {
|
|
|
String value = timeToRetain.getValue();
|
|
|
assertThat(value)
|
|
@@ -138,7 +139,7 @@ public class TopicCreateEditSettingsView {
|
|
|
.isEqualTo(time);
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView maxSizeOnDiskIs(String size) {
|
|
|
String retentionBytes = new KafkaUISelectElement("retentionBytes")
|
|
|
.getCurrentValue();
|
|
@@ -147,7 +148,7 @@ public class TopicCreateEditSettingsView {
|
|
|
.isEqualTo(size);
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+ @Step
|
|
|
public TopicCreateEditSettingsView maxMessageBytesIs(String bytes) {
|
|
|
String value = maxMessageBytes.getValue();
|
|
|
assertThat(value)
|