未验证 提交 00e0003a 编写于 作者: X xingchun-chen 提交者: GitHub

[test-2995][e2e]Add task connection (#3524)

* Add task connection 

* Optimize test cases
 

* Modify variable format
 
 

* Optimize test cases
 

* Update BrowserCommon.java

* Update BrowserCommon.java

* Update WorkflowDefineLocator.java
Co-authored-by: weixin_41213428's avatarchenxingchun <438044805@qq.com>
上级 59610a56
...@@ -223,22 +223,46 @@ public class BrowserCommon { ...@@ -223,22 +223,46 @@ public class BrowserCommon {
/** /**
* mouse drag element * mouse drag element
* *
* @param source_locator BY * @param sourceLocator BY
* @param target_locator BY * @param targetLocator BY
*/ */
public void dragAndDrop(By source_locator, By target_locator) { public void dragAndDrop(By sourceLocator, By targetLocator) {
WebElement sourceElement = locateElement(source_locator); WebElement sourceElement = locateElement(sourceLocator);
WebElement targetElement = locateElement(target_locator); WebElement targetElement = locateElement(targetLocator);
actions.dragAndDrop(sourceElement, targetElement).perform(); actions.dragAndDrop(sourceElement, targetElement).perform();
actions.release(); actions.release();
} }
public void moveToDragElement(By target_locator, int X, int Y) { public void moveToDragElement(By targetLocator, int x, int y) {
WebElement targetElement = locateElement(target_locator); WebElement targetElement = locateElement(targetLocator);
actions.dragAndDropBy(targetElement, X, Y).perform(); actions.dragAndDropBy(targetElement, x, y).perform();
actions.release(); actions.release();
} }
/**
* Right mouse click on the element
*
* @param locator By
* @return actions
*/
public void mouseRightClickElement(By locator) {
WebElement mouseRightClickElement = locateElement(locator);
actions.contextClick(mouseRightClickElement).perform();
}
/**
* The mouse moves from a position to a specified positionØ
*
* @param sourceLocator BY
* @param targetLocator BY
* @return actions
*/
public void mouseMovePosition(By sourceLocator, By targetLocator) throws InterruptedException {
WebElement sourceElement = locateElement(sourceLocator);
WebElement targetElement = locateElement(targetLocator);
actions.dragAndDrop(sourceElement,targetElement).perform();
actions.click();
}
/** /**
* jump page * jump page
......
...@@ -120,12 +120,22 @@ public class WorkflowDefineLocator { ...@@ -120,12 +120,22 @@ public class WorkflowDefineLocator {
//click submit button //click submit button
public static final By CLICK_SUBMIT_BUTTON = By.xpath("//div[3]/div/button[2]/span"); public static final By CLICK_SUBMIT_BUTTON = By.xpath("//div[3]/div/button[2]/span");
//copy task
public static final By MOUSE_RIGHT_CLICK = By.xpath("//div[2]/div[2]/div/div/div/div/div[2]");
public static final By COPY_TASK = By.xpath("//a[3]/span");
//click line
public static final By CLICK_LINE = By.xpath("//a[@id='line']/button/i");
public static final By LINE_SOURCES_TASK = By.xpath("//div[@id='canvas']/div[1]/div[2]");
public static final By LINE_TARGET_TASK = By.xpath("//div[@id='canvas']/div[2]/div[2]");
/** /**
* save workflow * save workflow
*/ */
//click save workflow button //click save workflow button
public static final By CLICK_SAVE_WORKFLOW_BUTTON = By.xpath("//div[2]/div[1]/div[2]/button[2]"); public static final By CLICK_SAVE_WORKFLOW_BUTTON = By.xpath("//div[2]/div[1]/div[2]/button[2]/span");
//input workflow name //input workflow name
public static final By INPUT_WORKFLOW_NAME = By.xpath("//input"); public static final By INPUT_WORKFLOW_NAME = By.xpath("//input");
......
...@@ -131,6 +131,11 @@ public class WorkflowDefinePage extends PageCommon { ...@@ -131,6 +131,11 @@ public class WorkflowDefinePage extends PageCommon {
System.out.println("move to Dag Element "); System.out.println("move to Dag Element ");
moveToDragElement(WorkflowDefineLocator.MOUSE_MOVE_SHELL_AT_DAG,-300,-100); moveToDragElement(WorkflowDefineLocator.MOUSE_MOVE_SHELL_AT_DAG,-300,-100);
System.out.println("copy task");
mouseRightClickElement(WorkflowDefineLocator.MOUSE_RIGHT_CLICK);
clickButton(WorkflowDefineLocator.COPY_TASK);
clickButton(WorkflowDefineLocator.CLICK_LINE);
mouseMovePosition(WorkflowDefineLocator.LINE_SOURCES_TASK,WorkflowDefineLocator.LINE_TARGET_TASK);
return ifTitleContains(WorkflowDefineData.CREATE_WORKFLOW_TITLE); return ifTitleContains(WorkflowDefineData.CREATE_WORKFLOW_TITLE);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册