From 268ac76ce85346d241cac0ea5c0a3ccd05fecf9d Mon Sep 17 00:00:00 2001 From: jkalinic Date: Thu, 16 Jul 2026 19:15:41 +0200 Subject: [PATCH 1/2] enable authst checks after fix Signed-off-by: jkalinic --- .../systemtests/locators/CssSelectors.java | 1 + .../utils/playwright/PwPageUrls.java | 3 +- .../streamshub/systemtests/auth/AuthST.java | 45 +++++++++---------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/systemtests/src/main/java/com/github/streamshub/systemtests/locators/CssSelectors.java b/systemtests/src/main/java/com/github/streamshub/systemtests/locators/CssSelectors.java index 826f7fafe..d4d0c00bb 100644 --- a/systemtests/src/main/java/com/github/streamshub/systemtests/locators/CssSelectors.java +++ b/systemtests/src/main/java/com/github/streamshub/systemtests/locators/CssSelectors.java @@ -146,6 +146,7 @@ private CssSelectors() {} .withElementButton().withComponentMenu().withSubComponentItem() .build(); + public static final String BODY_EMPTY_STATE = "body > div > div.pf-v6-c-page > div.pf-v6-c-page__main-container:nth-of-type(2) > main.pf-v6-c-page__main > section.pf-v6-c-page__main-section:nth-of-type(2) > div.pf-v6-c-page__main-body > div.pf-v6-c-empty-state > div.pf-v6-c-empty-state__content > div.pf-v6-c-empty-state__body"; // Kafka credentials login page diff --git a/systemtests/src/main/java/com/github/streamshub/systemtests/utils/playwright/PwPageUrls.java b/systemtests/src/main/java/com/github/streamshub/systemtests/utils/playwright/PwPageUrls.java index 178f51cf8..492e6fcf2 100644 --- a/systemtests/src/main/java/com/github/streamshub/systemtests/utils/playwright/PwPageUrls.java +++ b/systemtests/src/main/java/com/github/streamshub/systemtests/utils/playwright/PwPageUrls.java @@ -43,7 +43,8 @@ public static String getMessagesPage(TestCaseConfig tcc, String kafkaName, Strin } public static String getGroupsMembersPage(TestCaseConfig tcc, String kafkaName, String consumerGroupName) { - return getGroupsPage(tcc, kafkaName) + "/" + consumerGroupName + "/members"; + consumerGroupName = consumerGroupName.isBlank() ? "" : "/" + consumerGroupName; + return getGroupsPage(tcc, kafkaName) + consumerGroupName + "/members"; } public static String getGroupsPage(TestCaseConfig tcc, String kafkaName) { diff --git a/systemtests/src/test/java/com/github/streamshub/systemtests/auth/AuthST.java b/systemtests/src/test/java/com/github/streamshub/systemtests/auth/AuthST.java index 096d68e43..f71b2f2e6 100644 --- a/systemtests/src/test/java/com/github/streamshub/systemtests/auth/AuthST.java +++ b/systemtests/src/test/java/com/github/streamshub/systemtests/auth/AuthST.java @@ -7,6 +7,7 @@ import com.github.streamshub.systemtests.constants.AuthTestConstants; import com.github.streamshub.systemtests.constants.Constants; import com.github.streamshub.systemtests.constants.TestTags; +import com.github.streamshub.systemtests.constants.TimeConstants; import com.github.streamshub.systemtests.enums.FilterType; import com.github.streamshub.systemtests.locators.ClusterOverviewPageSelectors; import com.github.streamshub.systemtests.locators.CssSelectors; @@ -20,6 +21,7 @@ import com.github.streamshub.systemtests.setup.keycloak.KeycloakOperatorSetup; import com.github.streamshub.systemtests.setup.keycloak.KeycloakTestConfig; import com.github.streamshub.systemtests.setup.strimzi.KafkaSetup; +import com.github.streamshub.systemtests.utils.Utils; import com.github.streamshub.systemtests.utils.WaitUtils; import com.github.streamshub.systemtests.utils.playwright.PwPageUrls; import com.github.streamshub.systemtests.utils.playwright.PwUtils; @@ -44,6 +46,7 @@ import org.junit.jupiter.api.TestMethodOrder; import static com.github.streamshub.systemtests.utils.Utils.getTestCaseConfig; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @Tag(TestTags.REGRESSION) @@ -112,12 +115,11 @@ void testAccessDevUser() { PwUtils.waitForLocatorCount(tcc, 1, TopicsPageSelectors.TPS_TABLE_ROWS, false); PwUtils.waitForContainsText(tcc, TopicsPageSelectors.TPS_NO_RESULTS_FOUND, "No results found", false); - // TODO: enable once fixed // // Logout and check user is no longer logged in - // PwUtils.logoutUser(tcc, AuthTestConstants.USER_DEV_BOB, true); - // PwUtils.navigate(tcc, PwPageUrls.getKafkaBaseUrl(tcc, AuthTestConstants.TEAM_DEV_KAFKA_NAME)); - // Utils.sleepWait(TimeConstants.UI_COMPONENT_REACTION_INTERVAL_SHORT); - // assertNotEquals(tcc.page().url(), ConsoleUtils.getConsoleUiUrl(tcc.consoleInstanceName(), true)); + PwUtils.logoutUser(tcc, AuthTestConstants.USER_DEV_BOB, true); + PwUtils.navigate(tcc, PwPageUrls.getKafkaBaseUrl(tcc, AuthTestConstants.TEAM_DEV_KAFKA_NAME)); + Utils.sleepWait(TimeConstants.UI_COMPONENT_REACTION_INTERVAL_SHORT); + assertNotEquals(tcc.page().url(), ConsoleUtils.getConsoleUiUrl(tcc.consoleInstanceName(), true)); } /** @@ -204,17 +206,16 @@ void testAccessAdminUser() { PwUtils.waitForLocatorAndClick(tcc, TopicsPageSelectors.TPS_TOP_TOOLBAR_FILTER_SEARCH_BUTTON); PwUtils.waitForLocatorCount(tcc, AuthTestConstants.ADMIN_REPLICATED_TOPICS_COUNT, TopicsPageSelectors.TPS_TABLE_ROWS, false); - // TODO: enable once fixed // // Logout and check user is no longer logged in - // PwUtils.logoutUser(tcc, AuthTestConstants.USER_ADMIN_ALICE, true); - // // Dev - // PwUtils.navigate(tcc, PwPageUrls.getKafkaBaseUrl(tcc, AuthTestConstants.TEAM_DEV_KAFKA_NAME)); - // Utils.sleepWait(TimeConstants.UI_COMPONENT_REACTION_INTERVAL_SHORT); - // assertNotEquals(tcc.page().url(), ConsoleUtils.getConsoleUiUrl(tcc.consoleInstanceName(), true)); - // // Admin - // PwUtils.navigate(tcc, PwPageUrls.getKafkaBaseUrl(tcc, AuthTestConstants.TEAM_ADMIN_KAFKA_NAME)); - // Utils.sleepWait(TimeConstants.UI_COMPONENT_REACTION_INTERVAL_SHORT); - // assertNotEquals(tcc.page().url(), ConsoleUtils.getConsoleUiUrl(tcc.consoleInstanceName(), true)); + PwUtils.logoutUser(tcc, AuthTestConstants.USER_ADMIN_ALICE, true); + // Dev + PwUtils.navigate(tcc, PwPageUrls.getKafkaBaseUrl(tcc, AuthTestConstants.TEAM_DEV_KAFKA_NAME)); + Utils.sleepWait(TimeConstants.UI_COMPONENT_REACTION_INTERVAL_SHORT); + assertNotEquals(tcc.page().url(), ConsoleUtils.getConsoleUiUrl(tcc.consoleInstanceName(), true)); + // Admin + PwUtils.navigate(tcc, PwPageUrls.getKafkaBaseUrl(tcc, AuthTestConstants.TEAM_ADMIN_KAFKA_NAME)); + Utils.sleepWait(TimeConstants.UI_COMPONENT_REACTION_INTERVAL_SHORT); + assertNotEquals(tcc.page().url(), ConsoleUtils.getConsoleUiUrl(tcc.consoleInstanceName(), true)); } /** @@ -274,13 +275,12 @@ void testAccessTopicsViewUser() { PwUtils.navigate(tcc, PwPageUrls.getNodesPage(tcc, AuthTestConstants.TEAM_DEV_KAFKA_NAME)); PwUtils.waitForContainsText(tcc, NodesPageSelectors.PAGES_NOT_AUTHORIZED_CONTENT, "403", true); - // TODO: enable once fixed - // LOGGER.info("Verify consumer groups page is unavailable"); - // PwUtils.navigate(tcc, PwPageUrls.getGroupsMembersPage(tcc, AuthTestConstants.TEAM_DEV_KAFKA_NAME, "")); - // PwUtils.waitForContainsText(tcc, CssSelectors.PAGES_NOT_AUTHORIZED_CONTENT, "403 Forbidden", true); - // + LOGGER.info("Verify consumer groups page is unavailable"); + PwUtils.navigate(tcc, PwPageUrls.getGroupsMembersPage(tcc, AuthTestConstants.TEAM_DEV_KAFKA_NAME, "")); + PwUtils.waitForContainsText(tcc, CssSelectors.BODY_EMPTY_STATE, "403 Forbidden", true); + // Logout and check user is no longer logged in - //PwUtils.logoutUser(tcc, AuthTestConstants.USER_TOPICONLY_FRANK, true); + PwUtils.logoutUser(tcc, AuthTestConstants.USER_TOPICONLY_FRANK, true); } /** @@ -373,9 +373,8 @@ void testAccessGroupsViewUser() { LOGGER.info("Wait for producer and consumer clients on topic '{}' to complete successfully", newTopicName); WaitUtils.waitForClientsSuccess(clients); - // TODO: enable once fixed // Logout and check user is no longer logged in - //PwUtils.logoutUser(tcc, AuthTestConstants.USER_CONSUMERONLY_GRACE, true); + PwUtils.logoutUser(tcc, AuthTestConstants.USER_CONSUMERONLY_GRACE, true); } @BeforeAll From ff510145d8f140a80829cd93a426a279c13647b0 Mon Sep 17 00:00:00 2001 From: jkalinic Date: Mon, 20 Jul 2026 10:20:37 +0200 Subject: [PATCH 2/2] added specific groupID, removed blank members page check Signed-off-by: jkalinic --- .../utils/playwright/PwPageUrls.java | 3 +-- .../streamshub/systemtests/auth/AuthST.java | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/systemtests/src/main/java/com/github/streamshub/systemtests/utils/playwright/PwPageUrls.java b/systemtests/src/main/java/com/github/streamshub/systemtests/utils/playwright/PwPageUrls.java index 492e6fcf2..178f51cf8 100644 --- a/systemtests/src/main/java/com/github/streamshub/systemtests/utils/playwright/PwPageUrls.java +++ b/systemtests/src/main/java/com/github/streamshub/systemtests/utils/playwright/PwPageUrls.java @@ -43,8 +43,7 @@ public static String getMessagesPage(TestCaseConfig tcc, String kafkaName, Strin } public static String getGroupsMembersPage(TestCaseConfig tcc, String kafkaName, String consumerGroupName) { - consumerGroupName = consumerGroupName.isBlank() ? "" : "/" + consumerGroupName; - return getGroupsPage(tcc, kafkaName) + consumerGroupName + "/members"; + return getGroupsPage(tcc, kafkaName) + "/" + consumerGroupName + "/members"; } public static String getGroupsPage(TestCaseConfig tcc, String kafkaName) { diff --git a/systemtests/src/test/java/com/github/streamshub/systemtests/auth/AuthST.java b/systemtests/src/test/java/com/github/streamshub/systemtests/auth/AuthST.java index f71b2f2e6..409c763cd 100644 --- a/systemtests/src/test/java/com/github/streamshub/systemtests/auth/AuthST.java +++ b/systemtests/src/test/java/com/github/streamshub/systemtests/auth/AuthST.java @@ -1,5 +1,6 @@ package com.github.streamshub.systemtests.auth; +import com.github.streamshub.console.support.Identifiers; import com.github.streamshub.systemtests.AbstractST; import com.github.streamshub.systemtests.TestCaseConfig; import com.github.streamshub.systemtests.clients.KafkaClients; @@ -276,7 +277,24 @@ void testAccessTopicsViewUser() { PwUtils.waitForContainsText(tcc, NodesPageSelectors.PAGES_NOT_AUTHORIZED_CONTENT, "403", true); LOGGER.info("Verify consumer groups page is unavailable"); - PwUtils.navigate(tcc, PwPageUrls.getGroupsMembersPage(tcc, AuthTestConstants.TEAM_DEV_KAFKA_NAME, "")); + String newTopicName = AuthTestConstants.TEAM_DEV_TOPIC_PREFIX + "unathorized-groups"; + KafkaClients clients = new KafkaClientsBuilder() + .withNamespaceName(tcc.namespace()) + .withTopicName(newTopicName) + .withMessageCount(Constants.MESSAGE_COUNT) + .withDelayMs(0) + .withProducerName(KafkaNamingUtils.producerName(newTopicName)) + .withConsumerName(KafkaNamingUtils.consumerName(newTopicName)) + .withConsumerGroup(KafkaNamingUtils.consumerGroupName(newTopicName)) + .withBootstrapAddress(KafkaUtils.getPlainScramShaBootstrapAddress(AuthTestConstants.TEAM_DEV_KAFKA_NAME)) + .withUsername(KafkaNamingUtils.kafkaUserName(AuthTestConstants.TEAM_DEV_KAFKA_NAME)) + .withAdditionalConfig(KafkaClientsUtils.getScramShaConfig(tcc.namespace(), KafkaNamingUtils.kafkaUserName(AuthTestConstants.TEAM_DEV_KAFKA_NAME), SecurityProtocol.SASL_PLAINTEXT)) + .build(); + + KubeResourceManager.get().createResourceAsyncWait(clients.producer(), clients.consumer()); + WaitUtils.waitForClientsSuccess(clients); + String consumerGroupEncodedName = Identifiers.encode(KafkaNamingUtils.consumerGroupName(newTopicName)); + PwUtils.navigate(tcc, PwPageUrls.getGroupsMembersPage(tcc, AuthTestConstants.TEAM_DEV_KAFKA_NAME, consumerGroupEncodedName)); PwUtils.waitForContainsText(tcc, CssSelectors.BODY_EMPTY_STATE, "403 Forbidden", true); // Logout and check user is no longer logged in