Browse Source

[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: chenxingchun <438044805@qq.com>
pull/3/MERGE
xingchun-chen 4 years ago committed by GitHub
parent
commit
00e0003aed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java
  2. 12
      e2e/src/test/java/org/apache/dolphinscheduler/locator/project/WorkflowDefineLocator.java
  3. 5
      e2e/src/test/java/org/apache/dolphinscheduler/page/project/WorkflowDefinePage.java

40
e2e/src/test/java/org/apache/dolphinscheduler/common/BrowserCommon.java

@ -223,22 +223,46 @@ public class BrowserCommon {
/**
* mouse drag element
*
* @param source_locator BY
* @param target_locator BY
* @param sourceLocator BY
* @param targetLocator BY
*/
public void dragAndDrop(By source_locator, By target_locator) {
WebElement sourceElement = locateElement(source_locator);
WebElement targetElement = locateElement(target_locator);
public void dragAndDrop(By sourceLocator, By targetLocator) {
WebElement sourceElement = locateElement(sourceLocator);
WebElement targetElement = locateElement(targetLocator);
actions.dragAndDrop(sourceElement, targetElement).perform();
actions.release();
}
public void moveToDragElement(By target_locator, int X, int Y) {
WebElement targetElement = locateElement(target_locator);
actions.dragAndDropBy(targetElement, X, Y).perform();
public void moveToDragElement(By targetLocator, int x, int y) {
WebElement targetElement = locateElement(targetLocator);
actions.dragAndDropBy(targetElement, x, y).perform();
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

12
e2e/src/test/java/org/apache/dolphinscheduler/locator/project/WorkflowDefineLocator.java

@ -120,12 +120,22 @@ public class WorkflowDefineLocator {
//click submit button
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
*/
//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
public static final By INPUT_WORKFLOW_NAME = By.xpath("//input");

5
e2e/src/test/java/org/apache/dolphinscheduler/page/project/WorkflowDefinePage.java

@ -131,6 +131,11 @@ public class WorkflowDefinePage extends PageCommon {
System.out.println("move to Dag Element ");
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);
}

Loading…
Cancel
Save