elsa-core/test/integration/Elsa.Workflows.IntegrationTests/Scenarios
Sipke Schoorstra 66543a48b0
Add integration tests for WorkflowDefinitionActivity scenarios (#6999)
* Add unit tests for `FlowFork` activity and enhance test utilities

- Introduce `FlowForkTests` to validate activity behavior with various branch configurations.
- Extend `ActivityExecutionContextExtensions` with methods to retrieve and check outcomes.
- Modify `ActivityTestFixture` to ensure activities transition to `Running` status before execution.

* Add unit tests for `FlowSwitch` activity and extend test utilities

- Implement `FlowSwitchTests` to verify behavior based on switch cases, modes, and literal expressions.
- Enhance `ActivityExecutionContextExtensions` with methods to retrieve and check outcomes in execution context.

* Update test guidelines to include examples for checking activity outcomes

- Add unit test examples for validating multiple and default outcomes.
- Extend documentation to describe new `ActivityExecutionContextExtensions` methods: `GetOutcomes` and `HasOutcome`.

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Simplify `GetOutcomes` method in `ActivityExecutionContextExtensions`.

* Add unit tests for `FlowSendHttpRequest` activity and refactor helper utilities

- Introduce `FlowSendHttpRequestTests` to validate activity behavior across various scenarios.
- Add utility methods in `SendHttpRequestTestHelpers` for creating mock responses and exceptions.
- Refactor `Helpers` namespace to `Http.Helpers` for better organization.
- Update project file to reflect namespace adjustments.

* Update test/unit/Elsa.Activities.UnitTests/Elsa.Activities.UnitTests.csproj

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add integration tests for WorkflowDefinitionActivity scenarios

- Introduce integration tests covering inputs, outputs, version fallback, and outcome handling.
- Add JSON workflow definitions to validate parent-child workflow execution.
- Update project files to include new test scenarios.
- Enhance error handling in `RunWorkflowExtensions` for missing workflow definitions.
- Adjust JavaScript expression handler to support PascalCase activity names.

* Refactor WorkflowDefinitionActivity tests to use Theory with dynamic test cases

- Consolidate multiple Fact-based tests into a single parameterized Theory.
- Introduce `WorkflowDefinitionActivityTestCases` for reusable test scenarios.
- Simplify assertions and improve test structure for better maintainability.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-21 15:37:10 +02:00
..
ActivityNotificationsMiddleware Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
ActivityOutputs Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00
Blocking Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
BlockingAndBreaking Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00
CanExecute Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
Composites Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
CompositesAndOutcomes Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
CompositesPassingData Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
DependencyWorkflows Add integration tests for WorkflowDefinitionActivity scenarios (#6999) 2025-10-21 15:37:10 +02:00
DependencyWorkflowsPublishing Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
ExplicitJoins Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
FlowchartCompletion Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
FlowchartNextActivity Refactor FlowchartNextActivity tests: reduce unused cases, update switch behaviors, and improve consistency. 2025-10-05 10:51:29 +02:00
HttpRequestWithLiquid Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
ImportAndExecute Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
ImportAndPublish Create trigger payload validation, refacto HttpEndpoint validator and create Cron validator (#6641) 2025-05-20 19:52:43 +02:00
Incidents Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
JavaScriptFunctions Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
JavaScriptListsAndArrays Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
JavaScriptNativeVariables Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
JoinBehaviors Add integration test for implicit join behavior with merge mode set to None 2025-10-08 21:10:35 +02:00
JsonObjectSerialization Update namespaces and correct merge artefacts 2024-10-11 20:41:49 +02:00
JsonObjectToObjectRemainsJsonObject Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
ParentChildCompletion Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
ParentChildInputs Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
ParentChildOutputMapping Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
RunAsynchronousActivityOutput Small refactor for DRY principle + Fixing integration tests 2025-08-06 11:31:36 +02:00
Serialization Add integration test for workflow serialization 2024-12-26 11:17:54 +01:00
SetGetVariables Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00
SetGetVariablesFromActivities Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00
WorkflowCancellation Improved support for named workflow instances 2025-03-02 11:17:18 +01:00
WorkflowDefinitionActivities Add integration tests for WorkflowDefinitionActivity scenarios (#6999) 2025-10-21 15:37:10 +02:00
WorkflowDefinitionStorePopulation Addresses workflow identity reload conflict (#6909) 2025-09-15 11:56:01 +02:00
WorkflowInstanceName Improved support for named workflow instances 2025-03-02 11:17:18 +01:00
WorkflowOutputMapping Refactor Workflow Runtimes (#5444) 2024-06-10 19:36:51 +02:00
WorkflowResults Refactor variable initialization for clarity and consistency 2025-03-13 21:05:28 +01:00