Browse Source

[E2E-Test] Try to fix flaky e2e test (#13971)

* try to fix flaky e2e test
3.1.6-release
xiangzihao 2 years ago committed by zhuangchong
parent
commit
219bb21f4a
  1. 3
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/ResourcePage.java
  2. 4
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/UdfManagePage.java

3
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.urlContains("/resource"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(fileManageTab)); new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(fileManageTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", fileManageTab()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", fileManageTab());
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/file-manage"));
return tab.cast(new FileManagePage(driver)); 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.urlContains("/resource"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(udfManageTab)); new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(udfManageTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", udfManageTab()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", udfManageTab());
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource-manage"));
return tab.cast(new UdfManagePage(driver)); 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.urlContains("/resource"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(functionManageTab)); new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(functionManageTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", functionManageTab()); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", functionManageTab());
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/function-manage"));
return tab.cast(new FunctionManagePage(driver)); return tab.cast(new FunctionManagePage(driver));
} }

4
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.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.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
@Getter @Getter
public class UdfManagePage extends NavBarPage implements ResourcePage.Tab { 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) { public UdfManagePage uploadFile(String filePath) {
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(buttonUploadUdf));
buttonUploadUdf().click(); buttonUploadUdf().click();
driver.setFileDetector(new LocalFileDetector()); driver.setFileDetector(new LocalFileDetector());

Loading…
Cancel
Save