626: add assert for testing of topic's field
This commit is contained in:
parent
7a6430c1af
commit
408983bb56
3 changed files with 21 additions and 5 deletions
|
@ -8,7 +8,7 @@ public class Pages {
|
|||
public static Pages INSTANCE = new Pages();
|
||||
|
||||
public MainPage mainPage = new MainPage();
|
||||
public TopicPage topicPage = new TopicPage();
|
||||
public TopicsListPage topicsListPage = new TopicsListPage();
|
||||
|
||||
private Pages goTo(String path) {
|
||||
Selenide.open(TestConfiguration.BASE_URL+path);
|
||||
|
@ -23,7 +23,12 @@ public class Pages {
|
|||
return goTo(MainPage.path).mainPage;
|
||||
}
|
||||
|
||||
public TopicPage openTopicPage() {
|
||||
return goTo(TopicPage.path).topicPage;
|
||||
public TopicsListPage openTopicsListPage() {
|
||||
return goTo(TopicsListPage.path).topicsListPage;
|
||||
}
|
||||
|
||||
public Pages reloadPage() {
|
||||
Selenide.refresh();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class TopicsListPage {
|
|||
@SneakyThrows
|
||||
public TopicsListPage changeCleanupPolicy(String cleanupPolicyValue) {
|
||||
$(By.name("cleanupPolicy")).click();
|
||||
$(By.xpath("//select/option[text() = '%s']".formatted(cleanupPolicyValue))).click();
|
||||
$(By.xpath("//select/option[@value = '%s']".formatted(cleanupPolicyValue))).click();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,10 +3,14 @@ package com.provectus.kafka.ui.topics;
|
|||
import com.provectus.kafka.ui.base.BaseTest;
|
||||
import com.provectus.kafka.ui.pages.MainPage;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.Assert;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
import static com.codeborne.selenide.Selenide.$;
|
||||
|
||||
public class TopicTests extends BaseTest {
|
||||
|
||||
|
@ -43,11 +47,18 @@ public class TopicTests extends BaseTest {
|
|||
.shouldBeOnPage()
|
||||
.openTopic(NEW_TOPIC)
|
||||
.openEditSettings()
|
||||
.changeCleanupPolicy("Compact")
|
||||
.changeCleanupPolicy("compact")
|
||||
.changeTimeToRetainValue("604800001")
|
||||
.changeMaxSizeOnDisk("20 GB")
|
||||
.changeMaxMessageBytes("1000020")
|
||||
.submitSettingChanges();
|
||||
pages.reloadPage();
|
||||
pages.openTopicsListPage()
|
||||
.openTopic(NEW_TOPIC)
|
||||
.openEditSettings();
|
||||
|
||||
String cleanupPolicy = $(By.name("cleanupPolicy")).getSelectedValue();
|
||||
Assert.assertEquals("compact", cleanupPolicy);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue