From 718e786c24e919b5532c4132171b3303407abfd7 Mon Sep 17 00:00:00 2001 From: xiangzihao <460888207@qq.com> Date: Tue, 17 May 2022 14:51:43 +0800 Subject: [PATCH] Fix flaky filemanage_e2e_test (#10068) --- .../e2e/pages/resource/FileManagePage.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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();