@serenity-js/core 3.0.0-rc.9 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1041) hide show
  1. package/CHANGELOG.md +208 -2139
  2. package/README.md +8 -10
  3. package/lib/Serenity.d.ts +145 -80
  4. package/lib/Serenity.d.ts.map +1 -0
  5. package/lib/Serenity.js +159 -86
  6. package/lib/Serenity.js.map +1 -1
  7. package/lib/adapter/OutputStream.d.ts +14 -0
  8. package/lib/adapter/OutputStream.d.ts.map +1 -0
  9. package/lib/{io → adapter}/OutputStream.js.map +1 -1
  10. package/lib/adapter/TestRunnerAdapter.d.ts +33 -0
  11. package/lib/adapter/TestRunnerAdapter.d.ts.map +1 -0
  12. package/lib/adapter/TestRunnerAdapter.js.map +1 -0
  13. package/lib/adapter/index.d.ts +3 -0
  14. package/lib/adapter/index.d.ts.map +1 -0
  15. package/lib/adapter/index.js +19 -0
  16. package/lib/adapter/index.js.map +1 -0
  17. package/lib/config/ClassDescription.d.ts +60 -0
  18. package/lib/config/ClassDescription.d.ts.map +1 -0
  19. package/lib/config/ClassDescription.js +3 -0
  20. package/lib/config/ClassDescription.js.map +1 -0
  21. package/lib/config/SerenityConfig.d.ts +73 -0
  22. package/lib/config/SerenityConfig.d.ts.map +1 -0
  23. package/lib/config/SerenityConfig.js +20 -0
  24. package/lib/config/SerenityConfig.js.map +1 -0
  25. package/lib/config/index.d.ts +3 -0
  26. package/lib/config/index.d.ts.map +1 -0
  27. package/lib/config/index.js +19 -0
  28. package/lib/config/index.js.map +1 -0
  29. package/lib/errors/ErrorFactory.d.ts +16 -0
  30. package/lib/errors/ErrorFactory.d.ts.map +1 -0
  31. package/lib/errors/ErrorFactory.js +241 -0
  32. package/lib/errors/ErrorFactory.js.map +1 -0
  33. package/lib/errors/ErrorOptions.d.ts +16 -0
  34. package/lib/errors/ErrorOptions.d.ts.map +1 -0
  35. package/lib/errors/ErrorOptions.js +3 -0
  36. package/lib/errors/ErrorOptions.js.map +1 -0
  37. package/lib/errors/ErrorSerialiser.d.ts +14 -0
  38. package/lib/errors/ErrorSerialiser.d.ts.map +1 -0
  39. package/lib/{io → errors}/ErrorSerialiser.js +33 -7
  40. package/lib/errors/ErrorSerialiser.js.map +1 -0
  41. package/lib/errors/ErrorStackParser.d.ts +13 -0
  42. package/lib/errors/ErrorStackParser.d.ts.map +1 -0
  43. package/lib/errors/ErrorStackParser.js +42 -0
  44. package/lib/errors/ErrorStackParser.js.map +1 -0
  45. package/lib/errors/RaiseErrors.d.ts +57 -0
  46. package/lib/errors/RaiseErrors.d.ts.map +1 -0
  47. package/lib/errors/RaiseErrors.js +62 -0
  48. package/lib/errors/RaiseErrors.js.map +1 -0
  49. package/lib/errors/diff/AnsiDiffFormatter.d.ts +28 -0
  50. package/lib/errors/diff/AnsiDiffFormatter.d.ts.map +1 -0
  51. package/lib/errors/diff/AnsiDiffFormatter.js +38 -0
  52. package/lib/errors/diff/AnsiDiffFormatter.js.map +1 -0
  53. package/lib/errors/diff/DiffFormatter.d.ts +13 -0
  54. package/lib/errors/diff/DiffFormatter.d.ts.map +1 -0
  55. package/lib/errors/diff/DiffFormatter.js +3 -0
  56. package/lib/errors/diff/DiffFormatter.js.map +1 -0
  57. package/lib/errors/diff/NoOpDiffFormatter.d.ts +12 -0
  58. package/lib/errors/diff/NoOpDiffFormatter.d.ts.map +1 -0
  59. package/lib/errors/diff/NoOpDiffFormatter.js +21 -0
  60. package/lib/errors/diff/NoOpDiffFormatter.js.map +1 -0
  61. package/lib/errors/diff/index.d.ts +4 -0
  62. package/lib/errors/diff/index.d.ts.map +1 -0
  63. package/lib/errors/diff/index.js +20 -0
  64. package/lib/errors/diff/index.js.map +1 -0
  65. package/lib/errors/index.d.ts +8 -7
  66. package/lib/errors/index.d.ts.map +1 -0
  67. package/lib/errors/index.js +23 -8
  68. package/lib/errors/index.js.map +1 -1
  69. package/lib/errors/model/AssertionError.d.ts +16 -0
  70. package/lib/errors/model/AssertionError.d.ts.map +1 -0
  71. package/lib/errors/model/AssertionError.js +26 -0
  72. package/lib/errors/model/AssertionError.js.map +1 -0
  73. package/lib/errors/model/ConfigurationError.d.ts +16 -0
  74. package/lib/errors/model/ConfigurationError.d.ts.map +1 -0
  75. package/lib/errors/model/ConfigurationError.js +26 -0
  76. package/lib/errors/model/ConfigurationError.js.map +1 -0
  77. package/lib/errors/model/ImplementationPendingError.d.ts +37 -0
  78. package/lib/errors/model/ImplementationPendingError.d.ts.map +1 -0
  79. package/lib/errors/model/ImplementationPendingError.js +47 -0
  80. package/lib/errors/model/ImplementationPendingError.js.map +1 -0
  81. package/lib/errors/model/ListItemNotFoundError.d.ts +20 -0
  82. package/lib/errors/model/ListItemNotFoundError.d.ts.map +1 -0
  83. package/lib/errors/model/ListItemNotFoundError.js +30 -0
  84. package/lib/errors/model/ListItemNotFoundError.js.map +1 -0
  85. package/lib/errors/model/LogicError.d.ts +20 -0
  86. package/lib/errors/model/LogicError.d.ts.map +1 -0
  87. package/lib/errors/model/LogicError.js +30 -0
  88. package/lib/errors/model/LogicError.js.map +1 -0
  89. package/lib/errors/model/OperationInterruptedError.d.ts +20 -0
  90. package/lib/errors/model/OperationInterruptedError.d.ts.map +1 -0
  91. package/lib/errors/model/OperationInterruptedError.js +30 -0
  92. package/lib/errors/model/OperationInterruptedError.js.map +1 -0
  93. package/lib/errors/model/RuntimeError.d.ts +80 -0
  94. package/lib/errors/model/RuntimeError.d.ts.map +1 -0
  95. package/lib/errors/model/RuntimeError.js +97 -0
  96. package/lib/errors/model/RuntimeError.js.map +1 -0
  97. package/lib/errors/model/TestCompromisedError.d.ts +31 -0
  98. package/lib/errors/model/TestCompromisedError.d.ts.map +1 -0
  99. package/lib/errors/model/TestCompromisedError.js +41 -0
  100. package/lib/errors/model/TestCompromisedError.js.map +1 -0
  101. package/lib/errors/model/TimeoutExpiredError.d.ts +20 -0
  102. package/lib/errors/model/TimeoutExpiredError.d.ts.map +1 -0
  103. package/lib/errors/model/TimeoutExpiredError.js +30 -0
  104. package/lib/errors/model/TimeoutExpiredError.js.map +1 -0
  105. package/lib/errors/model/UnknownError.d.ts +16 -0
  106. package/lib/errors/model/UnknownError.d.ts.map +1 -0
  107. package/lib/errors/model/UnknownError.js +26 -0
  108. package/lib/errors/model/UnknownError.js.map +1 -0
  109. package/lib/errors/model/index.d.ts +11 -0
  110. package/lib/errors/model/index.d.ts.map +1 -0
  111. package/lib/errors/model/index.js +27 -0
  112. package/lib/errors/model/index.js.map +1 -0
  113. package/lib/events/ActivityFinished.d.ts +5 -5
  114. package/lib/events/ActivityFinished.d.ts.map +1 -0
  115. package/lib/events/ActivityFinished.js +2 -4
  116. package/lib/events/ActivityFinished.js.map +1 -1
  117. package/lib/events/ActivityRelatedArtifactArchived.d.ts +6 -1
  118. package/lib/events/ActivityRelatedArtifactArchived.d.ts.map +1 -0
  119. package/lib/events/ActivityRelatedArtifactArchived.js +7 -3
  120. package/lib/events/ActivityRelatedArtifactArchived.js.map +1 -1
  121. package/lib/events/ActivityRelatedArtifactGenerated.d.ts +6 -1
  122. package/lib/events/ActivityRelatedArtifactGenerated.d.ts.map +1 -0
  123. package/lib/events/ActivityRelatedArtifactGenerated.js +7 -3
  124. package/lib/events/ActivityRelatedArtifactGenerated.js.map +1 -1
  125. package/lib/events/ActivityStarts.d.ts +5 -5
  126. package/lib/events/ActivityStarts.d.ts.map +1 -0
  127. package/lib/events/ActivityStarts.js +2 -4
  128. package/lib/events/ActivityStarts.js.map +1 -1
  129. package/lib/events/ArtifactArchived.d.ts +6 -1
  130. package/lib/events/ArtifactArchived.d.ts.map +1 -0
  131. package/lib/events/ArtifactArchived.js +7 -3
  132. package/lib/events/ArtifactArchived.js.map +1 -1
  133. package/lib/events/ArtifactGenerated.d.ts +6 -1
  134. package/lib/events/ArtifactGenerated.d.ts.map +1 -0
  135. package/lib/events/ArtifactGenerated.js +7 -3
  136. package/lib/events/ArtifactGenerated.js.map +1 -1
  137. package/lib/events/AsyncOperationAborted.d.ts +14 -0
  138. package/lib/events/AsyncOperationAborted.d.ts.map +1 -0
  139. package/lib/events/AsyncOperationAborted.js +24 -0
  140. package/lib/events/AsyncOperationAborted.js.map +1 -0
  141. package/lib/events/AsyncOperationAttempted.d.ts +9 -3
  142. package/lib/events/AsyncOperationAttempted.d.ts.map +1 -0
  143. package/lib/events/AsyncOperationAttempted.js +12 -6
  144. package/lib/events/AsyncOperationAttempted.js.map +1 -1
  145. package/lib/events/AsyncOperationCompleted.d.ts +7 -3
  146. package/lib/events/AsyncOperationCompleted.d.ts.map +1 -0
  147. package/lib/events/AsyncOperationCompleted.js +8 -6
  148. package/lib/events/AsyncOperationCompleted.js.map +1 -1
  149. package/lib/events/AsyncOperationFailed.d.ts +6 -1
  150. package/lib/events/AsyncOperationFailed.d.ts.map +1 -0
  151. package/lib/events/AsyncOperationFailed.js +9 -5
  152. package/lib/events/AsyncOperationFailed.js.map +1 -1
  153. package/lib/events/BusinessRuleDetected.d.ts +6 -5
  154. package/lib/events/BusinessRuleDetected.d.ts.map +1 -0
  155. package/lib/events/BusinessRuleDetected.js +7 -7
  156. package/lib/events/BusinessRuleDetected.js.map +1 -1
  157. package/lib/events/DomainEvent.d.ts +5 -7
  158. package/lib/events/DomainEvent.d.ts.map +1 -0
  159. package/lib/events/DomainEvent.js +5 -8
  160. package/lib/events/DomainEvent.js.map +1 -1
  161. package/lib/events/FeatureNarrativeDetected.d.ts +6 -1
  162. package/lib/events/FeatureNarrativeDetected.d.ts.map +1 -0
  163. package/lib/events/FeatureNarrativeDetected.js +7 -3
  164. package/lib/events/FeatureNarrativeDetected.js.map +1 -1
  165. package/lib/events/InteractionFinished.d.ts +4 -0
  166. package/lib/events/InteractionFinished.d.ts.map +1 -0
  167. package/lib/events/InteractionFinished.js +5 -1
  168. package/lib/events/InteractionFinished.js.map +1 -1
  169. package/lib/events/InteractionStarts.d.ts +4 -0
  170. package/lib/events/InteractionStarts.d.ts.map +1 -0
  171. package/lib/events/InteractionStarts.js +5 -1
  172. package/lib/events/InteractionStarts.js.map +1 -1
  173. package/lib/events/RetryableSceneDetected.d.ts +9 -10
  174. package/lib/events/RetryableSceneDetected.d.ts.map +1 -0
  175. package/lib/events/RetryableSceneDetected.js +13 -15
  176. package/lib/events/RetryableSceneDetected.js.map +1 -1
  177. package/lib/events/SceneBackgroundDetected.d.ts +6 -1
  178. package/lib/events/SceneBackgroundDetected.d.ts.map +1 -0
  179. package/lib/events/SceneBackgroundDetected.js +8 -5
  180. package/lib/events/SceneBackgroundDetected.js.map +1 -1
  181. package/lib/events/SceneDescriptionDetected.d.ts +6 -1
  182. package/lib/events/SceneDescriptionDetected.d.ts.map +1 -0
  183. package/lib/events/SceneDescriptionDetected.js +7 -3
  184. package/lib/events/SceneDescriptionDetected.js.map +1 -1
  185. package/lib/events/SceneFinished.d.ts +6 -1
  186. package/lib/events/SceneFinished.d.ts.map +1 -0
  187. package/lib/events/SceneFinished.js +7 -3
  188. package/lib/events/SceneFinished.js.map +1 -1
  189. package/lib/events/SceneFinishes.d.ts +10 -4
  190. package/lib/events/SceneFinishes.d.ts.map +1 -0
  191. package/lib/events/SceneFinishes.js +11 -8
  192. package/lib/events/SceneFinishes.js.map +1 -1
  193. package/lib/events/SceneParametersDetected.d.ts +6 -1
  194. package/lib/events/SceneParametersDetected.d.ts.map +1 -0
  195. package/lib/events/SceneParametersDetected.js +7 -3
  196. package/lib/events/SceneParametersDetected.js.map +1 -1
  197. package/lib/events/SceneSequenceDetected.d.ts +6 -1
  198. package/lib/events/SceneSequenceDetected.d.ts.map +1 -0
  199. package/lib/events/SceneSequenceDetected.js +7 -3
  200. package/lib/events/SceneSequenceDetected.js.map +1 -1
  201. package/lib/events/SceneStarts.d.ts +6 -1
  202. package/lib/events/SceneStarts.d.ts.map +1 -0
  203. package/lib/events/SceneStarts.js +7 -3
  204. package/lib/events/SceneStarts.js.map +1 -1
  205. package/lib/events/SceneTagged.d.ts +6 -1
  206. package/lib/events/SceneTagged.d.ts.map +1 -0
  207. package/lib/events/SceneTagged.js +7 -3
  208. package/lib/events/SceneTagged.js.map +1 -1
  209. package/lib/events/SceneTemplateDetected.d.ts +6 -1
  210. package/lib/events/SceneTemplateDetected.d.ts.map +1 -0
  211. package/lib/events/SceneTemplateDetected.js +7 -3
  212. package/lib/events/SceneTemplateDetected.js.map +1 -1
  213. package/lib/events/TaskFinished.d.ts +4 -0
  214. package/lib/events/TaskFinished.d.ts.map +1 -0
  215. package/lib/events/TaskFinished.js +5 -1
  216. package/lib/events/TaskFinished.js.map +1 -1
  217. package/lib/events/TaskStarts.d.ts +4 -0
  218. package/lib/events/TaskStarts.d.ts.map +1 -0
  219. package/lib/events/TaskStarts.js +5 -1
  220. package/lib/events/TaskStarts.js.map +1 -1
  221. package/lib/events/TestRunFinished.d.ts +10 -5
  222. package/lib/events/TestRunFinished.d.ts.map +1 -0
  223. package/lib/events/TestRunFinished.js +8 -5
  224. package/lib/events/TestRunFinished.js.map +1 -1
  225. package/lib/events/TestRunFinishes.d.ts +6 -4
  226. package/lib/events/TestRunFinishes.d.ts.map +1 -0
  227. package/lib/events/TestRunFinishes.js +6 -5
  228. package/lib/events/TestRunFinishes.js.map +1 -1
  229. package/lib/events/TestRunStarts.d.ts +4 -4
  230. package/lib/events/TestRunStarts.d.ts.map +1 -0
  231. package/lib/events/TestRunStarts.js +4 -5
  232. package/lib/events/TestRunStarts.js.map +1 -1
  233. package/lib/events/TestRunnerDetected.d.ts +6 -2
  234. package/lib/events/TestRunnerDetected.d.ts.map +1 -0
  235. package/lib/events/TestRunnerDetected.js +9 -7
  236. package/lib/events/TestRunnerDetected.js.map +1 -1
  237. package/lib/events/TestSuiteFinished.d.ts +6 -1
  238. package/lib/events/TestSuiteFinished.d.ts.map +1 -0
  239. package/lib/events/TestSuiteFinished.js +7 -3
  240. package/lib/events/TestSuiteFinished.js.map +1 -1
  241. package/lib/events/TestSuiteStarts.d.ts +6 -1
  242. package/lib/events/TestSuiteStarts.d.ts.map +1 -0
  243. package/lib/events/TestSuiteStarts.js +7 -3
  244. package/lib/events/TestSuiteStarts.js.map +1 -1
  245. package/lib/events/index.d.ts +2 -0
  246. package/lib/events/index.d.ts.map +1 -0
  247. package/lib/events/index.js +6 -1
  248. package/lib/events/index.js.map +1 -1
  249. package/lib/index.d.ts +2 -2
  250. package/lib/index.d.ts.map +1 -0
  251. package/lib/index.js +7 -7
  252. package/lib/index.js.map +1 -1
  253. package/lib/instance.d.ts +180 -90
  254. package/lib/instance.d.ts.map +1 -0
  255. package/lib/instance.js +179 -90
  256. package/lib/instance.js.map +1 -1
  257. package/lib/io/Config.d.ts +2 -1
  258. package/lib/io/Config.d.ts.map +1 -0
  259. package/lib/io/FileFinder.d.ts +1 -0
  260. package/lib/io/FileFinder.d.ts.map +1 -0
  261. package/lib/io/FileFinder.js +5 -2
  262. package/lib/io/FileFinder.js.map +1 -1
  263. package/lib/io/FileSystem.d.ts +3 -0
  264. package/lib/io/FileSystem.d.ts.map +1 -0
  265. package/lib/io/FileSystem.js +30 -4
  266. package/lib/io/FileSystem.js.map +1 -1
  267. package/lib/io/FileSystemLocation.d.ts +1 -0
  268. package/lib/io/FileSystemLocation.d.ts.map +1 -0
  269. package/lib/io/FileSystemLocation.js +3 -3
  270. package/lib/io/FileSystemLocation.js.map +1 -1
  271. package/lib/io/Path.d.ts +2 -0
  272. package/lib/io/Path.d.ts.map +1 -0
  273. package/lib/io/Path.js +22 -16
  274. package/lib/io/Path.js.map +1 -1
  275. package/lib/io/asyncMap.d.ts +4 -4
  276. package/lib/io/asyncMap.d.ts.map +1 -0
  277. package/lib/io/asyncMap.js +5 -5
  278. package/lib/io/asyncMap.js.map +1 -1
  279. package/lib/io/commaSeparated.d.ts +6 -6
  280. package/lib/io/commaSeparated.d.ts.map +1 -0
  281. package/lib/io/commaSeparated.js +8 -9
  282. package/lib/io/commaSeparated.js.map +1 -1
  283. package/lib/io/format.d.ts +46 -19
  284. package/lib/io/format.d.ts.map +1 -0
  285. package/lib/io/format.js +48 -22
  286. package/lib/io/format.js.map +1 -1
  287. package/lib/io/index.d.ts +4 -9
  288. package/lib/io/index.d.ts.map +1 -0
  289. package/lib/io/index.js +8 -10
  290. package/lib/io/index.js.map +1 -1
  291. package/lib/io/inspected.d.ts +4 -19
  292. package/lib/io/inspected.d.ts.map +1 -0
  293. package/lib/io/inspected.js +11 -222
  294. package/lib/io/inspected.js.map +1 -1
  295. package/lib/io/inspectedObject.d.ts +4 -0
  296. package/lib/io/inspectedObject.d.ts.map +1 -0
  297. package/lib/io/inspectedObject.js +55 -0
  298. package/lib/io/inspectedObject.js.map +1 -0
  299. package/lib/io/loader/ClassDescriptionParser.d.ts +8 -0
  300. package/lib/io/loader/ClassDescriptionParser.d.ts.map +1 -0
  301. package/lib/io/loader/ClassDescriptionParser.js +52 -0
  302. package/lib/io/loader/ClassDescriptionParser.js.map +1 -0
  303. package/lib/io/loader/ClassDescriptor.d.ts +7 -0
  304. package/lib/io/loader/ClassDescriptor.d.ts.map +1 -0
  305. package/lib/io/loader/ClassDescriptor.js +3 -0
  306. package/lib/io/loader/ClassDescriptor.js.map +1 -0
  307. package/lib/io/loader/ClassLoader.d.ts +11 -0
  308. package/lib/io/loader/ClassLoader.d.ts.map +1 -0
  309. package/lib/io/loader/ClassLoader.js +34 -0
  310. package/lib/io/loader/ClassLoader.js.map +1 -0
  311. package/lib/io/{ModuleLoader.d.ts → loader/ModuleLoader.d.ts} +11 -18
  312. package/lib/io/loader/ModuleLoader.d.ts.map +1 -0
  313. package/lib/io/loader/ModuleLoader.js +96 -0
  314. package/lib/io/loader/ModuleLoader.js.map +1 -0
  315. package/lib/io/{Version.d.ts → loader/Version.d.ts} +2 -4
  316. package/lib/io/loader/Version.d.ts.map +1 -0
  317. package/lib/io/{Version.js → loader/Version.js} +14 -14
  318. package/lib/io/loader/Version.js.map +1 -0
  319. package/lib/io/loader/index.d.ts +6 -0
  320. package/lib/io/loader/index.d.ts.map +1 -0
  321. package/lib/io/loader/index.js +22 -0
  322. package/lib/io/loader/index.js.map +1 -0
  323. package/lib/io/proxies.d.ts +1 -0
  324. package/lib/io/proxies.d.ts.map +1 -0
  325. package/lib/io/reflection/has.d.ts +4 -5
  326. package/lib/io/reflection/has.d.ts.map +1 -0
  327. package/lib/io/reflection/has.js +3 -5
  328. package/lib/io/reflection/has.js.map +1 -1
  329. package/lib/io/reflection/index.d.ts +3 -0
  330. package/lib/io/reflection/index.d.ts.map +1 -0
  331. package/lib/io/reflection/index.js +7 -1
  332. package/lib/io/reflection/index.js.map +1 -1
  333. package/lib/io/reflection/isPrimitive.d.ts +8 -0
  334. package/lib/io/reflection/isPrimitive.d.ts.map +1 -0
  335. package/lib/io/reflection/isPrimitive.js +24 -0
  336. package/lib/io/reflection/isPrimitive.js.map +1 -0
  337. package/lib/io/reflection/typeOf.d.ts +7 -0
  338. package/lib/io/reflection/typeOf.d.ts.map +1 -0
  339. package/lib/io/reflection/typeOf.js +35 -0
  340. package/lib/io/reflection/typeOf.js.map +1 -0
  341. package/lib/io/stringified.d.ts +24 -0
  342. package/lib/io/stringified.d.ts.map +1 -0
  343. package/lib/io/stringified.js +220 -0
  344. package/lib/io/stringified.js.map +1 -0
  345. package/lib/io/trimmed.d.ts +6 -7
  346. package/lib/io/trimmed.d.ts.map +1 -0
  347. package/lib/io/trimmed.js +6 -8
  348. package/lib/io/trimmed.js.map +1 -1
  349. package/lib/model/ActivityDetails.d.ts +9 -1
  350. package/lib/model/ActivityDetails.d.ts.map +1 -0
  351. package/lib/model/ActivityDetails.js +9 -4
  352. package/lib/model/ActivityDetails.js.map +1 -1
  353. package/lib/model/Artifact.d.ts +2 -1
  354. package/lib/model/Artifact.d.ts.map +1 -0
  355. package/lib/model/Artifact.js +29 -6
  356. package/lib/model/Artifact.js.map +1 -1
  357. package/lib/model/BusinessRule.d.ts +1 -0
  358. package/lib/model/BusinessRule.d.ts.map +1 -0
  359. package/lib/model/BusinessRule.js +3 -3
  360. package/lib/model/BusinessRule.js.map +1 -1
  361. package/lib/model/Category.d.ts +1 -0
  362. package/lib/model/Category.d.ts.map +1 -0
  363. package/lib/model/Category.js +3 -3
  364. package/lib/model/Category.js.map +1 -1
  365. package/lib/model/CorrelationId.d.ts +1 -0
  366. package/lib/model/CorrelationId.d.ts.map +1 -0
  367. package/lib/model/CorrelationId.js +5 -2
  368. package/lib/model/CorrelationId.js.map +1 -1
  369. package/lib/model/Description.d.ts +1 -0
  370. package/lib/model/Description.d.ts.map +1 -0
  371. package/lib/model/Description.js +3 -3
  372. package/lib/model/Description.js.map +1 -1
  373. package/lib/model/Name.d.ts +1 -0
  374. package/lib/model/Name.d.ts.map +1 -0
  375. package/lib/model/Name.js +3 -3
  376. package/lib/model/Name.js.map +1 -1
  377. package/lib/model/ScenarioDetails.d.ts +1 -0
  378. package/lib/model/ScenarioDetails.d.ts.map +1 -0
  379. package/lib/model/ScenarioDetails.js +6 -3
  380. package/lib/model/ScenarioDetails.js.map +1 -1
  381. package/lib/model/ScenarioParameters.d.ts +1 -0
  382. package/lib/model/ScenarioParameters.d.ts.map +1 -0
  383. package/lib/model/ScenarioParameters.js +3 -3
  384. package/lib/model/ScenarioParameters.js.map +1 -1
  385. package/lib/model/TestSuiteDetails.d.ts +1 -0
  386. package/lib/model/TestSuiteDetails.d.ts.map +1 -0
  387. package/lib/model/TestSuiteDetails.js +3 -3
  388. package/lib/model/TestSuiteDetails.js.map +1 -1
  389. package/lib/model/artifacts/HTTPRequestResponse.d.ts +6 -13
  390. package/lib/model/artifacts/HTTPRequestResponse.d.ts.map +1 -0
  391. package/lib/model/artifacts/HTTPRequestResponse.js +1 -4
  392. package/lib/model/artifacts/HTTPRequestResponse.js.map +1 -1
  393. package/lib/model/artifacts/JSONData.d.ts +1 -0
  394. package/lib/model/artifacts/JSONData.d.ts.map +1 -0
  395. package/lib/model/artifacts/LogEntry.d.ts +1 -0
  396. package/lib/model/artifacts/LogEntry.d.ts.map +1 -0
  397. package/lib/model/artifacts/Photo.d.ts +1 -8
  398. package/lib/model/artifacts/Photo.d.ts.map +1 -0
  399. package/lib/model/artifacts/Photo.js +0 -8
  400. package/lib/model/artifacts/Photo.js.map +1 -1
  401. package/lib/model/artifacts/TestReport.d.ts +1 -0
  402. package/lib/model/artifacts/TestReport.d.ts.map +1 -0
  403. package/lib/model/artifacts/TextData.d.ts +1 -0
  404. package/lib/model/artifacts/TextData.d.ts.map +1 -0
  405. package/lib/model/artifacts/index.d.ts +1 -1
  406. package/lib/model/artifacts/index.d.ts.map +1 -0
  407. package/lib/model/artifacts/index.js +5 -2
  408. package/lib/model/artifacts/index.js.map +1 -1
  409. package/lib/model/index.d.ts +1 -2
  410. package/lib/model/index.d.ts.map +1 -0
  411. package/lib/model/index.js +5 -3
  412. package/lib/model/index.js.map +1 -1
  413. package/lib/model/outcomes.d.ts +1 -0
  414. package/lib/model/outcomes.d.ts.map +1 -0
  415. package/lib/model/outcomes.js +7 -7
  416. package/lib/model/outcomes.js.map +1 -1
  417. package/lib/model/tags/ArbitraryTag.d.ts +3 -5
  418. package/lib/model/tags/ArbitraryTag.d.ts.map +1 -0
  419. package/lib/model/tags/ArbitraryTag.js +2 -5
  420. package/lib/model/tags/ArbitraryTag.js.map +1 -1
  421. package/lib/model/tags/BrowserTag.d.ts +1 -0
  422. package/lib/model/tags/BrowserTag.d.ts.map +1 -0
  423. package/lib/model/tags/BrowserTag.js +3 -3
  424. package/lib/model/tags/BrowserTag.js.map +1 -1
  425. package/lib/model/tags/CapabilityTag.d.ts +1 -0
  426. package/lib/model/tags/CapabilityTag.d.ts.map +1 -0
  427. package/lib/model/tags/ExecutionRetriedTag.d.ts +3 -5
  428. package/lib/model/tags/ExecutionRetriedTag.d.ts.map +1 -0
  429. package/lib/model/tags/ExecutionRetriedTag.js +5 -8
  430. package/lib/model/tags/ExecutionRetriedTag.js.map +1 -1
  431. package/lib/model/tags/FeatureTag.d.ts +1 -0
  432. package/lib/model/tags/FeatureTag.d.ts.map +1 -0
  433. package/lib/model/tags/IssueTag.d.ts +1 -0
  434. package/lib/model/tags/IssueTag.d.ts.map +1 -0
  435. package/lib/model/tags/ManualTag.d.ts +1 -0
  436. package/lib/model/tags/ManualTag.d.ts.map +1 -0
  437. package/lib/model/tags/PlatformTag.d.ts +1 -0
  438. package/lib/model/tags/PlatformTag.d.ts.map +1 -0
  439. package/lib/model/tags/PlatformTag.js +3 -3
  440. package/lib/model/tags/PlatformTag.js.map +1 -1
  441. package/lib/model/tags/Tag.d.ts +1 -0
  442. package/lib/model/tags/Tag.d.ts.map +1 -0
  443. package/lib/model/tags/Tag.js +31 -8
  444. package/lib/model/tags/Tag.js.map +1 -1
  445. package/lib/model/tags/Tags.d.ts +1 -0
  446. package/lib/model/tags/Tags.d.ts.map +1 -0
  447. package/lib/model/tags/ThemeTag.d.ts +1 -0
  448. package/lib/model/tags/ThemeTag.d.ts.map +1 -0
  449. package/lib/model/tags/index.d.ts +1 -1
  450. package/lib/model/tags/index.d.ts.map +1 -0
  451. package/lib/model/tags/index.js +5 -2
  452. package/lib/model/tags/index.js.map +1 -1
  453. package/lib/screenplay/Activity.d.ts +35 -19
  454. package/lib/screenplay/Activity.d.ts.map +1 -0
  455. package/lib/screenplay/Activity.js +74 -0
  456. package/lib/screenplay/Activity.js.map +1 -1
  457. package/lib/screenplay/Actor.d.ts +146 -0
  458. package/lib/screenplay/Actor.d.ts.map +1 -0
  459. package/lib/screenplay/Actor.js +283 -0
  460. package/lib/screenplay/Actor.js.map +1 -0
  461. package/lib/screenplay/Answerable.d.ts +5 -7
  462. package/lib/screenplay/Answerable.d.ts.map +1 -0
  463. package/lib/screenplay/Answered.d.ts +13 -0
  464. package/lib/screenplay/Answered.d.ts.map +1 -0
  465. package/lib/screenplay/{Ability.js → Answered.js} +1 -1
  466. package/lib/screenplay/Answered.js.map +1 -0
  467. package/lib/screenplay/Interaction.d.ts +81 -18
  468. package/lib/screenplay/Interaction.d.ts.map +1 -0
  469. package/lib/screenplay/Interaction.js +70 -28
  470. package/lib/screenplay/Interaction.js.map +1 -1
  471. package/lib/screenplay/Optional.d.ts +15 -18
  472. package/lib/screenplay/Optional.d.ts.map +1 -0
  473. package/lib/screenplay/Question.d.ts +201 -70
  474. package/lib/screenplay/Question.d.ts.map +1 -0
  475. package/lib/screenplay/Question.js +295 -75
  476. package/lib/screenplay/Question.js.map +1 -1
  477. package/lib/screenplay/RecursivelyAnswered.d.ts +40 -0
  478. package/lib/screenplay/RecursivelyAnswered.d.ts.map +1 -0
  479. package/lib/screenplay/RecursivelyAnswered.js +3 -0
  480. package/lib/screenplay/RecursivelyAnswered.js.map +1 -0
  481. package/lib/screenplay/Task.d.ts +180 -40
  482. package/lib/screenplay/Task.d.ts.map +1 -0
  483. package/lib/screenplay/Task.js +175 -76
  484. package/lib/screenplay/Task.js.map +1 -1
  485. package/lib/screenplay/WithAnswerableProperties.d.ts +33 -0
  486. package/lib/screenplay/WithAnswerableProperties.d.ts.map +1 -0
  487. package/lib/screenplay/WithAnswerableProperties.js +3 -0
  488. package/lib/screenplay/WithAnswerableProperties.js.map +1 -0
  489. package/lib/screenplay/abilities/Ability.d.ts +397 -0
  490. package/lib/screenplay/abilities/Ability.d.ts.map +1 -0
  491. package/lib/screenplay/abilities/Ability.js +401 -0
  492. package/lib/screenplay/abilities/Ability.js.map +1 -0
  493. package/lib/screenplay/abilities/AbilityType.d.ts +45 -0
  494. package/lib/screenplay/abilities/AbilityType.d.ts.map +1 -0
  495. package/lib/screenplay/abilities/AbilityType.js.map +1 -0
  496. package/lib/screenplay/abilities/CanHaveAbilities.d.ts +19 -0
  497. package/lib/screenplay/abilities/CanHaveAbilities.d.ts.map +1 -0
  498. package/lib/screenplay/abilities/CanHaveAbilities.js.map +1 -0
  499. package/lib/screenplay/abilities/Discardable.d.ts +19 -7
  500. package/lib/screenplay/abilities/Discardable.d.ts.map +1 -0
  501. package/lib/screenplay/abilities/Initialisable.d.ts +18 -16
  502. package/lib/screenplay/abilities/Initialisable.d.ts.map +1 -0
  503. package/lib/screenplay/abilities/UsesAbilities.d.ts +23 -0
  504. package/lib/screenplay/abilities/UsesAbilities.d.ts.map +1 -0
  505. package/lib/screenplay/abilities/UsesAbilities.js.map +1 -0
  506. package/lib/screenplay/abilities/index.d.ts +5 -1
  507. package/lib/screenplay/abilities/index.d.ts.map +1 -0
  508. package/lib/screenplay/abilities/index.js +9 -2
  509. package/lib/screenplay/abilities/index.js.map +1 -1
  510. package/lib/screenplay/activities/PerformsActivities.d.ts +20 -0
  511. package/lib/screenplay/activities/PerformsActivities.d.ts.map +1 -0
  512. package/lib/screenplay/activities/PerformsActivities.js.map +1 -0
  513. package/lib/screenplay/activities/index.d.ts +2 -1
  514. package/lib/screenplay/activities/index.d.ts.map +1 -0
  515. package/lib/screenplay/activities/index.js +6 -2
  516. package/lib/screenplay/activities/index.js.map +1 -1
  517. package/lib/screenplay/artifacts/CollectsArtifacts.d.ts +24 -0
  518. package/lib/screenplay/artifacts/CollectsArtifacts.d.ts.map +1 -0
  519. package/lib/screenplay/artifacts/CollectsArtifacts.js.map +1 -0
  520. package/lib/screenplay/artifacts/index.d.ts +2 -0
  521. package/lib/screenplay/artifacts/index.d.ts.map +1 -0
  522. package/lib/screenplay/{actor → artifacts}/index.js +5 -6
  523. package/lib/screenplay/artifacts/index.js.map +1 -0
  524. package/lib/screenplay/debugging/Debug.d.ts +107 -0
  525. package/lib/screenplay/debugging/Debug.d.ts.map +1 -0
  526. package/lib/screenplay/debugging/Debug.js +131 -0
  527. package/lib/screenplay/debugging/Debug.js.map +1 -0
  528. package/lib/screenplay/debugging/DebuggingResult.d.ts +11 -0
  529. package/lib/screenplay/debugging/DebuggingResult.d.ts.map +1 -0
  530. package/lib/screenplay/debugging/DebuggingResult.js +3 -0
  531. package/lib/screenplay/debugging/DebuggingResult.js.map +1 -0
  532. package/lib/screenplay/debugging/Log.d.ts +47 -0
  533. package/lib/screenplay/debugging/Log.d.ts.map +1 -0
  534. package/lib/screenplay/debugging/Log.js +59 -0
  535. package/lib/screenplay/debugging/Log.js.map +1 -0
  536. package/lib/screenplay/debugging/index.d.ts +4 -0
  537. package/lib/screenplay/debugging/index.d.ts.map +1 -0
  538. package/lib/screenplay/debugging/index.js +20 -0
  539. package/lib/screenplay/debugging/index.js.map +1 -0
  540. package/lib/screenplay/index.d.ts +10 -4
  541. package/lib/screenplay/index.d.ts.map +1 -0
  542. package/lib/screenplay/index.js +14 -5
  543. package/lib/screenplay/index.js.map +1 -1
  544. package/lib/screenplay/notes/ChainableSetter.d.ts +9 -0
  545. package/lib/screenplay/notes/ChainableSetter.d.ts.map +1 -0
  546. package/lib/screenplay/notes/ChainableSetter.js +3 -0
  547. package/lib/screenplay/notes/ChainableSetter.js.map +1 -0
  548. package/lib/screenplay/notes/Notepad.d.ts +164 -0
  549. package/lib/screenplay/notes/Notepad.d.ts.map +1 -0
  550. package/lib/screenplay/notes/Notepad.js +200 -0
  551. package/lib/screenplay/notes/Notepad.js.map +1 -0
  552. package/lib/screenplay/notes/NotepadAdapter.d.ts +245 -0
  553. package/lib/screenplay/notes/NotepadAdapter.d.ts.map +1 -0
  554. package/lib/screenplay/notes/NotepadAdapter.js +298 -0
  555. package/lib/screenplay/notes/NotepadAdapter.js.map +1 -0
  556. package/lib/screenplay/notes/TakeNotes.d.ts +249 -0
  557. package/lib/screenplay/notes/TakeNotes.d.ts.map +1 -0
  558. package/lib/screenplay/notes/TakeNotes.js +259 -0
  559. package/lib/screenplay/notes/TakeNotes.js.map +1 -0
  560. package/lib/screenplay/notes/index.d.ts +6 -0
  561. package/lib/screenplay/notes/index.d.ts.map +1 -0
  562. package/lib/screenplay/notes/index.js +22 -0
  563. package/lib/screenplay/notes/index.js.map +1 -0
  564. package/lib/screenplay/notes/notes.d.ts +117 -0
  565. package/lib/screenplay/notes/notes.d.ts.map +1 -0
  566. package/lib/screenplay/notes/notes.js +123 -0
  567. package/lib/screenplay/notes/notes.js.map +1 -0
  568. package/lib/screenplay/questions/AnswersQuestions.d.ts +19 -0
  569. package/lib/screenplay/questions/AnswersQuestions.d.ts.map +1 -0
  570. package/lib/screenplay/questions/AnswersQuestions.js.map +1 -0
  571. package/lib/screenplay/questions/Check.d.ts +39 -57
  572. package/lib/screenplay/questions/Check.d.ts.map +1 -0
  573. package/lib/screenplay/questions/Check.js +41 -63
  574. package/lib/screenplay/questions/Check.js.map +1 -1
  575. package/lib/screenplay/questions/Expectation.d.ts +155 -44
  576. package/lib/screenplay/questions/Expectation.d.ts.map +1 -0
  577. package/lib/screenplay/questions/Expectation.js +172 -46
  578. package/lib/screenplay/questions/Expectation.js.map +1 -1
  579. package/lib/screenplay/questions/List.d.ts +14 -2
  580. package/lib/screenplay/questions/List.d.ts.map +1 -0
  581. package/lib/screenplay/questions/List.js +14 -11
  582. package/lib/screenplay/questions/List.js.map +1 -1
  583. package/lib/screenplay/questions/MetaQuestion.d.ts +18 -22
  584. package/lib/screenplay/questions/MetaQuestion.d.ts.map +1 -0
  585. package/lib/screenplay/questions/Unanswered.d.ts +20 -0
  586. package/lib/screenplay/questions/Unanswered.d.ts.map +1 -0
  587. package/lib/screenplay/questions/Unanswered.js +52 -0
  588. package/lib/screenplay/questions/Unanswered.js.map +1 -0
  589. package/lib/screenplay/questions/expectations/ExpectationDetails.d.ts +24 -0
  590. package/lib/screenplay/questions/expectations/ExpectationDetails.d.ts.map +1 -0
  591. package/lib/screenplay/questions/expectations/ExpectationDetails.js +55 -0
  592. package/lib/screenplay/questions/expectations/ExpectationDetails.js.map +1 -0
  593. package/lib/screenplay/questions/expectations/ExpectationMet.d.ts +7 -1
  594. package/lib/screenplay/questions/expectations/ExpectationMet.d.ts.map +1 -0
  595. package/lib/screenplay/questions/expectations/ExpectationMet.js +5 -0
  596. package/lib/screenplay/questions/expectations/ExpectationMet.js.map +1 -1
  597. package/lib/screenplay/questions/expectations/ExpectationNotMet.d.ts +7 -1
  598. package/lib/screenplay/questions/expectations/ExpectationNotMet.d.ts.map +1 -0
  599. package/lib/screenplay/questions/expectations/ExpectationNotMet.js +5 -0
  600. package/lib/screenplay/questions/expectations/ExpectationNotMet.js.map +1 -1
  601. package/lib/screenplay/questions/expectations/ExpectationOutcome.d.ts +13 -4
  602. package/lib/screenplay/questions/expectations/ExpectationOutcome.d.ts.map +1 -0
  603. package/lib/screenplay/questions/expectations/ExpectationOutcome.js +8 -1
  604. package/lib/screenplay/questions/expectations/ExpectationOutcome.js.map +1 -1
  605. package/lib/screenplay/questions/expectations/index.d.ts +2 -0
  606. package/lib/screenplay/questions/expectations/index.d.ts.map +1 -0
  607. package/lib/screenplay/questions/expectations/index.js +6 -1
  608. package/lib/screenplay/questions/expectations/index.js.map +1 -1
  609. package/lib/screenplay/questions/index.d.ts +3 -1
  610. package/lib/screenplay/questions/index.d.ts.map +1 -0
  611. package/lib/screenplay/questions/index.js +7 -2
  612. package/lib/screenplay/questions/index.js.map +1 -1
  613. package/lib/screenplay/questions/q.d.ts +56 -25
  614. package/lib/screenplay/questions/q.d.ts.map +1 -0
  615. package/lib/screenplay/questions/q.js +53 -23
  616. package/lib/screenplay/questions/q.js.map +1 -1
  617. package/lib/screenplay/time/abilities/ScheduleWork.d.ts +26 -0
  618. package/lib/screenplay/time/abilities/ScheduleWork.d.ts.map +1 -0
  619. package/lib/screenplay/time/abilities/ScheduleWork.js +45 -0
  620. package/lib/screenplay/time/abilities/ScheduleWork.js.map +1 -0
  621. package/lib/screenplay/time/abilities/index.d.ts +2 -0
  622. package/lib/screenplay/time/abilities/index.d.ts.map +1 -0
  623. package/lib/{io/json → screenplay/time/abilities}/index.js +6 -2
  624. package/lib/screenplay/time/abilities/index.js.map +1 -0
  625. package/lib/screenplay/time/activities/Wait.d.ts +212 -0
  626. package/lib/screenplay/time/activities/Wait.d.ts.map +1 -0
  627. package/lib/screenplay/time/activities/Wait.js +270 -0
  628. package/lib/screenplay/time/activities/Wait.js.map +1 -0
  629. package/lib/screenplay/time/activities/index.d.ts +2 -0
  630. package/lib/screenplay/time/activities/index.d.ts.map +1 -0
  631. package/lib/screenplay/{interactions → time/activities}/index.js +6 -3
  632. package/lib/screenplay/time/activities/index.js.map +1 -0
  633. package/lib/screenplay/time/index.d.ts +4 -0
  634. package/lib/screenplay/time/index.d.ts.map +1 -0
  635. package/lib/screenplay/time/index.js +20 -0
  636. package/lib/screenplay/time/index.js.map +1 -0
  637. package/lib/screenplay/time/models/Clock.d.ts +24 -0
  638. package/lib/screenplay/time/models/Clock.d.ts.map +1 -0
  639. package/lib/screenplay/time/models/Clock.js +31 -0
  640. package/lib/screenplay/time/models/Clock.js.map +1 -0
  641. package/lib/screenplay/time/models/DelayedCallback.d.ts +11 -0
  642. package/lib/screenplay/time/models/DelayedCallback.d.ts.map +1 -0
  643. package/lib/screenplay/time/models/DelayedCallback.js +3 -0
  644. package/lib/screenplay/time/models/DelayedCallback.js.map +1 -0
  645. package/lib/{model → screenplay/time/models}/Duration.d.ts +11 -1
  646. package/lib/screenplay/time/models/Duration.d.ts.map +1 -0
  647. package/lib/{model → screenplay/time/models}/Duration.js +14 -0
  648. package/lib/screenplay/time/models/Duration.js.map +1 -0
  649. package/lib/screenplay/time/models/RepeatUntilLimits.d.ts +12 -0
  650. package/lib/screenplay/time/models/RepeatUntilLimits.d.ts.map +1 -0
  651. package/lib/screenplay/time/models/RepeatUntilLimits.js +3 -0
  652. package/lib/screenplay/time/models/RepeatUntilLimits.js.map +1 -0
  653. package/lib/screenplay/time/models/Scheduler.d.ts +43 -0
  654. package/lib/screenplay/time/models/Scheduler.d.ts.map +1 -0
  655. package/lib/screenplay/time/models/Scheduler.js +166 -0
  656. package/lib/screenplay/time/models/Scheduler.js.map +1 -0
  657. package/lib/{model → screenplay/time/models}/Timestamp.d.ts +16 -0
  658. package/lib/screenplay/time/models/Timestamp.d.ts.map +1 -0
  659. package/lib/screenplay/time/models/Timestamp.js +81 -0
  660. package/lib/screenplay/time/models/Timestamp.js.map +1 -0
  661. package/lib/screenplay/time/models/index.d.ts +7 -0
  662. package/lib/screenplay/time/models/index.d.ts.map +1 -0
  663. package/lib/screenplay/time/models/index.js +23 -0
  664. package/lib/screenplay/time/models/index.js.map +1 -0
  665. package/lib/stage/Cast.d.ts +142 -49
  666. package/lib/stage/Cast.d.ts.map +1 -0
  667. package/lib/stage/Cast.js +141 -55
  668. package/lib/stage/Cast.js.map +1 -1
  669. package/lib/stage/Extras.d.ts +2 -4
  670. package/lib/stage/Extras.d.ts.map +1 -0
  671. package/lib/stage/Extras.js +1 -4
  672. package/lib/stage/Extras.js.map +1 -1
  673. package/lib/stage/ListensToDomainEvents.d.ts +14 -11
  674. package/lib/stage/ListensToDomainEvents.d.ts.map +1 -0
  675. package/lib/stage/Stage.d.ts +81 -100
  676. package/lib/stage/Stage.d.ts.map +1 -0
  677. package/lib/stage/Stage.js +122 -119
  678. package/lib/stage/Stage.js.map +1 -1
  679. package/lib/stage/StageCrewMember.d.ts +67 -15
  680. package/lib/stage/StageCrewMember.d.ts.map +1 -0
  681. package/lib/stage/StageCrewMemberBuilder.d.ts +14 -12
  682. package/lib/stage/StageCrewMemberBuilder.d.ts.map +1 -0
  683. package/lib/stage/StageCrewMemberBuilderDependencies.d.ts +6 -13
  684. package/lib/stage/StageCrewMemberBuilderDependencies.d.ts.map +1 -0
  685. package/lib/stage/StageManager.d.ts +6 -2
  686. package/lib/stage/StageManager.d.ts.map +1 -0
  687. package/lib/stage/StageManager.js +22 -20
  688. package/lib/stage/StageManager.js.map +1 -1
  689. package/lib/stage/crew/artifact-archiver/ArtifactArchiver.d.ts +70 -47
  690. package/lib/stage/crew/artifact-archiver/ArtifactArchiver.d.ts.map +1 -0
  691. package/lib/stage/crew/artifact-archiver/ArtifactArchiver.js +80 -56
  692. package/lib/stage/crew/artifact-archiver/ArtifactArchiver.js.map +1 -1
  693. package/lib/stage/crew/artifact-archiver/Hash.d.ts +1 -0
  694. package/lib/stage/crew/artifact-archiver/Hash.d.ts.map +1 -0
  695. package/lib/stage/crew/artifact-archiver/Hash.js +3 -3
  696. package/lib/stage/crew/artifact-archiver/Hash.js.map +1 -1
  697. package/lib/stage/crew/artifact-archiver/index.d.ts +1 -0
  698. package/lib/stage/crew/artifact-archiver/index.d.ts.map +1 -0
  699. package/lib/stage/crew/artifact-archiver/index.js +5 -1
  700. package/lib/stage/crew/artifact-archiver/index.js.map +1 -1
  701. package/lib/stage/crew/index.d.ts +1 -0
  702. package/lib/stage/crew/index.d.ts.map +1 -0
  703. package/lib/stage/crew/index.js +5 -1
  704. package/lib/stage/crew/index.js.map +1 -1
  705. package/lib/stage/crew/stream-reporter/StreamReporter.d.ts +82 -54
  706. package/lib/stage/crew/stream-reporter/StreamReporter.d.ts.map +1 -0
  707. package/lib/stage/crew/stream-reporter/StreamReporter.js +81 -54
  708. package/lib/stage/crew/stream-reporter/StreamReporter.js.map +1 -1
  709. package/lib/stage/crew/stream-reporter/index.d.ts +1 -0
  710. package/lib/stage/crew/stream-reporter/index.d.ts.map +1 -0
  711. package/lib/stage/crew/stream-reporter/index.js +5 -1
  712. package/lib/stage/crew/stream-reporter/index.js.map +1 -1
  713. package/lib/stage/index.d.ts +2 -1
  714. package/lib/stage/index.d.ts.map +1 -0
  715. package/lib/stage/index.js +6 -2
  716. package/lib/stage/index.js.map +1 -1
  717. package/lib/stage/queues/DomainEventQueue.d.ts +25 -0
  718. package/lib/stage/queues/DomainEventQueue.d.ts.map +1 -0
  719. package/lib/stage/queues/DomainEventQueue.js +33 -0
  720. package/lib/stage/queues/DomainEventQueue.js.map +1 -0
  721. package/lib/stage/queues/DomainEventQueues.d.ts +22 -0
  722. package/lib/stage/queues/DomainEventQueues.d.ts.map +1 -0
  723. package/lib/stage/queues/DomainEventQueues.js +76 -0
  724. package/lib/stage/queues/DomainEventQueues.js.map +1 -0
  725. package/lib/stage/queues/index.d.ts +3 -0
  726. package/lib/stage/queues/index.d.ts.map +1 -0
  727. package/lib/stage/queues/index.js +19 -0
  728. package/lib/stage/queues/index.js.map +1 -0
  729. package/package.json +31 -51
  730. package/src/Serenity.ts +183 -88
  731. package/src/adapter/OutputStream.ts +13 -0
  732. package/src/adapter/TestRunnerAdapter.ts +35 -0
  733. package/src/adapter/index.ts +2 -0
  734. package/src/config/ClassDescription.ts +55 -0
  735. package/src/config/SerenityConfig.ts +79 -0
  736. package/src/config/index.ts +2 -0
  737. package/src/errors/ErrorFactory.ts +329 -0
  738. package/src/errors/ErrorOptions.ts +16 -0
  739. package/src/errors/ErrorSerialiser.ts +106 -0
  740. package/src/{io → errors}/ErrorStackParser.ts +4 -4
  741. package/src/errors/RaiseErrors.ts +61 -0
  742. package/src/errors/diff/AnsiDiffFormatter.ts +41 -0
  743. package/src/errors/diff/DiffFormatter.ts +12 -0
  744. package/src/errors/diff/NoOpDiffFormatter.ts +20 -0
  745. package/src/errors/diff/index.ts +3 -0
  746. package/src/errors/index.ts +28 -7
  747. package/src/errors/model/AssertionError.ts +31 -0
  748. package/src/errors/model/ConfigurationError.ts +31 -0
  749. package/src/errors/model/ImplementationPendingError.ts +52 -0
  750. package/src/errors/model/ListItemNotFoundError.ts +35 -0
  751. package/src/errors/model/LogicError.ts +35 -0
  752. package/src/errors/model/OperationInterruptedError.ts +38 -0
  753. package/src/errors/model/RuntimeError.ts +101 -0
  754. package/src/errors/model/TestCompromisedError.ts +46 -0
  755. package/src/errors/model/TimeoutExpiredError.ts +38 -0
  756. package/src/errors/model/UnknownError.ts +31 -0
  757. package/src/errors/model/index.ts +10 -0
  758. package/src/events/ActivityFinished.ts +4 -5
  759. package/src/events/ActivityRelatedArtifactArchived.ts +6 -1
  760. package/src/events/ActivityRelatedArtifactGenerated.ts +5 -1
  761. package/src/events/ActivityStarts.ts +4 -5
  762. package/src/events/ArtifactArchived.ts +5 -1
  763. package/src/events/ArtifactGenerated.ts +5 -1
  764. package/src/events/AsyncOperationAborted.ts +28 -0
  765. package/src/events/AsyncOperationAttempted.ts +11 -4
  766. package/src/events/AsyncOperationCompleted.ts +5 -4
  767. package/src/events/AsyncOperationFailed.ts +6 -2
  768. package/src/events/BusinessRuleDetected.ts +5 -5
  769. package/src/events/DomainEvent.ts +4 -7
  770. package/src/events/FeatureNarrativeDetected.ts +5 -1
  771. package/src/events/InteractionFinished.ts +5 -1
  772. package/src/events/InteractionStarts.ts +5 -1
  773. package/src/events/RetryableSceneDetected.ts +8 -10
  774. package/src/events/SceneBackgroundDetected.ts +6 -1
  775. package/src/events/SceneDescriptionDetected.ts +5 -1
  776. package/src/events/SceneFinished.ts +5 -1
  777. package/src/events/SceneFinishes.ts +8 -7
  778. package/src/events/SceneParametersDetected.ts +5 -1
  779. package/src/events/SceneSequenceDetected.ts +5 -1
  780. package/src/events/SceneStarts.ts +5 -1
  781. package/src/events/SceneTagged.ts +5 -1
  782. package/src/events/SceneTemplateDetected.ts +5 -1
  783. package/src/events/TaskFinished.ts +5 -1
  784. package/src/events/TaskStarts.ts +5 -1
  785. package/src/events/TestRunFinished.ts +14 -6
  786. package/src/events/TestRunFinishes.ts +5 -4
  787. package/src/events/TestRunStarts.ts +3 -4
  788. package/src/events/TestRunnerDetected.ts +7 -4
  789. package/src/events/TestSuiteFinished.ts +5 -1
  790. package/src/events/TestSuiteStarts.ts +5 -1
  791. package/src/events/index.ts +1 -0
  792. package/src/index.ts +1 -2
  793. package/src/instance.ts +180 -91
  794. package/src/io/FileFinder.ts +2 -1
  795. package/src/io/FileSystem.ts +1 -1
  796. package/src/io/Path.ts +6 -3
  797. package/src/io/asyncMap.ts +6 -5
  798. package/src/io/commaSeparated.ts +8 -9
  799. package/src/io/format.ts +49 -22
  800. package/src/io/index.ts +3 -9
  801. package/src/io/inspected.ts +13 -271
  802. package/src/io/inspectedObject.ts +38 -0
  803. package/src/io/loader/ClassDescriptionParser.ts +67 -0
  804. package/src/io/loader/ClassDescriptor.ts +7 -0
  805. package/src/io/loader/ClassLoader.ts +42 -0
  806. package/src/io/{ModuleLoader.ts → loader/ModuleLoader.ts} +11 -19
  807. package/src/io/{Version.ts → loader/Version.ts} +2 -5
  808. package/src/io/loader/index.ts +5 -0
  809. package/src/io/reflection/has.ts +3 -5
  810. package/src/io/reflection/index.ts +2 -0
  811. package/src/io/reflection/isPrimitive.ts +20 -0
  812. package/src/io/reflection/typeOf.ts +31 -0
  813. package/src/io/stringified.ts +266 -0
  814. package/src/io/trimmed.ts +7 -9
  815. package/src/model/ActivityDetails.ts +8 -2
  816. package/src/model/CorrelationId.ts +1 -1
  817. package/src/model/ScenarioDetails.ts +4 -1
  818. package/src/model/artifacts/HTTPRequestResponse.ts +6 -10
  819. package/src/model/artifacts/Photo.ts +0 -8
  820. package/src/model/artifacts/index.ts +0 -1
  821. package/src/model/index.ts +0 -2
  822. package/src/model/outcomes.ts +5 -4
  823. package/src/model/tags/ArbitraryTag.ts +2 -5
  824. package/src/model/tags/ExecutionRetriedTag.ts +2 -5
  825. package/src/model/tags/index.ts +0 -1
  826. package/src/screenplay/Activity.ts +78 -20
  827. package/src/screenplay/Actor.ts +370 -0
  828. package/src/screenplay/Answerable.ts +3 -6
  829. package/src/screenplay/Answered.ts +16 -0
  830. package/src/screenplay/Interaction.ts +85 -42
  831. package/src/screenplay/Optional.ts +14 -18
  832. package/src/screenplay/Question.ts +369 -114
  833. package/src/screenplay/RecursivelyAnswered.ts +43 -0
  834. package/src/screenplay/Task.ts +185 -88
  835. package/src/screenplay/WithAnswerableProperties.ts +36 -0
  836. package/src/screenplay/abilities/Ability.ts +403 -0
  837. package/src/screenplay/abilities/AbilityType.ts +46 -0
  838. package/src/screenplay/abilities/CanHaveAbilities.ts +20 -0
  839. package/src/screenplay/abilities/Discardable.ts +19 -7
  840. package/src/screenplay/abilities/Initialisable.ts +17 -16
  841. package/src/screenplay/abilities/UsesAbilities.ts +24 -0
  842. package/src/screenplay/abilities/index.ts +4 -1
  843. package/src/screenplay/activities/PerformsActivities.ts +21 -0
  844. package/src/screenplay/activities/index.ts +1 -1
  845. package/src/screenplay/artifacts/CollectsArtifacts.ts +25 -0
  846. package/src/screenplay/artifacts/index.ts +1 -0
  847. package/src/screenplay/debugging/Debug.ts +161 -0
  848. package/src/screenplay/debugging/DebuggingResult.ts +10 -0
  849. package/src/screenplay/debugging/Log.ts +68 -0
  850. package/src/screenplay/debugging/index.ts +3 -0
  851. package/src/screenplay/index.ts +9 -4
  852. package/src/screenplay/notes/ChainableSetter.ts +9 -0
  853. package/src/screenplay/notes/Notepad.ts +208 -0
  854. package/src/screenplay/notes/NotepadAdapter.ts +317 -0
  855. package/src/screenplay/notes/TakeNotes.ts +257 -0
  856. package/src/screenplay/notes/index.ts +5 -0
  857. package/src/screenplay/notes/notes.ts +120 -0
  858. package/src/screenplay/questions/AnswersQuestions.ts +20 -0
  859. package/src/screenplay/questions/Check.ts +41 -62
  860. package/src/screenplay/questions/Expectation.ts +211 -65
  861. package/src/screenplay/questions/List.ts +18 -11
  862. package/src/screenplay/questions/MetaQuestion.ts +18 -22
  863. package/src/screenplay/questions/Unanswered.ts +27 -0
  864. package/src/screenplay/questions/expectations/ExpectationDetails.ts +64 -0
  865. package/src/screenplay/questions/expectations/ExpectationMet.ts +6 -1
  866. package/src/screenplay/questions/expectations/ExpectationNotMet.ts +6 -1
  867. package/src/screenplay/questions/expectations/ExpectationOutcome.ts +12 -3
  868. package/src/screenplay/questions/expectations/index.ts +1 -0
  869. package/src/screenplay/questions/index.ts +2 -1
  870. package/src/screenplay/questions/q.ts +55 -25
  871. package/src/screenplay/time/abilities/ScheduleWork.ts +52 -0
  872. package/src/screenplay/time/abilities/index.ts +1 -0
  873. package/src/screenplay/time/activities/Wait.ts +294 -0
  874. package/src/screenplay/time/activities/index.ts +1 -0
  875. package/src/screenplay/time/index.ts +3 -0
  876. package/src/screenplay/time/models/Clock.ts +28 -0
  877. package/src/screenplay/time/models/DelayedCallback.ts +8 -0
  878. package/src/{model → screenplay/time/models}/Duration.ts +17 -1
  879. package/src/screenplay/time/models/RepeatUntilLimits.ts +12 -0
  880. package/src/screenplay/time/models/Scheduler.ts +226 -0
  881. package/src/{model → screenplay/time/models}/Timestamp.ts +36 -2
  882. package/src/screenplay/time/models/index.ts +6 -0
  883. package/src/stage/Cast.ts +147 -62
  884. package/src/stage/Extras.ts +1 -4
  885. package/src/stage/ListensToDomainEvents.ts +13 -11
  886. package/src/stage/Stage.ts +140 -130
  887. package/src/stage/StageCrewMember.ts +66 -15
  888. package/src/stage/StageCrewMemberBuilder.ts +13 -12
  889. package/src/stage/StageCrewMemberBuilderDependencies.ts +5 -15
  890. package/src/stage/StageManager.ts +44 -44
  891. package/src/stage/crew/artifact-archiver/ArtifactArchiver.ts +81 -53
  892. package/src/stage/crew/stream-reporter/StreamReporter.ts +81 -54
  893. package/src/stage/index.ts +1 -1
  894. package/src/stage/queues/DomainEventQueue.ts +41 -0
  895. package/src/stage/queues/DomainEventQueues.ts +88 -0
  896. package/src/stage/queues/index.ts +2 -0
  897. package/tsconfig.build.json +10 -0
  898. package/lib/SerenityConfig.d.ts +0 -45
  899. package/lib/SerenityConfig.js +0 -12
  900. package/lib/SerenityConfig.js.map +0 -1
  901. package/lib/errors/AssertionError.d.ts +0 -18
  902. package/lib/errors/AssertionError.js +0 -25
  903. package/lib/errors/AssertionError.js.map +0 -1
  904. package/lib/errors/ConfigurationError.d.ts +0 -14
  905. package/lib/errors/ConfigurationError.js +0 -21
  906. package/lib/errors/ConfigurationError.js.map +0 -1
  907. package/lib/errors/ImplementationPendingError.d.ts +0 -29
  908. package/lib/errors/ImplementationPendingError.js +0 -36
  909. package/lib/errors/ImplementationPendingError.js.map +0 -1
  910. package/lib/errors/LogicError.d.ts +0 -17
  911. package/lib/errors/LogicError.js +0 -24
  912. package/lib/errors/LogicError.js.map +0 -1
  913. package/lib/errors/RuntimeError.d.ts +0 -43
  914. package/lib/errors/RuntimeError.js +0 -58
  915. package/lib/errors/RuntimeError.js.map +0 -1
  916. package/lib/errors/TestCompromisedError.d.ts +0 -26
  917. package/lib/errors/TestCompromisedError.js +0 -33
  918. package/lib/errors/TestCompromisedError.js.map +0 -1
  919. package/lib/errors/UnknownError.d.ts +0 -14
  920. package/lib/errors/UnknownError.js +0 -21
  921. package/lib/errors/UnknownError.js.map +0 -1
  922. package/lib/io/AssertionReportDiffer.d.ts +0 -12
  923. package/lib/io/AssertionReportDiffer.js +0 -34
  924. package/lib/io/AssertionReportDiffer.js.map +0 -1
  925. package/lib/io/ErrorSerialiser.d.ts +0 -27
  926. package/lib/io/ErrorSerialiser.js.map +0 -1
  927. package/lib/io/ErrorStackParser.d.ts +0 -12
  928. package/lib/io/ErrorStackParser.js +0 -19
  929. package/lib/io/ErrorStackParser.js.map +0 -1
  930. package/lib/io/ModuleLoader.js +0 -81
  931. package/lib/io/ModuleLoader.js.map +0 -1
  932. package/lib/io/OutputStream.d.ts +0 -16
  933. package/lib/io/TestRunnerAdapter.d.ts +0 -47
  934. package/lib/io/TestRunnerAdapter.js.map +0 -1
  935. package/lib/io/Version.js.map +0 -1
  936. package/lib/io/formatted.d.ts +0 -16
  937. package/lib/io/formatted.js +0 -23
  938. package/lib/io/formatted.js.map +0 -1
  939. package/lib/io/json/cycle.d.ts +0 -11
  940. package/lib/io/json/cycle.js +0 -165
  941. package/lib/io/json/cycle.js.map +0 -1
  942. package/lib/io/json/index.d.ts +0 -1
  943. package/lib/io/json/index.js.map +0 -1
  944. package/lib/model/Duration.js.map +0 -1
  945. package/lib/model/Timestamp.js +0 -48
  946. package/lib/model/Timestamp.js.map +0 -1
  947. package/lib/model/artifacts/AssertionReport.d.ts +0 -7
  948. package/lib/model/artifacts/AssertionReport.js +0 -11
  949. package/lib/model/artifacts/AssertionReport.js.map +0 -1
  950. package/lib/model/tags/ContextTag.d.ts +0 -17
  951. package/lib/model/tags/ContextTag.js +0 -24
  952. package/lib/model/tags/ContextTag.js.map +0 -1
  953. package/lib/screenplay/Ability.d.ts +0 -100
  954. package/lib/screenplay/Ability.js.map +0 -1
  955. package/lib/screenplay/AbilityType.d.ts +0 -42
  956. package/lib/screenplay/AbilityType.js.map +0 -1
  957. package/lib/screenplay/abilities/TakeNotes.d.ts +0 -151
  958. package/lib/screenplay/abilities/TakeNotes.js +0 -205
  959. package/lib/screenplay/abilities/TakeNotes.js.map +0 -1
  960. package/lib/screenplay/activities/ActivityDescriber.d.ts +0 -9
  961. package/lib/screenplay/activities/ActivityDescriber.js +0 -18
  962. package/lib/screenplay/activities/ActivityDescriber.js.map +0 -1
  963. package/lib/screenplay/activities/OutcomeMatcher.d.ts +0 -5
  964. package/lib/screenplay/activities/OutcomeMatcher.js +0 -21
  965. package/lib/screenplay/activities/OutcomeMatcher.js.map +0 -1
  966. package/lib/screenplay/activities/TrackedActivity.d.ts +0 -17
  967. package/lib/screenplay/activities/TrackedActivity.js +0 -40
  968. package/lib/screenplay/activities/TrackedActivity.js.map +0 -1
  969. package/lib/screenplay/actor/Actor.d.ts +0 -106
  970. package/lib/screenplay/actor/Actor.js +0 -189
  971. package/lib/screenplay/actor/Actor.js.map +0 -1
  972. package/lib/screenplay/actor/AnswersQuestions.d.ts +0 -10
  973. package/lib/screenplay/actor/AnswersQuestions.js.map +0 -1
  974. package/lib/screenplay/actor/CanHaveAbilities.d.ts +0 -15
  975. package/lib/screenplay/actor/CanHaveAbilities.js.map +0 -1
  976. package/lib/screenplay/actor/CollectsArtifacts.d.ts +0 -17
  977. package/lib/screenplay/actor/CollectsArtifacts.js.map +0 -1
  978. package/lib/screenplay/actor/PerformsActivities.d.ts +0 -10
  979. package/lib/screenplay/actor/PerformsActivities.js.map +0 -1
  980. package/lib/screenplay/actor/UsesAbilities.d.ts +0 -18
  981. package/lib/screenplay/actor/UsesAbilities.js.map +0 -1
  982. package/lib/screenplay/actor/index.d.ts +0 -6
  983. package/lib/screenplay/actor/index.js.map +0 -1
  984. package/lib/screenplay/interactions/Log.d.ts +0 -57
  985. package/lib/screenplay/interactions/Log.js +0 -74
  986. package/lib/screenplay/interactions/Log.js.map +0 -1
  987. package/lib/screenplay/interactions/TakeNote.d.ts +0 -87
  988. package/lib/screenplay/interactions/TakeNote.js +0 -103
  989. package/lib/screenplay/interactions/TakeNote.js.map +0 -1
  990. package/lib/screenplay/interactions/index.d.ts +0 -2
  991. package/lib/screenplay/interactions/index.js.map +0 -1
  992. package/lib/screenplay/questions/Note.d.ts +0 -79
  993. package/lib/screenplay/questions/Note.js +0 -96
  994. package/lib/screenplay/questions/Note.js.map +0 -1
  995. package/lib/stage/Clock.d.ts +0 -15
  996. package/lib/stage/Clock.js +0 -23
  997. package/lib/stage/Clock.js.map +0 -1
  998. package/src/SerenityConfig.ts +0 -49
  999. package/src/errors/AssertionError.ts +0 -20
  1000. package/src/errors/ConfigurationError.ts +0 -18
  1001. package/src/errors/ImplementationPendingError.ts +0 -33
  1002. package/src/errors/LogicError.ts +0 -21
  1003. package/src/errors/RuntimeError.ts +0 -60
  1004. package/src/errors/TestCompromisedError.ts +0 -30
  1005. package/src/errors/UnknownError.ts +0 -18
  1006. package/src/io/AssertionReportDiffer.ts +0 -43
  1007. package/src/io/ErrorSerialiser.ts +0 -78
  1008. package/src/io/OutputStream.ts +0 -16
  1009. package/src/io/TestRunnerAdapter.ts +0 -50
  1010. package/src/io/formatted.ts +0 -20
  1011. package/src/io/json/cycle.ts +0 -177
  1012. package/src/io/json/index.ts +0 -1
  1013. package/src/model/artifacts/AssertionReport.ts +0 -7
  1014. package/src/model/tags/ContextTag.ts +0 -21
  1015. package/src/screenplay/Ability.ts +0 -100
  1016. package/src/screenplay/AbilityType.ts +0 -44
  1017. package/src/screenplay/abilities/TakeNotes.ts +0 -216
  1018. package/src/screenplay/activities/ActivityDescriber.ts +0 -20
  1019. package/src/screenplay/activities/OutcomeMatcher.ts +0 -25
  1020. package/src/screenplay/activities/TrackedActivity.ts +0 -50
  1021. package/src/screenplay/actor/Actor.ts +0 -243
  1022. package/src/screenplay/actor/AnswersQuestions.ts +0 -11
  1023. package/src/screenplay/actor/CanHaveAbilities.ts +0 -16
  1024. package/src/screenplay/actor/CollectsArtifacts.ts +0 -18
  1025. package/src/screenplay/actor/PerformsActivities.ts +0 -11
  1026. package/src/screenplay/actor/UsesAbilities.ts +0 -20
  1027. package/src/screenplay/actor/index.ts +0 -6
  1028. package/src/screenplay/interactions/Log.ts +0 -81
  1029. package/src/screenplay/interactions/TakeNote.ts +0 -107
  1030. package/src/screenplay/interactions/index.ts +0 -2
  1031. package/src/screenplay/questions/Note.ts +0 -99
  1032. package/src/stage/Clock.ts +0 -19
  1033. package/tsconfig.eslint.json +0 -10
  1034. /package/lib/{io → adapter}/OutputStream.js +0 -0
  1035. /package/lib/{io → adapter}/TestRunnerAdapter.js +0 -0
  1036. /package/lib/screenplay/{AbilityType.js → abilities/AbilityType.js} +0 -0
  1037. /package/lib/screenplay/{actor → abilities}/CanHaveAbilities.js +0 -0
  1038. /package/lib/screenplay/{actor → abilities}/UsesAbilities.js +0 -0
  1039. /package/lib/screenplay/{actor → activities}/PerformsActivities.js +0 -0
  1040. /package/lib/screenplay/{actor → artifacts}/CollectsArtifacts.js +0 -0
  1041. /package/lib/screenplay/{actor → questions}/AnswersQuestions.js +0 -0
