You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ke...@apache.org on 2022/03/13 04:33:24 UTC
[dolphinscheduler] branch dev updated: [Feature-8844][E2E] Restore datasource center e2e test cases in ui-next (#8845)
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 2335453 [Feature-8844][E2E] Restore datasource center e2e test cases in ui-next (#8845)
2335453 is described below
commit 2335453482df236841bf2147596a89ef359f7036
Author: xiangzihao <46...@qq.com>
AuthorDate: Sun Mar 13 12:33:19 2022 +0800
[Feature-8844][E2E] Restore datasource center e2e test cases in ui-next (#8845)
---
.github/workflows/e2e.yml | 20 +++---
.../e2e/cases/ClickhouseDataSourceE2ETest.java | 3 +-
.../e2e/cases/HiveDataSourceE2ETest.java | 3 +-
.../e2e/cases/MysqlDataSourceE2ETest.java | 3 +-
.../e2e/cases/PostgresDataSourceE2ETest.java | 3 +-
.../e2e/cases/SqlServerDataSourceE2ETest.java | 3 +-
.../e2e/pages/datasource/DataSourcePage.java | 80 ++++++++++++++--------
7 files changed, 73 insertions(+), 42 deletions(-)
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index 5bcc6ac..9f924d9 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -93,16 +93,16 @@ jobs:
class: org.apache.dolphinscheduler.e2e.cases.UdfManageE2ETest
- name: FunctionManage
class: org.apache.dolphinscheduler.e2e.cases.FunctionManageE2ETest
-# - name: MysqlDataSource
-# class: org.apache.dolphinscheduler.e2e.cases.MysqlDataSourceE2ETest
-# - name: ClickhouseDataSource
-# class: org.apache.dolphinscheduler.e2e.cases.ClickhouseDataSourceE2ETest
-# - name: PostgresDataSource
-# class: org.apache.dolphinscheduler.e2e.cases.PostgresDataSourceE2ETest
-# - name: SqlServerDataSource
-# class: org.apache.dolphinscheduler.e2e.cases.SqlServerDataSourceE2ETest
-# - name: HiveDataSource
-# class: org.apache.dolphinscheduler.e2e.cases.HiveDataSourceE2ETest
+ - name: MysqlDataSource
+ class: org.apache.dolphinscheduler.e2e.cases.MysqlDataSourceE2ETest
+ - name: ClickhouseDataSource
+ class: org.apache.dolphinscheduler.e2e.cases.ClickhouseDataSourceE2ETest
+ - name: PostgresDataSource
+ class: org.apache.dolphinscheduler.e2e.cases.PostgresDataSourceE2ETest
+ - name: SqlServerDataSource
+ class: org.apache.dolphinscheduler.e2e.cases.SqlServerDataSourceE2ETest
+ - name: HiveDataSource
+ class: org.apache.dolphinscheduler.e2e.cases.HiveDataSourceE2ETest
env:
RECORDING_PATH: /tmp/recording-${{ matrix.case.name }}
steps:
diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClickhouseDataSourceE2ETest.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClickhouseDataSourceE2ETest.java
index 8f2011d..aae65d1 100644
--- a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClickhouseDataSourceE2ETest.java
+++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClickhouseDataSourceE2ETest.java
@@ -80,7 +80,8 @@ public class ClickhouseDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams);
- new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
+ new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(
+ new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/HiveDataSourceE2ETest.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/HiveDataSourceE2ETest.java
index 5335104..d27357c 100644
--- a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/HiveDataSourceE2ETest.java
+++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/HiveDataSourceE2ETest.java
@@ -79,7 +79,8 @@ public class HiveDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, hivePassword, database, jdbcParams);
- new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
+ new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(
+ new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/MysqlDataSourceE2ETest.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/MysqlDataSourceE2ETest.java
index 6c28e7b..76fb367 100644
--- a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/MysqlDataSourceE2ETest.java
+++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/MysqlDataSourceE2ETest.java
@@ -81,7 +81,8 @@ public class MysqlDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, mysqlPassword, database, jdbcParams);
- new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
+ new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(
+ new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/PostgresDataSourceE2ETest.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/PostgresDataSourceE2ETest.java
index ea2ec77..c54e867 100644
--- a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/PostgresDataSourceE2ETest.java
+++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/PostgresDataSourceE2ETest.java
@@ -80,7 +80,8 @@ public class PostgresDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams);
- new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
+ new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(
+ new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/SqlServerDataSourceE2ETest.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/SqlServerDataSourceE2ETest.java
index 2bbd37e..8a666fa 100644
--- a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/SqlServerDataSourceE2ETest.java
+++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/SqlServerDataSourceE2ETest.java
@@ -80,7 +80,8 @@ public class SqlServerDataSourceE2ETest {
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams);
- new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
+ new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(
+ new By.ByClassName("dialog-create-data-source")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java
index f4310a2..2e479fd 100644
--- a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java
+++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java
@@ -24,33 +24,35 @@ import lombok.Getter;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
+import java.security.Key;
import java.util.List;
import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.FindBys;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;
@Getter
public class DataSourcePage extends NavBarPage implements NavBarPage.NavBarItem {
- @FindBy(id = "btnCreateDataSource")
+ @FindBy(className = "btn-create-data-source")
private WebElement buttonCreateDataSource;
@FindBy(className = "data-source-items")
private List<WebElement> dataSourceItemsList;
@FindBys({
- @FindBy(className = "el-popconfirm"),
- @FindBy(className = "el-button--primary"),
+ @FindBy(className = "n-popconfirm__action"),
+ @FindBy(className = "n-button--primary-type"),
})
- private List<WebElement> buttonConfirm;
+ private WebElement buttonConfirm;
private final CreateDataSourceForm createDataSourceForm;
@@ -66,7 +68,8 @@ public class DataSourcePage extends NavBarPage implements NavBarPage.NavBarItem
createDataSourceForm().btnDataSourceTypeDropdown().click();
- new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
+ new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(
+ new By.ByClassName("dialog-create-data-source")));
createDataSourceForm().selectDataSourceType()
.stream()
@@ -78,7 +81,8 @@ public class DataSourcePage extends NavBarPage implements NavBarPage.NavBarItem
createDataSourceForm().inputDataSourceName().sendKeys(dataSourceName);
createDataSourceForm().inputDataSourceDescription().sendKeys(dataSourceDescription);
createDataSourceForm().inputIP().sendKeys(ip);
- createDataSourceForm().inputPort().clear();
+ createDataSourceForm().inputPort().sendKeys(Keys.CONTROL + "a");
+ createDataSourceForm().inputPort().sendKeys(Keys.BACK_SPACE);
createDataSourceForm().inputPort().sendKeys(port);
createDataSourceForm().inputUserName().sendKeys(userName);
createDataSourceForm().inputPassword().sendKeys(password);
@@ -97,18 +101,13 @@ public class DataSourcePage extends NavBarPage implements NavBarPage.NavBarItem
dataSourceItemsList()
.stream()
.filter(it -> it.getText().contains(name))
- .flatMap(it -> it.findElements(By.id("btnDelete")).stream())
+ .flatMap(it -> it.findElements(By.className("btn-delete")).stream())
.filter(WebElement::isDisplayed)
.findFirst()
.orElseThrow(() -> new RuntimeException("No delete button in data source list"))
.click();
- buttonConfirm()
- .stream()
- .filter(WebElement::isDisplayed)
- .findFirst()
- .orElseThrow(() -> new RuntimeException("No confirm button when deleting"))
- .click();
+ ((JavascriptExecutor) driver).executeScript("arguments[0].click();", buttonConfirm());
return this;
}
@@ -119,43 +118,70 @@ public class DataSourcePage extends NavBarPage implements NavBarPage.NavBarItem
PageFactory.initElements(driver, this);
}
- @FindBy(className = "options-datasource-type")
+ @FindBy(className = "n-base-select-option__content")
private List<WebElement> selectDataSourceType;
- @FindBy(id = "btnDataSourceTypeDropDown")
+ @FindBys({
+ @FindBy(className = "btn-data-source-type-drop-down"),
+ @FindBy(className = "n-base-selection"),
+ })
private WebElement btnDataSourceTypeDropdown;
- @FindBy(id = "inputDataSourceName")
+ @FindBys({
+ @FindBy(className = "input-data-source-name"),
+ @FindBy(tagName = "input"),
+ })
private WebElement inputDataSourceName;
- @FindBy(id = "inputDataSourceDescription")
+ @FindBys({
+ @FindBy(className = "input-data-source-description"),
+ @FindBy(tagName = "textarea"),
+ })
private WebElement inputDataSourceDescription;
- @FindBy(id = "inputIP")
+ @FindBys({
+ @FindBy(className = "input-ip"),
+ @FindBy(tagName = "input"),
+ })
private WebElement inputIP;
- @FindBy(id = "inputPort")
+ @FindBys({
+ @FindBy(className = "input-port"),
+ @FindBy(tagName = "input"),
+ })
private WebElement inputPort;
- @FindBy(id = "inputUserName")
+ @FindBys({
+ @FindBy(className = "input-username"),
+ @FindBy(tagName = "input"),
+ })
private WebElement inputUserName;
- @FindBy(id = "inputPassword")
+ @FindBys({
+ @FindBy(className = "input-password"),
+ @FindBy(tagName = "input"),
+ })
private WebElement inputPassword;
- @FindBy(id = "inputDataBase")
+ @FindBys({
+ @FindBy(className = "input-data-base"),
+ @FindBy(tagName = "input"),
+ })
private WebElement inputDataBase;
- @FindBy(id = "inputJdbcParams")
+ @FindBys({
+ @FindBy(className = "input-jdbc-params"),
+ @FindBy(tagName = "textarea"),
+ })
private WebElement inputJdbcParams;
- @FindBy(id = "btnSubmit")
+ @FindBy(className = "btn-submit")
private WebElement buttonSubmit;
- @FindBy(id = "btnCancel")
+ @FindBy(className = "btn-cancel")
private WebElement buttonCancel;
- @FindBy(id = "btnTestConnection")
+ @FindBy(className = "btn-test-connection")
private WebElement btnTestConnection;
}
}