Browse Source

[E2E] [CI] Fix flaky e2e test (#11077)

* fix flaky e2e test

* fix flaky e2e test

* fix flaky e2e test
3.1.0-release
xiangzihao 2 years ago committed by GitHub
parent
commit
72d29971bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/common/NavBarPage.java
  2. 8
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java

4
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/common/NavBarPage.java

@ -17,6 +17,7 @@
* under the License.
*
*/
package org.apache.dolphinscheduler.e2e.pages.common;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
@ -28,7 +29,6 @@ import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement;
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;
@ -75,7 +75,7 @@ public class NavBarPage {
if (nav == ResourcePage.class) {
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(resourceTab));
resourceTab.click();
((JavascriptExecutor) driver).executeScript("arguments[0].click();", resourceTab());
return nav.cast(new ResourcePage(driver));
}

8
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java

@ -30,11 +30,13 @@ import java.util.List;
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.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;
@ -66,10 +68,12 @@ public class DataSourcePage extends NavBarPage implements NavBarPage.NavBarItem
String jdbcParams) {
buttonCreateDataSource().click();
new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(
new By.ByClassName("dialog-create-data-source")));
createDataSourceForm().btnDataSourceTypeDropdown().click();
new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(
new By.ByClassName("dialog-create-data-source")));
new WebDriverWait(driver, 10).until(ExpectedConditions.textToBePresentInElement(driver.findElement(By.className("dialog-create-data-source")), dataSourceType.toUpperCase()));
createDataSourceForm().selectDataSourceType()
.stream()

Loading…
Cancel
Save