@@ -0,0 +1,283 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Actor = void 0;
4
+ const tiny_types_1 = require("tiny-types");
5
+ const errors_1 = require("../errors");
6
+ const events_1 = require("../events");
7
+ const io_1 = require("../io");
8
+ const model_1 = require("../model");
9
+ const screenplay_1 = require("../screenplay");
10
+ const Activity_1 = require("./Activity");
11
+ const Question_1 = require("./Question");
12
+ /**
13
+ * **Actors** represent **people** and **external systems** interacting with the system under test.
14
+ * Their role is to perform {@apilink Activity|activities} that demonstrate how to accomplish a given goal.
15
+ *
16
+ * Actors are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
17
+ * along with {@apilink Ability|Abilities}, {@apilink Interaction|Interactions}, {@apilink Task|Tasks}, and {@apilink Question|Questions}.
18
+ * Actors are also the first thing you see in a typical Serenity/JS test scenario.
19
+ *
20
+ * ![Screenplay Pattern](/images/design/serenity-js-screenplay-pattern.png)
21
+ *
22
+ * Learn more about:
23
+ * - {@apilink Cast}
24
+ * - {@apilink Stage}
25
+ * - {@apilink Ability|Abilities}
26
+ * - {@apilink Activity|Activities}
27
+ * - {@apilink Interaction|Interactions}
28
+ * - {@apilink Task|Tasks}
29
+ * - {@apilink Question|Questions}
30
+ *
31
+ * ## Representing people and systems as actors
32
+ *
33
+ * To use a Serenity/JS {@apilink Actor}, all you need is to say their name:
34
+ *
35
+ * ```typescript
36
+ * import { actorCalled } from '@serenity-js/core'
37
+ *
38
+ * actorCalled('Alice')
39
+ * // returns: Actor
40
+ * ```
41
+ *
42
+ * Serenity/JS actors perform within the scope of a test scenario, so the first time you invoke {@apilink actorCalled},
43
+ * Serenity/JS instantiates a new actor from the default {@apilink Cast} of actors (or any custom cast you might have {@apilink configured|configured}).
44
+ * Any subsequent invocations of this function within the scope of the same test scenario retrieve the already instantiated actor, identified by their name.
45
+ *
46
+ * ```typescript
47
+ * import { actorCalled } from '@serenity-js/core'
48
+ *
49
+ * actorCalled('Alice') // instantiates Alice
50
+ * actorCalled('Bob') // instantiates Bob
51
+ * actorCalled('Alice') // retrieves Alice, since she's already been instantiated
52
+ * ```
53
+ *
54
+ * Serenity/JS scenarios can involve as many or as few actors as you need to model the given business workflow.
55
+ * For example, you might want to use **multiple actors** in test scenarios that model how **different people** perform different parts of a larger business process, such as reviewing and approving a loan application.
56
+ * It is also quite common to introduce **supporting actors** to perform **administrative tasks**, like setting up test data and environment, or **audit tasks**, like checking the logs or messages emitted to a message queue
57
+ * by the system under test.
58
+ *
59
+ * :::info The Stan Lee naming convention
60
+ * Actor names can be much more than just simple identifiers like `Alice` or `Bob`. While you can give your actors any names you like, a good convention to follow is to give them
61
+ * names indicating the [personae](https://articles.uie.com/goodwin_interview/) they represent or the role they play in the system.
62
+ *
63
+ * Just like the characters in [Stan Lee](https://en.wikipedia.org/wiki/Stan_Lee) graphic novels,
64
+ * actors in Serenity/JS test scenarios are often given alliterate names as a mnemonic device.
65
+ * Names like "Adam the Admin", "Edna the Editor", "Trevor the Traveller", are far more memorable than a generic "UI user" or "API user".
66
+ * They're also much easier for people to associate with the context, constraints, and affordances of the given actor.
67
+ * :::
68
+ *
69
+ * @group Screenplay Pattern
70
+ */
71
+ class Actor {
72
+ constructor(name, stage, abilities = new Map()) {
73
+ this.name = name;
74
+ this.stage = stage;
75
+ this.abilities = abilities;
76
+ }
77
+ /**
78
+ * Retrieves actor's {@apilink Ability} of `abilityType`, or one that extends `abilityType`.
79
+ *
80
+ * Please note that this method performs an {@apilink instanceof} check against abilities
81
+ * given to this actor via {@apilink Actor.whoCan}.
82
+ *
83
+ * Please also note that {@apilink Actor.whoCan} performs the same check when abilities are assigned to the actor
84
+ * to ensure the actor has at most one instance of a given ability type.
85
+ *
86
+ * @param abilityType
87
+ */
88
+ abilityTo(abilityType) {
89
+ const found = this.findAbilityTo(abilityType);
90
+ if (!found) {
91
+ if (this.abilities.size > 0) {
92
+ throw new errors_1.ConfigurationError(`${this.name} can ${Array.from(this.abilities.keys()).map(type => type.name).join(', ')}. ` +
93
+ `They can't, however, ${abilityType.name} yet. ` +
94
+ `Did you give them the ability to do so?`);
95
+ }
96
+ throw new errors_1.ConfigurationError(`${this.name} can't ${abilityType.name} yet. ` +
97
+ `Did you give them the ability to do so?`);
98
+ }
99
+ return found;
100
+ }
101
+ /**
102
+ * Instructs the actor to attempt to perform a number of {@apilink Activity|activities},
103
+ * so either {@apilink Task|Tasks} or {@apilink Interaction|Interactions}),
104
+ * one by one.
105
+ *
106
+ * @param {...activities: Activity[]} activities
107
+ */
108
+ attemptsTo(...activities) {
109
+ return activities
110
+ .map(activity => new TrackedActivity(activity, this.stage))
111
+ .reduce((previous, current) => {
112
+ return previous
113
+ // synchronise async operations like taking screenshots
114
+ .then(() => this.stage.waitForNextCue())
115
+ .then(() => {
116
+ /* todo: add an execution strategy */
117
+ return current.performAs(this);
118
+ });
119
+ }, this.initialiseAbilities());
120
+ }
121
+ /**
122
+ * Gives this Actor a list of {@apilink Ability|abilities} they can use
123
+ * to interact with the system under test or the test environment.
124
+ *
125
+ * @param abilities
126
+ * A vararg list of abilities to give the actor
127
+ *
128
+ * @returns
129
+ * The actor with newly gained abilities
130
+ *
131
+ * @throws {@apilink ConfigurationError}
132
+ * Throws a ConfigurationError if the actor already has an ability of this type.
133
+ */
134
+ whoCan(...abilities) {
135
+ abilities.forEach(ability => this.acquireAbility(ability));
136
+ return this;
137
+ }
138
+ /**
139
+ * @param answerable -
140
+ * An {@apilink Answerable} to answer (resolve the value of).
141
+ *
142
+ * @returns
143
+ * The answer to the Answerable
144
+ */
145
+ answer(answerable) {
146
+ function isAPromise(v) {
147
+ return Object.prototype.hasOwnProperty.call(v, 'then');
148
+ }
149
+ function isDefined(v) {
150
+ return !(v === undefined || v === null);
151
+ }
152
+ if (isDefined(answerable) && isAPromise(answerable)) {
153
+ return answerable;
154
+ }
155
+ if (isDefined(answerable) && Question_1.Question.isAQuestion(answerable)) {
156
+ return this.answer(answerable.answeredBy(this));
157
+ }
158
+ return Promise.resolve(answerable);
159
+ }
160
+ /**
161
+ * Announce collection of an {@apilink Artifact} so that it can be picked up by a {@apilink StageCrewMember}.
162
+ *
163
+ * @param artifact
164
+ * @param name
165
+ */
166
+ collect(artifact, name) {
167
+ this.stage.announce(new events_1.ActivityRelatedArtifactGenerated(this.stage.currentSceneId(), this.stage.currentActivityId(), this.nameFrom(name || new model_1.Name(artifact.constructor.name)), artifact, this.stage.currentTime()));
168
+ }
169
+ /**
170
+ * Instructs the actor to invoke {@apilink Discardable.discard} method on any
171
+ * {@apilink Discardable} {@apilink Ability} it's been configured with.
172
+ */
173
+ dismiss() {
174
+ return this.findAbilitiesOfType('discard')
175
+ .reduce((previous, ability) => previous.then(() => ability.discard()), Promise.resolve(void 0));
176
+ }
177
+ /**
178
+ * Returns a human-readable, string representation of this actor and their abilities.
179
+ *
180
+ * **PRO TIP:** To get the name of the actor, use {@apilink Actor.name}
181
+ */
182
+ toString() {
183
+ const abilities = Array.from(this.abilities.values()).map(ability => ability.constructor.name);
184
+ return `Actor(name=${this.name}, abilities=[${abilities.join(', ')}])`;
185
+ }
186
+ initialiseAbilities() {
187
+ return this.findAbilitiesOfType('initialise', 'isInitialised')
188
+ .filter(ability => !ability.isInitialised())
189
+ .reduce((previous, ability) => previous
190
+ .then(() => ability.initialise())
191
+ .catch(error => {
192
+ throw new errors_1.TestCompromisedError(`${this.name} couldn't initialise the ability to ${ability.constructor.name}`, error);
193
+ }), Promise.resolve(void 0));
194
+ }
195
+ findAbilitiesOfType(...methodNames) {
196
+ const abilitiesFrom = (map) => Array.from(map.values());
197
+ const abilitiesWithDesiredMethods = (ability) => methodNames.every(methodName => typeof (ability[methodName]) === 'function');
198
+ return abilitiesFrom(this.abilities)
199
+ .filter(abilitiesWithDesiredMethods);
200
+ }
201
+ findAbilityTo(doSomething) {
202
+ const abilityType = this.mostGenericTypeOf(doSomething);
203
+ return this.abilities.get(abilityType);
204
+ }
205
+ acquireAbility(ability) {
206
+ if (!(ability instanceof screenplay_1.Ability)) {
207
+ throw new errors_1.ConfigurationError(`Custom abilities must extend Ability from '@serenity-js/core'. Received ${(0, io_1.typeOf)(ability)}`);
208
+ }
209
+ const abilityType = this.mostGenericTypeOf(ability.constructor);
210
+ this.abilities.set(abilityType, ability);
211
+ }
212
+ mostGenericTypeOf(abilityType) {
213
+ const parentType = Object.getPrototypeOf(abilityType);
214
+ return !parentType || parentType === screenplay_1.Ability
215
+ ? abilityType
216
+ : this.mostGenericTypeOf(parentType);
217
+ }
218
+ /**
219
+ * Instantiates a {@apilink Name} based on the string value of the parameter,
220
+ * or returns the argument if it's already an instance of {@apilink Name}.
221
+ *
222
+ * @param maybeName
223
+ */
224
+ nameFrom(maybeName) {
225
+ return typeof maybeName === 'string'
226
+ ? new model_1.Name(maybeName)
227
+ : maybeName;
228
+ }
229
+ }
230
+ exports.Actor = Actor;
231
+ class ActivityDescriber {
232
+ describe(activity, actor) {
233
+ const template = activity.toString() === ({}).toString()
234
+ ? `#actor performs ${activity.constructor.name}`
235
+ : activity.toString();
236
+ return new model_1.Name(this.includeActorName(template, actor));
237
+ }
238
+ includeActorName(template, actor) {
239
+ return template.replace('#actor', actor.name);
240
+ }
241
+ }
242
+ class OutcomeMatcher {
243
+ outcomeFor(error) {
244
+ return (0, tiny_types_1.match)(error)
245
+ .when(errors_1.ImplementationPendingError, _ => new model_1.ImplementationPending(error))
246
+ .when(errors_1.TestCompromisedError, _ => new model_1.ExecutionCompromised(error))
247
+ .when(errors_1.AssertionError, _ => new model_1.ExecutionFailedWithAssertionError(error))
248
+ .when(Error, _ => /AssertionError/.test(error.constructor.name) // mocha
249
+ ? new model_1.ExecutionFailedWithAssertionError(error)
250
+ : new model_1.ExecutionFailedWithError(error))
251
+ .else(_ => new model_1.ExecutionFailedWithError(error));
252
+ }
253
+ }
254
+ class TrackedActivity extends Activity_1.Activity {
255
+ constructor(activity, stage) {
256
+ super(activity.toString(), activity.instantiationLocation());
257
+ this.activity = activity;
258
+ this.stage = stage;
259
+ }
260
+ performAs(actor) {
261
+ const sceneId = this.stage.currentSceneId();
262
+ const details = new model_1.ActivityDetails(TrackedActivity.describer.describe(this.activity, actor), this.activity.instantiationLocation());
263
+ const activityId = this.stage.assignNewActivityId(details);
264
+ const [activityStarts, activityFinished] = this.activity instanceof screenplay_1.Interaction
265
+ ? [events_1.InteractionStarts, events_1.InteractionFinished]
266
+ : [events_1.TaskStarts, events_1.TaskFinished];
267
+ return Promise.resolve()
268
+ .then(() => this.stage.announce(new activityStarts(sceneId, activityId, details, this.stage.currentTime())))
269
+ .then(() => this.activity.performAs(actor))
270
+ .then(() => {
271
+ const outcome = new model_1.ExecutionSuccessful();
272
+ this.stage.announce(new activityFinished(sceneId, activityId, details, outcome, this.stage.currentTime()));
273
+ })
274
+ .catch(error => {
275
+ const outcome = TrackedActivity.outcomes.outcomeFor(error);
276
+ this.stage.announce(new activityFinished(sceneId, activityId, details, outcome, this.stage.currentTime()));
277
+ throw error;
278
+ });
279
+ }
280
+ }
281
+ TrackedActivity.describer = new ActivityDescriber();
282
+ TrackedActivity.outcomes = new OutcomeMatcher();
283
+ //# sourceMappingURL=Actor.js.map
@@ -0,0 +1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BAAY,CAAE,CAAC;QAEnC,OAAO,OAAO,CAAC,OAAO,EAAE;aACnB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;aAC3G,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;aAC1C,IAAI,CAAC,GAAG,EAAE;YACP,MAAM,OAAO,GAAG,IAAI,2BAAmB,EAAE,CAAC;YAC1C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAC/G,CAAC,CAAC;aACD,KAAK,CAAC,KAAK,CAAC,EAAE;YACX,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC3D,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YAE3G,MAAM,KAAK,CAAC;QAChB,CAAC,CAAC,CAAC;IACX,CAAC;;AAnCyB,yBAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;AACpC,wBAAQ,GAAG,IAAI,cAAc,EAAE,CAAC"}
@@ -1,11 +1,9 @@
1
1
  import { Question } from './Question';
