Skip to content

Commit

Permalink
[CI][E2E] Upgrade e2e dependency version (#14634)
Browse files Browse the repository at this point in the history
* upgrade e2e dependency version

* upgrade e2e dependency version

* optimize imports

* remove duplicated awaitility

* remove duplicated awaitility
  • Loading branch information
SbloodyS authored Jul 25, 2023
1 parent 4a80e3a commit c669668
Show file tree
Hide file tree
Showing 37 changed files with 223 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
package org.apache.dolphinscheduler.e2e.cases;

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.pages.LoginPage;
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.Order;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -80,10 +82,10 @@ void testCreateClickhouseDataSource() {

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")));

await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
Awaitility.await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName)));
Expand All @@ -96,7 +98,7 @@ void testDeleteClickhouseDataSource() {

page.delete(dataSourceName);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();

assertThat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@


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.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.security.ClusterPage;
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.Order;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -63,7 +63,7 @@ void testCreateCluster() {
final ClusterPage page = new ClusterPage(browser);
page.create(clusterName, clusterConfig, clusterDesc);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();
assertThat(page.clusterList())
.as("Cluster list should contain newly-created cluster")
Expand All @@ -78,7 +78,7 @@ void testCreateDuplicateCluster() {
final ClusterPage page = new ClusterPage(browser);
page.create(clusterName, clusterConfig, clusterDesc);

await().untilAsserted(() ->
Awaitility.await().untilAsserted(() ->
assertThat(browser.findElement(By.tagName("body")).getText())
.contains("already exists")
);
Expand All @@ -92,7 +92,7 @@ void testEditCluster() {
final ClusterPage page = new ClusterPage(browser);
page.update(clusterName, editClusterName, editClusterConfig, editClusterDesc);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();
assertThat(page.clusterList())
.as("Cluster list should contain newly-modified cluster")
Expand All @@ -108,7 +108,7 @@ void testDeleteCluster() {

page.delete(editClusterName);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();

assertThat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@


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.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.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.Order;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -68,7 +65,7 @@ void testCreateEnvironment() {
final EnvironmentPage page = new EnvironmentPage(browser);
page.create(environmentName, environmentConfig, environmentDesc, environmentWorkerGroup);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();
assertThat(page.environmentList())
.as("Environment list should contain newly-created environment")
Expand All @@ -83,7 +80,7 @@ void testCreateDuplicateEnvironment() {
final EnvironmentPage page = new EnvironmentPage(browser);
page.create(environmentName, environmentConfig, environmentDesc, environmentWorkerGroup);

await().untilAsserted(() ->
Awaitility.await().untilAsserted(() ->
assertThat(browser.findElement(By.tagName("body")).getText())
.contains("already exists")
);
Expand All @@ -97,7 +94,7 @@ void testEditEnvironment() {
final EnvironmentPage page = new EnvironmentPage(browser);
page.update(environmentName, editEnvironmentName, editEnvironmentConfig, editEnvironmentDesc, editEnvironmentWorkerGroup);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();
assertThat(page.environmentList())
.as("Environment list should contain newly-modified environment")
Expand All @@ -113,7 +110,7 @@ void testDeleteEnvironment() {

page.delete(editEnvironmentName);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();

assertThat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


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.DolphinScheduler;
Expand All @@ -40,6 +39,7 @@
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.BeforeAll;
import org.junit.jupiter.api.Order;
Expand Down Expand Up @@ -90,15 +90,15 @@ public static void setup() {
.goToTab(TenantPage.class)
.create(tenant);

await().untilAsserted(() -> assertThat(tenantPage.tenantList())
.as("Tenant list should contain newly-created tenant")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(tenant)));
Awaitility.await().untilAsserted(() -> assertThat(tenantPage.tenantList())
.as("Tenant list should contain newly-created tenant")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(tenant)));

UserPage userPage = tenantPage.goToNav(SecurityPage.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")));

userPage.update(user, user, email, phone, tenant)
Expand All @@ -124,7 +124,7 @@ void testCreateDirectory() {

page.createDirectory(testDirectoryName);

await().untilAsserted(() -> assertThat(page.fileList())
Awaitility.await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(testDirectoryName)));
Expand All @@ -137,7 +137,7 @@ void testCancelCreateDirectory() {

page.cancelCreateDirectory(testDirectoryName);

await().untilAsserted(() -> assertThat(page.fileList())
Awaitility.await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(testDirectoryName)));
Expand Down Expand Up @@ -199,7 +199,7 @@ void testDeleteDirectory() {
.goToTab(FileManagePage.class)
.delete(testDirectoryName);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();

assertThat(
Expand All @@ -218,7 +218,7 @@ void testCreateFile() {

page.createFile(testFileName, scripts);

await().untilAsserted(() -> assertThat(page.fileList())
Awaitility.await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(testFileName)));
Expand All @@ -231,7 +231,7 @@ void testRenameFile() {

page.rename(testFileName, testRenameFileName);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();

assertThat(page.fileList())
Expand All @@ -249,7 +249,7 @@ void testEditFile() {

page.editFile(testRenameFileName, scripts);

await().untilAsserted(() -> assertThat(page.fileList())
Awaitility.await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(testRenameFileName)));
Expand All @@ -262,7 +262,7 @@ void testDeleteFile() {

page.delete(testRenameFileName);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();

assertThat(
Expand All @@ -285,9 +285,9 @@ void testUploadUnder1GBFile() throws IOException {

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())
.as("File list should contain newly-created file")
.extracting(WebElement::getText)
Expand All @@ -304,7 +304,7 @@ void testDownloadFile() {

File file = Constants.HOST_CHROME_DOWNLOAD_PATH.resolve(testUnder1GBFileName).toFile();

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
assert file.exists();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import lombok.SneakyThrows;
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.DolphinScheduler;
Expand All @@ -44,6 +43,7 @@
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.BeforeAll;
import org.junit.jupiter.api.Order;
Expand Down Expand Up @@ -89,7 +89,7 @@ public static void setup() {
.goToTab(TenantPage.class)
.create(tenant);

await().untilAsserted(() -> assertThat(tenantPage.tenantList())
Awaitility.await().untilAsserted(() -> assertThat(tenantPage.tenantList())
.as("Tenant list should contain newly-created tenant")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(tenant)));
Expand All @@ -99,7 +99,7 @@ public static void setup() {
UserPage userPage = tenantPage.goToNav(SecurityPage.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")));

UdfManagePage udfManagePage = userPage.update(user, user, email, phone, tenant)
Expand Down Expand Up @@ -147,7 +147,7 @@ void testCreateUdfFunction() {

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")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(testUdfFunctionName)));
Expand All @@ -162,7 +162,7 @@ void testRenameUdfFunction() {

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")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(testRenameUdfFunctionName)));
Expand All @@ -175,7 +175,7 @@ void testDeleteUdfFunction() {

page.deleteUdfFunction(testRenameUdfFunctionName);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();

assertThat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
package org.apache.dolphinscheduler.e2e.cases;

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.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;

import java.time.Duration;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
Expand All @@ -35,6 +36,7 @@
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testcontainers.shaded.org.awaitility.Awaitility;

@DolphinScheduler(composeFiles = "docker/datasource-hive/docker-compose.yaml")
public class HiveDataSourceE2ETest {
Expand Down Expand Up @@ -64,12 +66,13 @@ public class HiveDataSourceE2ETest {

private static final String jdbcParams = "";


@BeforeAll
public static void setup() {
new LoginPage(browser)
.login(user, password)
.goToNav(DataSourcePage.class);


}

@Test
Expand All @@ -79,10 +82,10 @@ void testCreateHiveDataSource() {

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")));

await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
Awaitility.await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName)));
Expand All @@ -95,7 +98,7 @@ void testDeleteHiveDataSource() {

page.delete(dataSourceName);

await().untilAsserted(() -> {
Awaitility.await().untilAsserted(() -> {
browser.navigate().refresh();

assertThat(
Expand Down
Loading

0 comments on commit c669668

Please sign in to comment.