Browse Source

Fix flaky filemanage_e2e_test (#10068)

3.1.0-release
xiangzihao 3 years ago committed by GitHub
parent
commit
718e786c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/FileManagePage.java

10
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.By;
import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys; import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.LocalFileDetector; import org.openqa.selenium.remote.LocalFileDetector;
import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.FindBys; import org.openqa.selenium.support.FindBys;
import org.openqa.selenium.support.PageFactory; 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.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.WebDriverWait;
@ -71,6 +73,12 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab {
}) })
private WebElement buttonConfirm; private WebElement buttonConfirm;
@FindBys({
@FindBy(className = "monaco-editor"),
@FindBy(className = "view-line"),
})
private WebElement editor;
public FileManagePage(RemoteWebDriver driver) { public FileManagePage(RemoteWebDriver driver) {
super(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(ExpectedConditions.urlContains("/edit"));
new WebDriverWait(driver, 5).until((ExpectedCondition<Object>) webDriver -> editor.getText().length() > 0);
editFileBox().codeEditor().content(scripts); editFileBox().codeEditor().content(scripts);
editFileBox().buttonSubmit().click(); editFileBox().buttonSubmit().click();

Loading…
Cancel
Save