Skip to content

Commit 69a00d0

Browse files
committed
update test to consider multiple pages
1 parent a92489e commit 69a00d0

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

e2e-tests/src/main/java/io/kafbat/ui/screens/topics/TopicSettingsTab.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
import io.qameta.allure.Step;
1010
import java.util.ArrayList;
1111
import java.util.List;
12+
import java.util.NoSuchElementException;
1213

1314
public class TopicSettingsTab extends BasePage {
1415

1516
protected SelenideElement defaultValueColumnHeaderLocator = $x("//div[text() = 'Default Value']");
17+
protected SelenideElement nextButton = $x("//button[contains(text(), 'Next')]");
18+
protected SelenideElement previousButton = $x("//button[contains(text(), 'Previous')]");
1619

1720
@Step
1821
public TopicSettingsTab waitUntilScreenReady() {
@@ -36,7 +39,23 @@ private TopicSettingsTab.SettingsGridItem getItemByKey(String key) {
3639

3740
@Step
3841
public String getValueByKey(String key) {
39-
return getItemByKey(key).getValue();
42+
while (true) {
43+
try {
44+
String value = getItemByKey(key).getValue();
45+
resetPageNavigation();
46+
return value;
47+
} catch (NoSuchElementException ignored) {
48+
if (nextButton.isEnabled()) {
49+
nextButton.click();
50+
}
51+
}
52+
}
53+
}
54+
55+
private void resetPageNavigation() {
56+
while (previousButton.isEnabled()) {
57+
previousButton.click();
58+
}
4059
}
4160

4261
public static class SettingsGridItem extends BasePage {

0 commit comments

Comments
 (0)