ailiujiarui commented on code in PR #16542:
URL: 
https://github.com/apache/dolphinscheduler/pull/16542#discussion_r1814071222


##########
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/WorkflowJavaTaskE2ETest.java:
##########
@@ -163,17 +183,112 @@ void testRunWorkflow() {
                 .run(workflow)
                 .submit();
 
-        Awaitility.await().untilAsserted(() -> {
-            browser.navigate().refresh();
+        Awaitility.await()
+                .atMost(Duration.ofMinutes(5))
+                .untilAsserted(() -> {
+                    browser.navigate().refresh();
+
+                    final WorkflowInstanceTab.Row row = projectPage
+                            .goToTab(WorkflowInstanceTab.class)
+                            .instances()
+                            .iterator()
+                            .next();
 
-            final WorkflowInstanceTab.Row row = projectPage
-                    .goToTab(WorkflowInstanceTab.class)
-                    .instances()
-                    .iterator()
-                    .next();
+                    assertThat(row.isSuccess()).isTrue();
+                    assertThat(row.executionTime()).isEqualTo(1);
+                });
 
-            assertThat(row.isSuccess()).isTrue();
-            assertThat(row.executionTime()).isEqualTo(1);
-        });
     }
+
+    @Test
+    @Order(60)
+    void testCreateNormalWorkflow() {
+        FileManagePage file = new NavBarPage(browser)
+                .goToNav(ResourcePage.class)
+                .goToTab(FileManagePage.class)
+                .uploadFile(filePath + "/normal2.jar");
+
+        WebDriverWait wait = WebDriverWaitFactory.createWebDriverWait(browser);
+
+        
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[text()='normal2.jar']")));
+
+        file.uploadFile(filePath + "/normal1.jar");
+
+        
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[text()='normal1.jar']")));
+
+        ProjectPage projectPage = new NavBarPage(browser)
+                .goToNav(ProjectPage.class);
+
+        
wait.until(ExpectedConditions.visibilityOfAllElements(projectPage.projectList()));
+
+        WorkflowDefinitionTab workflowDefinitionPage = projectPage
+                .goTo(project)
+                .goToTab(WorkflowDefinitionTab.class);
+
+        workflowDefinitionPage.createWorkflow()
+                .<JavaTaskForm>addTask(WorkflowForm.TaskType.JAVA)
+                .selectRunType("NORMAL_JAR")
+                .selectMainPackage("normal1.jar")
+                .selectResource("normal1.jar")
+                .selectResource("normal2.jar")
+                .name("test-2")
+                .selectEnv(environmentName)
+                .submit()
+                .submit()
+                .name(workflow2)
+                .submit();
+
+        Awaitility.await().untilAsserted(() -> 
assertThat(workflowDefinitionPage.workflowList())
+                .as("Workflow list should contain newly-created workflow")
+                .anyMatch(it -> it.getText().contains(workflow2)));
+
+        workflowDefinitionPage.publish(workflow2);
+    }
+
+    @Test
+    @Order(90)
+    void testRunNormalWorkflow() {
+        final ProjectDetailPage projectPage =
+                new ProjectPage(browser)
+                        .goToNav(ProjectPage.class)
+                        .goTo(project);
+
+        projectPage
+                .goToTab(WorkflowInstanceTab.class)
+                .deleteAll();
+        projectPage
+                .goToTab(WorkflowDefinitionTab.class)
+                .run(workflow2)
+                .submit();
+
+        Awaitility.await()
+                .atMost(Duration.ofMinutes(5))
+                .untilAsserted(() -> {
+                    browser.navigate().refresh();
+
+                    final WorkflowInstanceTab.Row row = projectPage
+                            .goToTab(WorkflowInstanceTab.class)
+                            .instances()
+                            .iterator()
+                            .next();
+
+                    assertThat(row.isSuccess()).isTrue();
+                    assertThat(row.executionTime()).isEqualTo(1);
+                });
+        /*
+         * Awaitility.await() .atMost(Duration.ofMinutes(5)) .untilAsserted(() 
-> { browser.navigate().refresh();
+         * 
+         * final WorkflowInstanceTab workflowInstanceTab = 
projectPage.goToTab(WorkflowInstanceTab.class);
+         * 
+         * List<WorkflowInstanceTab.Row> instances = 
workflowInstanceTab.instances();
+         * 
+         * if (instances.isEmpty()) { throw new RuntimeException("No workflow 
instances found"); }
+         * 
+         * WorkflowInstanceTab.Row row = instances.get(0);
+         * 
+         * assertThat(row.isSuccess()).isTrue(); 
assertThat(row.executionTime()).isEqualTo(1); });
+         */

Review Comment:
   The comment has been removed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to