|
@@ -1,5 +1,6 @@
|
|
package com.provectus.kafka.ui.pages.topic;
|
|
package com.provectus.kafka.ui.pages.topic;
|
|
|
|
|
|
|
|
+import static com.codeborne.selenide.Condition.visible;
|
|
import static com.codeborne.selenide.Selenide.$x;
|
|
import static com.codeborne.selenide.Selenide.$x;
|
|
|
|
|
|
import com.codeborne.selenide.CollectionCondition;
|
|
import com.codeborne.selenide.CollectionCondition;
|
|
@@ -22,11 +23,12 @@ public class TopicsList extends BasePage {
|
|
protected SelenideElement deleteSelectedTopicsBtn = $x("//button[text()='Delete selected topics']");
|
|
protected SelenideElement deleteSelectedTopicsBtn = $x("//button[text()='Delete selected topics']");
|
|
protected SelenideElement copySelectedTopicBtn = $x("//button[text()='Copy selected topic']");
|
|
protected SelenideElement copySelectedTopicBtn = $x("//button[text()='Copy selected topic']");
|
|
protected SelenideElement purgeMessagesOfSelectedTopicsBtn = $x("//button[text()='Purge messages of selected topics']");
|
|
protected SelenideElement purgeMessagesOfSelectedTopicsBtn = $x("//button[text()='Purge messages of selected topics']");
|
|
|
|
+ protected SelenideElement clearMessagesBtn = $x("//ul[contains(@class ,'open')]//div[text()='Clear Messages']");
|
|
|
|
|
|
@Step
|
|
@Step
|
|
public TopicsList waitUntilScreenReady() {
|
|
public TopicsList waitUntilScreenReady() {
|
|
waitUntilSpinnerDisappear();
|
|
waitUntilSpinnerDisappear();
|
|
- topicListHeader.shouldBe(Condition.visible);
|
|
|
|
|
|
+ topicListHeader.shouldBe(visible);
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -38,7 +40,7 @@ public class TopicsList extends BasePage {
|
|
|
|
|
|
@Step
|
|
@Step
|
|
public boolean isTopicVisible(String topicName) {
|
|
public boolean isTopicVisible(String topicName) {
|
|
- tableGrid.shouldBe(Condition.visible);
|
|
|
|
|
|
+ tableGrid.shouldBe(visible);
|
|
return isVisible(getTableElement(topicName));
|
|
return isVisible(getTableElement(topicName));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -59,6 +61,12 @@ public class TopicsList extends BasePage {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Step
|
|
|
|
+ public TopicsList openDotMenuByTopicName(String topicName){
|
|
|
|
+ getTopicItem(topicName).openDotMenu();
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Step
|
|
@Step
|
|
public boolean isCopySelectedTopicBtnEnabled(){
|
|
public boolean isCopySelectedTopicBtnEnabled(){
|
|
return isEnabled(copySelectedTopicBtn);
|
|
return isEnabled(copySelectedTopicBtn);
|
|
@@ -76,6 +84,23 @@ public class TopicsList extends BasePage {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Step
|
|
|
|
+ public TopicsList clickClearMessagesBtn(){
|
|
|
|
+ clickByJavaScript(clearMessagesBtn.shouldBe(visible));
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Step
|
|
|
|
+ public TopicsList clickConfirmBtnMdl() {
|
|
|
|
+ clickConfirmButton();
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Step
|
|
|
|
+ public boolean isAlertWithMessageVisible(AlertHeader header, String message) {
|
|
|
|
+ return isAlertVisible(header, message);
|
|
|
|
+ }
|
|
|
|
+
|
|
private List<SelenideElement> getVisibleColumnHeaders() {
|
|
private List<SelenideElement> getVisibleColumnHeaders() {
|
|
return Stream.of("Replication Factor","Number of messages","Topic Name", "Partitions", "Out of sync replicas", "Size")
|
|
return Stream.of("Replication Factor","Number of messages","Topic Name", "Partitions", "Out of sync replicas", "Size")
|
|
.map(name -> $x(String.format(columnHeaderLocator, name)))
|
|
.map(name -> $x(String.format(columnHeaderLocator, name)))
|
|
@@ -110,12 +135,12 @@ public class TopicsList extends BasePage {
|
|
return gridItemList;
|
|
return gridItemList;
|
|
}
|
|
}
|
|
|
|
|
|
- @Step
|
|
|
|
- public TopicGridItem getTopicItem(String name) {
|
|
|
|
- return initGridItems().stream()
|
|
|
|
|
|
+ @Step
|
|
|
|
+ public TopicGridItem getTopicItem(String name) {
|
|
|
|
+ return initGridItems().stream()
|
|
.filter(e -> e.getName().equals(name))
|
|
.filter(e -> e.getName().equals(name))
|
|
.findFirst().orElse(null);
|
|
.findFirst().orElse(null);
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
@Step
|
|
@Step
|
|
public List<TopicGridItem> getNonInternalTopics() {
|
|
public List<TopicGridItem> getNonInternalTopics() {
|
|
@@ -149,7 +174,7 @@ public class TopicsList extends BasePage {
|
|
public boolean isInternal() {
|
|
public boolean isInternal() {
|
|
boolean internal = false;
|
|
boolean internal = false;
|
|
try {
|
|
try {
|
|
- element.$x("./td[2]/a/span").shouldBe(Condition.visible);
|
|
|
|
|
|
+ element.$x("./td[2]/a/span").shouldBe(visible);
|
|
internal = true;
|
|
internal = true;
|
|
} catch (Throwable ignored) {
|
|
} catch (Throwable ignored) {
|
|
}
|
|
}
|