zzzk1 commented on code in PR #3824:
URL: 
https://github.com/apache/incubator-streampark/pull/3824#discussion_r1665101897


##########
streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/cases/RoleManagementTest.java:
##########
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.streampark.e2e.cases;
+
+import org.apache.streampark.e2e.core.StreamPark;
+import org.apache.streampark.e2e.pages.LoginPage;
+import org.apache.streampark.e2e.pages.system.RoleManagementPage;
+import org.apache.streampark.e2e.pages.system.SystemPage;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.RemoteWebDriver;
+import org.testcontainers.shaded.org.awaitility.Awaitility;
+import static org.assertj.core.api.Assertions.assertThat;
+
+@StreamPark(composeFiles = "docker/basic/docker-compose.yaml")
+public class RoleManagementTest {
+  private static RemoteWebDriver browser;
+
+  private static final String userName = "admin";
+
+  private static final String password = "streampark";
+
+  private static final String teamName = "default";
+
+  private static final String newRoleName = "new_role";
+
+  private static final String newDescription = "new_description";
+
+  private static final String existMenuName = "Apache Flink";
+
+  @BeforeAll
+  public static void setup() {
+    new LoginPage(browser)
+        .login(userName, password, teamName)
+        .goToNav(SystemPage.class)
+        .goToTab(RoleManagementPage.class);
+  }
+
+  @Test
+  @Order(10)
+  void testCreateUser() {
+    final RoleManagementPage roleManagementPage = new 
RoleManagementPage(browser);
+    roleManagementPage.createRole(newRoleName, newDescription, existMenuName);
+
+    Awaitility.await()
+        .untilAsserted(
+            () ->
+                assertThat(roleManagementPage.roleList())
+                    .as("Role list should contain newly-created role")
+                    .extracting(WebElement::getText)
+                    .anyMatch(it -> it.contains(newRoleName)));
+  }
+
+  @Test
+  @Order(20)
+  void testCreateDuplicateRole() {
+    final RoleManagementPage roleManagementPage = new 
RoleManagementPage(browser);
+    roleManagementPage.createRole(newRoleName, newDescription, existMenuName);
+
+    Awaitility.await()
+        .untilAsserted(
+            () ->
+                assertThat(roleManagementPage.errorMessageList())
+                    .as("Role Name Duplicated Error message should be 
displayed")
+                    .extracting(WebElement::getText)
+                    .anyMatch(it -> it.contains("Sorry, the role name already 
exists")));
+
+    roleManagementPage.createRoleForm().buttonCancel().click();
+  }
+    @Test
+    @Order(30)
+    void testEditRole() {
+      final RoleManagementPage roleManagementPage = new 
RoleManagementPage(browser);
+
+      String newEditDescription = newDescription + "_edit";
+      String newEditMenuName = "System";
+      roleManagementPage.editRole(newRoleName, newEditDescription, 
newEditMenuName);
+
+    //TODO: there is no description filed value actual exist
+    //       Awaitility.await()
+    //           .untilAsserted(
+    //               () ->
+    //                   assertThat(roleManagementPage.roleList())
+    //                       .as("Role list should contain newly-created role")
+    //                       .extracting(WebElement::getText)
+    //                       .anyMatch(it -> it.contains(newEditDescription)));
+    }

Review Comment:
   > I tested it and it was a bug. The description did not showing 
successfully. Would you like to fix it?
   
   i will fix it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to