diff --git a/runtime-acceptance-tests/src/main/java/org/activiti/cloud/qa/story/ProcessInstanceSignalEvents.java b/runtime-acceptance-tests/src/main/java/org/activiti/cloud/qa/story/ProcessInstanceSignalEvents.java index 89e6b651..cbe912e3 100644 --- a/runtime-acceptance-tests/src/main/java/org/activiti/cloud/qa/story/ProcessInstanceSignalEvents.java +++ b/runtime-acceptance-tests/src/main/java/org/activiti/cloud/qa/story/ProcessInstanceSignalEvents.java @@ -69,7 +69,7 @@ public void startSignalCatchProcess() { assertThat(processInstanceCatchSignal).isNotNull(); } - @Then("the task is created with a name $taskName") + @Then("the task with a name '$taskName' is created") public void checkTaskIsCreated(String taskName) { List tasks = new ArrayList<>( runtimeBundleSteps.getTaskByProcessInstanceId(processInstanceBoundarySignal.getId())); diff --git a/runtime-acceptance-tests/src/main/java/org/activiti/cloud/qa/story/Tasks.java b/runtime-acceptance-tests/src/main/java/org/activiti/cloud/qa/story/Tasks.java index 364ec095..048f2a8a 100644 --- a/runtime-acceptance-tests/src/main/java/org/activiti/cloud/qa/story/Tasks.java +++ b/runtime-acceptance-tests/src/main/java/org/activiti/cloud/qa/story/Tasks.java @@ -18,6 +18,13 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import net.serenitybdd.core.Serenity; import net.thucydides.core.annotations.Steps; import org.activiti.api.model.shared.event.VariableEvent; @@ -42,13 +49,6 @@ import org.jbehave.core.annotations.When; import org.springframework.hateoas.PagedResources; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - public class Tasks { public static final String STAND_ALONE_TASK_ID = "standAloneTaskId"; @@ -104,7 +104,7 @@ public void createUnassignedTask() throws Exception { Serenity.setSessionVariable(STAND_ALONE_TASK_ID).to(newTask.getId()); } - @Then("the task is created and the status is assigned") + @Then("the task with a status assigned is created") public void taskIsCreatedAndAssigned() throws Exception { final CloudTask assignedTask = taskRuntimeBundleSteps.getTaskById(newTask.getId()); assertThat(assignedTask).isNotNull(); @@ -252,6 +252,8 @@ public void adminUpdateTaskFields(){ Collection tasksCollection = taskQuerySteps.getTasksByProcessInstance(processInstanceId).getContent(); List tasksList = new ArrayList<>(tasksCollection); newTask = tasksList.get(0); + + assertThat(newTask.getTaskDefinitionKey()).isEqualTo("Task_03l0zc2"); Date tomorrow = new Date(System.currentTimeMillis() + 86400000); Serenity.setSessionVariable("tomorrow").to(tomorrow); @@ -270,25 +272,23 @@ public void adminUpdateTaskFields(){ public void checkUpdatedTaskFields (){ Date tomorrow = Serenity.sessionVariableCalled("tomorrow"); - //name - assertThat(taskRuntimeBundleSteps.getTaskById(newTask.getId()).getName()) - .isEqualTo("new-task-name"); - assertThat(taskQuerySteps.getTaskById(newTask.getId()).getName()) - .isEqualTo("new-task-name"); - //priority - assertThat(taskRuntimeBundleSteps.getTaskById(newTask.getId()).getPriority()) - .isEqualTo(3); - assertThat(taskQuerySteps.getTaskById(newTask.getId()).getPriority()) - .isEqualTo(3); - //dueDate - assertThat(taskRuntimeBundleSteps.getTaskById(newTask.getId()).getDueDate()) - .isEqualTo(tomorrow); - assertThat(taskQuerySteps.getTaskById(newTask.getId()).getDueDate()) - .isEqualTo(tomorrow); - //formKey - assertThat(taskRuntimeBundleSteps.getTaskById(newTask.getId()).getFormKey()) - .isEqualTo("new-task-form-key"); - //assertThat(taskQuerySteps.getTaskById(newTask.getId()).getFormKey()).isEqualTo("new-task-form-key"); + CloudTask checkTask = taskRuntimeBundleSteps.getTaskById(newTask.getId()); + + assertThat(checkTask).isNotNull(); + assertThat(checkTask.getTaskDefinitionKey()).isEqualTo("Task_03l0zc2"); + assertThat(checkTask.getName()).isEqualTo("new-task-name"); + assertThat(checkTask.getPriority()).isEqualTo(3); + assertThat(checkTask.getDueDate()).isEqualTo(tomorrow); + assertThat(checkTask.getFormKey()).isEqualTo("new-task-form-key"); + + checkTask = taskQuerySteps.getTaskById(newTask.getId()); + + assertThat(checkTask).isNotNull(); + assertThat(checkTask.getTaskDefinitionKey()).isEqualTo("Task_03l0zc2"); + assertThat(checkTask.getName()).isEqualTo("new-task-name"); + assertThat(checkTask.getPriority()).isEqualTo(3); + assertThat(checkTask.getDueDate()).isEqualTo(tomorrow); + assertThat(checkTask.getFormKey()).isEqualTo("new-task-form-key"); } @Then("the task is updated") @@ -296,7 +296,7 @@ public void checkIfTaskUpdated (){ auditSteps.checkTaskUpdatedEvent(newTask.getId()); } - @Then("the user will see only root tasks when quering for root tasks") + @Then("the user can see only root tasks when quering for root tasks") public void checkRootTasks(){ String processInstanceId = Serenity.sessionVariableCalled("processInstanceId"); Collection rootTasksCollection = taskQuerySteps.getRootTasksByProcessInstance(processInstanceId).getContent(); @@ -309,7 +309,7 @@ public void checkRootTasks(){ ); } - @Then("the user will see only standalone tasks when quering for standalone tasks") + @Then("the user can see only standalone tasks when quering for standalone tasks") public void checkStandaloneTasks(){ Collection standaloneTasksCollection = taskQuerySteps.getStandaloneTasks().getContent(); diff --git a/runtime-acceptance-tests/src/main/resources/stories/runtime-bundle/process-instance-signal-actions.story b/runtime-acceptance-tests/src/main/resources/stories/runtime-bundle/process-instance-signal-actions.story index 67c0a0ee..b5ebdfbe 100644 --- a/runtime-acceptance-tests/src/main/resources/stories/runtime-bundle/process-instance-signal-actions.story +++ b/runtime-acceptance-tests/src/main/resources/stories/runtime-bundle/process-instance-signal-actions.story @@ -9,13 +9,13 @@ Given the user is authenticated as hruser Then check number of processes with processDefinitionKey SignalStartEventProcess When the user starts a process with intermediate catch signal And the user starts a process with a boundary signal -Then the task is created with a name Boundary container +Then the task with a name 'Boundary container' is created When the user starts a process with intermediate throw signal Then the process throwing a signal is completed And the process catching a signal is completed And check number of processes with processDefinitionKey SignalStartEventProcess increased And the SIGNAL_RECEIVED event was catched up by intermediateCatchEvent process -And the task is created with a name Boundary target +And the task with a name 'Boundary target' is created And the SIGNAL_RECEIVED event was catched up by boundary signal process When another user is authenticated as testadmin And the admin deletes boundary signal process diff --git a/runtime-acceptance-tests/src/main/resources/stories/runtime-bundle/task-actions.story b/runtime-acceptance-tests/src/main/resources/stories/runtime-bundle/task-actions.story index 311c4cc5..c841b5a6 100644 --- a/runtime-acceptance-tests/src/main/resources/stories/runtime-bundle/task-actions.story +++ b/runtime-acceptance-tests/src/main/resources/stories/runtime-bundle/task-actions.story @@ -15,7 +15,7 @@ Then the status of the process and the task is changed to completed Scenario: create a standalone task Given the user is authenticated as testuser When the user creates a standalone task -Then the task is created and the status is assigned +Then the task with a status assigned is created Scenario: delete a standalone task Given the user is authenticated as testuser @@ -124,7 +124,7 @@ And the task has the updated fields Scenario: check root tasks for the process TWO_TASK_PROCESS Given the user is authenticated as testuser When the user starts an instance of the process called TWO_TASK_PROCESS -Then the user will see only root tasks when quering for root tasks +Then the user can see only root tasks when quering for root tasks Scenario: check the task has completion fields Given the user is authenticated as testuser @@ -137,7 +137,7 @@ Given the user is authenticated as testuser When the user starts an instance of the process called PROCESS_INSTANCE_WITH_VARIABLES And the user claims the task And the user creates a standalone task -Then the user will see only standalone tasks when quering for standalone tasks +Then the user can see only standalone tasks when quering for standalone tasks Scenario: admin completes tasks in a running process Given the user is authenticated as testadmin