This is an automated email from the ASF dual-hosted git repository.

achao pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new 8c1e6197c [Improve] e2e findElement improvement (#4049)
8c1e6197c is described below

commit 8c1e6197c35c37123b84292b005a3982d04d76df
Author: benjobs <[email protected]>
AuthorDate: Thu Sep 12 08:05:47 2024 +0800

    [Improve] e2e findElement improvement (#4049)
---
 .../streampark-console-webapp/src/design/index.less | 21 +++++++++++++++++++++
 .../resource/variable/components/VariableDrawer.vue |  2 ++
 .../src/views/system/role/components/RoleDrawer.vue |  2 ++
 .../e2e/pages/resource/VariablesPage.java           |  6 +++---
 .../e2e/pages/system/RoleManagementPage.java        |  4 ++--
 5 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/streampark-console/streampark-console-webapp/src/design/index.less 
b/streampark-console/streampark-console-webapp/src/design/index.less
index ce0035409..ac3e23a64 100644
--- a/streampark-console/streampark-console-webapp/src/design/index.less
+++ b/streampark-console/streampark-console-webapp/src/design/index.less
@@ -91,3 +91,24 @@ span {
   font-size: 18px;
   font-weight: bold;
 }
+
+.ant-input,
+.ant-input-number,
+.ant-input-affix-wrapper,
+.ant-btn:not(.ant-btn-circle),
+.ant-pagination-item,
+.ant-modal-header,
+.ant-modal-footer,
+.ant-modal-content,
+.ant-tree-checkbox-inner,
+.ant-table,
+.ant-alert,
+.bold-tag,
+.bold-tag > .ant-tag,
+.ant-tabs-tab,
+.ant-btn-group,
+textarea.ant-input,
+.ant-select-selector,
+.ant-upload.ant-upload-drag {
+  border-radius: 0 !important;
+}
diff --git 
a/streampark-console/streampark-console-webapp/src/views/resource/variable/components/VariableDrawer.vue
 
b/streampark-console/streampark-console-webapp/src/views/resource/variable/components/VariableDrawer.vue
index b669aa73a..407baab0d 100644
--- 
a/streampark-console/streampark-console-webapp/src/views/resource/variable/components/VariableDrawer.vue
+++ 
b/streampark-console/streampark-console-webapp/src/views/resource/variable/components/VariableDrawer.vue
@@ -16,6 +16,8 @@
 -->
 <template>
   <BasicDrawer
+    :okButtonProps="{ 'class': 'e2e_var_pop_ok' }"
+    :cancelButtonProps="{ 'class': 'e2e_var_pop_cancel'}"
     :okText="t('common.submitText')"
     @register="registerDrawer"
     showFooter
diff --git 
a/streampark-console/streampark-console-webapp/src/views/system/role/components/RoleDrawer.vue
 
b/streampark-console/streampark-console-webapp/src/views/system/role/components/RoleDrawer.vue
index 5ec33b101..473b0b3e6 100644
--- 
a/streampark-console/streampark-console-webapp/src/views/system/role/components/RoleDrawer.vue
+++ 
b/streampark-console/streampark-console-webapp/src/views/system/role/components/RoleDrawer.vue
@@ -16,6 +16,8 @@
 -->
 <template>
   <BasicDrawer
+    :okButtonProps="{ 'class': 'e2e_role_pop_ok' }"
+    :cancelButtonProps="{ 'class': 'e2e_role_pop_cancel'}"
     v-bind="$attrs"
     @register="registerDrawer"
     showFooter
diff --git 
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/VariablesPage.java
 
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/VariablesPage.java
index 7878d95c6..f3da373cc 100644
--- 
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/VariablesPage.java
+++ 
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/resource/VariablesPage.java
@@ -43,7 +43,7 @@ public class VariablesPage extends NavBarPage implements 
ResourcePage.Tab {
     @FindBy(className = "swal2-html-container")
     private List<WebElement> errorMessageList;
 
-    @FindBy(xpath = "//button[contains(text(), 'OK')]")
+    @FindBy(xpath = "//button[contains(@class, 'swal2-confirm')]")
     private WebElement errorMessageConfirmButton;
 
     @FindBy(className = "e2e-variable-delete-confirm")
@@ -147,10 +147,10 @@ public class VariablesPage extends NavBarPage implements 
ResourcePage.Tab {
         @FindBy(id = "VariableForm_desensitization")
         private WebElement buttonDesensitization;
 
-        @FindBy(xpath = "//button[contains(@class, 
'ant-btn')]//span[contains(., 'Submit')]")
+        @FindBy(className = "e2e_var_pop_ok")
         private WebElement buttonSubmit;
 
-        @FindBy(xpath = "//button[contains(@class, 
'ant-btn')]//span[contains(., 'Cancel')]")
+        @FindBy(className = "e2e_var_pop_cancel")
         private WebElement buttonCancel;
     }
 }
diff --git 
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/system/RoleManagementPage.java
 
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/system/RoleManagementPage.java
index 7f10f6d3b..794642d56 100644
--- 
a/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/system/RoleManagementPage.java
+++ 
b/streampark-e2e/streampark-e2e-case/src/test/java/org/apache/streampark/e2e/pages/system/RoleManagementPage.java
@@ -151,10 +151,10 @@ public class RoleManagementPage extends NavBarPage 
implements SystemPage.Tab {
         })
         private List<WebElement> inputMenus;
 
-        @FindBy(xpath = "//button[contains(@class, 
'ant-btn')]//span[contains(., 'Submit')]")
+        @FindBy(className = "e2e_role_pop_ok")
         private WebElement buttonSubmit;
 
-        @FindBy(xpath = "//button[contains(@class, 
'ant-btn')]//span[contains(., 'Cancel')]")
+        @FindBy(className = "e2e_role_pop_cancel")
         private WebElement buttonCancel;
     }
 }

Reply via email to