|
|
@ -32,11 +32,15 @@ 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 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.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; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
import org.openqa.selenium.By; |
|
|
|
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.WebDriverWait; |
|
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
import static org.awaitility.Awaitility.await; |
|
|
|
import static org.awaitility.Awaitility.await; |
|
|
@ -44,46 +48,63 @@ import static org.awaitility.Awaitility.await; |
|
|
|
@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml") |
|
|
|
@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml") |
|
|
|
class WorkflowE2ETest { |
|
|
|
class WorkflowE2ETest { |
|
|
|
private static final String project = "test-workflow-1"; |
|
|
|
private static final String project = "test-workflow-1"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String user = "admin"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String password = "dolphinscheduler123"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String email = "admin@gmail.com"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String phone = "15800000000"; |
|
|
|
|
|
|
|
|
|
|
|
private static final String tenant = System.getProperty("user.name"); |
|
|
|
private static final String tenant = System.getProperty("user.name"); |
|
|
|
|
|
|
|
|
|
|
|
private static RemoteWebDriver browser; |
|
|
|
private static RemoteWebDriver browser; |
|
|
|
|
|
|
|
|
|
|
|
@BeforeAll |
|
|
|
@BeforeAll |
|
|
|
public static void setup() { |
|
|
|
public static void setup() { |
|
|
|
new LoginPage(browser) |
|
|
|
UserPage userPage = new LoginPage(browser) |
|
|
|
.login("admin", "dolphinscheduler123") |
|
|
|
.login("admin", "dolphinscheduler123") |
|
|
|
.goToNav(SecurityPage.class) |
|
|
|
.goToNav(SecurityPage.class) |
|
|
|
.goToTab(TenantPage.class) |
|
|
|
.goToTab(TenantPage.class) |
|
|
|
.create(tenant) |
|
|
|
.create(tenant) |
|
|
|
.goToNav(ProjectPage.class) |
|
|
|
.goToNav(SecurityPage.class) |
|
|
|
.create(project) |
|
|
|
.goToTab(UserPage.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new WebDriverWait(userPage.driver(), 20).until(ExpectedConditions.visibilityOfElementLocated( |
|
|
|
|
|
|
|
new By.ByClassName("name"))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userPage.update(user, user, password, email, phone, tenant) |
|
|
|
|
|
|
|
.goToNav(ProjectPage.class) |
|
|
|
|
|
|
|
.create(project) |
|
|
|
; |
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@AfterAll |
|
|
|
// @AfterAll
|
|
|
|
public static void cleanup() { |
|
|
|
// public static void cleanup() {
|
|
|
|
new NavBarPage(browser) |
|
|
|
// new NavBarPage(browser)
|
|
|
|
.goToNav(ProjectPage.class) |
|
|
|
// .goToNav(ProjectPage.class)
|
|
|
|
.goTo(project) |
|
|
|
// .goTo(project)
|
|
|
|
.goToTab(WorkflowDefinitionTab.class) |
|
|
|
// .goToTab(WorkflowDefinitionTab.class)
|
|
|
|
.cancelPublishAll() |
|
|
|
// .cancelPublishAll()
|
|
|
|
.deleteAll() |
|
|
|
// .deleteAll()
|
|
|
|
; |
|
|
|
// ;
|
|
|
|
new NavBarPage(browser) |
|
|
|
//
|
|
|
|
.goToNav(ProjectPage.class) |
|
|
|
// new NavBarPage(browser)
|
|
|
|
.delete(project) |
|
|
|
// .goToNav(ProjectPage.class)
|
|
|
|
.goToNav(SecurityPage.class) |
|
|
|
// .delete(project)
|
|
|
|
.goToTab(TenantPage.class) |
|
|
|
// .goToNav(SecurityPage.class)
|
|
|
|
.delete(tenant) |
|
|
|
// .goToTab(TenantPage.class)
|
|
|
|
; |
|
|
|
// .delete(tenant)
|
|
|
|
} |
|
|
|
// ;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@Order(1) |
|
|
|
@Order(1) |
|
|
|
void testCreateWorkflow() { |
|
|
|
void testCreateWorkflow() { |
|
|
|
final String workflow = "test-workflow-1"; |
|
|
|
final String workflow = "test-workflow-1"; |
|
|
|
|
|
|
|
|
|
|
|
final WorkflowDefinitionTab workflowDefinitionPage = |
|
|
|
WorkflowDefinitionTab workflowDefinitionPage = |
|
|
|
new ProjectPage(browser) |
|
|
|
new ProjectPage(browser) |
|
|
|
.goTo(project) |
|
|
|
.goTo(project) |
|
|
|
.goToTab(WorkflowDefinitionTab.class); |
|
|
|
.goToTab(WorkflowDefinitionTab.class); |
|
|
@ -104,43 +125,47 @@ class WorkflowE2ETest { |
|
|
|
.submit() |
|
|
|
.submit() |
|
|
|
; |
|
|
|
; |
|
|
|
|
|
|
|
|
|
|
|
await().untilAsserted(() -> assertThat( |
|
|
|
await().untilAsserted(() -> assertThat(workflowDefinitionPage.workflowList()) |
|
|
|
workflowDefinitionPage.workflowList() |
|
|
|
.as("Workflow list should contain newly-created workflow") |
|
|
|
).anyMatch(it -> it.getText().contains(workflow))); |
|
|
|
.anyMatch( |
|
|
|
|
|
|
|
it -> it.getText().contains(workflow) |
|
|
|
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
|
|
workflowDefinitionPage.publish(workflow); |
|
|
|
workflowDefinitionPage.publish(workflow); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
// @Test
|
|
|
|
@Order(10) |
|
|
|
// @Order(10)
|
|
|
|
void testCreateSubWorkflow() { |
|
|
|
// void testCreateSubWorkflow() {
|
|
|
|
final String workflow = "test-sub-workflow-1"; |
|
|
|
// final String workflow = "test-sub-workflow-1";
|
|
|
|
|
|
|
|
//
|
|
|
|
final WorkflowDefinitionTab workflowDefinitionPage = |
|
|
|
// WorkflowDefinitionTab workflowDefinitionPage =
|
|
|
|
new ProjectPage(browser) |
|
|
|
// new ProjectPage(browser)
|
|
|
|
.goToNav(ProjectPage.class) |
|
|
|
// .goToNav(ProjectPage.class)
|
|
|
|
.goTo(project) |
|
|
|
// .goTo(project)
|
|
|
|
.goToTab(WorkflowDefinitionTab.class); |
|
|
|
// .goToTab(WorkflowDefinitionTab.class);
|
|
|
|
|
|
|
|
//
|
|
|
|
workflowDefinitionPage |
|
|
|
// workflowDefinitionPage
|
|
|
|
.createWorkflow() |
|
|
|
// .createWorkflow()
|
|
|
|
|
|
|
|
//
|
|
|
|
.<SubWorkflowTaskForm> addTask(TaskType.SUB_PROCESS) |
|
|
|
// .<SubWorkflowTaskForm> addTask(TaskType.SUB_PROCESS)
|
|
|
|
.submit() |
|
|
|
// .childNode("test-workflow-1")
|
|
|
|
|
|
|
|
// .name("test-sub-1")
|
|
|
|
.submit() |
|
|
|
// .submit()
|
|
|
|
.name(workflow) |
|
|
|
//
|
|
|
|
.tenant(tenant) |
|
|
|
// .submit()
|
|
|
|
.addGlobalParam("global_param", "hello world") |
|
|
|
// .name(workflow)
|
|
|
|
.submit() |
|
|
|
// .tenant(tenant)
|
|
|
|
; |
|
|
|
// .addGlobalParam("global_param", "hello world")
|
|
|
|
|
|
|
|
// .submit()
|
|
|
|
await().untilAsserted(() -> assertThat( |
|
|
|
// ;
|
|
|
|
workflowDefinitionPage.workflowList() |
|
|
|
//
|
|
|
|
).anyMatch(it -> it.getText().contains(workflow))); |
|
|
|
// await().untilAsserted(() -> assertThat(
|
|
|
|
|
|
|
|
// workflowDefinitionPage.workflowList()
|
|
|
|
workflowDefinitionPage.publish(workflow); |
|
|
|
// ).anyMatch(it -> it.getText().contains(workflow)));
|
|
|
|
} |
|
|
|
//
|
|
|
|
|
|
|
|
// workflowDefinitionPage.publish(workflow);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@Order(30) |
|
|
|
@Order(30) |
|
|
@ -148,27 +173,27 @@ class WorkflowE2ETest { |
|
|
|
final String workflow = "test-workflow-1"; |
|
|
|
final String workflow = "test-workflow-1"; |
|
|
|
|
|
|
|
|
|
|
|
final ProjectDetailPage projectPage = |
|
|
|
final ProjectDetailPage projectPage = |
|
|
|
new ProjectPage(browser) |
|
|
|
new ProjectPage(browser) |
|
|
|
.goToNav(ProjectPage.class) |
|
|
|
.goToNav(ProjectPage.class) |
|
|
|
.goTo(project); |
|
|
|
.goTo(project); |
|
|
|
|
|
|
|
|
|
|
|
projectPage |
|
|
|
projectPage |
|
|
|
.goToTab(WorkflowInstanceTab.class) |
|
|
|
.goToTab(WorkflowInstanceTab.class) |
|
|
|
.deleteAll(); |
|
|
|
.deleteAll(); |
|
|
|
|
|
|
|
|
|
|
|
projectPage |
|
|
|
projectPage |
|
|
|
.goToTab(WorkflowDefinitionTab.class) |
|
|
|
.goToTab(WorkflowDefinitionTab.class) |
|
|
|
.run(workflow) |
|
|
|
.run(workflow) |
|
|
|
.submit(); |
|
|
|
.submit(); |
|
|
|
|
|
|
|
|
|
|
|
await().untilAsserted(() -> { |
|
|
|
await().untilAsserted(() -> { |
|
|
|
browser.navigate().refresh(); |
|
|
|
browser.navigate().refresh(); |
|
|
|
|
|
|
|
|
|
|
|
final Row row = projectPage |
|
|
|
final Row row = projectPage |
|
|
|
.goToTab(WorkflowInstanceTab.class) |
|
|
|
.goToTab(WorkflowInstanceTab.class) |
|
|
|
.instances() |
|
|
|
.instances() |
|
|
|
.iterator() |
|
|
|
.iterator() |
|
|
|
.next(); |
|
|
|
.next(); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(row.isSuccess()).isTrue(); |
|
|
|
assertThat(row.isSuccess()).isTrue(); |
|
|
|
assertThat(row.executionTime()).isEqualTo(1); |
|
|
|
assertThat(row.executionTime()).isEqualTo(1); |
|
|
@ -176,22 +201,22 @@ class WorkflowE2ETest { |
|
|
|
|
|
|
|
|
|
|
|
// Test rerun
|
|
|
|
// Test rerun
|
|
|
|
projectPage |
|
|
|
projectPage |
|
|
|
.goToTab(WorkflowInstanceTab.class) |
|
|
|
.goToTab(WorkflowInstanceTab.class) |
|
|
|
.instances() |
|
|
|
.instances() |
|
|
|
.stream() |
|
|
|
.stream() |
|
|
|
.filter(it -> it.rerunButton().isDisplayed()) |
|
|
|
.filter(it -> it.rerunButton().isDisplayed()) |
|
|
|
.iterator() |
|
|
|
.iterator() |
|
|
|
.next() |
|
|
|
.next() |
|
|
|
.rerun(); |
|
|
|
.rerun(); |
|
|
|
|
|
|
|
|
|
|
|
await().untilAsserted(() -> { |
|
|
|
await().untilAsserted(() -> { |
|
|
|
browser.navigate().refresh(); |
|
|
|
browser.navigate().refresh(); |
|
|
|
|
|
|
|
|
|
|
|
final Row row = projectPage |
|
|
|
final Row row = projectPage |
|
|
|
.goToTab(WorkflowInstanceTab.class) |
|
|
|
.goToTab(WorkflowInstanceTab.class) |
|
|
|
.instances() |
|
|
|
.instances() |
|
|
|
.iterator() |
|
|
|
.iterator() |
|
|
|
.next(); |
|
|
|
.next(); |
|
|
|
|
|
|
|
|
|
|
|
assertThat(row.isSuccess()).isTrue(); |
|
|
|
assertThat(row.isSuccess()).isTrue(); |
|
|
|
assertThat(row.executionTime()).isEqualTo(2); |
|
|
|
assertThat(row.executionTime()).isEqualTo(2); |
|
|
|