|
9 | 9 | import io.qameta.allure.Issue; |
10 | 10 | import io.qameta.allure.Step; |
11 | 11 | import io.qase.api.annotation.CaseId; |
| 12 | +import io.qase.api.annotation.QaseId; |
12 | 13 | import org.testng.Assert; |
13 | 14 | import org.testng.annotations.AfterClass; |
14 | 15 | import org.testng.annotations.BeforeClass; |
@@ -48,16 +49,21 @@ public class MessagesTest extends BaseTest { |
48 | 49 | .setName("topic-to-recreate-attribute-" + randomAlphabetic(5)) |
49 | 50 | .setMessageKey(randomAlphabetic(5)) |
50 | 51 | .setMessageContent(randomAlphabetic(10)); |
| 52 | + private static final Topic TOPIC_FOR_CHECK_MESSAGES_COUNT = new Topic() |
| 53 | + .setName("topic-for-check-messages-count" + randomAlphabetic(5)) |
| 54 | + .setMessageKey(randomAlphabetic(5)) |
| 55 | + .setMessageContent(randomAlphabetic(10)); |
51 | 56 | private static final List<Topic> TOPIC_LIST = new ArrayList<>(); |
52 | 57 |
|
53 | 58 | @BeforeClass(alwaysRun = true) |
54 | 59 | public void beforeClass() { |
55 | 60 | TOPIC_LIST.addAll(List.of(TOPIC_FOR_MESSAGES, TOPIC_FOR_CHECKING_FILTERS, TOPIC_TO_CLEAR_AND_PURGE_MESSAGES, |
56 | | - TOPIC_TO_RECREATE)); |
| 61 | + TOPIC_TO_RECREATE, TOPIC_FOR_CHECK_MESSAGES_COUNT)); |
57 | 62 | TOPIC_LIST.forEach(topic -> apiService.createTopic(topic.getName())); |
58 | 63 | IntStream.range(1, 3).forEach(i -> apiService.sendMessage(TOPIC_FOR_CHECKING_FILTERS)); |
59 | 64 | waitUntilNewMinuteStarted(); |
60 | 65 | IntStream.range(1, 3).forEach(i -> apiService.sendMessage(TOPIC_FOR_CHECKING_FILTERS)); |
| 66 | + IntStream.range(1, 110).forEach(i -> apiService.sendMessage(TOPIC_FOR_CHECK_MESSAGES_COUNT)); |
61 | 67 | } |
62 | 68 |
|
63 | 69 | @Suite(suiteId = SUITE_ID, title = SUITE_TITLE) |
@@ -272,6 +278,31 @@ public void checkRecreateTopic() { |
272 | 278 | softly.assertAll(); |
273 | 279 | } |
274 | 280 |
|
| 281 | + @Ignore |
| 282 | + @Issue("https://github.com/provectus/kafka-ui/issues/3129") |
| 283 | + @QaseId(267) |
| 284 | + @Test(priority = 10) |
| 285 | + public void CheckMessagesCountPerPageWithinTopic() { |
| 286 | + navigateToTopicsAndOpenDetails(TOPIC_FOR_CHECK_MESSAGES_COUNT.getName()); |
| 287 | + topicDetails |
| 288 | + .openDetailsTab(MESSAGES); |
| 289 | + int messagesPerPage = topicDetails.getAllMessages().size(); |
| 290 | + SoftAssert softly = new SoftAssert(); |
| 291 | + softly.assertEquals(messagesPerPage, 100, "getAllMessages()"); |
| 292 | + softly.assertFalse(topicDetails.isBackButtonEnabled(), "isBackButtonEnabled()"); |
| 293 | + softly.assertTrue(topicDetails.isNextButtonEnabled(), "isNextButtonEnabled()"); |
| 294 | + softly.assertAll(); |
| 295 | + int lastOffsetOnPage = topicDetails.getAllMessages() |
| 296 | + .get(messagesPerPage -1).getOffset(); |
| 297 | + topicDetails |
| 298 | + .clickNextButton(); |
| 299 | + softly.assertEquals(topicDetails.getAllMessages().stream().findFirst().orElseThrow().getOffset(), |
| 300 | + lastOffsetOnPage + 1, "findFirst().getOffset()"); |
| 301 | + softly.assertTrue(topicDetails.isBackButtonEnabled(), "isBackButtonEnabled()"); |
| 302 | + softly.assertFalse(topicDetails.isNextButtonEnabled(), "isNextButtonEnabled()"); |
| 303 | + softly.assertAll(); |
| 304 | + } |
| 305 | + |
275 | 306 | @Step |
276 | 307 | protected void produceMessage(Topic topic) { |
277 | 308 | topicDetails |
|
0 commit comments