2
2
  /**
3
- * @desc
4
- * A union type that provides a convenient way to represent any value
5
- * that can be resolved by {@link Actor#answer}.
3
+ * A union type that provides a convenient way to represent any value
4
+ * that can be resolved by {@apilink Actor.answer}.
6
5
  *
7
- * @public
8
- *
9
- * @typedef {Question<Promise<T>> | Question<T> | Promise<T> | T} Answerable<T>
6
+ * @group Questions
10
7
  */
11
- export declare type Answerable<T> = Question<Promise<T>> | Question<T> | Promise<T> | T;
8
+ export type Answerable<T> = Question<Promise<T>> | Question<T> | Promise<T> | T;
9
+ //# sourceMappingURL=Answerable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Answerable.d.ts","sourceRoot":"","sources":["../../src/screenplay/Answerable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Question } from './Question';
2
+ /**
3
+ * Describes the type of answer a given {@apilink Answerable} would
4
+ * resolve to when given to {@apilink Actor.answer}.
5
+ *
6
+ * ```ts
7
+ * Answered<Answerable<T>> === T
8
+ * ```
9
+ *
10
+ * @group Questions
11
+ */
12
+ export type Answered<T> = T extends null | undefined ? T : T extends Question<Promise<infer A>> | Question<infer A> | Promise<infer A> ? Awaited<A> : T;
13
+ //# sourceMappingURL=Answered.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Answered.d.ts","sourceRoot":"","sources":["../../src/screenplay/Answered.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAClB,CAAC,SAAS,IAAI,GAAG,SAAS,GAAG,CAAC,GAC1B,CAAC,SAAS,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GACpF,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Ability.js.map
3
+ //# sourceMappingURL=Answered.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Answered.js","sourceRoot":"","sources":["../../src/screenplay/Answered.ts"],"names":[],"mappings":""}
@@ -1,27 +1,90 @@
1
+ import { UsesAbilities } from './abilities';
1
2
  import { Activity } from './Activity';
