[Feature-9021][E2E] Recover sub_process e2e test in ui-next (#9023)

This commit is contained in:
xiangzihao 2022-03-20 13:11:48 +08:00 committed by GitHub
parent fd5e79bd80
commit 82394ba81d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 54 deletions

View File

@ -80,24 +80,24 @@ class WorkflowE2ETest {
;
}
// @AfterAll
// public static void cleanup() {
// new NavBarPage(browser)
// .goToNav(ProjectPage.class)
// .goTo(project)
// .goToTab(WorkflowDefinitionTab.class)
// .cancelPublishAll()
// .deleteAll()
// ;
//
// new NavBarPage(browser)
// .goToNav(ProjectPage.class)
// .delete(project)
// .goToNav(SecurityPage.class)
// .goToTab(TenantPage.class)
// .delete(tenant)
// ;
// }
@AfterAll
public static void cleanup() {
new NavBarPage(browser)
.goToNav(ProjectPage.class)
.goTo(project)
.goToTab(WorkflowDefinitionTab.class)
.cancelPublishAll()
.deleteAll()
;
new NavBarPage(browser)
.goToNav(ProjectPage.class)
.delete(project)
.goToNav(SecurityPage.class)
.goToTab(TenantPage.class)
.delete(tenant)
;
}
@Test
@Order(1)
@ -134,38 +134,38 @@ class WorkflowE2ETest {
workflowDefinitionPage.publish(workflow);
}
// @Test
// @Order(10)
// void testCreateSubWorkflow() {
// final String workflow = "test-sub-workflow-1";
//
// WorkflowDefinitionTab workflowDefinitionPage =
// new ProjectPage(browser)
// .goToNav(ProjectPage.class)
// .goTo(project)
// .goToTab(WorkflowDefinitionTab.class);
//
// workflowDefinitionPage
// .createWorkflow()
//
// .<SubWorkflowTaskForm> addTask(TaskType.SUB_PROCESS)
// .childNode("test-workflow-1")
// .name("test-sub-1")
// .submit()
//
// .submit()
// .name(workflow)
// .tenant(tenant)
// .addGlobalParam("global_param", "hello world")
// .submit()
// ;
//
// await().untilAsserted(() -> assertThat(
// workflowDefinitionPage.workflowList()
// ).anyMatch(it -> it.getText().contains(workflow)));
//
// workflowDefinitionPage.publish(workflow);
// }
@Test
@Order(10)
void testCreateSubWorkflow() {
final String workflow = "test-sub-workflow-1";
WorkflowDefinitionTab workflowDefinitionPage =
new ProjectPage(browser)
.goToNav(ProjectPage.class)
.goTo(project)
.goToTab(WorkflowDefinitionTab.class);
workflowDefinitionPage
.createWorkflow()
.<SubWorkflowTaskForm> addTask(TaskType.SUB_PROCESS)
.childNode("test-workflow-1")
.name("test-sub-1")
.submit()
.submit()
.name(workflow)
.tenant(tenant)
.addGlobalParam("global_param", "hello world")
.submit()
;
await().untilAsserted(() -> assertThat(
workflowDefinitionPage.workflowList()
).anyMatch(it -> it.getText().contains(workflow)));
workflowDefinitionPage.publish(workflow);
}
@Test
@Order(30)

View File

@ -38,10 +38,17 @@ public final class WorkflowDefinitionTab extends NavBarPage implements ProjectDe
@FindBy(className = "btn-create-process")
private WebElement buttonCreateProcess;
@FindBy(className = "select-all")
@FindBys({
@FindBy(className = "btn-selected"),
@FindBy(className = "n-checkbox"),
})
private WebElement checkBoxSelectAll;
@FindBy(className = "btn-delete-all")
@FindBys({
@FindBy(className = "btn-delete-all"),
@FindBy(className = "n-button__content"),
@FindBy(tagName = "span")
})
private WebElement buttonDeleteAll;
@FindBys({
@ -98,7 +105,6 @@ public final class WorkflowDefinitionTab extends NavBarPage implements ProjectDe
for (WebElement cancelButton : cancelButtons) {
cancelButton.click();
driver().navigate().refresh();
}
return this;

View File

@ -55,7 +55,7 @@ public final class SubWorkflowTaskForm extends TaskNodeForm {
public SubWorkflowTaskForm childNode(String node) {
btnSelectChildNodeDropdown().click();
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(new By.ByClassName(
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(By.className(
"n-base-select-option__content")));
selectChildNode()