sunlishuo25 commented on PR #18673:
URL:
https://github.com/apache/dolphinscheduler/pull/18673#issuecomment-6234282140
@SbloodyS Thanks for the review. I've refactored the E2E test in 7713eb1,
6ac8aa1, 9ed1feb and 64e5cac to follow the existing Page Object Model and test
structure.
**Test structure**
- Moved the test to `cases/tasks/SeaTunnelTaskE2ETest`, next to
`ShellTaskE2ETest` and `PythonTaskE2ETest`, and made it extend
`BaseWorkflowE2ETest`. Setup is in `@BeforeAll`, the same way as
`PythonTaskE2ETest`.
- Split the single long test into six `@Order` scenarios: execution type
default and persistence, copying a STREAM task, edge style, the BATCH run, the
STREAM run, and the Flink savepoint check. Scenarios 1–3 only depend on
`@BeforeAll`. Scenario 5 uses the BATCH task from scenario 4 as evidence that
the Batch list has loaded, and the scenarios run one local engine at a time.
`@DisableIfTestFails` skips the later scenarios if an earlier one fails.
- The real SeaTunnel and Flink runs and all regression assertions are kept.
The test-local helpers went from 17 to 8, and none of them touch the DOM any
more; navigation, task configuration, submission and execution now use the
existing page objects and `BaseWorkflowE2ETest`.
**Changes to shared code, and why each one is needed**
1. `WorkflowForm.addTask(type, x, y)` is removed and `dragAndDrop.js` is
restored to `dev`. `addTask(type)` only gains the `SEATUNNEL` and
`FLINK_STREAM` cases. Without drop coordinates, nodes dropped by
`dragAndDrop.js` all land at the same position, so the test now lays them out
with the existing `WorkflowForm.formatDAG()` instead.
2. `formatDAG()` / `WorkflowFormatDialog.confirm()` were broken, so I fixed
them rather than adding a separate implementation:
- `formatDAG()` locates the button by the `graph-format` class, but the
DAG toolbar no longer renders that class (no match in
`dolphinscheduler-ui/src`). I added it back to the format button in
`dag-toolbar.tsx`, the same way the save button has `btn-save`. This is the
only production change in this update, and it only adds a class name. #18715
added `dialog-start-workflow` and `dialog-create-directory` for E2E in the same
way.
- `WorkflowFormatDialog.confirm()` looked for Element UI classes
(`el-dialog__wrapper`, `el-button--primary`) that the current Naive UI modal
does not have. It now clicks `[data-modal-ready] .btn-submit` through
`UiInteraction`, following #18715.
- These page objects were only used by `WorkflowSwitchE2ETest`, which is
commented out in `e2e.yml`, so the breakage had gone unnoticed.
3. `TaskNodeForm.preTask()` always timed out: it waited for an
`option-pre-tasks` class that the pre-task select never renders, and it opened
the select with a JavaScript click. It now opens the select through
`UiInteraction` and picks the option by exact name. This removes one
`executeScript` call. Its only other caller is the disabled
`WorkflowSwitchE2ETest`, which already uses exact names.
4. `WorkflowForm.getTask()` matched node text with `contains`, and its
selector also matched the nodes mirrored in the minimap. A copied task is named
`<source>_<suffix>`, so `getTask("st-source")` could open the copy instead of
the source. It now matches the full node title inside the main graph through a
private `findTask()`, which the new `copyTask()` also uses, so node lookup
lives in one place. Before clicking, it also scrolls the canvas with native
wheel actions until the node is in the middle of the view: after formatting,
the canvas can stay scrolled away from the node, and on my fork the
double-click then missed the node entirely.
5. `WorkflowSaveDialog.submit()` clicked the dialog's submit button as soon
as it was clickable, while the dialog could still be entering. When editing an
existing workflow there is no name to type first, so the click landed during
the animation and failed with `ElementClickInterceptedException` on my fork. It
now clicks `[data-modal-ready] .btn-submit` through `UiInteraction`, following
#18715. Other tests that save workflows only gain the wait for the dialog to be
ready; the now-unused `buttonSubmit` locator was removed.
6. New page object methods, each needed by a scenario:
- `WorkflowForm.copyTask()` (context menu Copy), `edgeDashArrays()` (edge
style check), and `openTaskCategory()`. The task palette is an accordion and
SeaTunnel is in the Data Integration category, while Shell and Flink are in
Universal, so the edge-style scenario has to switch categories.
- `WorkflowDefinitionTab.edit()` reopens a saved workflow with the row's
edit button, in the same tab, the same way as `publish()` and `run()`. This
replaces the previous window switching and page-load timeout handling.
- `CodeEditor.content()` reads the editor content with the clipboard
mechanism `CodeEditor` already uses. The existing copy check in
`content(String)` was moved into a shared private method without changing its
behavior. This replaces the keyboard-based reader in `SeaTunnelTaskForm`.
- `TaskInstanceTab` gains Stream-tab support (`selectType`,
`streamInstances`, `isSavepointEnabled`, `stopStream`, `log`) and
`Row.isRunning()` / `isStopped()`, alongside the existing `isSuccess()` /
`isFailed()`.
No new `JavascriptExecutor` calls were added.
On my fork, all 24 E2E jobs passed for 64e5cac
([run](https://github.com/sunlishuo25/dolphinscheduler/actions/runs/39033414162);
`SeaTunnelTaskE2ETest` ran 6 tests with 0 failures), and Backend, Frontend,
Test, API-Test, E2E-K8S and CodeQL passed for 7713eb1; the later commits only
change E2E test code.
--
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]