2
- import { AnswersQuestions, CollectsArtifacts, UsesAbilities } from './actor';
3
+ import { CollectsArtifacts } from './artifacts';
4
+ import { AnswersQuestions } from './questions';
3
5
  /**
4
- * @desc
5
- * Directly exercises the {@link Actor}'s {@link Ability} to interact
6
- * with the System Under Test.
6
+ * **Interactions** are low-level {@apilink Activity|activities} that encapsulate
7
+ * a handful of instructions for an {@apilink Actor|actor} on how to use their {@apilink Ability|abilities}
8
+ * to perform an individual interaction with the given interface of the system under test.
7
9
  *
8
- * @implements {Activity}
9
- * @see {@link Ability}
10
- * @see {@link Actor}
10
+ * :::tip Tasks or interactions?
11
+ * Because of their low-level nature, interactions are named using the vocabulary of the [solution domain](https://blog.mattwynne.net/2013/01/17/the-problem-with-solutions/),
12
+ * and represent an individual interaction with the given interface, e.g. {@apilink Click}, {@apilink Enter}, or {@apilink Send}.
13
+ *
14
+ * Interactions follow the [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single_responsibility_principle) which means that they do _one thing and one thing only_.
15
+ * If you're considering implementing an "interaction" that performs more than one logical activity, e.g. checks if the button is visible and then clicks on it if is,
16
+ * consider using separate interactions for separate responsibilities and then composing them using a {@apilink Task|task}.
17
+ * :::
18
+ *
19
+ * Interactions are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
20
+ * along with {@apilink Actor|Actors}, {@apilink Ability|Abilities}, {@apilink Question|Questions}, and {@apilink Task|Tasks}.
21
+ *
22
+ * ![Screenplay Pattern](/images/design/serenity-js-screenplay-pattern.png)
23
+ *
24
+ * Learn more about:
25
+ * - {@apilink Actor|Actor}
26
+ * - {@apilink Ability|Abilities}
27
+ * - {@apilink Activity|Activities}
28
+ *
29
+ * ## Writing a custom interaction
30
+ *
31
+ * [Serenity/JS modules](/handbook/about/architecture) ship with dozens of interactions to help you compose your test scenarios.
32
+ * However, if you need to interact with a non-standard interface, or want to create a flavour of a given interaction that behaves slightly differently than the built-in version,
33
+ * you can easily create your own implementations using the {@apilink Interaction.where} factory method.
34
+ *
35
+ * ```ts
36
+ * import { Actor, Interaction } from '@serenity-js/core'
37
+ * import { BrowseTheWeb, Page } from '@serenity-js/web'
38
+ *
39
+ * export const ClearLocalStorage = () =>
40
+ * Interaction.where(`#actor clears local storage`, async (actor: Actor) => {
41
+ * // Interaction to ClearLocalStorage directly uses Actor's ability to BrowseTheWeb
42
+ * const page: Page = await BrowseTheWeb.as(actor).currentPage()
43
+ * await page.executeScript(() => window.localStorage.clear())
44
+ * })
45
+ * ```
46
+ *
47
+ * ## Using a custom interaction
48
+ *
49
+ * ```ts
50
+ * import { actorCalled } from '@serenity-js/core';
51
+ * import { BrowseTheWebWithPlaywright } from '@serenity-js/playwright'
52
+ * import { By, Navigate, PageElement } from '@serenity-js/web'
53
+ * import { Ensure, equals } from '@serenity-js/assertions'
54
+ * import { Browser, chromium } from 'playwright'
55
+ *
56
+ * const browser = await chromium.launch({ headless: true })
57
+ *
58
+ * await actorCalled('Inês')
59
+ * .whoCan(BrowseTheWebWithPlaywright.using(browser))
60
+ * .attemptsTo(
61
+ * Navigate.to(`https://serenity-js.org`),
62
+ * ClearLocalStorage(), // reported as "Inês clears local storage"
63
+ * )
64
+ * ```
65
+ *
66
+ * @group Screenplay Pattern
11
67
  */
