Merge branch 'issues/Checking_Broker's_config_search' into issues/Checking_Broker's_Source_information
This commit is contained in:
commit
aec089503f
10 changed files with 143 additions and 44 deletions
|
@ -63,6 +63,14 @@ public abstract class BasePage extends WebUtils {
|
|||
clickByJavaScript(submitBtn);
|
||||
}
|
||||
|
||||
protected void clickNextBtn() {
|
||||
clickByJavaScript(nextBtn);
|
||||
}
|
||||
|
||||
protected void clickBackBtn() {
|
||||
clickByJavaScript(backBtn);
|
||||
}
|
||||
|
||||
protected void setJsonInputValue(SelenideElement jsonInput, String jsonConfig) {
|
||||
sendKeysByActions(jsonInput, jsonConfig.replace(" ", ""));
|
||||
new Actions(WebDriverRunner.getWebDriver())
|
||||
|
|
|
@ -3,29 +3,37 @@ package com.provectus.kafka.ui.pages.brokers;
|
|||
import static com.codeborne.selenide.Selenide.$$x;
|
||||
import static com.codeborne.selenide.Selenide.$x;
|
||||
|
||||
import com.codeborne.selenide.CollectionCondition;
|
||||
import com.codeborne.selenide.Condition;
|
||||
import com.codeborne.selenide.ElementsCollection;
|
||||
import com.codeborne.selenide.SelenideElement;
|
||||
import com.provectus.kafka.ui.pages.BasePage;
|
||||
import io.qameta.allure.Step;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class BrokersConfigTab extends BasePage {
|
||||
|
||||
protected List<SelenideElement> editBtn = $$x("//button[@aria-label='editAction']");
|
||||
protected SelenideElement searchByKeyField = $x("//input[@placeholder='Search by Key']");
|
||||
protected ElementsCollection editBtns = $$x("//button[@aria-label='editAction']");
|
||||
|
||||
@Step
|
||||
public BrokersConfigTab waitUntilScreenReady() {
|
||||
waitUntilSpinnerDisappear();
|
||||
searchByKeyField.shouldBe(Condition.visible);
|
||||
searchFld.shouldBe(Condition.visible);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public boolean isSearchByKeyVisible() {
|
||||
return isVisible(searchByKeyField);
|
||||
return isVisible(searchFld);
|
||||
}
|
||||
|
||||
@Step
|
||||
public BrokersConfigTab searchConfig(String key) {
|
||||
searchItem(key);
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<SelenideElement> getColumnHeaders() {
|
||||
|
@ -35,6 +43,61 @@ public class BrokersConfigTab extends BasePage {
|
|||
}
|
||||
|
||||
public List<SelenideElement> getEditButtons() {
|
||||
return editBtn;
|
||||
return editBtns;
|
||||
}
|
||||
|
||||
@Step
|
||||
public BrokersConfigTab clickNextButton() {
|
||||
clickNextBtn();
|
||||
waitUntilSpinnerDisappear(1);
|
||||
return this;
|
||||
}
|
||||
|
||||
private List<BrokersConfigTab.BrokersConfigItem> initGridItems() {
|
||||
List<BrokersConfigTab.BrokersConfigItem> gridItemList = new ArrayList<>();
|
||||
gridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
|
||||
.forEach(item -> gridItemList.add(new BrokersConfigTab.BrokersConfigItem(item)));
|
||||
return gridItemList;
|
||||
}
|
||||
|
||||
@Step
|
||||
public BrokersConfigTab.BrokersConfigItem getConfig(String key) {
|
||||
return initGridItems().stream()
|
||||
.filter(e -> e.getKey().equals(key))
|
||||
.findFirst().orElseThrow();
|
||||
}
|
||||
|
||||
@Step
|
||||
public List<BrokersConfigTab.BrokersConfigItem> getAllConfigs() {
|
||||
return initGridItems();
|
||||
}
|
||||
|
||||
public static class BrokersConfigItem extends BasePage {
|
||||
|
||||
private final SelenideElement element;
|
||||
|
||||
public BrokersConfigItem(SelenideElement element) {
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
@Step
|
||||
public String getKey() {
|
||||
return element.$x("./td[1]").getText().trim();
|
||||
}
|
||||
|
||||
@Step
|
||||
public String getValue() {
|
||||
return element.$x("./td[2]//span").getText().trim();
|
||||
}
|
||||
|
||||
@Step
|
||||
public void edit() {
|
||||
element.$x("./td[2]//button").shouldBe(Condition.enabled).click();
|
||||
}
|
||||
|
||||
@Step
|
||||
public String getSource() {
|
||||
return element.$x("./td[3]").getText().trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.provectus.kafka.ui.pages.brokers;
|
||||
|
||||
import static com.codeborne.selenide.Selenide.$;
|
||||
import static com.codeborne.selenide.Selenide.$x;
|
||||
|
||||
import com.codeborne.selenide.Condition;
|
||||
|
@ -8,28 +7,24 @@ import com.codeborne.selenide.SelenideElement;
|
|||
import com.provectus.kafka.ui.pages.BasePage;
|
||||
import io.qameta.allure.Step;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
public class BrokersDetails extends BasePage {
|
||||
|
||||
protected SelenideElement logDirectoriesTab = $x("//a[text()='Log directories']");
|
||||
protected SelenideElement metricsTab = $x("//a[text()='Metrics']");
|
||||
protected String brokersTabLocator = "//a[text()='%s']";
|
||||
|
||||
@Step
|
||||
public BrokersDetails waitUntilScreenReady() {
|
||||
waitUntilSpinnerDisappear();
|
||||
Arrays.asList(logDirectoriesTab, metricsTab).forEach(element -> element.shouldBe(Condition.visible));
|
||||
$x(String.format(brokersTabLocator, DetailsTab.LOG_DIRECTORIES)).shouldBe(Condition.visible);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public BrokersDetails openDetailsTab(DetailsTab menu) {
|
||||
$(By.linkText(menu.toString())).shouldBe(Condition.enabled).click();
|
||||
$x(String.format(brokersTabLocator, menu.toString())).shouldBe(Condition.enabled).click();
|
||||
waitUntilSpinnerDisappear();
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public class BrokersList extends BasePage {
|
|||
|
||||
@Step
|
||||
public BrokersList openBroker(int brokerId) {
|
||||
getBrokerItem(brokerId).openItem();
|
||||
getBroker(brokerId).openItem();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -58,30 +58,30 @@ public class BrokersList extends BasePage {
|
|||
return getEnabledColumnHeaders();
|
||||
}
|
||||
|
||||
private List<BrokersList.BrokerGridItem> initGridItems() {
|
||||
List<BrokersList.BrokerGridItem> gridItemList = new ArrayList<>();
|
||||
private List<BrokersGridItem> initGridItems() {
|
||||
List<BrokersGridItem> gridItemList = new ArrayList<>();
|
||||
gridItems.shouldHave(CollectionCondition.sizeGreaterThan(0))
|
||||
.forEach(item -> gridItemList.add(new BrokersList.BrokerGridItem(item)));
|
||||
.forEach(item -> gridItemList.add(new BrokersGridItem(item)));
|
||||
return gridItemList;
|
||||
}
|
||||
|
||||
@Step
|
||||
public BrokerGridItem getBrokerItem(int id) {
|
||||
public BrokersGridItem getBroker(int id) {
|
||||
return initGridItems().stream()
|
||||
.filter(e -> e.getId() == id)
|
||||
.findFirst().orElseThrow();
|
||||
}
|
||||
|
||||
@Step
|
||||
public List<BrokerGridItem> getAllBrokers() {
|
||||
public List<BrokersGridItem> getAllBrokers() {
|
||||
return initGridItems();
|
||||
}
|
||||
|
||||
public static class BrokerGridItem extends BasePage {
|
||||
public static class BrokersGridItem extends BasePage {
|
||||
|
||||
private final SelenideElement element;
|
||||
|
||||
public BrokerGridItem(SelenideElement element) {
|
||||
public BrokersGridItem(SelenideElement element) {
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ public class TopicDetails extends BasePage {
|
|||
|
||||
@Step
|
||||
public TopicDetails clickNextButton() {
|
||||
nextBtn.shouldBe(Condition.enabled).click();
|
||||
clickNextBtn();
|
||||
waitUntilSpinnerDisappear();
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -68,6 +68,15 @@ public class TopicsList extends BasePage {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicsList goToLastPage() {
|
||||
while (nextBtn.isEnabled()) {
|
||||
clickNextBtn();
|
||||
waitUntilSpinnerDisappear(1);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Step
|
||||
public TopicsList openTopic(String topicName) {
|
||||
getTopicItem(topicName).openItem();
|
||||
|
|
|
@ -95,7 +95,7 @@ public class WebUtils {
|
|||
return isSelected;
|
||||
}
|
||||
|
||||
public static boolean selectElement(SelenideElement element, boolean select) {
|
||||
public static void selectElement(SelenideElement element, boolean select) {
|
||||
if (select) {
|
||||
if (!element.isSelected()) {
|
||||
clickByJavaScript(element);
|
||||
|
@ -105,6 +105,5 @@ public class WebUtils {
|
|||
clickByJavaScript(element);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,65 +14,58 @@ import org.testng.annotations.Test;
|
|||
public class SmokeBacklog extends BaseManualTest {
|
||||
|
||||
@Automation(state = TO_BE_AUTOMATED)
|
||||
@Suite(id = BROKERS_SUITE_ID)
|
||||
@QaseId(330)
|
||||
@Suite(id = KSQL_DB_SUITE_ID)
|
||||
@QaseId(276)
|
||||
@Test
|
||||
public void testCaseA() {
|
||||
}
|
||||
|
||||
@Automation(state = TO_BE_AUTOMATED)
|
||||
@Suite(id = KSQL_DB_SUITE_ID)
|
||||
@QaseId(276)
|
||||
@QaseId(277)
|
||||
@Test
|
||||
public void testCaseB() {
|
||||
}
|
||||
|
||||
@Automation(state = TO_BE_AUTOMATED)
|
||||
@Suite(id = KSQL_DB_SUITE_ID)
|
||||
@QaseId(277)
|
||||
@QaseId(278)
|
||||
@Test
|
||||
public void testCaseC() {
|
||||
}
|
||||
|
||||
@Automation(state = TO_BE_AUTOMATED)
|
||||
@Suite(id = KSQL_DB_SUITE_ID)
|
||||
@QaseId(278)
|
||||
@Test
|
||||
public void testCaseD() {
|
||||
}
|
||||
|
||||
@Automation(state = TO_BE_AUTOMATED)
|
||||
@Suite(id = KSQL_DB_SUITE_ID)
|
||||
@QaseId(284)
|
||||
@Test
|
||||
public void testCaseE() {
|
||||
public void testCaseD() {
|
||||
}
|
||||
|
||||
@Automation(state = TO_BE_AUTOMATED)
|
||||
@Suite(id = BROKERS_SUITE_ID)
|
||||
@QaseId(331)
|
||||
@Test
|
||||
public void testCaseF() {
|
||||
public void testCaseE() {
|
||||
}
|
||||
|
||||
@Automation(state = TO_BE_AUTOMATED)
|
||||
@Suite(id = BROKERS_SUITE_ID)
|
||||
@QaseId(332)
|
||||
@Test
|
||||
public void testCaseG() {
|
||||
public void testCaseF() {
|
||||
}
|
||||
|
||||
@Automation(state = TO_BE_AUTOMATED)
|
||||
@Suite(id = TOPICS_PROFILE_SUITE_ID)
|
||||
@QaseId(335)
|
||||
@Test
|
||||
public void testCaseH() {
|
||||
public void testCaseG() {
|
||||
}
|
||||
|
||||
@Automation(state = TO_BE_AUTOMATED)
|
||||
@Suite(id = TOPICS_PROFILE_SUITE_ID)
|
||||
@QaseId(336)
|
||||
@Test
|
||||
public void testCaseI() {
|
||||
public void testCaseH() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,12 +4,17 @@ import static com.provectus.kafka.ui.pages.brokers.BrokersDetails.DetailsTab.CON
|
|||
|
||||
import com.codeborne.selenide.Condition;
|
||||
import com.provectus.kafka.ui.BaseTest;
|
||||
import com.provectus.kafka.ui.pages.brokers.BrokersConfigTab;
|
||||
import io.qameta.allure.Issue;
|
||||
import io.qase.api.annotation.QaseId;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Ignore;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class BrokersTest extends BaseTest {
|
||||
|
||||
public static final int DEFAULT_BROKER_ID = 1;
|
||||
|
||||
@QaseId(1)
|
||||
@Test
|
||||
public void checkBrokersOverview() {
|
||||
|
@ -25,7 +30,7 @@ public class BrokersTest extends BaseTest {
|
|||
navigateToBrokers();
|
||||
Assert.assertTrue(brokersList.getAllBrokers().size() > 0, "getAllBrokers()");
|
||||
brokersList
|
||||
.openBroker(1);
|
||||
.openBroker(DEFAULT_BROKER_ID);
|
||||
brokersDetails
|
||||
.waitUntilScreenReady();
|
||||
verifyElementsCondition(brokersDetails.getAllVisibleElements(), Condition.visible);
|
||||
|
@ -38,4 +43,30 @@ public class BrokersTest extends BaseTest {
|
|||
verifyElementsCondition(brokersConfigTab.getEditButtons(), Condition.enabled);
|
||||
Assert.assertTrue(brokersConfigTab.isSearchByKeyVisible(), "isSearchByKeyVisible()");
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Issue("https://github.com/provectus/kafka-ui/issues/3347")
|
||||
@QaseId(330)
|
||||
@Test
|
||||
public void brokersConfigSearchCheck() {
|
||||
navigateToBrokersAndOpenDetails(DEFAULT_BROKER_ID);
|
||||
brokersDetails
|
||||
.openDetailsTab(CONFIGS);
|
||||
String anyConfigKey = brokersConfigTab
|
||||
.getAllConfigs().stream()
|
||||
.findAny().orElseThrow()
|
||||
.getKey();
|
||||
brokersConfigTab
|
||||
.clickNextButton();
|
||||
Assert.assertFalse(brokersConfigTab.getAllConfigs().stream()
|
||||
.map(BrokersConfigTab.BrokersConfigItem::getKey)
|
||||
.toList().contains(anyConfigKey),
|
||||
String.format("getAllConfigs().contains(%s)", anyConfigKey));
|
||||
brokersConfigTab
|
||||
.searchConfig(anyConfigKey);
|
||||
Assert.assertTrue(brokersConfigTab.getAllConfigs().stream()
|
||||
.map(BrokersConfigTab.BrokersConfigItem::getKey)
|
||||
.toList().contains(anyConfigKey),
|
||||
String.format("getAllConfigs().contains(%s)", anyConfigKey));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -365,12 +365,13 @@ public class TopicsTest extends BaseTest {
|
|||
navigateToTopics();
|
||||
topicsList
|
||||
.setShowInternalRadioButton(true);
|
||||
SoftAssert softly = new SoftAssert();
|
||||
softly.assertTrue(topicsList.getInternalTopics().size() > 0, "getInternalTopics()");
|
||||
softly.assertTrue(topicsList.getNonInternalTopics().size() > 0, "getNonInternalTopics()");
|
||||
softly.assertAll();
|
||||
Assert.assertTrue(topicsList.getInternalTopics().size() > 0, "getInternalTopics()");
|
||||
topicsList
|
||||
.goToLastPage();
|
||||
Assert.assertTrue(topicsList.getNonInternalTopics().size() > 0, "getNonInternalTopics()");
|
||||
topicsList
|
||||
.setShowInternalRadioButton(false);
|
||||
SoftAssert softly = new SoftAssert();
|
||||
softly.assertEquals(topicsList.getInternalTopics().size(), 0, "getInternalTopics()");
|
||||
softly.assertTrue(topicsList.getNonInternalTopics().size() > 0, "getNonInternalTopics()");
|
||||
softly.assertAll();
|
||||
|
|
Loading…
Add table
Reference in a new issue