You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/configuration/pages/tests-configuration.adoc
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,6 +163,47 @@ e.g., `0`, `#`, specify the way indices are displayed.
163
163
|Paths to the composite steps e.g. `steps/*.steps`
164
164
|===
165
165
166
+
==== Parallel Story Execution
167
+
168
+
Stories within a batch are executed in parallel using the number of threads specified by the `batch-<batch-number>.threads` property. By default, stories run sequentially (1 thread). Increasing the thread count can significantly reduce test execution time.
169
+
170
+
.suite.properties: Running stories in 2 batches with different parallelism levels
171
+
[source,properties]
172
+
----
173
+
batch-1.resource-location=story/api
174
+
batch-1.threads=5
175
+
batch-1.name=API Tests
176
+
177
+
batch-2.resource-location=story/ui
178
+
batch-2.threads=2
179
+
batch-2.name=UI Tests
180
+
----
181
+
182
+
In this example:
183
+
184
+
* `batch-1` runs API test stories from the `story/api` folder using `5` parallel threads. Since API tests are generally stateless, a higher level of parallelism can be used.
185
+
* `batch-2` runs UI test stories from the `story/ui` folder using `2` parallel threads. UI tests may require more resources per thread, so a lower parallelism level is configured.
186
+
* `batch-1` runs first, and only after it completes, `batch-2` starts (batches always run sequentially).
187
+
188
+
[IMPORTANT]
189
+
====
190
+
When running stories in parallel, make sure:
191
+
192
+
* Stories do not depend on each other's state or execution order.
193
+
* Shared resources (e.g. database records, user sessions) are properly isolated across threads.
194
+
* The `story` xref:commons:variables.adoc[variable scope] is thread-safe, but the `next_batches` and `global` scopes are shared.
195
+
====
196
+
197
+
.suite.properties: Running all stories from a single folder with 3 threads
198
+
[source,properties]
199
+
----
200
+
batch-1.resource-location=story/regression
201
+
batch-1.threads=3
202
+
batch-1.story.execution-timeout=PT30M
203
+
----
204
+
205
+
The `story.execution-timeout` property limits how long each individual story can run. This is useful in parallel execution to prevent a single slow story from blocking a thread indefinitely.
206
+
166
207
=== Profiles
167
208
168
209
A profile defines the subject of the test, i.e. it answers the question "What are specifics of the browser/device I want to run tests on?".
0 commit comments