diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/ResourcePage.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/ResourcePage.java index 1faba6d090..f5a7b075d1 100644 --- a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/ResourcePage.java +++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/ResourcePage.java @@ -50,6 +50,7 @@ public class ResourcePage extends NavBarPage implements NavBarPage.NavBarItem { new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource")); new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(fileManageTab)); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", fileManageTab()); + new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/file-manage")); return tab.cast(new FileManagePage(driver)); } @@ -57,6 +58,7 @@ public class ResourcePage extends NavBarPage implements NavBarPage.NavBarItem { new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource")); new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(udfManageTab)); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", udfManageTab()); + new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource-manage")); return tab.cast(new UdfManagePage(driver)); } @@ -64,6 +66,7 @@ public class ResourcePage extends NavBarPage implements NavBarPage.NavBarItem { new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource")); new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(functionManageTab)); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", functionManageTab()); + new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/function-manage")); return tab.cast(new FunctionManagePage(driver)); } diff --git a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/UdfManagePage.java b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/UdfManagePage.java index 092f407c46..cc838652f8 100644 --- a/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/UdfManagePage.java +++ b/dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/UdfManagePage.java @@ -34,6 +34,8 @@ 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.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; @Getter public class UdfManagePage extends NavBarPage implements ResourcePage.Tab { @@ -79,6 +81,8 @@ public class UdfManagePage extends NavBarPage implements ResourcePage.Tab { } public UdfManagePage uploadFile(String filePath) { + new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(buttonUploadUdf)); + buttonUploadUdf().click(); driver.setFileDetector(new LocalFileDetector());