12
- export declare abstract class Interaction implements Activity {
13
- static where(description: string, interaction: (actor: UsesAbilities & AnswersQuestions & CollectsArtifacts) => PromiseLike<void> | void): Interaction;
68
+ export declare abstract class Interaction extends Activity {
69
+ /**
70
+ * @param description
71
+ * Description to be used when reporting this interaction, for example `#actor clears local storage`.
72
+ * Note that `#actor` will be replaced with the name of the actor performing this interaction.
73
+ *
74
+ * @param interaction
75
+ */
76
+ static where(description: string, interaction: (actor: UsesAbilities & AnswersQuestions & CollectsArtifacts) => Promise<void> | void): Interaction;
14
77
  /**
15
- * @desc
16
- * Makes the provided {@link Actor}
17
- * perform this {@link Interaction}.
78
+ * Instructs the provided {@apilink Actor} to perform this {@apilink Interaction}.
18
79
  *
19
- * @param {UsesAbilities & AnswersQuestions} actor
20
- * @returns {Promise<void>}
80
+ * #### Learn more
81
+ * - {@apilink Actor}
82
+ * - {@apilink PerformsActivities}
83
+ * - {@apilink UsesAbilities}
84
+ * - {@apilink AnswersQuestions}
21
85
  *
22
- * @see {@link Actor}
23
- * @see {@link UsesAbilities}
24
- * @see {@link AnswersQuestions}
86
+ * @param actor
25
87
  */
26
- abstract performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void>;
88
+ abstract performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
27
89
  }
90
+ //# sourceMappingURL=Interaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Interaction.d.ts","sourceRoot":"","sources":["../../src/screenplay/Interaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,8BAAsB,WAAY,SAAQ,QAAQ;IAE9C;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CACR,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GACnG,WAAW;IAId;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAC7E"}
@@ -1,16 +1,78 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Interaction = void 0;
4
+ const Activity_1 = require("./Activity");
4
5
  /**
5
- * @desc
6
- * Directly exercises the {@link Actor}'s {@link Ability} to interact
7
- * with the System Under Test.
6
+ * **Interactions** are low-level {@apilink Activity|activities} that encapsulate
7
+ * a handful of instructions for an {@apilink Actor|actor} on how to use their {@apilink Ability|abilities}
8
+ * to perform an individual interaction with the given interface of the system under test.
8
9
  *
9
- * @implements {Activity}
10
- * @see {@link Ability}
11
- * @see {@link Actor}
10
+ * :::tip Tasks or interactions?
11
+ * Because of their low-level nature, interactions are named using the vocabulary of the [solution domain](https://blog.mattwynne.net/2013/01/17/the-problem-with-solutions/),
12
+ * and represent an individual interaction with the given interface, e.g. {@apilink Click}, {@apilink Enter}, or {@apilink Send}.
13
+ *
14
+ * Interactions follow the [Single Responsibility Principle](https://en.wikipedia.org/wiki/Single_responsibility_principle) which means that they do _one thing and one thing only_.
15
+ * If you're considering implementing an "interaction" that performs more than one logical activity, e.g. checks if the button is visible and then clicks on it if is,
16
+ * consider using separate interactions for separate responsibilities and then composing them using a {@apilink Task|task}.
17
+ * :::
18
+ *
19
+ * Interactions are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
20
+ * along with {@apilink Actor|Actors}, {@apilink Ability|Abilities}, {@apilink Question|Questions}, and {@apilink Task|Tasks}.
21
+ *
22
+ * ![Screenplay Pattern](/images/design/serenity-js-screenplay-pattern.png)
23
+ *
24
+ * Learn more about:
25
+ * - {@apilink Actor|Actor}
26
+ * - {@apilink Ability|Abilities}
27
+ * - {@apilink Activity|Activities}
28
+ *
29
+ * ## Writing a custom interaction
30
+ *
31
+ * [Serenity/JS modules](/handbook/about/architecture) ship with dozens of interactions to help you compose your test scenarios.
32
+ * However, if you need to interact with a non-standard interface, or want to create a flavour of a given interaction that behaves slightly differently than the built-in version,
33
+ * you can easily create your own implementations using the {@apilink Interaction.where} factory method.
34
+ *
35
+ * ```ts
36
+ * import { Actor, Interaction } from '@serenity-js/core'
37
+ * import { BrowseTheWeb, Page } from '@serenity-js/web'
38
+ *
39
+ * export const ClearLocalStorage = () =>
40
+ * Interaction.where(`#actor clears local storage`, async (actor: Actor) => {
41
+ * // Interaction to ClearLocalStorage directly uses Actor's ability to BrowseTheWeb
42
+ * const page: Page = await BrowseTheWeb.as(actor).currentPage()
43
+ * await page.executeScript(() => window.localStorage.clear())
44
+ * })
45
+ * ```
46
+ *
47
+ * ## Using a custom interaction
48
+ *
49
+ * ```ts
50
+ * import { actorCalled } from '@serenity-js/core';
51
+ * import { BrowseTheWebWithPlaywright } from '@serenity-js/playwright'
52
+ * import { By, Navigate, PageElement } from '@serenity-js/web'
53
+ * import { Ensure, equals } from '@serenity-js/assertions'
54
+ * import { Browser, chromium } from 'playwright'
55
+ *
56
+ * const browser = await chromium.launch({ headless: true })
57
+ *
58
+ * await actorCalled('Inês')
59
+ * .whoCan(BrowseTheWebWithPlaywright.using(browser))
60
+ * .attemptsTo(
61
+ * Navigate.to(`https://serenity-js.org`),
62
+ * ClearLocalStorage(), // reported as "Inês clears local storage"
63
+ * )
64
+ * ```
65
+ *
66
+ * @group Screenplay Pattern
12
67
  */
13
- class Interaction {
68
+ class Interaction extends Activity_1.Activity {
69
+ /**
70
+ * @param description
71
+ * Description to be used when reporting this interaction, for example `#actor clears local storage`.
72
+ * Note that `#actor` will be replaced with the name of the actor performing this interaction.
73
+ *
74
+ * @param interaction
75
+ */
14
76
  static where(description, interaction) {
15
77
  return new DynamicallyGeneratedInteraction(description, interaction);
16
78
  }
@@ -21,20 +83,9 @@ exports.Interaction = Interaction;
21
83
  */
22
84
  class DynamicallyGeneratedInteraction extends Interaction {
23
85
  constructor(description, interaction) {
24
- super();
25
- this.description = description;
86
+ super(description, Interaction.callerLocation(4));
26
87
  this.interaction = interaction;
27
88
  }
28
- /**
29
- * @desc
30
- * Makes the provided {@link Actor}
31
- * perform this {@link Interaction}.
32
- *
33
- * @param {Actor} actor
34
- * @returns {Promise<void>}
35
- *
36
- * @see {@link Actor}
37
- */
38
89
  performAs(actor) {
39
90
  try {
40
91
  return Promise.resolve(this.interaction(actor));
@@ -43,14 +94,5 @@ class DynamicallyGeneratedInteraction extends Interaction {
43
94
  return Promise.reject(error);
44
95
  }
45
96
  }
46
- /**
47
- * @desc
48
- * Generates a description to be used when reporting this {@link Activity}.
49
- *
50
- * @returns {string}
51
- */
52
- toString() {
53
- return this.description;
54
- }
55
97
  }
56
98
  //# sourceMappingURL=Interaction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Interaction.js","sourceRoot":"","sources":["../../src/screenplay/Interaction.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;GAQG;AACH,MAAsB,WAAW;IAC7B,MAAM,CAAC,KAAK,CACR,WAAmB,EACnB,WAAsG;QAEtG,OAAO,IAAI,+BAA+B,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;CAeJ;AArBD,kCAqBC;AAED;;GAEG;AACH,MAAM,+BAAgC,SAAQ,WAAW;IACrD,YACqB,WAAmB,EACnB,WAAsG;QAEvH,KAAK,EAAE,CAAC;QAHS,gBAAW,GAAX,WAAW,CAAQ;QACnB,gBAAW,GAAX,WAAW,CAA2F;IAG3H,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CAAC,KAAY;QAClB,IAAI;YACA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;SACnD;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAChC;IACL,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACJ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CACJ"}
1
+ {"version":3,"file":"Interaction.js","sourceRoot":"","sources":["../../src/screenplay/Interaction.ts"],"names":[],"mappings":";;;AACA,yCAAsC;AAItC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,MAAsB,WAAY,SAAQ,mBAAQ;IAE9C;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CACR,WAAmB,EACnB,WAAkG;QAElG,OAAO,IAAI,+BAA+B,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;CAcJ;AA5BD,kCA4BC;AAED;;GAEG;AACH,MAAM,+BAAgC,SAAQ,WAAW;IACrD,YACI,WAAmB,EACF,WAAkG;QAEnH,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;QAFjC,gBAAW,GAAX,WAAW,CAAuF;IAGvH,CAAC;IAED,SAAS,CAAC,KAA2D;QACjE,IAAI;YACA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;SACnD;QAAC,OAAO,KAAK,EAAE;YACZ,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAChC;IACL,CAAC;CACJ"}
@@ -1,29 +1,26 @@
1
1
  import { Answerable } from './Answerable';
2
2
  /**
3
- * @desc
4
- * `Optional` is a container object, which holds a value that may or may not be "present",
3
+ * `Optional` is a container object, which holds a value that may or may not be "present",
5
4
  *
6
- * The meaning of being "present" depends on the context and typically means a value that:
7
- * - is other than `null` or `undefined`
8
- * - is retrievable, so retrieving it doesn't throw any errors
5
+ * The meaning of being "present" depends on the context and typically means a value that:
6
+ * - is other than `null` or `undefined`
7
+ * - is retrievable, so retrieving it doesn't throw any errors
9
8
  *
10
- * Additionally, `Optional` can also have a context-specific meaning. For example, `Optional#isPresent()`:
11
- * - in the context of a `PageElement` means that the element exists in the DOM.
12
- * - in the context of a `ModalWindow` means that the modal window is open.
13
- * - in the case of a REST API response, `LastResponse.body().books[0].author.name.isPresent()`
14
- * will inform us if a given entry exists (so `books[0].author.name`),
15
- * and if all the links of the property chain leading to the entry of interest exist too
16
- * (so `books` is present, and so is `books[0]`, `books[0].author`, `books[0].author.name`).
9
+ * Additionally, `Optional` can also have a context-specific meaning. For example, `Optional#isPresent()`:
10
+ * - in the context of a `PageElement` means that the element exists in the DOM.
11
+ * - in the context of a `ModalWindow` means that the modal window is open.
12
+ * - in the case of a REST API response, `LastResponse.body().books[0].author.name.isPresent()`
13
+ * will inform us if a given entry exists (so `books[0].author.name`),
14
+ * and if all the links of the property chain leading to the entry of interest exist too
15
+ * (so `books` is present, and so is `books[0]`, `books[0].author`, `books[0].author.name`).
17
16
  *
18
- * @public
17
+ * @group Questions
19
18
  */
20
19
  export interface Optional {
21
20
  /**
22
- * @desc
23
- * Returns an {@link Answerable} that resolves to `true` when the optional value
24
- * is present, `false` otherwise.
25
- *
26
- * @returns {Answerable<boolean>}
21
+ * Returns an {@apilink Answerable} that resolves to `true` when the optional value
22
+ * is present, `false` otherwise.
27
23
  */
28
24
  isPresent(): Answerable<boolean>;
29
25
  }
26
+ //# sourceMappingURL=Optional.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Optional.d.ts","sourceRoot":"","sources":["../../src/screenplay/Optional.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,QAAQ;IACrB;;;OAGG;IACH,SAAS,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;CACpC"}