[e2e] Rename POM classes according to their type and naming on UI (#2698)
* Renamed classes for same name with UI * Facade refactored * Deleted SchemaCreateView.java * accompanying changes * deleted SchemaCreateView.java * delete ConnectorDetails.java outdated * add new ConnectorDetails class * refactored of ConnectorCreateForm * Added spaces between methods
This commit is contained in:
parent
b19b9d82e9
commit
f8f3d87259
15 changed files with 160 additions and 173 deletions
|
@ -10,16 +10,16 @@ import static com.codeborne.selenide.Selenide.sleep;
|
|||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
import static com.provectus.kafka.ui.utilities.screenshots.Screenshooter.log;
|
||||
|
||||
public class ConnectorCreateView {
|
||||
public class ConnectorCreateForm {
|
||||
|
||||
SelenideElement nameField = $(By.xpath("//input[@name='name']"));
|
||||
SelenideElement contentTextArea = $(".ace_text-input");
|
||||
SelenideElement submitButton = $(By.xpath("//button[@type='submit']"));
|
||||
protected SelenideElement nameField = $(By.xpath("//input[@name='name']"));
|
||||
protected SelenideElement contentTextArea = $(".ace_text-input");
|
||||
protected SelenideElement submitButton = $(By.xpath("//button[@type='submit']"));
|
||||
|
||||
private static final String path = "/ui/clusters/secondLocal/connectors/create_new";
|
||||
|
||||
@Step("Set connector config JSON")
|
||||
public ConnectorsView setConnectorConfig(String connectName, String configJson) {
|
||||
public ConnectorDetails setConnectorConfig(String connectName, String configJson) {
|
||||
nameField.setValue(connectName);
|
||||
$("#config").click();
|
||||
contentTextArea.setValue("");
|
||||
|
@ -28,11 +28,11 @@ public class ConnectorCreateView {
|
|||
clickByJavaScript(submitButton);
|
||||
sleep(4000);
|
||||
log.info("Connector config is submitted");
|
||||
return new ConnectorsView();
|
||||
return new ConnectorDetails();
|
||||
}
|
||||
|
||||
@Step
|
||||
public ConnectorCreateView waitUntilScreenReady() {
|
||||
public ConnectorCreateForm waitUntilScreenReady() {
|
||||
nameField.shouldBe(Condition.visible);
|
||||
return this;
|
||||
}
|
|
@ -11,7 +11,7 @@ import static com.codeborne.selenide.Selenide.sleep;
|
|||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
import static com.provectus.kafka.ui.utilities.screenshots.Screenshooter.log;
|
||||
|
||||
public class ConnectorsView {
|
||||
public class ConnectorDetails {
|
||||
protected SelenideElement dotMenuBtn = $(By.xpath("//button[@aria-label='Dropdown Toggle']"));
|
||||
protected SelenideElement deleteBtn = $(By.xpath("//li/div[text()='Delete']"));
|
||||
protected SelenideElement confirmBtnMdl = $(By.xpath("//div[@role='dialog']//button[text()='Confirm']"));
|
||||
|
@ -19,7 +19,7 @@ public class ConnectorsView {
|
|||
protected SelenideElement contentTextArea = $("[wrap]");
|
||||
|
||||
@Step
|
||||
public ConnectorsView waitUntilScreenReady() {
|
||||
public ConnectorDetails waitUntilScreenReady() {
|
||||
$(By.xpath("//a[text() ='Tasks']")).shouldBe(Condition.visible);
|
||||
$(By.xpath("//a[text() ='Config']")).shouldBe(Condition.visible);
|
||||
$(By.xpath("//a[text() ='Overview']")).shouldBe(Condition.visible);
|
||||
|
@ -27,13 +27,13 @@ public class ConnectorsView {
|
|||
}
|
||||
|
||||
@Step()
|
||||
public ConnectorsView openConfigTab() {
|
||||
public ConnectorDetails openConfigTab() {
|
||||
clickByJavaScript($(By.xpath("//a[text() ='Config']")));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step()
|
||||
public ConnectorsView setConfig(String configJson) {
|
||||
public ConnectorDetails setConfig(String configJson) {
|
||||
$("#config").click();
|
||||
contentTextArea.sendKeys(Keys.LEFT_CONTROL + "a");
|
||||
contentTextArea.setValue("");
|
||||
|
@ -46,26 +46,26 @@ public class ConnectorsView {
|
|||
}
|
||||
|
||||
@Step()
|
||||
public ConnectorsView openDotMenu() {
|
||||
public ConnectorDetails openDotMenu() {
|
||||
clickByJavaScript(dotMenuBtn);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step()
|
||||
public ConnectorsView clickDeleteButton() {
|
||||
public ConnectorDetails clickDeleteButton() {
|
||||
clickByJavaScript(deleteBtn);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step()
|
||||
public ConnectorsView clickConfirmButton() {
|
||||
public ConnectorDetails clickConfirmButton() {
|
||||
confirmBtnMdl.shouldBe(Condition.enabled).click();
|
||||
confirmBtnMdl.shouldBe(Condition.disappear);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step()
|
||||
public ConnectorsView deleteConnector() {
|
||||
public ConnectorDetails deleteConnector() {
|
||||
openDotMenu();
|
||||
clickDeleteButton();
|
||||
clickConfirmButton();
|
|
@ -2,42 +2,42 @@ package com.provectus.kafka.ui.pages.connector;
|
|||
|
||||
import com.codeborne.selenide.Condition;
|
||||
import com.codeborne.selenide.Selenide;
|
||||
import com.provectus.kafka.ui.utilities.WaitUtils;
|
||||
import com.provectus.kafka.ui.settings.Source;
|
||||
import com.provectus.kafka.ui.utilities.WaitUtils;
|
||||
import io.qameta.allure.Step;
|
||||
import lombok.experimental.ExtensionMethod;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
import static com.codeborne.selenide.Selenide.$;
|
||||
import static com.codeborne.selenide.Selenide.$x;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.isVisible;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.isVisible;
|
||||
|
||||
@ExtensionMethod(WaitUtils.class)
|
||||
public class ConnectorsList {
|
||||
public class KafkaConnectList {
|
||||
|
||||
private static final String path = "/ui/clusters/%s/connectors";
|
||||
|
||||
@Step("Open URL to {cluster}")
|
||||
public ConnectorsList goTo(String cluster) {
|
||||
public KafkaConnectList goTo(String cluster) {
|
||||
Selenide.open(Source.BASE_WEB_URL + String.format(path, cluster));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public ConnectorsList waitUntilScreenReady() {
|
||||
public KafkaConnectList waitUntilScreenReady() {
|
||||
$(By.xpath("//h1[text()='Connectors']")).shouldBe(Condition.visible);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step("Click on button 'Create Connector'")
|
||||
public ConnectorCreateView clickCreateConnectorButton() {
|
||||
public ConnectorCreateForm clickCreateConnectorButton() {
|
||||
clickByJavaScript($x("//button[text()='Create Connector']"));
|
||||
return new ConnectorCreateView();
|
||||
return new ConnectorCreateForm();
|
||||
}
|
||||
|
||||
@Step
|
||||
public ConnectorsList openConnector(String connectorName) {
|
||||
public KafkaConnectList openConnector(String connectorName) {
|
||||
$(By.linkText(connectorName)).click();
|
||||
return this;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class ConnectorsList {
|
|||
}
|
||||
|
||||
@Step
|
||||
public ConnectorsList connectorIsUpdatedInList(String connectorName, String topicName) {
|
||||
public KafkaConnectList connectorIsUpdatedInList(String connectorName, String topicName) {
|
||||
$(By.xpath(String.format("//a[text() = '%s']", connectorName))).shouldBe(Condition.visible);
|
||||
By.xpath(String.format("//a[text() = '%s']", topicName)).refreshUntil(Condition.visible);
|
||||
return this;
|
|
@ -1,6 +1,5 @@
|
|||
package com.provectus.kafka.ui.pages.schema;
|
||||
|
||||
import com.codeborne.selenide.Condition;
|
||||
import com.codeborne.selenide.Selenide;
|
||||
import com.codeborne.selenide.SelenideElement;
|
||||
import com.provectus.kafka.ui.api.model.CompatibilityLevel;
|
||||
|
@ -13,31 +12,48 @@ import static com.codeborne.selenide.Selenide.$;
|
|||
import static com.codeborne.selenide.Selenide.$x;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
|
||||
public class SchemaEditView {
|
||||
public class SchemaCreateForm {
|
||||
|
||||
protected SelenideElement subjectName = $(By.xpath("//input[@name='subject']"));
|
||||
protected SelenideElement schemaField = $(By.xpath("//textarea[@name='schema']"));
|
||||
protected SelenideElement submitSchemaButton = $(By.xpath("//button[@type='submit']"));
|
||||
protected SelenideElement newSchemaTextArea = $("#newSchema [wrap]");
|
||||
protected SelenideElement schemaTypeDropDown = $x("//ul[@name='schemaType']");
|
||||
|
||||
@Step
|
||||
public SchemaEditView selectSchemaTypeFromDropdown(SchemaType schemaType) {
|
||||
$x("//ul[@name='schemaType']").click();
|
||||
public SchemaCreateForm setSubjectName(String name) {
|
||||
subjectName.setValue(name);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public SchemaCreateForm setSchemaField(String text) {
|
||||
schemaField.setValue(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public SchemaCreateForm selectSchemaTypeFromDropdown(SchemaType schemaType) {
|
||||
$("ul[role='listbox']").click();
|
||||
$x("//li[text()='" + schemaType.getValue() + "']").click();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public SchemaEditView selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum level) {
|
||||
public SchemaDetails clickSubmit() {
|
||||
clickByJavaScript(submitSchemaButton);
|
||||
return new SchemaDetails();
|
||||
}
|
||||
|
||||
@Step
|
||||
public SchemaCreateForm selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum level) {
|
||||
$x("//ul[@name='compatibilityLevel']").click();
|
||||
$x("//li[text()='" + level.getValue() + "']").click();
|
||||
return this;
|
||||
}
|
||||
@Step
|
||||
public SchemaView clickSubmit() {
|
||||
clickByJavaScript($(By.xpath("//button[@type='submit']")));
|
||||
return new SchemaView();
|
||||
}
|
||||
|
||||
@Step("Set new schema value")
|
||||
public SchemaEditView setNewSchemaValue(String configJson) {
|
||||
public SchemaCreateForm setNewSchemaValue(String configJson) {
|
||||
$("#newSchema").click();
|
||||
newSchemaTextArea.sendKeys(Keys.CONTROL + "a", Keys.BACK_SPACE);
|
||||
Selenide.executeJavaScript("arguments[0].value = '';", $("#newSchema"));
|
||||
|
@ -45,22 +61,15 @@ public class SchemaEditView {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public SchemaRegistryList removeSchema() {
|
||||
$(By.xpath("//*[contains(text(),'Remove')]")).click();
|
||||
$(By.xpath("//*[text()='Confirm']")).shouldBe(Condition.visible).click();
|
||||
return new SchemaRegistryList();
|
||||
}
|
||||
|
||||
@Step
|
||||
public boolean isSchemaDropDownDisabled(){
|
||||
boolean disabled = false;
|
||||
try{
|
||||
String attribute = schemaTypeDropDown.getAttribute("disabled");
|
||||
disabled = true;
|
||||
String attribute = schemaTypeDropDown.getAttribute("disabled");
|
||||
disabled = true;
|
||||
}
|
||||
catch (Throwable ignored){
|
||||
}
|
||||
return disabled;
|
||||
return disabled;
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package com.provectus.kafka.ui.pages.schema;
|
||||
|
||||
import com.codeborne.selenide.SelenideElement;
|
||||
import com.provectus.kafka.ui.api.model.SchemaType;
|
||||
import io.qameta.allure.Step;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
import static com.codeborne.selenide.Selenide.$;
|
||||
import static com.codeborne.selenide.Selenide.$x;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
|
||||
public class SchemaCreateView {
|
||||
|
||||
private final SelenideElement subjectName = $(By.xpath("//input[@name='subject']"));
|
||||
private final SelenideElement schemaField = $(By.xpath("//textarea[@name='schema']"));
|
||||
private final SelenideElement submitSchemaButton = $(By.xpath("//button[@type='submit']"));
|
||||
@Step
|
||||
public SchemaCreateView selectSchemaTypeFromDropdown(SchemaType schemaType) {
|
||||
$("ul[role='listbox']").click();
|
||||
$x("//li[text()='" + schemaType.getValue() + "']").click();
|
||||
return this;
|
||||
}
|
||||
@Step
|
||||
public SchemaView clickSubmit() {
|
||||
clickByJavaScript(submitSchemaButton);
|
||||
return new SchemaView();
|
||||
}
|
||||
@Step
|
||||
public SchemaCreateView setSubjectName(String name) {
|
||||
subjectName.setValue(name);
|
||||
return this;
|
||||
}
|
||||
@Step
|
||||
public SchemaCreateView setSchemaField(String text) {
|
||||
schemaField.setValue(text);
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -8,12 +8,12 @@ import org.openqa.selenium.By;
|
|||
import static com.codeborne.selenide.Selenide.*;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
|
||||
public class SchemaView {
|
||||
public class SchemaDetails {
|
||||
|
||||
protected SelenideElement dotMenuBtn = $$x("//button[@aria-label='Dropdown Toggle']").first();
|
||||
|
||||
@Step
|
||||
public SchemaView waitUntilScreenReady() {
|
||||
public SchemaDetails waitUntilScreenReady() {
|
||||
$("div#schema").shouldBe(Condition.visible);
|
||||
return this;
|
||||
}
|
||||
|
@ -24,10 +24,11 @@ public class SchemaView {
|
|||
}
|
||||
|
||||
@Step
|
||||
public SchemaEditView openEditSchema(){
|
||||
public SchemaDetails openEditSchema(){
|
||||
$x("//button[text()= 'Edit Schema']").click();
|
||||
return new SchemaEditView();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public SchemaRegistryList removeSchema() {
|
||||
clickByJavaScript(dotMenuBtn);
|
|
@ -5,24 +5,25 @@ import com.codeborne.selenide.SelenideElement;
|
|||
import io.qameta.allure.Step;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
import static com.codeborne.selenide.Selenide.*;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.isVisible;
|
||||
import static com.codeborne.selenide.Selenide.$;
|
||||
import static com.codeborne.selenide.Selenide.$x;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.isVisible;
|
||||
|
||||
public class SchemaRegistryList {
|
||||
|
||||
private final SelenideElement schemaButton = $(By.xpath("//*[contains(text(),'Create Schema')]"));
|
||||
|
||||
@Step
|
||||
public SchemaCreateView clickCreateSchema() {
|
||||
public SchemaCreateForm clickCreateSchema() {
|
||||
clickByJavaScript(schemaButton);
|
||||
return new SchemaCreateView();
|
||||
return new SchemaCreateForm();
|
||||
}
|
||||
|
||||
@Step
|
||||
public SchemaView openSchema(String schemaName) {
|
||||
public SchemaDetails openSchema(String schemaName) {
|
||||
$(By.xpath("//*[contains(text(),'" + schemaName + "')]")).click();
|
||||
return new SchemaView();
|
||||
return new SchemaDetails();
|
||||
}
|
||||
|
||||
@Step
|
||||
|
|
|
@ -39,10 +39,10 @@ public class ProduceMessagePanel {
|
|||
}
|
||||
|
||||
@Step
|
||||
public TopicView submitProduceMessage() {
|
||||
public TopicDetails submitProduceMessage() {
|
||||
submitBtn.shouldBe(Condition.enabled).click();
|
||||
submitBtn.shouldBe(Condition.disappear);
|
||||
refresh();
|
||||
return new TopicView().waitUntilScreenReady();
|
||||
return new TopicDetails().waitUntilScreenReady();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,48 +11,55 @@ import static com.codeborne.selenide.Selenide.*;
|
|||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class TopicCreateEditSettingsView {
|
||||
public class TopicCreateEditForm {
|
||||
|
||||
private final SelenideElement timeToRetain = $(By.cssSelector("input#timeToRetain"));
|
||||
private final SelenideElement maxMessageBytes = $(By.name("maxMessageBytes"));
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView setTopicName(String topicName) {
|
||||
public TopicCreateEditForm setTopicName(String topicName) {
|
||||
$("input#topicFormName").setValue(topicName);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView setMinInsyncReplicas(Integer minInsyncReplicas) {
|
||||
public TopicCreateEditForm setMinInsyncReplicas(Integer minInsyncReplicas) {
|
||||
$("input[name=minInSyncReplicas]").setValue(minInsyncReplicas.toString());
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView setTimeToRetainDataInMs(Long ms) {
|
||||
public TopicCreateEditForm setTimeToRetainDataInMs(Long ms) {
|
||||
timeToRetain.setValue(ms.toString());
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView setTimeToRetainDataInMs(String ms) {
|
||||
public TopicCreateEditForm setTimeToRetainDataInMs(String ms) {
|
||||
timeToRetain.setValue(ms);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView setMaxSizeOnDiskInGB(String value) {
|
||||
public TopicCreateEditForm setMaxSizeOnDiskInGB(String value) {
|
||||
KafkaUISelectElement kafkaUISelectElement = new KafkaUISelectElement("retentionBytes");
|
||||
kafkaUISelectElement.selectByVisibleText(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView setMaxMessageBytes(Long bytes) {
|
||||
public TopicCreateEditForm setMaxMessageBytes(Long bytes) {
|
||||
maxMessageBytes.setValue(bytes.toString());
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView setMaxMessageBytes(String bytes) {
|
||||
public TopicCreateEditForm setMaxMessageBytes(String bytes) {
|
||||
return setMaxMessageBytes(Long.parseLong(bytes));
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView setTimeToRetainDataInMsUsingButtons(String value) {
|
||||
public TopicCreateEditForm setTimeToRetainDataInMsUsingButtons(String value) {
|
||||
timeToRetain
|
||||
.parent()
|
||||
.parent()
|
||||
|
@ -63,32 +70,37 @@ public class TopicCreateEditSettingsView {
|
|||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView selectCleanupPolicy(CleanupPolicyValue cleanupPolicyValue) {
|
||||
public TopicCreateEditForm selectCleanupPolicy(CleanupPolicyValue cleanupPolicyValue) {
|
||||
return selectFromDropDownByOptionValue("cleanupPolicy",
|
||||
cleanupPolicyValue.getOptionValue());
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView selectCleanupPolicy(String cleanupPolicyOptionValue) {
|
||||
public TopicCreateEditForm selectCleanupPolicy(String cleanupPolicyOptionValue) {
|
||||
$("ul#topicFormCleanupPolicy").click();
|
||||
$x("//li[text()='" + cleanupPolicyOptionValue + "']").click();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView selectRetentionBytes(String visibleValue) {
|
||||
public TopicCreateEditForm selectRetentionBytes(String visibleValue) {
|
||||
return selectFromDropDownByVisibleText("retentionBytes", visibleValue);
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView selectRetentionBytes(Long optionValue) {
|
||||
public TopicCreateEditForm selectRetentionBytes(Long optionValue) {
|
||||
return selectFromDropDownByOptionValue("retentionBytes", optionValue.toString());
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicView sendData() {
|
||||
public TopicDetails sendData() {
|
||||
clickByJavaScript($x("//button[@type='submit']"));
|
||||
return new TopicView();
|
||||
return new TopicDetails();
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView addCustomParameter(String customParameterName,
|
||||
String customParameterValue) {
|
||||
public TopicCreateEditForm addCustomParameter(String customParameterName,
|
||||
String customParameterValue) {
|
||||
ElementsCollection customParametersElements =
|
||||
$$("ul[role=listbox][name^=customParams][name$=name]");
|
||||
KafkaUISelectElement kafkaUISelectElement = null;
|
||||
|
@ -110,9 +122,10 @@ public class TopicCreateEditSettingsView {
|
|||
.setValue(customParameterValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView updateCustomParameter(String customParameterName,
|
||||
String customParameterValue) {
|
||||
public TopicCreateEditForm updateCustomParameter(String customParameterName,
|
||||
String customParameterValue) {
|
||||
SelenideElement selenideElement = $$("ul[role=listbox][name^=customParams][name$=name]")
|
||||
.find(Condition.exactText(customParameterName));
|
||||
String name = selenideElement.getAttribute("name");
|
||||
|
@ -122,8 +135,9 @@ public class TopicCreateEditSettingsView {
|
|||
$(String.format("input[name^=%s]", name)).setValue(customParameterValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView cleanupPolicyIs(String value) {
|
||||
public TopicCreateEditForm cleanupPolicyIs(String value) {
|
||||
String cleanupPolicy = new KafkaUISelectElement("cleanupPolicy")
|
||||
.getCurrentValue();
|
||||
assertThat(cleanupPolicy)
|
||||
|
@ -131,14 +145,16 @@ public class TopicCreateEditSettingsView {
|
|||
.isEqualToIgnoringCase(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView timeToRetainIs(String time) {
|
||||
public TopicCreateEditForm timeToRetainIs(String time) {
|
||||
String value = timeToRetain.getValue();
|
||||
assertThat(value)
|
||||
.as("Time to retain data (in ms) should be " + time)
|
||||
.isEqualTo(time);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public String getCleanupPolicy() {
|
||||
return new KafkaUISelectElement("cleanupPolicy").getCurrentValue();
|
||||
|
@ -215,15 +231,15 @@ public class TopicCreateEditSettingsView {
|
|||
}
|
||||
}
|
||||
|
||||
private TopicCreateEditSettingsView selectFromDropDownByOptionValue(String dropDownElementName,
|
||||
String optionValue) {
|
||||
private TopicCreateEditForm selectFromDropDownByOptionValue(String dropDownElementName,
|
||||
String optionValue) {
|
||||
KafkaUISelectElement select = new KafkaUISelectElement(dropDownElementName);
|
||||
select.selectByOptionValue(optionValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
private TopicCreateEditSettingsView selectFromDropDownByVisibleText(String dropDownElementName,
|
||||
String visibleText) {
|
||||
private TopicCreateEditForm selectFromDropDownByVisibleText(String dropDownElementName,
|
||||
String visibleText) {
|
||||
KafkaUISelectElement select = new KafkaUISelectElement(dropDownElementName);
|
||||
select.selectByVisibleText(visibleText);
|
||||
return this;
|
|
@ -3,8 +3,8 @@ package com.provectus.kafka.ui.pages.topic;
|
|||
import com.codeborne.selenide.Condition;
|
||||
import com.codeborne.selenide.Selenide;
|
||||
import com.codeborne.selenide.SelenideElement;
|
||||
import com.provectus.kafka.ui.utilities.WaitUtils;
|
||||
import com.provectus.kafka.ui.settings.Source;
|
||||
import com.provectus.kafka.ui.utilities.WaitUtils;
|
||||
import io.qameta.allure.Step;
|
||||
import lombok.experimental.ExtensionMethod;
|
||||
import org.openqa.selenium.By;
|
||||
|
@ -13,32 +13,32 @@ import static com.codeborne.selenide.Selenide.*;
|
|||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
|
||||
@ExtensionMethod({WaitUtils.class})
|
||||
public class TopicView {
|
||||
public class TopicDetails {
|
||||
|
||||
private static final String URL_PATH = "/ui/clusters/%s/topics/%s";
|
||||
protected SelenideElement dotMenuBtn = $$x("//button[@aria-label='Dropdown Toggle']").first();
|
||||
|
||||
@Step
|
||||
public TopicView goTo(String cluster, String topic) {
|
||||
public TopicDetails goTo(String cluster, String topic) {
|
||||
Selenide.open(Source.BASE_WEB_URL + String.format(URL_PATH, cluster, topic));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicView waitUntilScreenReady() {
|
||||
public TopicDetails waitUntilScreenReady() {
|
||||
$(By.linkText("Overview")).shouldBe(Condition.visible);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView openEditSettings() {
|
||||
public TopicCreateEditForm openEditSettings() {
|
||||
clickByJavaScript(dotMenuBtn);
|
||||
$x("//li[@role][text()='Edit settings']").click();
|
||||
return new TopicCreateEditSettingsView();
|
||||
return new TopicCreateEditForm();
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicView openTopicMenu(TopicMenu menu) {
|
||||
public TopicDetails openTopicMenu(TopicMenu menu) {
|
||||
$(By.linkText(menu.getValue())).shouldBe(Condition.visible).click();
|
||||
return this;
|
||||
}
|
|
@ -3,15 +3,15 @@ package com.provectus.kafka.ui.pages.topic;
|
|||
import com.codeborne.selenide.CollectionCondition;
|
||||
import com.codeborne.selenide.Condition;
|
||||
import com.codeborne.selenide.Selenide;
|
||||
import com.provectus.kafka.ui.utilities.WaitUtils;
|
||||
import com.provectus.kafka.ui.settings.Source;
|
||||
import com.provectus.kafka.ui.utilities.WaitUtils;
|
||||
import io.qameta.allure.Step;
|
||||
import lombok.experimental.ExtensionMethod;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
import static com.codeborne.selenide.Selenide.*;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.isVisible;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.clickByJavaScript;
|
||||
import static com.provectus.kafka.ui.utilities.WebUtils.isVisible;
|
||||
|
||||
@ExtensionMethod(WaitUtils.class)
|
||||
public class TopicsList {
|
||||
|
@ -32,9 +32,9 @@ public class TopicsList {
|
|||
}
|
||||
|
||||
@Step
|
||||
public TopicCreateEditSettingsView pressCreateNewTopic() {
|
||||
public TopicCreateEditForm pressCreateNewTopic() {
|
||||
clickByJavaScript($x("//button[normalize-space(text()) ='Add a Topic']"));
|
||||
return new TopicCreateEditSettingsView();
|
||||
return new TopicCreateEditForm();
|
||||
}
|
||||
|
||||
@Step
|
||||
|
@ -44,9 +44,9 @@ public class TopicsList {
|
|||
}
|
||||
|
||||
@Step
|
||||
public TopicView openTopic(String topicName) {
|
||||
public TopicDetails openTopic(String topicName) {
|
||||
$(By.linkText(topicName)).click();
|
||||
return new TopicView();
|
||||
return new TopicDetails();
|
||||
}
|
||||
|
||||
@Step
|
||||
|
|
|
@ -2,30 +2,28 @@ package com.provectus.kafka.ui.base;
|
|||
|
||||
import com.provectus.kafka.ui.helpers.ApiHelper;
|
||||
import com.provectus.kafka.ui.pages.MainPage;
|
||||
import com.provectus.kafka.ui.pages.connector.ConnectorCreateView;
|
||||
import com.provectus.kafka.ui.pages.connector.ConnectorsList;
|
||||
import com.provectus.kafka.ui.pages.connector.ConnectorsView;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaCreateView;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaEditView;
|
||||
import com.provectus.kafka.ui.pages.connector.ConnectorCreateForm;
|
||||
import com.provectus.kafka.ui.pages.connector.ConnectorDetails;
|
||||
import com.provectus.kafka.ui.pages.connector.KafkaConnectList;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaCreateForm;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaDetails;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaRegistryList;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaView;
|
||||
import com.provectus.kafka.ui.pages.topic.ProduceMessagePanel;
|
||||
import com.provectus.kafka.ui.pages.topic.TopicCreateEditSettingsView;
|
||||
import com.provectus.kafka.ui.pages.topic.TopicView;
|
||||
import com.provectus.kafka.ui.pages.topic.TopicCreateEditForm;
|
||||
import com.provectus.kafka.ui.pages.topic.TopicDetails;
|
||||
import com.provectus.kafka.ui.pages.topic.TopicsList;
|
||||
|
||||
public abstract class Facade {
|
||||
protected MainPage mainPage = new MainPage();
|
||||
protected ApiHelper apiHelper = new ApiHelper();
|
||||
protected ConnectorCreateView connectorCreateView = new ConnectorCreateView();
|
||||
protected ConnectorsList connectorsList = new ConnectorsList();
|
||||
protected ConnectorsView connectorsView = new ConnectorsView();
|
||||
protected SchemaCreateView schemaCreateView = new SchemaCreateView();
|
||||
protected SchemaEditView schemaEditView = new SchemaEditView();
|
||||
protected SchemaView schemaView = new SchemaView();
|
||||
protected ConnectorCreateForm connectorCreateForm = new ConnectorCreateForm();
|
||||
protected KafkaConnectList kafkaConnectList = new KafkaConnectList();
|
||||
protected ConnectorDetails connectorDetails = new ConnectorDetails();
|
||||
protected SchemaCreateForm schemaCreateForm = new SchemaCreateForm();
|
||||
protected SchemaDetails schemaDetails = new SchemaDetails();
|
||||
protected SchemaRegistryList schemaRegistryList = new SchemaRegistryList();
|
||||
protected ProduceMessagePanel produceMessagePanel = new ProduceMessagePanel();
|
||||
protected TopicCreateEditSettingsView topicCreateEditSettingsView = new TopicCreateEditSettingsView();
|
||||
protected TopicCreateEditForm topicCreateEditForm = new TopicCreateEditForm();
|
||||
protected TopicsList topicsList = new TopicsList();
|
||||
protected TopicView topicView = new TopicView();
|
||||
protected TopicDetails topicDetails = new TopicDetails();
|
||||
}
|
||||
|
|
|
@ -60,14 +60,14 @@ public class ConnectorsTests extends BaseTest {
|
|||
Connector connectorForCreate = new Connector()
|
||||
.setName("sink_postgres_activities_e2e_checks")
|
||||
.setConfig(getResourceAsString("config_for_create_connector.json"));
|
||||
connectorsList.goTo(CLUSTER_NAME)
|
||||
kafkaConnectList.goTo(CLUSTER_NAME)
|
||||
.waitUntilScreenReady()
|
||||
.clickCreateConnectorButton()
|
||||
.waitUntilScreenReady()
|
||||
.setConnectorConfig(connectorForCreate.getName(), connectorForCreate.getConfig());
|
||||
connectorsList.goTo(CLUSTER_NAME)
|
||||
kafkaConnectList.goTo(CLUSTER_NAME)
|
||||
.waitUntilScreenReady();
|
||||
Assertions.assertTrue(connectorsList.isConnectorVisible(connectorForCreate.getName()),"isConnectorVisible()");
|
||||
Assertions.assertTrue(kafkaConnectList.isConnectorVisible(connectorForCreate.getName()),"isConnectorVisible()");
|
||||
CONNECTOR_LIST.add(connectorForCreate);
|
||||
}
|
||||
|
||||
|
@ -77,14 +77,14 @@ public class ConnectorsTests extends BaseTest {
|
|||
@CaseId(196)
|
||||
@Test
|
||||
public void updateConnector() {
|
||||
connectorsList.goTo(CLUSTER_NAME)
|
||||
kafkaConnectList.goTo(CLUSTER_NAME)
|
||||
.waitUntilScreenReady()
|
||||
.openConnector(CONNECTOR_FOR_UPDATE.getName());
|
||||
connectorsView.waitUntilScreenReady()
|
||||
connectorDetails.waitUntilScreenReady()
|
||||
.openConfigTab()
|
||||
.setConfig(CONNECTOR_FOR_UPDATE.getConfig());
|
||||
connectorsList.goTo(CLUSTER_NAME);
|
||||
Assertions.assertTrue(connectorsList.isConnectorVisible(CONNECTOR_FOR_UPDATE.getName()),"isConnectorVisible()");
|
||||
kafkaConnectList.goTo(CLUSTER_NAME);
|
||||
Assertions.assertTrue(kafkaConnectList.isConnectorVisible(CONNECTOR_FOR_UPDATE.getName()),"isConnectorVisible()");
|
||||
}
|
||||
|
||||
@DisplayName("should delete connector")
|
||||
|
@ -93,16 +93,16 @@ public class ConnectorsTests extends BaseTest {
|
|||
@CaseId(195)
|
||||
@Test
|
||||
public void deleteConnector() {
|
||||
connectorsList.goTo(CLUSTER_NAME)
|
||||
kafkaConnectList.goTo(CLUSTER_NAME)
|
||||
.waitUntilScreenReady()
|
||||
.openConnector(CONNECTOR_FOR_DELETE.getName());
|
||||
connectorsView
|
||||
connectorDetails
|
||||
.waitUntilScreenReady()
|
||||
.openDotMenu()
|
||||
.clickDeleteButton()
|
||||
.clickConfirmButton();
|
||||
connectorsList.goTo(CLUSTER_NAME);
|
||||
Assertions.assertFalse(connectorsList.isConnectorVisible(CONNECTOR_FOR_DELETE.getName()), "isConnectorVisible()");
|
||||
kafkaConnectList.goTo(CLUSTER_NAME);
|
||||
Assertions.assertFalse(kafkaConnectList.isConnectorVisible(CONNECTOR_FOR_DELETE.getName()), "isConnectorVisible()");
|
||||
CONNECTOR_LIST.remove(CONNECTOR_FOR_DELETE);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.provectus.kafka.ui.api.model.CompatibilityLevel;
|
|||
import com.provectus.kafka.ui.base.BaseTest;
|
||||
import com.provectus.kafka.ui.models.Schema;
|
||||
import com.provectus.kafka.ui.pages.MainPage;
|
||||
import com.provectus.kafka.ui.pages.schema.SchemaView;
|
||||
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.Suite;
|
||||
import com.provectus.kafka.ui.utilities.qaseIoUtils.enums.Status;
|
||||
|
@ -69,12 +69,12 @@ public class SchemasTests extends BaseTest {
|
|||
schemaRegistryList.openSchema(AVRO_API.getName())
|
||||
.waitUntilScreenReady()
|
||||
.openEditSchema();
|
||||
Assertions.assertTrue(schemaEditView.isSchemaDropDownDisabled(),"isSchemaDropDownDisabled()");
|
||||
schemaEditView.selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
|
||||
Assertions.assertTrue(schemaCreateForm.isSchemaDropDownDisabled(),"isSchemaDropDownDisabled()");
|
||||
schemaCreateForm.selectCompatibilityLevelFromDropdown(CompatibilityLevel.CompatibilityEnum.NONE)
|
||||
.setNewSchemaValue(fileToString(AVRO_API.getValuePath()))
|
||||
.clickSubmit()
|
||||
.waitUntilScreenReady();
|
||||
Assertions.assertEquals(CompatibilityLevel.CompatibilityEnum.NONE.toString(), new SchemaView().getCompatibility(), "getCompatibility()");
|
||||
Assertions.assertEquals(CompatibilityLevel.CompatibilityEnum.NONE.toString(), new SchemaDetails().getCompatibility(), "getCompatibility()");
|
||||
}
|
||||
|
||||
@DisplayName("should delete AVRO schema")
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.provectus.kafka.ui.tests;
|
|||
import com.provectus.kafka.ui.base.BaseTest;
|
||||
import com.provectus.kafka.ui.models.Topic;
|
||||
import com.provectus.kafka.ui.pages.MainPage;
|
||||
import com.provectus.kafka.ui.pages.topic.TopicView;
|
||||
import com.provectus.kafka.ui.pages.topic.TopicDetails;
|
||||
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.enums.Status;
|
||||
|
@ -81,10 +81,10 @@ public class TopicTests extends BaseTest {
|
|||
.waitUntilScreenReady()
|
||||
.openEditSettings();
|
||||
SoftAssertions softly = new SoftAssertions();
|
||||
softly.assertThat(topicCreateEditSettingsView.getCleanupPolicy()).as("Cleanup Policy").isEqualTo(TOPIC_FOR_UPDATE.getCompactPolicyValue());
|
||||
softly.assertThat(topicCreateEditSettingsView.getTimeToRetain()).as("Time to retain").isEqualTo(TOPIC_FOR_UPDATE.getTimeToRetainData());
|
||||
softly.assertThat(topicCreateEditSettingsView.getMaxSizeOnDisk()).as("Max size on disk").isEqualTo(TOPIC_FOR_UPDATE.getMaxSizeOnDisk());
|
||||
softly.assertThat(topicCreateEditSettingsView.getMaxMessageBytes()).as("Max message bytes").isEqualTo(TOPIC_FOR_UPDATE.getMaxMessageBytes());
|
||||
softly.assertThat(topicCreateEditForm.getCleanupPolicy()).as("Cleanup Policy").isEqualTo(TOPIC_FOR_UPDATE.getCompactPolicyValue());
|
||||
softly.assertThat(topicCreateEditForm.getTimeToRetain()).as("Time to retain").isEqualTo(TOPIC_FOR_UPDATE.getTimeToRetainData());
|
||||
softly.assertThat(topicCreateEditForm.getMaxSizeOnDisk()).as("Max size on disk").isEqualTo(TOPIC_FOR_UPDATE.getMaxSizeOnDisk());
|
||||
softly.assertThat(topicCreateEditForm.getMaxMessageBytes()).as("Max message bytes").isEqualTo(TOPIC_FOR_UPDATE.getMaxMessageBytes());
|
||||
softly.assertAll();
|
||||
}
|
||||
|
||||
|
@ -115,14 +115,14 @@ public class TopicTests extends BaseTest {
|
|||
.waitUntilScreenReady()
|
||||
.openTopic(TOPIC_FOR_UPDATE.getName())
|
||||
.waitUntilScreenReady()
|
||||
.openTopicMenu(TopicView.TopicMenu.MESSAGES)
|
||||
.openTopicMenu(TopicDetails.TopicMenu.MESSAGES)
|
||||
.clickOnButton("Produce Message")
|
||||
.setContentFiled(TOPIC_FOR_UPDATE.getMessageContent())
|
||||
.setKeyField(TOPIC_FOR_UPDATE.getMessageKey())
|
||||
.submitProduceMessage();
|
||||
SoftAssertions softly = new SoftAssertions();
|
||||
softly.assertThat(topicView.isKeyMessageVisible((TOPIC_FOR_UPDATE.getMessageKey()))).withFailMessage("isKeyMessageVisible()").isTrue();
|
||||
softly.assertThat(topicView.isContentMessageVisible((TOPIC_FOR_UPDATE.getMessageContent()).trim())).withFailMessage("isContentMessageVisible()").isTrue();
|
||||
softly.assertThat(topicDetails.isKeyMessageVisible((TOPIC_FOR_UPDATE.getMessageKey()))).withFailMessage("isKeyMessageVisible()").isTrue();
|
||||
softly.assertThat(topicDetails.isContentMessageVisible((TOPIC_FOR_UPDATE.getMessageContent()).trim())).withFailMessage("isContentMessageVisible()").isTrue();
|
||||
softly.assertAll();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue