@ -18,8 +18,9 @@ package org.apache.dolphinscheduler.page.project;
import org.apache.dolphinscheduler.common.PageCommon ;
import org.apache.dolphinscheduler.data.project.TimingData ;
import org.apache.dolphinscheduler.locator.project.RunWorkflowLocator ;
import org.apache.dolphinscheduler.data.project.WorkflowDefineData ;
import org.apache.dolphinscheduler.locator.project.TimingLocator ;
import org.apache.dolphinscheduler.locator.project.WorkflowDefineLocator ;
import org.openqa.selenium.WebDriver ;
public class TimingPage extends PageCommon {
@ -32,19 +33,19 @@ public class TimingPage extends PageCommon {
* create timing
* /
public boolean createTiming ( ) throws InterruptedException {
// Determine whether the workflow status is online
ifTextExists ( WorkflowDefineLocator . WORKFLOW_STATE , WorkflowDefineData . WORKFLOW_ONLINE_STATE ) ;
// click timing button
System . out . println ( "Click timing button" ) ;
Thread . sleep ( 1000 ) ;
clickButton ( TimingLocator . CLICK_TIMING_BUTTON ) ;
System . out . println ( "Click execution timing button" ) ;
clickButton ( TimingLocator . CLICK_EXECUTION_TIMING_BUTTON ) ;
Thread . sleep ( 1000 ) ;
clickElement ( TimingLocator . SELECT_FAILURE_STRATEGY_END ) ;
clickElement ( TimingLocator . SELECT_FAILURE_STRATEGY_CONTINUE ) ;
clickElement ( TimingLocator . CLICK_NOTICE_STRATEGY ) ;
clickElement ( TimingLocator . SELECT_NOTICE_STRATEGY ) ;
Thread . sleep ( 500 ) ;
clickElement ( TimingLocator . CLICK_PROCESS_PRIORITY ) ;
clickElement ( TimingLocator . SELECT_PROCESS_PRIORITY ) ;
clickElement ( TimingLocator . CLICK_WORKER_GROUP ) ;
@ -55,7 +56,7 @@ public class TimingPage extends PageCommon {
sendInput ( TimingLocator . INPUT_Cc , TimingData . Cc ) ;
clickButton ( TimingLocator . CLICK_CREATE_BUTTON ) ;
return ifTitleContains ( TimingData . WORKFLOW_TITL E ) ;
return ifTextExists ( TimingLocator . TIMING_STATE , TimingData . TIMING_OFFLINE_STAT E ) ;
}
/ * *
@ -64,20 +65,20 @@ public class TimingPage extends PageCommon {
public boolean editTiming ( ) throws InterruptedException {
// click timing button
System . out . println ( "Click timing management button" ) ;
Thread . sleep ( 1000 ) ;
clickButton ( TimingLocator . CLICK_TIMING_MANAGEMENT_BUTTON ) ;
Thread . sleep ( 1000 ) ;
// Determine whether the workflow name exists
ifTextExists ( TimingLocator . WORKFLOW_NAME , WorkflowDefineData . INPUT_WORKFLOW_NAME ) ;
System . out . println ( "Click edit timing button" ) ;
clickButton ( TimingLocator . CLICK_EDIT_TIMING_BUTTON ) ;
System . out . println ( "Click execution timing button" ) ;
clickButton ( TimingLocator . CLICK_EXECUTION_TIMING_BUTTON ) ;
Thread . sleep ( 1000 ) ;
clickElement ( TimingLocator . SELECT_FAILURE_STRATEGY_END ) ;
clickElement ( TimingLocator . SELECT_FAILURE_STRATEGY_CONTINUE ) ;
clickElement ( TimingLocator . CLICK_NOTICE_STRATEGY ) ;
clickElement ( TimingLocator . SELECT_NOTICE_STRATEGY ) ;
Thread . sleep ( 500 ) ;
clickElement ( TimingLocator . CLICK_PROCESS_PRIORITY ) ;
clickElement ( TimingLocator . SELECT_PROCESS_PRIORITY ) ;
clickElement ( TimingLocator . CLICK_WORKER_GROUP ) ;
@ -96,12 +97,15 @@ public class TimingPage extends PageCommon {
* online timing
* /
public boolean onlineTiming ( ) throws InterruptedException {
flushPage ( ) ;
// Determine whether the timing is offline
ifTextExists ( TimingLocator . TIMING_MANAGEMENT_TIMING_STATE , TimingData . TIMING_OFFLINE_STATE ) ;
// click online timing button
System . out . println ( "Click online timing button" ) ;
Thread . sleep ( 500 ) ;
clickButton ( TimingLocator . CLICK_ONLINE_TIMING_BUTTON ) ;
clickElement ( TimingLocator . CLICK_ONLINE_TIMING_BUTTON ) ;
return ifTitleContains ( TimingData . TIMING_TITLE ) ;
return ifTextExists ( TimingLocator . TIMING_MANAGEMENT_TIMING_STATE , TimingData . TIMING_ONLINE_STATE ) ;
}
@ -109,12 +113,15 @@ public class TimingPage extends PageCommon {
* offline timing
* /
public boolean offlineTiming ( ) throws InterruptedException {
flushPage ( ) ;
// Determine whether the timing is online
ifTextExists ( TimingLocator . TIMING_MANAGEMENT_TIMING_STATE , TimingData . TIMING_ONLINE_STATE ) ;
// click offline timing button
System . out . println ( "Click offline timing button" ) ;
Thread . sleep ( 500 ) ;
clickButton ( TimingLocator . CLICK_OFFLINE_TIMING_BUTTON ) ;
clickElement ( TimingLocator . CLICK_OFFLINE_TIMING_BUTTON ) ;
return ifTitleContains ( TimingData . TIMING_TITLE ) ;
return ifTextExists ( TimingLocator . TIMING_MANAGEMENT_TIMING_STATE , TimingData . TIMING_OFFLINE_STATE ) ;
}
@ -123,12 +130,14 @@ public class TimingPage extends PageCommon {
* delete timing
* /
public boolean deleteTiming ( ) throws InterruptedException {
// Determine whether the timing is offline
ifTextExists ( TimingLocator . TIMING_MANAGEMENT_TIMING_STATE , TimingData . TIMING_OFFLINE_STATE ) ;
// click offline timing button
System . out . println ( "Click delete timing button" ) ;
Thread . sleep ( 500 ) ;
clickButton ( TimingLocator . CLICK_DELETE_TIMING_BUTTON ) ;
clickButton ( TimingLocator . CLICK_CONFIRM_DELETE_TIMING_BUTTON ) ;
return ifTitleContains ( TimingData . WORKFLOW_TITLE ) ;
return ifTextExists ( TimingLocator . TIMING_STATE , "-" ) ;
}
}