Browse Source

[CI][E2E] Upgrade e2e dependency version (#14634)

* upgrade e2e dependency version

* upgrade e2e dependency version

* optimize imports

* remove duplicated awaitility

* remove duplicated awaitility
3.2.1-prepare
xiangzihao 1 year ago committed by GitHub
parent
commit
c6696683e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClickhouseDataSourceE2ETest.java
  2. 10
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClusterE2ETest.java
  3. 13
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/EnvironmentE2ETest.java
  4. 32
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/FileManageE2ETest.java
  5. 12
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/FunctionManageE2ETest.java
  6. 13
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/HiveDataSourceE2ETest.java
  7. 11
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/MysqlDataSourceE2ETest.java
  8. 10
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/PostgresDataSourceE2ETest.java
  9. 5
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ProjectE2ETest.java
  10. 8
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/QueueE2ETest.java
  11. 10
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/SqlServerDataSourceE2ETest.java
  12. 10
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/TenantE2ETest.java
  13. 8
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/TokenE2ETest.java
  14. 40
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/UdfManageE2ETest.java
  15. 16
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/UserE2ETest.java
  16. 14
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/WorkerGroupE2ETest.java
  17. 13
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/WorkflowE2ETest.java
  18. 9
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/WorkflowSwitchE2ETest.java
  19. 6
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/LoginPage.java
  20. 5
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/common/CodeEditor.java
  21. 10
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/common/NavBarPage.java
  22. 5
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java
  23. 12
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/WorkflowDefinitionTab.java
  24. 3
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/WorkflowForm.java
  25. 5
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/WorkflowRunDialog.java
  26. 5
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/task/SubWorkflowTaskForm.java
  27. 5
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/task/SwitchTaskForm.java
  28. 3
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/task/TaskNodeForm.java
  29. 5
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/FileManagePage.java
  30. 25
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/ResourcePage.java
  31. 3
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/UdfManagePage.java
  32. 5
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/security/EnvironmentPage.java
  33. 34
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/security/SecurityPage.java
  34. 11
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/security/TokenPage.java
  35. 5
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/security/UserPage.java
  36. 11
      dolphinscheduler-e2e/dolphinscheduler-e2e-core/src/main/java/org/apache/dolphinscheduler/e2e/core/DolphinSchedulerExtension.java
  37. 14
      dolphinscheduler-e2e/pom.xml

10
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClickhouseDataSourceE2ETest.java

@ -21,12 +21,14 @@
package org.apache.dolphinscheduler.e2e.cases; package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage; import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import java.time.Duration;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -80,10 +82,10 @@ public class ClickhouseDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams); page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated( new WebDriverWait(page.driver(), Duration.ofSeconds(20)).until(ExpectedConditions.invisibilityOfElementLocated(
new By.ByClassName("dialog-create-data-source"))); new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList()) Awaitility.await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database") .as("DataSource list should contain newly-created database")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName))); .anyMatch(it -> it.contains(dataSourceName)));
@ -96,7 +98,7 @@ public class ClickhouseDataSourceE2ETest {
page.delete(dataSourceName); page.delete(dataSourceName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

10
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClusterE2ETest.java

@ -21,13 +21,13 @@ package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.security.ClusterPage; import org.apache.dolphinscheduler.e2e.pages.security.ClusterPage;
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage; import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -63,7 +63,7 @@ class ClusterE2ETest {
final ClusterPage page = new ClusterPage(browser); final ClusterPage page = new ClusterPage(browser);
page.create(clusterName, clusterConfig, clusterDesc); page.create(clusterName, clusterConfig, clusterDesc);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.clusterList()) assertThat(page.clusterList())
.as("Cluster list should contain newly-created cluster") .as("Cluster list should contain newly-created cluster")
@ -78,7 +78,7 @@ class ClusterE2ETest {
final ClusterPage page = new ClusterPage(browser); final ClusterPage page = new ClusterPage(browser);
page.create(clusterName, clusterConfig, clusterDesc); page.create(clusterName, clusterConfig, clusterDesc);
await().untilAsserted(() -> Awaitility.await().untilAsserted(() ->
assertThat(browser.findElement(By.tagName("body")).getText()) assertThat(browser.findElement(By.tagName("body")).getText())
.contains("already exists") .contains("already exists")
); );
@ -92,7 +92,7 @@ class ClusterE2ETest {
final ClusterPage page = new ClusterPage(browser); final ClusterPage page = new ClusterPage(browser);
page.update(clusterName, editClusterName, editClusterConfig, editClusterDesc); page.update(clusterName, editClusterName, editClusterConfig, editClusterDesc);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.clusterList()) assertThat(page.clusterList())
.as("Cluster list should contain newly-modified cluster") .as("Cluster list should contain newly-modified cluster")
@ -108,7 +108,7 @@ class ClusterE2ETest {
page.delete(editClusterName); page.delete(editClusterName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

13
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/EnvironmentE2ETest.java

@ -21,16 +21,13 @@ package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
import org.apache.dolphinscheduler.e2e.pages.security.EnvironmentPage; import org.apache.dolphinscheduler.e2e.pages.security.EnvironmentPage;
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage; import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.apache.dolphinscheduler.e2e.pages.security.WorkerGroupPage;
import org.junit.jupiter.api.AfterAll; import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -68,7 +65,7 @@ class EnvironmentE2ETest {
final EnvironmentPage page = new EnvironmentPage(browser); final EnvironmentPage page = new EnvironmentPage(browser);
page.create(environmentName, environmentConfig, environmentDesc, environmentWorkerGroup); page.create(environmentName, environmentConfig, environmentDesc, environmentWorkerGroup);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.environmentList()) assertThat(page.environmentList())
.as("Environment list should contain newly-created environment") .as("Environment list should contain newly-created environment")
@ -83,7 +80,7 @@ class EnvironmentE2ETest {
final EnvironmentPage page = new EnvironmentPage(browser); final EnvironmentPage page = new EnvironmentPage(browser);
page.create(environmentName, environmentConfig, environmentDesc, environmentWorkerGroup); page.create(environmentName, environmentConfig, environmentDesc, environmentWorkerGroup);
await().untilAsserted(() -> Awaitility.await().untilAsserted(() ->
assertThat(browser.findElement(By.tagName("body")).getText()) assertThat(browser.findElement(By.tagName("body")).getText())
.contains("already exists") .contains("already exists")
); );
@ -97,7 +94,7 @@ class EnvironmentE2ETest {
final EnvironmentPage page = new EnvironmentPage(browser); final EnvironmentPage page = new EnvironmentPage(browser);
page.update(environmentName, editEnvironmentName, editEnvironmentConfig, editEnvironmentDesc, editEnvironmentWorkerGroup); page.update(environmentName, editEnvironmentName, editEnvironmentConfig, editEnvironmentDesc, editEnvironmentWorkerGroup);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.environmentList()) assertThat(page.environmentList())
.as("Environment list should contain newly-modified environment") .as("Environment list should contain newly-modified environment")
@ -113,7 +110,7 @@ class EnvironmentE2ETest {
page.delete(editEnvironmentName); page.delete(editEnvironmentName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

32
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/FileManageE2ETest.java

@ -21,7 +21,6 @@ package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.Constants; import org.apache.dolphinscheduler.e2e.core.Constants;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
@ -40,6 +39,7 @@ import java.nio.file.Path;
import java.time.Duration; import java.time.Duration;
import java.util.Comparator; import java.util.Comparator;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
@ -90,15 +90,15 @@ public class FileManageE2ETest {
.goToTab(TenantPage.class) .goToTab(TenantPage.class)
.create(tenant); .create(tenant);
await().untilAsserted(() -> assertThat(tenantPage.tenantList()) Awaitility.await().untilAsserted(() -> assertThat(tenantPage.tenantList())
.as("Tenant list should contain newly-created tenant") .as("Tenant list should contain newly-created tenant")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(tenant))); .anyMatch(it -> it.contains(tenant)));
UserPage userPage = tenantPage.goToNav(SecurityPage.class) UserPage userPage = tenantPage.goToNav(SecurityPage.class)
.goToTab(UserPage.class); .goToTab(UserPage.class);
new WebDriverWait(userPage.driver(), 20).until(ExpectedConditions.visibilityOfElementLocated( new WebDriverWait(userPage.driver(), Duration.ofSeconds(20)).until(ExpectedConditions.visibilityOfElementLocated(
new By.ByClassName("name"))); new By.ByClassName("name")));
userPage.update(user, user, email, phone, tenant) userPage.update(user, user, email, phone, tenant)
@ -124,7 +124,7 @@ public class FileManageE2ETest {
page.createDirectory(testDirectoryName); page.createDirectory(testDirectoryName);
await().untilAsserted(() -> assertThat(page.fileList()) Awaitility.await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file") .as("File list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(testDirectoryName))); .anyMatch(it -> it.contains(testDirectoryName)));
@ -137,7 +137,7 @@ public class FileManageE2ETest {
page.cancelCreateDirectory(testDirectoryName); page.cancelCreateDirectory(testDirectoryName);
await().untilAsserted(() -> assertThat(page.fileList()) Awaitility.await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file") .as("File list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(testDirectoryName))); .anyMatch(it -> it.contains(testDirectoryName)));
@ -199,7 +199,7 @@ public class FileManageE2ETest {
.goToTab(FileManagePage.class) .goToTab(FileManagePage.class)
.delete(testDirectoryName); .delete(testDirectoryName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(
@ -218,7 +218,7 @@ public class FileManageE2ETest {
page.createFile(testFileName, scripts); page.createFile(testFileName, scripts);
await().untilAsserted(() -> assertThat(page.fileList()) Awaitility.await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file") .as("File list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(testFileName))); .anyMatch(it -> it.contains(testFileName)));
@ -231,7 +231,7 @@ public class FileManageE2ETest {
page.rename(testFileName, testRenameFileName); page.rename(testFileName, testRenameFileName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.fileList()) assertThat(page.fileList())
@ -249,7 +249,7 @@ public class FileManageE2ETest {
page.editFile(testRenameFileName, scripts); page.editFile(testRenameFileName, scripts);
await().untilAsserted(() -> assertThat(page.fileList()) Awaitility.await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file") .as("File list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(testRenameFileName))); .anyMatch(it -> it.contains(testRenameFileName)));
@ -262,7 +262,7 @@ public class FileManageE2ETest {
page.delete(testRenameFileName); page.delete(testRenameFileName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(
@ -285,9 +285,9 @@ public class FileManageE2ETest {
page.uploadFile(testUnder1GBFilePath.toFile().getAbsolutePath()); page.uploadFile(testUnder1GBFilePath.toFile().getAbsolutePath());
new WebDriverWait(browser, 10).until(ExpectedConditions.invisibilityOfElementLocated(By.id("fileUpdateDialog"))); new WebDriverWait(browser, Duration.ofSeconds(20)).until(ExpectedConditions.invisibilityOfElementLocated(By.id("fileUpdateDialog")));
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
assertThat(page.fileList()) assertThat(page.fileList())
.as("File list should contain newly-created file") .as("File list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
@ -304,7 +304,7 @@ public class FileManageE2ETest {
File file = Constants.HOST_CHROME_DOWNLOAD_PATH.resolve(testUnder1GBFileName).toFile(); File file = Constants.HOST_CHROME_DOWNLOAD_PATH.resolve(testUnder1GBFileName).toFile();
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
assert file.exists(); assert file.exists();
}); });
} }

12
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/FunctionManageE2ETest.java

@ -22,7 +22,6 @@ package org.apache.dolphinscheduler.e2e.cases;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.Constants; import org.apache.dolphinscheduler.e2e.core.Constants;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
@ -44,6 +43,7 @@ import java.nio.file.Path;
import java.time.Duration; import java.time.Duration;
import java.util.Comparator; import java.util.Comparator;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
@ -89,7 +89,7 @@ public class FunctionManageE2ETest {
.goToTab(TenantPage.class) .goToTab(TenantPage.class)
.create(tenant); .create(tenant);
await().untilAsserted(() -> assertThat(tenantPage.tenantList()) Awaitility.await().untilAsserted(() -> assertThat(tenantPage.tenantList())
.as("Tenant list should contain newly-created tenant") .as("Tenant list should contain newly-created tenant")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(tenant))); .anyMatch(it -> it.contains(tenant)));
@ -99,7 +99,7 @@ public class FunctionManageE2ETest {
UserPage userPage = tenantPage.goToNav(SecurityPage.class) UserPage userPage = tenantPage.goToNav(SecurityPage.class)
.goToTab(UserPage.class); .goToTab(UserPage.class);
new WebDriverWait(userPage.driver(), 20).until(ExpectedConditions.visibilityOfElementLocated( new WebDriverWait(userPage.driver(), Duration.ofSeconds(20)).until(ExpectedConditions.visibilityOfElementLocated(
new By.ByClassName("name"))); new By.ByClassName("name")));
UdfManagePage udfManagePage = userPage.update(user, user, email, phone, tenant) UdfManagePage udfManagePage = userPage.update(user, user, email, phone, tenant)
@ -147,7 +147,7 @@ public class FunctionManageE2ETest {
page.createUdfFunction(testUdfFunctionName, testClassName, testUploadUdfFileName, testDescription); page.createUdfFunction(testUdfFunctionName, testClassName, testUploadUdfFileName, testDescription);
await().untilAsserted(() -> assertThat(page.functionList()) Awaitility.await().untilAsserted(() -> assertThat(page.functionList())
.as("Function list should contain newly-created file") .as("Function list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(testUdfFunctionName))); .anyMatch(it -> it.contains(testUdfFunctionName)));
@ -162,7 +162,7 @@ public class FunctionManageE2ETest {
page.renameUdfFunction(testUdfFunctionName, testRenameUdfFunctionName); page.renameUdfFunction(testUdfFunctionName, testRenameUdfFunctionName);
await().pollDelay(Duration.ofSeconds(2)).untilAsserted(() -> assertThat(page.functionList()) Awaitility.await().pollDelay(Duration.ofSeconds(2)).untilAsserted(() -> assertThat(page.functionList())
.as("Function list should contain newly-created file") .as("Function list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(testRenameUdfFunctionName))); .anyMatch(it -> it.contains(testRenameUdfFunctionName)));
@ -175,7 +175,7 @@ public class FunctionManageE2ETest {
page.deleteUdfFunction(testRenameUdfFunctionName); page.deleteUdfFunction(testRenameUdfFunctionName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

13
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/HiveDataSourceE2ETest.java

@ -21,12 +21,13 @@
package org.apache.dolphinscheduler.e2e.cases; package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage; import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import java.time.Duration;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -35,6 +36,7 @@ import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import org.testcontainers.shaded.org.awaitility.Awaitility;
@DolphinScheduler(composeFiles = "docker/datasource-hive/docker-compose.yaml") @DolphinScheduler(composeFiles = "docker/datasource-hive/docker-compose.yaml")
public class HiveDataSourceE2ETest { public class HiveDataSourceE2ETest {
@ -64,12 +66,13 @@ public class HiveDataSourceE2ETest {
private static final String jdbcParams = ""; private static final String jdbcParams = "";
@BeforeAll @BeforeAll
public static void setup() { public static void setup() {
new LoginPage(browser) new LoginPage(browser)
.login(user, password) .login(user, password)
.goToNav(DataSourcePage.class); .goToNav(DataSourcePage.class);
} }
@Test @Test
@ -79,10 +82,10 @@ public class HiveDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, hivePassword, database, jdbcParams); page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, hivePassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated( new WebDriverWait(page.driver(), Duration.ofSeconds(20)).until(ExpectedConditions.invisibilityOfElementLocated(
new By.ByClassName("dialog-create-data-source"))); new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList()) Awaitility.await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database") .as("DataSource list should contain newly-created database")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName))); .anyMatch(it -> it.contains(dataSourceName)));
@ -95,7 +98,7 @@ public class HiveDataSourceE2ETest {
page.delete(dataSourceName); page.delete(dataSourceName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

11
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/MysqlDataSourceE2ETest.java

@ -21,17 +21,18 @@
package org.apache.dolphinscheduler.e2e.cases; package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage; import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import java.time.Duration;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
@ -81,10 +82,10 @@ public class MysqlDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, mysqlPassword, database, jdbcParams); page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, mysqlPassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated( new WebDriverWait(page.driver(), Duration.ofSeconds(20)).until(ExpectedConditions.invisibilityOfElementLocated(
new By.ByClassName("dialog-create-data-source"))); new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList()) Awaitility.await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database") .as("DataSource list should contain newly-created database")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName))); .anyMatch(it -> it.contains(dataSourceName)));
@ -97,7 +98,7 @@ public class MysqlDataSourceE2ETest {
page.delete(dataSourceName); page.delete(dataSourceName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

10
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/PostgresDataSourceE2ETest.java

@ -21,12 +21,14 @@
package org.apache.dolphinscheduler.e2e.cases; package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage; import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import java.time.Duration;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -80,10 +82,10 @@ public class PostgresDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams); page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated( new WebDriverWait(page.driver(), Duration.ofSeconds(20)).until(ExpectedConditions.invisibilityOfElementLocated(
new By.ByClassName("dialog-create-data-source"))); new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList()) Awaitility.await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database") .as("DataSource list should contain newly-created database")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName))); .anyMatch(it -> it.contains(dataSourceName)));
@ -96,7 +98,7 @@ public class PostgresDataSourceE2ETest {
page.delete(dataSourceName); page.delete(dataSourceName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

5
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ProjectE2ETest.java

@ -20,16 +20,15 @@
package org.apache.dolphinscheduler.e2e.cases; package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.project.ProjectPage; import org.apache.dolphinscheduler.e2e.pages.project.ProjectPage;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.RemoteWebDriver;
@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml") @DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
@ -57,7 +56,7 @@ class ProjectE2ETest {
final ProjectPage page = new ProjectPage(browser); final ProjectPage page = new ProjectPage(browser);
page.delete(project); page.delete(project);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(
page.projectList() page.projectList()

8
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/QueueE2ETest.java

@ -21,13 +21,13 @@ package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.security.QueuePage; import org.apache.dolphinscheduler.e2e.pages.security.QueuePage;
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage; import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -60,7 +60,7 @@ class QueueE2ETest {
final QueuePage page = new QueuePage(browser); final QueuePage page = new QueuePage(browser);
page.create(queueName, queueValue); page.create(queueName, queueValue);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.queueList()) assertThat(page.queueList())
.as("Queue list should contain newly-created queue") .as("Queue list should contain newly-created queue")
@ -75,7 +75,7 @@ class QueueE2ETest {
final QueuePage page = new QueuePage(browser); final QueuePage page = new QueuePage(browser);
page.create(queueName, queueValue); page.create(queueName, queueValue);
await().untilAsserted(() -> Awaitility.await().untilAsserted(() ->
assertThat(browser.findElement(By.tagName("body")).getText()) assertThat(browser.findElement(By.tagName("body")).getText())
.contains("already exists") .contains("already exists")
); );
@ -90,7 +90,7 @@ class QueueE2ETest {
page.update(queueName, editQueueName, editQueueValue); page.update(queueName, editQueueName, editQueueValue);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.queueList()) assertThat(page.queueList())
.as("Queue list should contain newly-modified Queue") .as("Queue list should contain newly-modified Queue")

10
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/SqlServerDataSourceE2ETest.java

@ -21,12 +21,14 @@
package org.apache.dolphinscheduler.e2e.cases; package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage; import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import java.time.Duration;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -80,10 +82,10 @@ public class SqlServerDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams); page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated( new WebDriverWait(page.driver(), Duration.ofSeconds(20)).until(ExpectedConditions.invisibilityOfElementLocated(
new By.ByClassName("dialog-create-data-source"))); new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList()) Awaitility.await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database") .as("DataSource list should contain newly-created database")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName))); .anyMatch(it -> it.contains(dataSourceName)));
@ -96,7 +98,7 @@ public class SqlServerDataSourceE2ETest {
page.delete(dataSourceName); page.delete(dataSourceName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

10
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/TenantE2ETest.java

@ -20,13 +20,13 @@
package org.apache.dolphinscheduler.e2e.cases; package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage; import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.apache.dolphinscheduler.e2e.pages.security.TenantPage; import org.apache.dolphinscheduler.e2e.pages.security.TenantPage;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -56,7 +56,7 @@ class TenantE2ETest {
final TenantPage page = new TenantPage(browser); final TenantPage page = new TenantPage(browser);
page.create(tenant); page.create(tenant);
await().untilAsserted(() -> assertThat(page.tenantList()) Awaitility.await().untilAsserted(() -> assertThat(page.tenantList())
.as("Tenant list should contain newly-created tenant") .as("Tenant list should contain newly-created tenant")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(tenant))); .anyMatch(it -> it.contains(tenant)));
@ -69,7 +69,7 @@ class TenantE2ETest {
page.create(tenant); page.create(tenant);
await().untilAsserted(() -> Awaitility.await().untilAsserted(() ->
assertThat(browser.findElement(By.tagName("body")).getText()) assertThat(browser.findElement(By.tagName("body")).getText())
.contains("already exists") .contains("already exists")
); );
@ -84,7 +84,7 @@ class TenantE2ETest {
page.update(tenant, editDescription); page.update(tenant, editDescription);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.tenantList()) assertThat(page.tenantList())
.as("Tenant list should contain newly-modified tenant") .as("Tenant list should contain newly-modified tenant")
@ -99,7 +99,7 @@ class TenantE2ETest {
final TenantPage page = new TenantPage(browser); final TenantPage page = new TenantPage(browser);
page.delete(tenant); page.delete(tenant);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

8
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/TokenE2ETest.java

@ -20,13 +20,13 @@
package org.apache.dolphinscheduler.e2e.cases; package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage; import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.apache.dolphinscheduler.e2e.pages.security.TokenPage; import org.apache.dolphinscheduler.e2e.pages.security.TokenPage;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -55,7 +55,7 @@ public class TokenE2ETest {
TokenPage page = new TokenPage(browser); TokenPage page = new TokenPage(browser);
page.create(userName); page.create(userName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.tokenList()) assertThat(page.tokenList())
@ -72,7 +72,7 @@ public class TokenE2ETest {
String oldToken = page.getToken(userName); String oldToken = page.getToken(userName);
page.update(userName); page.update(userName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.tokenList()) assertThat(page.tokenList())
@ -88,7 +88,7 @@ public class TokenE2ETest {
TokenPage page = new TokenPage(browser); TokenPage page = new TokenPage(browser);
page.delete(userName); page.delete(userName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.tokenList()) assertThat(page.tokenList())

40
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/UdfManageE2ETest.java

@ -20,9 +20,7 @@
package org.apache.dolphinscheduler.e2e.cases; package org.apache.dolphinscheduler.e2e.cases;
import lombok.SneakyThrows;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.Constants; import org.apache.dolphinscheduler.e2e.core.Constants;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
@ -33,6 +31,17 @@ import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.apache.dolphinscheduler.e2e.pages.security.TenantPage; import org.apache.dolphinscheduler.e2e.pages.security.TenantPage;
import org.apache.dolphinscheduler.e2e.pages.security.UserPage; import org.apache.dolphinscheduler.e2e.pages.security.UserPage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
import java.util.Comparator;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
@ -43,16 +52,7 @@ import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import java.io.File; import lombok.SneakyThrows;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.Objects;
@DolphinScheduler(composeFiles = "docker/file-manage/docker-compose.yaml") @DolphinScheduler(composeFiles = "docker/file-manage/docker-compose.yaml")
public class UdfManageE2ETest { public class UdfManageE2ETest {
@ -86,7 +86,7 @@ public class UdfManageE2ETest {
.goToTab(TenantPage.class) .goToTab(TenantPage.class)
.create(tenant); .create(tenant);
await().untilAsserted(() -> assertThat(tenantPage.tenantList()) Awaitility.await().untilAsserted(() -> assertThat(tenantPage.tenantList())
.as("Tenant list should contain newly-created tenant") .as("Tenant list should contain newly-created tenant")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(tenant))); .anyMatch(it -> it.contains(tenant)));
@ -94,7 +94,7 @@ public class UdfManageE2ETest {
UserPage userPage = tenantPage.goToNav(SecurityPage.class) UserPage userPage = tenantPage.goToNav(SecurityPage.class)
.goToTab(UserPage.class); .goToTab(UserPage.class);
new WebDriverWait(userPage.driver(), 20).until(ExpectedConditions.visibilityOfElementLocated( new WebDriverWait(userPage.driver(), Duration.ofSeconds(20)).until(ExpectedConditions.visibilityOfElementLocated(
new By.ByClassName("name"))); new By.ByClassName("name")));
userPage.update(user, user, email, phone, tenant) userPage.update(user, user, email, phone, tenant)
@ -118,10 +118,10 @@ public class UdfManageE2ETest {
void testCreateDirectory() { void testCreateDirectory() {
final UdfManagePage page = new UdfManagePage(browser); final UdfManagePage page = new UdfManagePage(browser);
new WebDriverWait(page.driver(), 10) new WebDriverWait(page.driver(), Duration.ofSeconds(20))
.until(ExpectedConditions.urlContains("/resource-manage")); .until(ExpectedConditions.urlContains("/resource-manage"));
page.createDirectory(testDirectoryName); page.createDirectory(testDirectoryName);
await().untilAsserted(() -> assertThat(page.udfList()) Awaitility.await().untilAsserted(() -> assertThat(page.udfList())
.as("File list should contain newly-created file") .as("File list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(testDirectoryName))); .anyMatch(it -> it.contains(testDirectoryName)));
@ -151,7 +151,7 @@ public class UdfManageE2ETest {
final UdfManagePage page = new UdfManagePage(browser); final UdfManagePage page = new UdfManagePage(browser);
page.delete(testDirectoryName); page.delete(testDirectoryName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(
@ -170,7 +170,7 @@ public class UdfManageE2ETest {
downloadFile("https://repo1.maven.org/maven2/org/apache/hive/hive-jdbc/3.1.2/hive-jdbc-3.1.2.jar", testUploadUdfFilePath.toFile().getAbsolutePath()); downloadFile("https://repo1.maven.org/maven2/org/apache/hive/hive-jdbc/3.1.2/hive-jdbc-3.1.2.jar", testUploadUdfFilePath.toFile().getAbsolutePath());
page.uploadFile(testUploadUdfFilePath.toFile().getAbsolutePath()); page.uploadFile(testUploadUdfFilePath.toFile().getAbsolutePath());
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
assertThat(page.udfList()) assertThat(page.udfList())
.as("File list should contain newly-created file") .as("File list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
@ -202,7 +202,7 @@ public class UdfManageE2ETest {
final UdfManagePage page = new UdfManagePage(browser); final UdfManagePage page = new UdfManagePage(browser);
page.rename(testUploadUdfFileName, testUploadUdfRenameFileName); page.rename(testUploadUdfFileName, testUploadUdfRenameFileName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
assertThat(page.udfList()) assertThat(page.udfList())
.as("File list should contain newly-created file") .as("File list should contain newly-created file")
.extracting(WebElement::getText) .extracting(WebElement::getText)
@ -216,7 +216,7 @@ public class UdfManageE2ETest {
final UdfManagePage page = new UdfManagePage(browser); final UdfManagePage page = new UdfManagePage(browser);
page.delete(testUploadUdfRenameFileName); page.delete(testUploadUdfRenameFileName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

16
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/UserE2ETest.java

@ -21,7 +21,6 @@ package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
@ -30,6 +29,9 @@ import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.apache.dolphinscheduler.e2e.pages.security.TenantPage; import org.apache.dolphinscheduler.e2e.pages.security.TenantPage;
import org.apache.dolphinscheduler.e2e.pages.security.UserPage; import org.apache.dolphinscheduler.e2e.pages.security.UserPage;
import java.time.Duration;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
@ -63,7 +65,7 @@ class UserE2ETest {
.goToTab(TenantPage.class) .goToTab(TenantPage.class)
.create(tenant); .create(tenant);
await().untilAsserted(() -> assertThat(tenantPage.tenantList()) Awaitility.await().untilAsserted(() -> assertThat(tenantPage.tenantList())
.as("Tenant list should contain newly-created tenant") .as("Tenant list should contain newly-created tenant")
.extracting(WebElement::getText) .extracting(WebElement::getText)
.anyMatch(it -> it.contains(tenant))); .anyMatch(it -> it.contains(tenant)));
@ -87,7 +89,7 @@ class UserE2ETest {
page.create(user, password, email, phone, tenant); page.create(user, password, email, phone, tenant);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.userList()) assertThat(page.userList())
@ -104,7 +106,7 @@ class UserE2ETest {
page.create(user, password, email, phone, tenant); page.create(user, password, email, phone, tenant);
await().untilAsserted(() -> Awaitility.await().untilAsserted(() ->
assertThat(browser.findElement(By.tagName("body")).getText()) assertThat(browser.findElement(By.tagName("body")).getText())
.contains("already exists") .contains("already exists")
); );
@ -117,14 +119,14 @@ class UserE2ETest {
void testEditUser() { void testEditUser() {
UserPage page = new UserPage(browser); UserPage page = new UserPage(browser);
new WebDriverWait(browser, 20).until(ExpectedConditions.visibilityOfElementLocated( new WebDriverWait(browser, Duration.ofSeconds(20)).until(ExpectedConditions.visibilityOfElementLocated(
new By.ByClassName("name"))); new By.ByClassName("name")));
browser.navigate().refresh(); browser.navigate().refresh();
page.update(user, editUser, editEmail, editPhone, tenant); page.update(user, editUser, editEmail, editPhone, tenant);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.userList()) assertThat(page.userList())
.as("User list should contain newly-modified User") .as("User list should contain newly-modified User")
@ -140,7 +142,7 @@ class UserE2ETest {
page.delete(editUser); page.delete(editUser);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

14
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/WorkerGroupE2ETest.java

@ -21,13 +21,15 @@ package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler; import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage; import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage; import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.apache.dolphinscheduler.e2e.pages.security.WorkerGroupPage; import org.apache.dolphinscheduler.e2e.pages.security.WorkerGroupPage;
import java.time.Duration;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -57,12 +59,12 @@ class WorkerGroupE2ETest {
void testCreateWorkerGroup() { void testCreateWorkerGroup() {
final WorkerGroupPage page = new WorkerGroupPage(browser); final WorkerGroupPage page = new WorkerGroupPage(browser);
new WebDriverWait(page.driver(), 10) new WebDriverWait(page.driver(), Duration.ofSeconds(20))
.until(ExpectedConditions.urlContains("/security/worker-group-manage")); .until(ExpectedConditions.urlContains("/security/worker-group-manage"));
page.create(workerGroupName); page.create(workerGroupName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.workerGroupList()) assertThat(page.workerGroupList())
@ -79,7 +81,7 @@ class WorkerGroupE2ETest {
page.create(workerGroupName); page.create(workerGroupName);
await().untilAsserted(() -> Awaitility.await().untilAsserted(() ->
assertThat(browser.findElement(By.tagName("body")).getText()) assertThat(browser.findElement(By.tagName("body")).getText())
.contains("already exists") .contains("already exists")
); );
@ -93,7 +95,7 @@ class WorkerGroupE2ETest {
final WorkerGroupPage page = new WorkerGroupPage(browser); final WorkerGroupPage page = new WorkerGroupPage(browser);
page.update(workerGroupName, editWorkerGroupName); page.update(workerGroupName, editWorkerGroupName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat(page.workerGroupList()) assertThat(page.workerGroupList())
.as("workerGroup list should contain newly-modified workerGroup") .as("workerGroup list should contain newly-modified workerGroup")
@ -110,7 +112,7 @@ class WorkerGroupE2ETest {
page.delete(editWorkerGroupName); page.delete(editWorkerGroupName);
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
assertThat( assertThat(

13
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/WorkflowE2ETest.java

@ -33,6 +33,8 @@ import org.apache.dolphinscheduler.e2e.pages.project.workflow.task.SubWorkflowTa
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage; import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.apache.dolphinscheduler.e2e.pages.security.TenantPage; import org.apache.dolphinscheduler.e2e.pages.security.TenantPage;
import org.apache.dolphinscheduler.e2e.pages.security.UserPage; import org.apache.dolphinscheduler.e2e.pages.security.UserPage;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
@ -43,7 +45,6 @@ import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import java.time.Duration; import java.time.Duration;
@ -75,7 +76,7 @@ class WorkflowE2ETest {
.goToNav(SecurityPage.class) .goToNav(SecurityPage.class)
.goToTab(UserPage.class); .goToTab(UserPage.class);
new WebDriverWait(userPage.driver(), 20).until(ExpectedConditions.visibilityOfElementLocated( new WebDriverWait(userPage.driver(), Duration.ofSeconds(20)).until(ExpectedConditions.visibilityOfElementLocated(
new By.ByClassName("name"))); new By.ByClassName("name")));
userPage.update(user, user, email, phone, tenant) userPage.update(user, user, email, phone, tenant)
@ -127,7 +128,7 @@ class WorkflowE2ETest {
.submit() .submit()
; ;
await().untilAsserted(() -> assertThat(workflowDefinitionPage.workflowList()) Awaitility.await().untilAsserted(() -> assertThat(workflowDefinitionPage.workflowList())
.as("Workflow list should contain newly-created workflow") .as("Workflow list should contain newly-created workflow")
.anyMatch( .anyMatch(
it -> it.getText().contains(workflow) it -> it.getText().contains(workflow)
@ -159,7 +160,7 @@ class WorkflowE2ETest {
.submit() .submit()
; ;
await().untilAsserted(() -> assertThat( Awaitility.await().untilAsserted(() -> assertThat(
workflowDefinitionPage.workflowList() workflowDefinitionPage.workflowList()
).anyMatch(it -> it.getText().contains(workflow))); ).anyMatch(it -> it.getText().contains(workflow)));
workflowDefinitionPage.publish(workflow); workflowDefinitionPage.publish(workflow);
@ -181,7 +182,7 @@ class WorkflowE2ETest {
.run(workflow) .run(workflow)
.submit(); .submit();
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
final Row row = projectPage final Row row = projectPage
@ -203,7 +204,7 @@ class WorkflowE2ETest {
.next() .next()
.rerun(); .rerun();
await().timeout(Duration.ofSeconds(20)).untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
final Row row = projectPage final Row row = projectPage

9
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/WorkflowSwitchE2ETest.java

@ -34,6 +34,8 @@ import org.apache.dolphinscheduler.e2e.pages.project.workflow.task.ShellTaskForm
import org.apache.dolphinscheduler.e2e.pages.project.workflow.task.SwitchTaskForm; import org.apache.dolphinscheduler.e2e.pages.project.workflow.task.SwitchTaskForm;
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage; import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
import org.apache.dolphinscheduler.e2e.pages.security.TenantPage; import org.apache.dolphinscheduler.e2e.pages.security.TenantPage;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
@ -43,7 +45,6 @@ import org.openqa.selenium.remote.RemoteWebDriver;
import java.util.List; import java.util.List;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml") @DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
class WorkflowSwitchE2ETest { class WorkflowSwitchE2ETest {
@ -133,7 +134,7 @@ class WorkflowSwitchE2ETest {
.addGlobalParam("key", "1") .addGlobalParam("key", "1")
.submit(); .submit();
await().untilAsserted(() -> assertThat( Awaitility.await().untilAsserted(() -> assertThat(
workflowDefinitionPage.workflowList() workflowDefinitionPage.workflowList()
).anyMatch(it -> it.getText().contains(workflow))); ).anyMatch(it -> it.getText().contains(workflow)));
@ -157,7 +158,7 @@ class WorkflowSwitchE2ETest {
.run(workflow) .run(workflow)
.submit(); .submit();
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh(); browser.navigate().refresh();
final Row row = projectPage final Row row = projectPage
@ -175,7 +176,7 @@ class WorkflowSwitchE2ETest {
.goToTab(TaskInstanceTab.class) .goToTab(TaskInstanceTab.class)
.instances(); .instances();
await().untilAsserted(() -> { Awaitility.await().untilAsserted(() -> {
assertThat(taskInstances.size()).isEqualTo(3); assertThat(taskInstances.size()).isEqualTo(3);
assertThat(taskInstances.stream().filter(row -> row.name().contains(ifBranchName)).count()).isEqualTo(1); assertThat(taskInstances.stream().filter(row -> row.name().contains(ifBranchName)).count()).isEqualTo(1);
assertThat(taskInstances.stream().noneMatch(row -> row.name().contains(elseBranchName))).isTrue(); assertThat(taskInstances.stream().noneMatch(row -> row.name().contains(elseBranchName))).isTrue();

6
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/LoginPage.java

@ -32,6 +32,8 @@ import org.openqa.selenium.support.ui.WebDriverWait;
import lombok.Getter; import lombok.Getter;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import java.time.Duration;
@Getter @Getter
public final class LoginPage extends NavBarPage { public final class LoginPage extends NavBarPage {
@FindBys({ @FindBys({
@ -58,7 +60,7 @@ public final class LoginPage extends NavBarPage {
@SneakyThrows @SneakyThrows
public NavBarPage login(String username, String password) { public NavBarPage login(String username, String password) {
new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(buttonSwitchLanguage)); new WebDriverWait(driver, Duration.ofSeconds(30)).until(ExpectedConditions.elementToBeClickable(buttonSwitchLanguage));
buttonSwitchLanguage().click(); buttonSwitchLanguage().click();
@ -66,7 +68,7 @@ public final class LoginPage extends NavBarPage {
inputPassword().sendKeys(password); inputPassword().sendKeys(password);
buttonLogin().click(); buttonLogin().click();
new WebDriverWait(driver, 20) new WebDriverWait(driver, Duration.ofSeconds(30))
.until(ExpectedConditions.urlContains("/home")); .until(ExpectedConditions.urlContains("/home"));
return new NavBarPage(driver); return new NavBarPage(driver);

5
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/common/CodeEditor.java

@ -29,6 +29,9 @@ import org.openqa.selenium.support.FindBys;
import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.PageFactory;
import lombok.Getter; import lombok.Getter;
import java.time.Duration;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
@ -48,7 +51,7 @@ public final class CodeEditor {
} }
public CodeEditor content(String content) { public CodeEditor content(String content) {
new WebDriverWait(this.driver, 10).until(ExpectedConditions.elementToBeClickable(editor)); new WebDriverWait(this.driver, Duration.ofSeconds(20)).until(ExpectedConditions.elementToBeClickable(editor));
editor.click(); editor.click();

10
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/common/NavBarPage.java

@ -35,6 +35,8 @@ import org.openqa.selenium.support.ui.WebDriverWait;
import lombok.Getter; import lombok.Getter;
import java.time.Duration;
@Getter @Getter
public class NavBarPage { public class NavBarPage {
protected final RemoteWebDriver driver; protected final RemoteWebDriver driver;
@ -62,25 +64,25 @@ public class NavBarPage {
public <T extends NavBarItem> T goToNav(Class<T> nav) { public <T extends NavBarItem> T goToNav(Class<T> nav) {
if (nav == ProjectPage.class) { if (nav == ProjectPage.class) {
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(projectTab)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(projectTab));
projectTab.click(); projectTab.click();
return nav.cast(new ProjectPage(driver)); return nav.cast(new ProjectPage(driver));
} }
if (nav == SecurityPage.class) { if (nav == SecurityPage.class) {
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(securityTab)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(securityTab));
securityTab.click(); securityTab.click();
return nav.cast(new SecurityPage(driver)); return nav.cast(new SecurityPage(driver));
} }
if (nav == ResourcePage.class) { if (nav == ResourcePage.class) {
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(resourceTab)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(resourceTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", resourceTab()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", resourceTab());
return nav.cast(new ResourcePage(driver)); return nav.cast(new ResourcePage(driver));
} }
if (nav == DataSourcePage.class) { if (nav == DataSourcePage.class) {
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(dataSourceTab)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(dataSourceTab));
dataSourceTab.click(); dataSourceTab.click();
return nav.cast(new DataSourcePage(driver)); return nav.cast(new DataSourcePage(driver));
} }

5
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java

@ -25,6 +25,7 @@ import lombok.Getter;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage; import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
import java.security.Key; import java.security.Key;
import java.time.Duration;
import java.util.List; import java.util.List;
import org.openqa.selenium.By; import org.openqa.selenium.By;
@ -73,12 +74,12 @@ public class DataSourcePage extends NavBarPage implements NavBarPage.NavBarItem
String jdbcParams) { String jdbcParams) {
buttonCreateDataSource().click(); buttonCreateDataSource().click();
new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated( new WebDriverWait(driver, Duration.ofSeconds(10)).until(ExpectedConditions.visibilityOfElementLocated(
new By.ByClassName("dialog-source-modal"))); new By.ByClassName("dialog-source-modal")));
dataSourceModal().findElement(By.className(dataSourceType.toUpperCase()+"-box")).click(); dataSourceModal().findElement(By.className(dataSourceType.toUpperCase()+"-box")).click();
new WebDriverWait(driver, 10).until(ExpectedConditions.textToBePresentInElement(driver.findElement(By.className("dialog-create-data-source")), dataSourceType.toUpperCase())); new WebDriverWait(driver, Duration.ofSeconds(10)).until(ExpectedConditions.textToBePresentInElement(driver.findElement(By.className("dialog-create-data-source")), dataSourceType.toUpperCase()));
createDataSourceForm().inputDataSourceName().sendKeys(dataSourceName); createDataSourceForm().inputDataSourceName().sendKeys(dataSourceName);
createDataSourceForm().inputDataSourceDescription().sendKeys(dataSourceDescription); createDataSourceForm().inputDataSourceDescription().sendKeys(dataSourceDescription);

12
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/WorkflowDefinitionTab.java

@ -20,20 +20,22 @@
package org.apache.dolphinscheduler.e2e.pages.project.workflow; package org.apache.dolphinscheduler.e2e.pages.project.workflow;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import lombok.Getter;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage; import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
import org.apache.dolphinscheduler.e2e.pages.project.ProjectDetailPage; import org.apache.dolphinscheduler.e2e.pages.project.ProjectDetailPage;
import java.util.List;
import java.util.stream.Collectors;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.FindBys; import org.openqa.selenium.support.FindBys;
import org.testcontainers.shaded.org.awaitility.Awaitility;
import java.util.List; import lombok.Getter;
import java.util.stream.Collectors;
@Getter @Getter
public final class WorkflowDefinitionTab extends NavBarPage implements ProjectDetailPage.Tab { public final class WorkflowDefinitionTab extends NavBarPage implements ProjectDetailPage.Tab {
@ -133,7 +135,7 @@ public final class WorkflowDefinitionTab extends NavBarPage implements ProjectDe
} }
public WorkflowDefinitionTab delete(String workflow) { public WorkflowDefinitionTab delete(String workflow) {
await().untilAsserted(() -> assertThat(workflowList()) Awaitility.await().untilAsserted(() -> assertThat(workflowList())
.as("Workflow list should contain newly-created workflow") .as("Workflow list should contain newly-created workflow")
.anyMatch( .anyMatch(
it -> it.getText().contains(workflow) it -> it.getText().contains(workflow)

3
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/WorkflowForm.java

@ -23,6 +23,7 @@ import org.apache.dolphinscheduler.e2e.pages.project.workflow.task.ShellTaskForm
import org.apache.dolphinscheduler.e2e.pages.project.workflow.task.SubWorkflowTaskForm; import org.apache.dolphinscheduler.e2e.pages.project.workflow.task.SubWorkflowTaskForm;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -86,7 +87,7 @@ public final class WorkflowForm {
} }
public WebElement getTask(String taskName) { public WebElement getTask(String taskName) {
List<WebElement> tasks = new WebDriverWait(driver, 10) List<WebElement> tasks = new WebDriverWait(driver, Duration.ofSeconds(20))
.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.cssSelector("svg > g > g[class^='x6-graph-svg-stage'] > g[data-shape^='dag-task']"))); .until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.cssSelector("svg > g > g[class^='x6-graph-svg-stage'] > g[data-shape^='dag-task']")));
WebElement task = tasks.stream() WebElement task = tasks.stream()

5
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/WorkflowRunDialog.java

@ -24,6 +24,9 @@ import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.PageFactory;
import lombok.Getter; import lombok.Getter;
import java.time.Duration;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
@ -41,7 +44,7 @@ public final class WorkflowRunDialog {
} }
public WorkflowDefinitionTab submit() { public WorkflowDefinitionTab submit() {
new WebDriverWait(parent().driver(), 5).until(ExpectedConditions.elementToBeClickable(buttonSubmit())); new WebDriverWait(parent().driver(), Duration.ofSeconds(20)).until(ExpectedConditions.elementToBeClickable(buttonSubmit()));
buttonSubmit().click(); buttonSubmit().click();

5
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/task/SubWorkflowTaskForm.java

@ -30,6 +30,7 @@ import org.openqa.selenium.support.FindBys;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import java.time.Duration;
import java.util.List; import java.util.List;
@Getter @Getter
@ -53,11 +54,11 @@ public final class SubWorkflowTaskForm extends TaskNodeForm {
} }
public SubWorkflowTaskForm childNode(String node) { public SubWorkflowTaskForm childNode(String node) {
new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(btnSelectChildNodeDropdown)); new WebDriverWait(driver, Duration.ofSeconds(5)).until(ExpectedConditions.elementToBeClickable(btnSelectChildNodeDropdown));
btnSelectChildNodeDropdown().click(); btnSelectChildNodeDropdown().click();
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(By.className( new WebDriverWait(driver, Duration.ofSeconds(5)).until(ExpectedConditions.visibilityOfElementLocated(By.className(
"n-base-select-option__content"))); "n-base-select-option__content")));
selectChildNode() selectChildNode()

5
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/task/SwitchTaskForm.java

@ -29,6 +29,7 @@ import org.openqa.selenium.support.FindBys;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import java.time.Duration;
import java.util.List; import java.util.List;
@Getter @Getter
@ -53,7 +54,7 @@ public final class SwitchTaskForm extends TaskNodeForm {
final By optionsLocator = By.className("option-else-branches"); final By optionsLocator = By.className("option-else-branches");
new WebDriverWait(parent().driver(), 10) new WebDriverWait(parent().driver(), Duration.ofSeconds(10))
.until(ExpectedConditions.visibilityOfElementLocated(optionsLocator)); .until(ExpectedConditions.visibilityOfElementLocated(optionsLocator));
List<WebElement> webElements = parent().driver().findElements(optionsLocator); List<WebElement> webElements = parent().driver().findElements(optionsLocator);
@ -78,7 +79,7 @@ public final class SwitchTaskForm extends TaskNodeForm {
final By optionsLocator = By.className("option-if-branches"); final By optionsLocator = By.className("option-if-branches");
new WebDriverWait(parent().driver(), 10) new WebDriverWait(parent().driver(), Duration.ofSeconds(10))
.until(ExpectedConditions.visibilityOfElementLocated(optionsLocator)); .until(ExpectedConditions.visibilityOfElementLocated(optionsLocator));
List<WebElement> webElements = parent().driver().findElements(optionsLocator); List<WebElement> webElements = parent().driver().findElements(optionsLocator);

3
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/task/TaskNodeForm.java

@ -32,6 +32,7 @@ import org.openqa.selenium.support.pagefactory.ByChained;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import java.time.Duration;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -116,7 +117,7 @@ public abstract class TaskNodeForm {
final By optionsLocator = By.className("option-pre-tasks"); final By optionsLocator = By.className("option-pre-tasks");
new WebDriverWait(parent.driver(), 10) new WebDriverWait(parent.driver(), Duration.ofSeconds(20))
.until(ExpectedConditions.visibilityOfElementLocated(optionsLocator)); .until(ExpectedConditions.visibilityOfElementLocated(optionsLocator));
List<WebElement> webElements = parent.driver().findElements(optionsLocator); List<WebElement> webElements = parent.driver().findElements(optionsLocator);

5
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/FileManagePage.java

@ -40,6 +40,7 @@ import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import java.io.File; import java.io.File;
import java.time.Duration;
import java.util.List; import java.util.List;
@ -181,9 +182,9 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab {
.orElseThrow(() -> new RuntimeException("No edit button in file manage list")) .orElseThrow(() -> new RuntimeException("No edit button in file manage list"))
.click(); .click();
new WebDriverWait(driver, 5).until(ExpectedConditions.urlContains("/edit")); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.urlContains("/edit"));
new WebDriverWait(driver, 5).until(ExpectedConditions.textToBePresentInElement(driver.findElementByTagName("body"), fileName)); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.textToBePresentInElement(driver.findElement(By.tagName("body")), fileName));
editFileBox().codeEditor().content(scripts); editFileBox().codeEditor().content(scripts);
editFileBox().buttonSubmit().click(); editFileBox().buttonSubmit().click();

25
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/ResourcePage.java

@ -19,9 +19,10 @@
*/ */
package org.apache.dolphinscheduler.e2e.pages.resource; package org.apache.dolphinscheduler.e2e.pages.resource;
import lombok.Getter;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage; import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
import org.apache.dolphinscheduler.e2e.pages.security.TenantPage;
import java.time.Duration;
import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.RemoteWebDriver;
@ -29,6 +30,8 @@ import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
import lombok.Getter;
@Getter @Getter
public class ResourcePage extends NavBarPage implements NavBarPage.NavBarItem { public class ResourcePage extends NavBarPage implements NavBarPage.NavBarItem {
@ -47,26 +50,26 @@ public class ResourcePage extends NavBarPage implements NavBarPage.NavBarItem {
public <T extends ResourcePage.Tab> T goToTab(Class<T> tab) { public <T extends ResourcePage.Tab> T goToTab(Class<T> tab) {
if (tab == FileManagePage.class) { if (tab == FileManagePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource")); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.urlContains("/resource"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(fileManageTab)); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.elementToBeClickable(fileManageTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", fileManageTab()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", fileManageTab());
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/file-manage")); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.urlContains("/file-manage"));
return tab.cast(new FileManagePage(driver)); return tab.cast(new FileManagePage(driver));
} }
if (tab == UdfManagePage.class) { if (tab == UdfManagePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource")); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.urlContains("/resource"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(udfManageTab)); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.elementToBeClickable(udfManageTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", udfManageTab()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", udfManageTab());
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource-manage")); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.urlContains("/resource-manage"));
return tab.cast(new UdfManagePage(driver)); return tab.cast(new UdfManagePage(driver));
} }
if (tab == FunctionManagePage.class) { if (tab == FunctionManagePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource")); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.urlContains("/resource"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(functionManageTab)); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.elementToBeClickable(functionManageTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", functionManageTab()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", functionManageTab());
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/function-manage")); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.urlContains("/function-manage"));
return tab.cast(new FunctionManagePage(driver)); return tab.cast(new FunctionManagePage(driver));
} }

3
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/UdfManagePage.java

@ -24,6 +24,7 @@ import lombok.Getter;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage; import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
import java.time.Duration;
import java.util.List; import java.util.List;
import org.openqa.selenium.By; import org.openqa.selenium.By;
@ -80,7 +81,7 @@ public class UdfManagePage extends NavBarPage implements ResourcePage.Tab {
} }
public UdfManagePage uploadFile(String filePath) { public UdfManagePage uploadFile(String filePath) {
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(buttonUploadUdf)); new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.elementToBeClickable(buttonUploadUdf));
buttonUploadUdf().click(); buttonUploadUdf().click();

5
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/security/EnvironmentPage.java

@ -21,6 +21,7 @@ package org.apache.dolphinscheduler.e2e.pages.security;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage; import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
import java.time.Duration;
import java.util.List; import java.util.List;
import org.openqa.selenium.By; import org.openqa.selenium.By;
@ -66,7 +67,7 @@ public final class EnvironmentPage extends NavBarPage implements SecurityPage.Ta
createEnvironmentForm().inputEnvironmentDesc().sendKeys(desc); createEnvironmentForm().inputEnvironmentDesc().sendKeys(desc);
editEnvironmentForm().btnSelectWorkerGroupDropdown().click(); editEnvironmentForm().btnSelectWorkerGroupDropdown().click();
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName( new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName(
"n-base-select-option__content"))); "n-base-select-option__content")));
editEnvironmentForm().selectWorkerGroupList() editEnvironmentForm().selectWorkerGroupList()
.stream() .stream()
@ -105,7 +106,7 @@ public final class EnvironmentPage extends NavBarPage implements SecurityPage.Ta
if (editEnvironmentForm().selectedWorkerGroup().getAttribute("innerHTML").equals(workerGroup)) { if (editEnvironmentForm().selectedWorkerGroup().getAttribute("innerHTML").equals(workerGroup)) {
editEnvironmentForm().btnSelectWorkerGroupDropdown().click(); editEnvironmentForm().btnSelectWorkerGroupDropdown().click();
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName( new WebDriverWait(driver, Duration.ofSeconds(20)).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName(
"n-base-select-option__content"))); "n-base-select-option__content")));
editEnvironmentForm().selectWorkerGroupList() editEnvironmentForm().selectWorkerGroupList()
.stream() .stream()

34
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/security/SecurityPage.java

@ -33,6 +33,8 @@ import org.openqa.selenium.support.ui.WebDriverWait;
import lombok.Getter; import lombok.Getter;
import java.time.Duration;
@Getter @Getter
public class SecurityPage extends NavBarPage implements NavBarItem { public class SecurityPage extends NavBarPage implements NavBarItem {
@ -66,57 +68,57 @@ public class SecurityPage extends NavBarPage implements NavBarItem {
public <T extends SecurityPage.Tab> T goToTab(Class<T> tab) { public <T extends SecurityPage.Tab> T goToTab(Class<T> tab) {
if (tab == TenantPage.class) { if (tab == TenantPage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security")); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuTenantManage)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(menuTenantManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuTenantManage()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuTenantManage());
return tab.cast(new TenantPage(driver)); return tab.cast(new TenantPage(driver));
} }
if (tab == UserPage.class) { if (tab == UserPage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security")); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menUserManage)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(menUserManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menUserManage()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menUserManage());
return tab.cast(new UserPage(driver)); return tab.cast(new UserPage(driver));
} }
if (tab == WorkerGroupPage.class) { if (tab == WorkerGroupPage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security")); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menWorkerGroupManage)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(menWorkerGroupManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menWorkerGroupManage()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menWorkerGroupManage());
return tab.cast(new WorkerGroupPage(driver)); return tab.cast(new WorkerGroupPage(driver));
} }
if (tab == QueuePage.class) { if (tab == QueuePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security")); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuQueueManage)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(menuQueueManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuQueueManage()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuQueueManage());
return tab.cast(new QueuePage(driver)); return tab.cast(new QueuePage(driver));
} }
if (tab == EnvironmentPage.class) { if (tab == EnvironmentPage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security")); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuEnvironmentManage)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(menuEnvironmentManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuEnvironmentManage()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuEnvironmentManage());
return tab.cast(new EnvironmentPage(driver)); return tab.cast(new EnvironmentPage(driver));
} }
if (tab == ClusterPage.class) { if (tab == ClusterPage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security")); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuClusterManage)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(menuClusterManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuClusterManage()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuClusterManage());
return tab.cast(new ClusterPage(driver)); return tab.cast(new ClusterPage(driver));
} }
if (tab == TokenPage.class) { if (tab == TokenPage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security")); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuTokenManage)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(menuTokenManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuTokenManage()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuTokenManage());
return tab.cast(new TokenPage(driver)); return tab.cast(new TokenPage(driver));
} }
if (tab == NamespacePage.class) { if (tab == NamespacePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security")); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuNamespaceManage)); new WebDriverWait(driver, Duration.ofSeconds(60)).until(ExpectedConditions.elementToBeClickable(menuNamespaceManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuNamespaceManage()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuNamespaceManage());
return tab.cast(new NamespacePage(driver)); return tab.cast(new NamespacePage(driver));
} }

11
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/security/TokenPage.java

@ -22,6 +22,7 @@ package org.apache.dolphinscheduler.e2e.pages.security;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage; import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage.Tab; import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage.Tab;
import java.time.Duration;
import java.util.List; import java.util.List;
import org.openqa.selenium.By; import org.openqa.selenium.By;
@ -68,9 +69,9 @@ public final class TokenPage extends NavBarPage implements Tab {
public TokenPage create(String userName) { public TokenPage create(String userName) {
buttonCreateToken().click(); buttonCreateToken().click();
new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(createTokenForm().selectUserNameDropdown())); new WebDriverWait(driver, Duration.ofSeconds(30)).until(ExpectedConditions.elementToBeClickable(createTokenForm().selectUserNameDropdown()));
createTokenForm().selectUserNameDropdown().click(); createTokenForm().selectUserNameDropdown().click();
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName( new WebDriverWait(driver, Duration.ofSeconds(30)).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName(
"n-base-select-option__content"))); "n-base-select-option__content")));
createTokenForm().selectUserNameList() createTokenForm().selectUserNameList()
.stream() .stream()
@ -80,7 +81,7 @@ public final class TokenPage extends NavBarPage implements Tab {
userName))) userName)))
.click(); .click();
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(createTokenForm().buttonGenerateToken())); new WebDriverWait(driver, Duration.ofSeconds(30)).until(ExpectedConditions.elementToBeClickable(createTokenForm().buttonGenerateToken()));
createTokenForm().buttonGenerateToken().click(); createTokenForm().buttonGenerateToken().click();
createTokenForm().buttonSubmit().click(); createTokenForm().buttonSubmit().click();
@ -97,9 +98,9 @@ public final class TokenPage extends NavBarPage implements Tab {
.orElseThrow(() -> new RuntimeException("No edit button in token list")) .orElseThrow(() -> new RuntimeException("No edit button in token list"))
.click(); .click();
new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(editTokenForm().buttonGenerateToken())); new WebDriverWait(driver, Duration.ofSeconds(30)).until(ExpectedConditions.elementToBeClickable(editTokenForm().buttonGenerateToken()));
editTokenForm().buttonGenerateToken().click(); editTokenForm().buttonGenerateToken().click();
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(editTokenForm().buttonGenerateToken())); new WebDriverWait(driver, Duration.ofSeconds(30)).until(ExpectedConditions.elementToBeClickable(editTokenForm().buttonGenerateToken()));
editTokenForm().buttonSubmit().click(); editTokenForm().buttonSubmit().click();

5
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/security/UserPage.java

@ -21,6 +21,7 @@ package org.apache.dolphinscheduler.e2e.pages.security;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage; import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
import java.time.Duration;
import java.util.List; import java.util.List;
import org.openqa.selenium.By; import org.openqa.selenium.By;
@ -66,7 +67,7 @@ public final class UserPage extends NavBarPage implements SecurityPage.Tab {
createUserForm().btnSelectTenantDropdown().click(); createUserForm().btnSelectTenantDropdown().click();
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName( new WebDriverWait(driver, Duration.ofSeconds(30)).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName(
"n-base-select-option__content"))); "n-base-select-option__content")));
createUserForm().selectTenant() createUserForm().selectTenant()
@ -99,7 +100,7 @@ public final class UserPage extends NavBarPage implements SecurityPage.Tab {
createUserForm().btnSelectTenantDropdown().click(); createUserForm().btnSelectTenantDropdown().click();
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName( new WebDriverWait(driver, Duration.ofSeconds(30)).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName(
"n-base-select-option__content"))); "n-base-select-option__content")));
createUserForm().selectTenant() createUserForm().selectTenant()

11
dolphinscheduler-e2e/dolphinscheduler-e2e-core/src/main/java/org/apache/dolphinscheduler/e2e/core/DolphinSchedulerExtension.java

@ -34,7 +34,6 @@ import java.time.Duration;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -50,12 +49,12 @@ import org.testcontainers.containers.BrowserWebDriverContainer;
import org.testcontainers.containers.DockerComposeContainer; import org.testcontainers.containers.DockerComposeContainer;
import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.shaded.org.awaitility.Awaitility; import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.testcontainers.utility.DockerImageName;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.net.HostAndPort; import com.google.common.net.HostAndPort;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.testcontainers.utility.DockerImageName;
@Slf4j @Slf4j
final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCallback, BeforeEachCallback { final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCallback, BeforeEachCallback {
@ -77,7 +76,7 @@ final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCall
@SuppressWarnings("UnstableApiUsage") @SuppressWarnings("UnstableApiUsage")
public void beforeAll(ExtensionContext context) throws IOException { public void beforeAll(ExtensionContext context) throws IOException {
Awaitility.setDefaultTimeout(Duration.ofSeconds(60)); Awaitility.setDefaultTimeout(Duration.ofSeconds(60));
Awaitility.setDefaultPollInterval(Duration.ofSeconds(10)); Awaitility.setDefaultPollInterval(Duration.ofSeconds(2));
setRecordPath(); setRecordPath();
@ -95,11 +94,11 @@ final class DolphinSchedulerExtension implements BeforeAllCallback, AfterAllCall
} }
browser.start(); browser.start();
driver = browser.getWebDriver(); driver = new RemoteWebDriver(browser.getSeleniumAddress(), new ChromeOptions());
driver.manage().timeouts() driver.manage().timeouts()
.implicitlyWait(5, TimeUnit.SECONDS) .implicitlyWait(Duration.ofSeconds(10))
.pageLoadTimeout(5, TimeUnit.SECONDS); .pageLoadTimeout(Duration.ofSeconds(10));
driver.manage().window() driver.manage().window()
.maximize(); .maximize();

14
dolphinscheduler-e2e/pom.xml

@ -35,11 +35,10 @@
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.7.2</junit.version> <junit.version>5.8.1</junit.version>
<selenium.version>3.141.59</selenium.version> <selenium.version>4.6.0</selenium.version>
<lombok.version>1.18.20</lombok.version> <lombok.version>1.18.20</lombok.version>
<assertj-core.version>3.20.2</assertj-core.version> <assertj-core.version>3.20.2</assertj-core.version>
<awaitility.version>4.1.0</awaitility.version>
<kotlin.version>1.5.30</kotlin.version> <kotlin.version>1.5.30</kotlin.version>
<slf4j-api.version>1.7.36</slf4j-api.version> <slf4j-api.version>1.7.36</slf4j-api.version>
<log4j-slf4j-impl.version>2.17.2</log4j-slf4j-impl.version> <log4j-slf4j-impl.version>2.17.2</log4j-slf4j-impl.version>
@ -95,13 +94,6 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
@ -127,7 +119,7 @@
<dependency> <dependency>
<groupId>org.testcontainers</groupId> <groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId> <artifactId>testcontainers-bom</artifactId>
<version>1.16.3</version> <version>1.18.3</version>
<scope>import</scope> <scope>import</scope>
<type>pom</type> <type>pom</type>
</dependency> </dependency>

Loading…
Cancel
Save