[E2E] [CI] Fix flaky e2e test cause by #9036 (#9053)

This commit is contained in:
xiangzihao 2022-03-21 17:30:33 +08:00 committed by GitHub
parent af2321f228
commit e0e7701341
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 8 deletions

View File

@ -53,6 +53,8 @@ public final class SubWorkflowTaskForm extends TaskNodeForm {
}
public SubWorkflowTaskForm childNode(String node) {
new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(btnSelectChildNodeDropdown));
btnSelectChildNodeDropdown().click();
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(By.className(

View File

@ -47,19 +47,21 @@ public class ResourcePage extends NavBarPage implements NavBarPage.NavBarItem {
public <T extends ResourcePage.Tab> T goToTab(Class<T> tab) {
if (tab == FileManagePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/file-manage"));
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(fileManageTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", fileManageTab());
return tab.cast(new FileManagePage(driver));
}
if (tab == UdfManagePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(udfManageTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", udfManageTab());
return tab.cast(new UdfManagePage(driver));
}
if (tab == FunctionManagePage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/resource"));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(functionManageTab));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", functionManageTab());
return tab.cast(new FunctionManagePage(driver));

View File

@ -63,40 +63,51 @@ public class SecurityPage extends NavBarPage implements NavBarItem {
public <T extends SecurityPage.Tab> T goToTab(Class<T> tab) {
if (tab == TenantPage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuTenantManage));
menuTenantManage.click();
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuTenantManage());
return tab.cast(new TenantPage(driver));
}
if (tab == UserPage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menUserManage));
menUserManage.click();
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menUserManage());
return tab.cast(new UserPage(driver));
}
if (tab == WorkerGroupPage.class) {
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menWorkerGroupManage));
menWorkerGroupManage.click();
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menWorkerGroupManage());
return tab.cast(new WorkerGroupPage(driver));
}
if (tab == QueuePage.class) {
menuQueueManage().click();
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuQueueManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuQueueManage());
return tab.cast(new QueuePage(driver));
}
if (tab == EnvironmentPage.class) {
menuEnvironmentManage().click();
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuEnvironmentManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuEnvironmentManage());
return tab.cast(new EnvironmentPage(driver));
}
if (tab == TokenPage.class) {
menuTokenManage().click();
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuTokenManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuTokenManage());
return tab.cast(new TokenPage(driver));
}
if (tab == NamespacePage.class) {
menuNamespaceManage().click();
new WebDriverWait(driver, 10).until(ExpectedConditions.urlContains("/security"));
new WebDriverWait(driver, 60).until(ExpectedConditions.elementToBeClickable(menuNamespaceManage));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", menuNamespaceManage());
return tab.cast(new NamespacePage(driver));
}