sunlishuo25 commented on code in PR #18673:
URL:
https://github.com/apache/dolphinscheduler/pull/18673#discussion_r4254211087
##########
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/WorkflowForm.java:
##########
@@ -110,6 +121,84 @@ public WebElement getTask(String taskName) {
return task;
}
+ public String taskCode(String taskName) {
+ return WebDriverWaitFactory.createWebDriverWait(driver).until(unused
-> driver
+ .findElements(By.cssSelector(".dag-container
.x6-graph-scroller g[data-shape='dag-task']")).stream()
+ .filter(node ->
node.findElement(By.xpath("./*[local-name()='text']")).getText()
+ .equals(taskName))
+ .map(node -> node.getAttribute("data-cell-id"))
+ .findFirst().orElse(null));
+ }
+
+ private WebElement taskBodyInView(String code) {
+ By body = By.cssSelector(".dag-container .x6-graph-scroller
g[data-shape='dag-task'][data-cell-id='"
+ + code + "'] > .dag-task-body");
+ return WebDriverWaitFactory.createWebDriverWait(driver)
+ .withMessage("Task body is hidden or its center is covered: "
+ code).until(unused -> {
+ WebElement node =
ExpectedConditions.visibilityOfElementLocated(body).apply(driver);
+ if (node == null) {
+ return null;
+ }
+ // Require an unclipped center so the hit test matches the
native pointer location.
+ boolean target = Boolean.TRUE.equals(((JavascriptExecutor)
driver).executeScript(
Review Comment:
Removed the added hit test in `1f47241`.
[`WorkflowForm.java`](https://github.com/apache/dolphinscheduler/blob/1f47241c12fc97582ff65ea105d46b4245c8a94c/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/project/workflow/WorkflowForm.java#L138)
now uses native WebDriver interactions with the rendered task label for
opening and copying. The existing drag-and-drop helper is still used for adding
nodes.
--
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]