diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/FileManagePage.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/FileManagePage.java index 395877d8ea..f38bab003c 100644 --- a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/FileManagePage.java +++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/FileManagePage.java @@ -28,12 +28,14 @@ import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.Keys; +import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.LocalFileDetector; import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBys; import org.openqa.selenium.support.PageFactory; +import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; @@ -71,6 +73,12 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { }) private WebElement buttonConfirm; + @FindBys({ + @FindBy(className = "monaco-editor"), + @FindBy(className = "view-line"), + }) + private WebElement editor; + public FileManagePage(RemoteWebDriver driver) { super(driver); @@ -178,6 +186,8 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab { new WebDriverWait(driver, 5).until(ExpectedConditions.urlContains("/edit")); + new WebDriverWait(driver, 5).until((ExpectedCondition) webDriver -> editor.getText().length() > 0); + editFileBox().codeEditor().content(scripts); editFileBox().buttonSubmit().click();