@serenity-js/core 3.0.0-rc.9 → 3.0.0
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.
- package/CHANGELOG.md +207 -2146
- package/README.md +8 -10
- package/lib/Serenity.d.ts +145 -80
- package/lib/Serenity.d.ts.map +1 -0
- package/lib/Serenity.js +159 -86
- package/lib/Serenity.js.map +1 -1
- package/lib/adapter/OutputStream.d.ts +14 -0
- package/lib/adapter/OutputStream.d.ts.map +1 -0
- package/lib/{io → adapter}/OutputStream.js.map +1 -1
- package/lib/adapter/TestRunnerAdapter.d.ts +33 -0
- package/lib/adapter/TestRunnerAdapter.d.ts.map +1 -0
- package/lib/adapter/TestRunnerAdapter.js.map +1 -0
- package/lib/adapter/index.d.ts +3 -0
- package/lib/adapter/index.d.ts.map +1 -0
- package/lib/adapter/index.js +19 -0
- package/lib/adapter/index.js.map +1 -0
- package/lib/config/ClassDescription.d.ts +60 -0
- package/lib/config/ClassDescription.d.ts.map +1 -0
- package/lib/config/ClassDescription.js +3 -0
- package/lib/config/ClassDescription.js.map +1 -0
- package/lib/config/SerenityConfig.d.ts +73 -0
- package/lib/config/SerenityConfig.d.ts.map +1 -0
- package/lib/config/SerenityConfig.js +20 -0
- package/lib/config/SerenityConfig.js.map +1 -0
- package/lib/config/index.d.ts +3 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/config/index.js +19 -0
- package/lib/config/index.js.map +1 -0
- package/lib/errors/ErrorFactory.d.ts +16 -0
- package/lib/errors/ErrorFactory.d.ts.map +1 -0
- package/lib/errors/ErrorFactory.js +241 -0
- package/lib/errors/ErrorFactory.js.map +1 -0
- package/lib/errors/ErrorOptions.d.ts +16 -0
- package/lib/errors/ErrorOptions.d.ts.map +1 -0
- package/lib/errors/ErrorOptions.js +3 -0
- package/lib/errors/ErrorOptions.js.map +1 -0
- package/lib/errors/ErrorSerialiser.d.ts +14 -0
- package/lib/errors/ErrorSerialiser.d.ts.map +1 -0
- package/lib/{io → errors}/ErrorSerialiser.js +33 -7
- package/lib/errors/ErrorSerialiser.js.map +1 -0
- package/lib/errors/ErrorStackParser.d.ts +13 -0
- package/lib/errors/ErrorStackParser.d.ts.map +1 -0
- package/lib/errors/ErrorStackParser.js +42 -0
- package/lib/errors/ErrorStackParser.js.map +1 -0
- package/lib/errors/RaiseErrors.d.ts +57 -0
- package/lib/errors/RaiseErrors.d.ts.map +1 -0
- package/lib/errors/RaiseErrors.js +62 -0
- package/lib/errors/RaiseErrors.js.map +1 -0
- package/lib/errors/diff/AnsiDiffFormatter.d.ts +28 -0
- package/lib/errors/diff/AnsiDiffFormatter.d.ts.map +1 -0
- package/lib/errors/diff/AnsiDiffFormatter.js +38 -0
- package/lib/errors/diff/AnsiDiffFormatter.js.map +1 -0
- package/lib/errors/diff/DiffFormatter.d.ts +13 -0
- package/lib/errors/diff/DiffFormatter.d.ts.map +1 -0
- package/lib/errors/diff/DiffFormatter.js +3 -0
- package/lib/errors/diff/DiffFormatter.js.map +1 -0
- package/lib/errors/diff/NoOpDiffFormatter.d.ts +12 -0
- package/lib/errors/diff/NoOpDiffFormatter.d.ts.map +1 -0
- package/lib/errors/diff/NoOpDiffFormatter.js +21 -0
- package/lib/errors/diff/NoOpDiffFormatter.js.map +1 -0
- package/lib/errors/diff/index.d.ts +4 -0
- package/lib/errors/diff/index.d.ts.map +1 -0
- package/lib/errors/diff/index.js +20 -0
- package/lib/errors/diff/index.js.map +1 -0
- package/lib/errors/index.d.ts +8 -7
- package/lib/errors/index.d.ts.map +1 -0
- package/lib/errors/index.js +23 -8
- package/lib/errors/index.js.map +1 -1
- package/lib/errors/model/AssertionError.d.ts +16 -0
- package/lib/errors/model/AssertionError.d.ts.map +1 -0
- package/lib/errors/model/AssertionError.js +26 -0
- package/lib/errors/model/AssertionError.js.map +1 -0
- package/lib/errors/model/ConfigurationError.d.ts +16 -0
- package/lib/errors/model/ConfigurationError.d.ts.map +1 -0
- package/lib/errors/model/ConfigurationError.js +26 -0
- package/lib/errors/model/ConfigurationError.js.map +1 -0
- package/lib/errors/model/ImplementationPendingError.d.ts +37 -0
- package/lib/errors/model/ImplementationPendingError.d.ts.map +1 -0
- package/lib/errors/model/ImplementationPendingError.js +47 -0
- package/lib/errors/model/ImplementationPendingError.js.map +1 -0
- package/lib/errors/model/ListItemNotFoundError.d.ts +20 -0
- package/lib/errors/model/ListItemNotFoundError.d.ts.map +1 -0
- package/lib/errors/model/ListItemNotFoundError.js +30 -0
- package/lib/errors/model/ListItemNotFoundError.js.map +1 -0
- package/lib/errors/model/LogicError.d.ts +20 -0
- package/lib/errors/model/LogicError.d.ts.map +1 -0
- package/lib/errors/model/LogicError.js +30 -0
- package/lib/errors/model/LogicError.js.map +1 -0
- package/lib/errors/model/OperationInterruptedError.d.ts +20 -0
- package/lib/errors/model/OperationInterruptedError.d.ts.map +1 -0
- package/lib/errors/model/OperationInterruptedError.js +30 -0
- package/lib/errors/model/OperationInterruptedError.js.map +1 -0
- package/lib/errors/model/RuntimeError.d.ts +80 -0
- package/lib/errors/model/RuntimeError.d.ts.map +1 -0
- package/lib/errors/model/RuntimeError.js +97 -0
- package/lib/errors/model/RuntimeError.js.map +1 -0
- package/lib/errors/model/TestCompromisedError.d.ts +31 -0
- package/lib/errors/model/TestCompromisedError.d.ts.map +1 -0
- package/lib/errors/model/TestCompromisedError.js +41 -0
- package/lib/errors/model/TestCompromisedError.js.map +1 -0
- package/lib/errors/model/TimeoutExpiredError.d.ts +20 -0
- package/lib/errors/model/TimeoutExpiredError.d.ts.map +1 -0
- package/lib/errors/model/TimeoutExpiredError.js +30 -0
- package/lib/errors/model/TimeoutExpiredError.js.map +1 -0
- package/lib/errors/model/UnknownError.d.ts +16 -0
- package/lib/errors/model/UnknownError.d.ts.map +1 -0
- package/lib/errors/model/UnknownError.js +26 -0
- package/lib/errors/model/UnknownError.js.map +1 -0
- package/lib/errors/model/index.d.ts +11 -0
- package/lib/errors/model/index.d.ts.map +1 -0
- package/lib/errors/model/index.js +27 -0
- package/lib/errors/model/index.js.map +1 -0
- package/lib/events/ActivityFinished.d.ts +5 -5
- package/lib/events/ActivityFinished.d.ts.map +1 -0
- package/lib/events/ActivityFinished.js +2 -4
- package/lib/events/ActivityFinished.js.map +1 -1
- package/lib/events/ActivityRelatedArtifactArchived.d.ts +6 -1
- package/lib/events/ActivityRelatedArtifactArchived.d.ts.map +1 -0
- package/lib/events/ActivityRelatedArtifactArchived.js +7 -3
- package/lib/events/ActivityRelatedArtifactArchived.js.map +1 -1
- package/lib/events/ActivityRelatedArtifactGenerated.d.ts +6 -1
- package/lib/events/ActivityRelatedArtifactGenerated.d.ts.map +1 -0
- package/lib/events/ActivityRelatedArtifactGenerated.js +7 -3
- package/lib/events/ActivityRelatedArtifactGenerated.js.map +1 -1
- package/lib/events/ActivityStarts.d.ts +5 -5
- package/lib/events/ActivityStarts.d.ts.map +1 -0
- package/lib/events/ActivityStarts.js +2 -4
- package/lib/events/ActivityStarts.js.map +1 -1
- package/lib/events/ArtifactArchived.d.ts +6 -1
- package/lib/events/ArtifactArchived.d.ts.map +1 -0
- package/lib/events/ArtifactArchived.js +7 -3
- package/lib/events/ArtifactArchived.js.map +1 -1
- package/lib/events/ArtifactGenerated.d.ts +6 -1
- package/lib/events/ArtifactGenerated.d.ts.map +1 -0
- package/lib/events/ArtifactGenerated.js +7 -3
- package/lib/events/ArtifactGenerated.js.map +1 -1
- package/lib/events/AsyncOperationAborted.d.ts +14 -0
- package/lib/events/AsyncOperationAborted.d.ts.map +1 -0
- package/lib/events/AsyncOperationAborted.js +24 -0
- package/lib/events/AsyncOperationAborted.js.map +1 -0
- package/lib/events/AsyncOperationAttempted.d.ts +9 -3
- package/lib/events/AsyncOperationAttempted.d.ts.map +1 -0
- package/lib/events/AsyncOperationAttempted.js +12 -6
- package/lib/events/AsyncOperationAttempted.js.map +1 -1
- package/lib/events/AsyncOperationCompleted.d.ts +7 -3
- package/lib/events/AsyncOperationCompleted.d.ts.map +1 -0
- package/lib/events/AsyncOperationCompleted.js +8 -6
- package/lib/events/AsyncOperationCompleted.js.map +1 -1
- package/lib/events/AsyncOperationFailed.d.ts +6 -1
- package/lib/events/AsyncOperationFailed.d.ts.map +1 -0
- package/lib/events/AsyncOperationFailed.js +9 -5
- package/lib/events/AsyncOperationFailed.js.map +1 -1
- package/lib/events/BusinessRuleDetected.d.ts +6 -5
- package/lib/events/BusinessRuleDetected.d.ts.map +1 -0
- package/lib/events/BusinessRuleDetected.js +7 -7
- package/lib/events/BusinessRuleDetected.js.map +1 -1
- package/lib/events/DomainEvent.d.ts +5 -7
- package/lib/events/DomainEvent.d.ts.map +1 -0
- package/lib/events/DomainEvent.js +5 -8
- package/lib/events/DomainEvent.js.map +1 -1
- package/lib/events/FeatureNarrativeDetected.d.ts +6 -1
- package/lib/events/FeatureNarrativeDetected.d.ts.map +1 -0
- package/lib/events/FeatureNarrativeDetected.js +7 -3
- package/lib/events/FeatureNarrativeDetected.js.map +1 -1
- package/lib/events/InteractionFinished.d.ts +4 -0
- package/lib/events/InteractionFinished.d.ts.map +1 -0
- package/lib/events/InteractionFinished.js +5 -1
- package/lib/events/InteractionFinished.js.map +1 -1
- package/lib/events/InteractionStarts.d.ts +4 -0
- package/lib/events/InteractionStarts.d.ts.map +1 -0
- package/lib/events/InteractionStarts.js +5 -1
- package/lib/events/InteractionStarts.js.map +1 -1
- package/lib/events/RetryableSceneDetected.d.ts +9 -10
- package/lib/events/RetryableSceneDetected.d.ts.map +1 -0
- package/lib/events/RetryableSceneDetected.js +13 -15
- package/lib/events/RetryableSceneDetected.js.map +1 -1
- package/lib/events/SceneBackgroundDetected.d.ts +6 -1
- package/lib/events/SceneBackgroundDetected.d.ts.map +1 -0
- package/lib/events/SceneBackgroundDetected.js +8 -5
- package/lib/events/SceneBackgroundDetected.js.map +1 -1
- package/lib/events/SceneDescriptionDetected.d.ts +6 -1
- package/lib/events/SceneDescriptionDetected.d.ts.map +1 -0
- package/lib/events/SceneDescriptionDetected.js +7 -3
- package/lib/events/SceneDescriptionDetected.js.map +1 -1
- package/lib/events/SceneFinished.d.ts +6 -1
- package/lib/events/SceneFinished.d.ts.map +1 -0
- package/lib/events/SceneFinished.js +7 -3
- package/lib/events/SceneFinished.js.map +1 -1
- package/lib/events/SceneFinishes.d.ts +10 -4
- package/lib/events/SceneFinishes.d.ts.map +1 -0
- package/lib/events/SceneFinishes.js +11 -8
- package/lib/events/SceneFinishes.js.map +1 -1
- package/lib/events/SceneParametersDetected.d.ts +6 -1
- package/lib/events/SceneParametersDetected.d.ts.map +1 -0
- package/lib/events/SceneParametersDetected.js +7 -3
- package/lib/events/SceneParametersDetected.js.map +1 -1
- package/lib/events/SceneSequenceDetected.d.ts +6 -1
- package/lib/events/SceneSequenceDetected.d.ts.map +1 -0
- package/lib/events/SceneSequenceDetected.js +7 -3
- package/lib/events/SceneSequenceDetected.js.map +1 -1
- package/lib/events/SceneStarts.d.ts +6 -1
- package/lib/events/SceneStarts.d.ts.map +1 -0
- package/lib/events/SceneStarts.js +7 -3
- package/lib/events/SceneStarts.js.map +1 -1
- package/lib/events/SceneTagged.d.ts +6 -1
- package/lib/events/SceneTagged.d.ts.map +1 -0
- package/lib/events/SceneTagged.js +7 -3
- package/lib/events/SceneTagged.js.map +1 -1
- package/lib/events/SceneTemplateDetected.d.ts +6 -1
- package/lib/events/SceneTemplateDetected.d.ts.map +1 -0
- package/lib/events/SceneTemplateDetected.js +7 -3
- package/lib/events/SceneTemplateDetected.js.map +1 -1
- package/lib/events/TaskFinished.d.ts +4 -0
- package/lib/events/TaskFinished.d.ts.map +1 -0
- package/lib/events/TaskFinished.js +5 -1
- package/lib/events/TaskFinished.js.map +1 -1
- package/lib/events/TaskStarts.d.ts +4 -0
- package/lib/events/TaskStarts.d.ts.map +1 -0
- package/lib/events/TaskStarts.js +5 -1
- package/lib/events/TaskStarts.js.map +1 -1
- package/lib/events/TestRunFinished.d.ts +10 -5
- package/lib/events/TestRunFinished.d.ts.map +1 -0
- package/lib/events/TestRunFinished.js +8 -5
- package/lib/events/TestRunFinished.js.map +1 -1
- package/lib/events/TestRunFinishes.d.ts +6 -4
- package/lib/events/TestRunFinishes.d.ts.map +1 -0
- package/lib/events/TestRunFinishes.js +6 -5
- package/lib/events/TestRunFinishes.js.map +1 -1
- package/lib/events/TestRunStarts.d.ts +4 -4
- package/lib/events/TestRunStarts.d.ts.map +1 -0
- package/lib/events/TestRunStarts.js +4 -5
- package/lib/events/TestRunStarts.js.map +1 -1
- package/lib/events/TestRunnerDetected.d.ts +6 -2
- package/lib/events/TestRunnerDetected.d.ts.map +1 -0
- package/lib/events/TestRunnerDetected.js +9 -7
- package/lib/events/TestRunnerDetected.js.map +1 -1
- package/lib/events/TestSuiteFinished.d.ts +6 -1
- package/lib/events/TestSuiteFinished.d.ts.map +1 -0
- package/lib/events/TestSuiteFinished.js +7 -3
- package/lib/events/TestSuiteFinished.js.map +1 -1
- package/lib/events/TestSuiteStarts.d.ts +6 -1
- package/lib/events/TestSuiteStarts.d.ts.map +1 -0
- package/lib/events/TestSuiteStarts.js +7 -3
- package/lib/events/TestSuiteStarts.js.map +1 -1
- package/lib/events/index.d.ts +2 -0
- package/lib/events/index.d.ts.map +1 -0
- package/lib/events/index.js +6 -1
- package/lib/events/index.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -7
- package/lib/index.js.map +1 -1
- package/lib/instance.d.ts +180 -90
- package/lib/instance.d.ts.map +1 -0
- package/lib/instance.js +179 -90
- package/lib/instance.js.map +1 -1
- package/lib/io/Config.d.ts +2 -1
- package/lib/io/Config.d.ts.map +1 -0
- package/lib/io/FileFinder.d.ts +1 -0
- package/lib/io/FileFinder.d.ts.map +1 -0
- package/lib/io/FileFinder.js +5 -2
- package/lib/io/FileFinder.js.map +1 -1
- package/lib/io/FileSystem.d.ts +3 -0
- package/lib/io/FileSystem.d.ts.map +1 -0
- package/lib/io/FileSystem.js +30 -4
- package/lib/io/FileSystem.js.map +1 -1
- package/lib/io/FileSystemLocation.d.ts +1 -0
- package/lib/io/FileSystemLocation.d.ts.map +1 -0
- package/lib/io/FileSystemLocation.js +3 -3
- package/lib/io/FileSystemLocation.js.map +1 -1
- package/lib/io/Path.d.ts +2 -0
- package/lib/io/Path.d.ts.map +1 -0
- package/lib/io/Path.js +22 -16
- package/lib/io/Path.js.map +1 -1
- package/lib/io/asyncMap.d.ts +4 -4
- package/lib/io/asyncMap.d.ts.map +1 -0
- package/lib/io/asyncMap.js +5 -5
- package/lib/io/asyncMap.js.map +1 -1
- package/lib/io/commaSeparated.d.ts +6 -6
- package/lib/io/commaSeparated.d.ts.map +1 -0
- package/lib/io/commaSeparated.js +8 -9
- package/lib/io/commaSeparated.js.map +1 -1
- package/lib/io/format.d.ts +46 -19
- package/lib/io/format.d.ts.map +1 -0
- package/lib/io/format.js +48 -22
- package/lib/io/format.js.map +1 -1
- package/lib/io/index.d.ts +4 -9
- package/lib/io/index.d.ts.map +1 -0
- package/lib/io/index.js +8 -10
- package/lib/io/index.js.map +1 -1
- package/lib/io/inspected.d.ts +4 -19
- package/lib/io/inspected.d.ts.map +1 -0
- package/lib/io/inspected.js +11 -222
- package/lib/io/inspected.js.map +1 -1
- package/lib/io/inspectedObject.d.ts +4 -0
- package/lib/io/inspectedObject.d.ts.map +1 -0
- package/lib/io/inspectedObject.js +55 -0
- package/lib/io/inspectedObject.js.map +1 -0
- package/lib/io/loader/ClassDescriptionParser.d.ts +8 -0
- package/lib/io/loader/ClassDescriptionParser.d.ts.map +1 -0
- package/lib/io/loader/ClassDescriptionParser.js +52 -0
- package/lib/io/loader/ClassDescriptionParser.js.map +1 -0
- package/lib/io/loader/ClassDescriptor.d.ts +7 -0
- package/lib/io/loader/ClassDescriptor.d.ts.map +1 -0
- package/lib/io/loader/ClassDescriptor.js +3 -0
- package/lib/io/loader/ClassDescriptor.js.map +1 -0
- package/lib/io/loader/ClassLoader.d.ts +11 -0
- package/lib/io/loader/ClassLoader.d.ts.map +1 -0
- package/lib/io/loader/ClassLoader.js +34 -0
- package/lib/io/loader/ClassLoader.js.map +1 -0
- package/lib/io/{ModuleLoader.d.ts → loader/ModuleLoader.d.ts} +11 -18
- package/lib/io/loader/ModuleLoader.d.ts.map +1 -0
- package/lib/io/loader/ModuleLoader.js +96 -0
- package/lib/io/loader/ModuleLoader.js.map +1 -0
- package/lib/io/{Version.d.ts → loader/Version.d.ts} +2 -4
- package/lib/io/loader/Version.d.ts.map +1 -0
- package/lib/io/{Version.js → loader/Version.js} +14 -14
- package/lib/io/loader/Version.js.map +1 -0
- package/lib/io/loader/index.d.ts +6 -0
- package/lib/io/loader/index.d.ts.map +1 -0
- package/lib/io/loader/index.js +22 -0
- package/lib/io/loader/index.js.map +1 -0
- package/lib/io/proxies.d.ts +1 -0
- package/lib/io/proxies.d.ts.map +1 -0
- package/lib/io/reflection/has.d.ts +4 -5
- package/lib/io/reflection/has.d.ts.map +1 -0
- package/lib/io/reflection/has.js +3 -5
- package/lib/io/reflection/has.js.map +1 -1
- package/lib/io/reflection/index.d.ts +3 -0
- package/lib/io/reflection/index.d.ts.map +1 -0
- package/lib/io/reflection/index.js +7 -1
- package/lib/io/reflection/index.js.map +1 -1
- package/lib/io/reflection/isPrimitive.d.ts +8 -0
- package/lib/io/reflection/isPrimitive.d.ts.map +1 -0
- package/lib/io/reflection/isPrimitive.js +24 -0
- package/lib/io/reflection/isPrimitive.js.map +1 -0
- package/lib/io/reflection/typeOf.d.ts +7 -0
- package/lib/io/reflection/typeOf.d.ts.map +1 -0
- package/lib/io/reflection/typeOf.js +35 -0
- package/lib/io/reflection/typeOf.js.map +1 -0
- package/lib/io/stringified.d.ts +24 -0
- package/lib/io/stringified.d.ts.map +1 -0
- package/lib/io/stringified.js +220 -0
- package/lib/io/stringified.js.map +1 -0
- package/lib/io/trimmed.d.ts +6 -7
- package/lib/io/trimmed.d.ts.map +1 -0
- package/lib/io/trimmed.js +6 -8
- package/lib/io/trimmed.js.map +1 -1
- package/lib/model/ActivityDetails.d.ts +9 -1
- package/lib/model/ActivityDetails.d.ts.map +1 -0
- package/lib/model/ActivityDetails.js +9 -4
- package/lib/model/ActivityDetails.js.map +1 -1
- package/lib/model/Artifact.d.ts +2 -1
- package/lib/model/Artifact.d.ts.map +1 -0
- package/lib/model/Artifact.js +29 -6
- package/lib/model/Artifact.js.map +1 -1
- package/lib/model/BusinessRule.d.ts +1 -0
- package/lib/model/BusinessRule.d.ts.map +1 -0
- package/lib/model/BusinessRule.js +3 -3
- package/lib/model/BusinessRule.js.map +1 -1
- package/lib/model/Category.d.ts +1 -0
- package/lib/model/Category.d.ts.map +1 -0
- package/lib/model/Category.js +3 -3
- package/lib/model/Category.js.map +1 -1
- package/lib/model/CorrelationId.d.ts +1 -0
- package/lib/model/CorrelationId.d.ts.map +1 -0
- package/lib/model/CorrelationId.js +5 -2
- package/lib/model/CorrelationId.js.map +1 -1
- package/lib/model/Description.d.ts +1 -0
- package/lib/model/Description.d.ts.map +1 -0
- package/lib/model/Description.js +3 -3
- package/lib/model/Description.js.map +1 -1
- package/lib/model/Name.d.ts +1 -0
- package/lib/model/Name.d.ts.map +1 -0
- package/lib/model/Name.js +3 -3
- package/lib/model/Name.js.map +1 -1
- package/lib/model/ScenarioDetails.d.ts +1 -0
- package/lib/model/ScenarioDetails.d.ts.map +1 -0
- package/lib/model/ScenarioDetails.js +6 -3
- package/lib/model/ScenarioDetails.js.map +1 -1
- package/lib/model/ScenarioParameters.d.ts +1 -0
- package/lib/model/ScenarioParameters.d.ts.map +1 -0
- package/lib/model/ScenarioParameters.js +3 -3
- package/lib/model/ScenarioParameters.js.map +1 -1
- package/lib/model/TestSuiteDetails.d.ts +1 -0
- package/lib/model/TestSuiteDetails.d.ts.map +1 -0
- package/lib/model/TestSuiteDetails.js +3 -3
- package/lib/model/TestSuiteDetails.js.map +1 -1
- package/lib/model/artifacts/HTTPRequestResponse.d.ts +6 -13
- package/lib/model/artifacts/HTTPRequestResponse.d.ts.map +1 -0
- package/lib/model/artifacts/HTTPRequestResponse.js +1 -4
- package/lib/model/artifacts/HTTPRequestResponse.js.map +1 -1
- package/lib/model/artifacts/JSONData.d.ts +1 -0
- package/lib/model/artifacts/JSONData.d.ts.map +1 -0
- package/lib/model/artifacts/LogEntry.d.ts +1 -0
- package/lib/model/artifacts/LogEntry.d.ts.map +1 -0
- package/lib/model/artifacts/Photo.d.ts +1 -8
- package/lib/model/artifacts/Photo.d.ts.map +1 -0
- package/lib/model/artifacts/Photo.js +0 -8
- package/lib/model/artifacts/Photo.js.map +1 -1
- package/lib/model/artifacts/TestReport.d.ts +1 -0
- package/lib/model/artifacts/TestReport.d.ts.map +1 -0
- package/lib/model/artifacts/TextData.d.ts +1 -0
- package/lib/model/artifacts/TextData.d.ts.map +1 -0
- package/lib/model/artifacts/index.d.ts +1 -1
- package/lib/model/artifacts/index.d.ts.map +1 -0
- package/lib/model/artifacts/index.js +5 -2
- package/lib/model/artifacts/index.js.map +1 -1
- package/lib/model/index.d.ts +1 -2
- package/lib/model/index.d.ts.map +1 -0
- package/lib/model/index.js +5 -3
- package/lib/model/index.js.map +1 -1
- package/lib/model/outcomes.d.ts +1 -0
- package/lib/model/outcomes.d.ts.map +1 -0
- package/lib/model/outcomes.js +7 -7
- package/lib/model/outcomes.js.map +1 -1
- package/lib/model/tags/ArbitraryTag.d.ts +3 -5
- package/lib/model/tags/ArbitraryTag.d.ts.map +1 -0
- package/lib/model/tags/ArbitraryTag.js +2 -5
- package/lib/model/tags/ArbitraryTag.js.map +1 -1
- package/lib/model/tags/BrowserTag.d.ts +1 -0
- package/lib/model/tags/BrowserTag.d.ts.map +1 -0
- package/lib/model/tags/BrowserTag.js +3 -3
- package/lib/model/tags/BrowserTag.js.map +1 -1
- package/lib/model/tags/CapabilityTag.d.ts +1 -0
- package/lib/model/tags/CapabilityTag.d.ts.map +1 -0
- package/lib/model/tags/ExecutionRetriedTag.d.ts +3 -5
- package/lib/model/tags/ExecutionRetriedTag.d.ts.map +1 -0
- package/lib/model/tags/ExecutionRetriedTag.js +5 -8
- package/lib/model/tags/ExecutionRetriedTag.js.map +1 -1
- package/lib/model/tags/FeatureTag.d.ts +1 -0
- package/lib/model/tags/FeatureTag.d.ts.map +1 -0
- package/lib/model/tags/IssueTag.d.ts +1 -0
- package/lib/model/tags/IssueTag.d.ts.map +1 -0
- package/lib/model/tags/ManualTag.d.ts +1 -0
- package/lib/model/tags/ManualTag.d.ts.map +1 -0
- package/lib/model/tags/PlatformTag.d.ts +1 -0
- package/lib/model/tags/PlatformTag.d.ts.map +1 -0
- package/lib/model/tags/PlatformTag.js +3 -3
- package/lib/model/tags/PlatformTag.js.map +1 -1
- package/lib/model/tags/Tag.d.ts +1 -0
- package/lib/model/tags/Tag.d.ts.map +1 -0
- package/lib/model/tags/Tag.js +31 -8
- package/lib/model/tags/Tag.js.map +1 -1
- package/lib/model/tags/Tags.d.ts +1 -0
- package/lib/model/tags/Tags.d.ts.map +1 -0
- package/lib/model/tags/ThemeTag.d.ts +1 -0
- package/lib/model/tags/ThemeTag.d.ts.map +1 -0
- package/lib/model/tags/index.d.ts +1 -1
- package/lib/model/tags/index.d.ts.map +1 -0
- package/lib/model/tags/index.js +5 -2
- package/lib/model/tags/index.js.map +1 -1
- package/lib/screenplay/Activity.d.ts +35 -19
- package/lib/screenplay/Activity.d.ts.map +1 -0
- package/lib/screenplay/Activity.js +74 -0
- package/lib/screenplay/Activity.js.map +1 -1
- package/lib/screenplay/Actor.d.ts +146 -0
- package/lib/screenplay/Actor.d.ts.map +1 -0
- package/lib/screenplay/Actor.js +283 -0
- package/lib/screenplay/Actor.js.map +1 -0
- package/lib/screenplay/Answerable.d.ts +5 -7
- package/lib/screenplay/Answerable.d.ts.map +1 -0
- package/lib/screenplay/Answered.d.ts +13 -0
- package/lib/screenplay/Answered.d.ts.map +1 -0
- package/lib/screenplay/{Ability.js → Answered.js} +1 -1
- package/lib/screenplay/Answered.js.map +1 -0
- package/lib/screenplay/Interaction.d.ts +81 -18
- package/lib/screenplay/Interaction.d.ts.map +1 -0
- package/lib/screenplay/Interaction.js +70 -28
- package/lib/screenplay/Interaction.js.map +1 -1
- package/lib/screenplay/Optional.d.ts +15 -18
- package/lib/screenplay/Optional.d.ts.map +1 -0
- package/lib/screenplay/Question.d.ts +201 -70
- package/lib/screenplay/Question.d.ts.map +1 -0
- package/lib/screenplay/Question.js +295 -75
- package/lib/screenplay/Question.js.map +1 -1
- package/lib/screenplay/RecursivelyAnswered.d.ts +40 -0
- package/lib/screenplay/RecursivelyAnswered.d.ts.map +1 -0
- package/lib/screenplay/RecursivelyAnswered.js +3 -0
- package/lib/screenplay/RecursivelyAnswered.js.map +1 -0
- package/lib/screenplay/Task.d.ts +180 -40
- package/lib/screenplay/Task.d.ts.map +1 -0
- package/lib/screenplay/Task.js +175 -76
- package/lib/screenplay/Task.js.map +1 -1
- package/lib/screenplay/WithAnswerableProperties.d.ts +33 -0
- package/lib/screenplay/WithAnswerableProperties.d.ts.map +1 -0
- package/lib/screenplay/WithAnswerableProperties.js +3 -0
- package/lib/screenplay/WithAnswerableProperties.js.map +1 -0
- package/lib/screenplay/abilities/Ability.d.ts +397 -0
- package/lib/screenplay/abilities/Ability.d.ts.map +1 -0
- package/lib/screenplay/abilities/Ability.js +401 -0
- package/lib/screenplay/abilities/Ability.js.map +1 -0
- package/lib/screenplay/abilities/AbilityType.d.ts +45 -0
- package/lib/screenplay/abilities/AbilityType.d.ts.map +1 -0
- package/lib/screenplay/abilities/AbilityType.js.map +1 -0
- package/lib/screenplay/abilities/CanHaveAbilities.d.ts +19 -0
- package/lib/screenplay/abilities/CanHaveAbilities.d.ts.map +1 -0
- package/lib/screenplay/abilities/CanHaveAbilities.js.map +1 -0
- package/lib/screenplay/abilities/Discardable.d.ts +19 -7
- package/lib/screenplay/abilities/Discardable.d.ts.map +1 -0
- package/lib/screenplay/abilities/Initialisable.d.ts +18 -16
- package/lib/screenplay/abilities/Initialisable.d.ts.map +1 -0
- package/lib/screenplay/abilities/UsesAbilities.d.ts +23 -0
- package/lib/screenplay/abilities/UsesAbilities.d.ts.map +1 -0
- package/lib/screenplay/abilities/UsesAbilities.js.map +1 -0
- package/lib/screenplay/abilities/index.d.ts +5 -1
- package/lib/screenplay/abilities/index.d.ts.map +1 -0
- package/lib/screenplay/abilities/index.js +9 -2
- package/lib/screenplay/abilities/index.js.map +1 -1
- package/lib/screenplay/activities/PerformsActivities.d.ts +20 -0
- package/lib/screenplay/activities/PerformsActivities.d.ts.map +1 -0
- package/lib/screenplay/activities/PerformsActivities.js.map +1 -0
- package/lib/screenplay/activities/index.d.ts +2 -1
- package/lib/screenplay/activities/index.d.ts.map +1 -0
- package/lib/screenplay/activities/index.js +6 -2
- package/lib/screenplay/activities/index.js.map +1 -1
- package/lib/screenplay/artifacts/CollectsArtifacts.d.ts +24 -0
- package/lib/screenplay/artifacts/CollectsArtifacts.d.ts.map +1 -0
- package/lib/screenplay/artifacts/CollectsArtifacts.js.map +1 -0
- package/lib/screenplay/artifacts/index.d.ts +2 -0
- package/lib/screenplay/artifacts/index.d.ts.map +1 -0
- package/lib/screenplay/{actor → artifacts}/index.js +5 -6
- package/lib/screenplay/artifacts/index.js.map +1 -0
- package/lib/screenplay/debugging/Debug.d.ts +107 -0
- package/lib/screenplay/debugging/Debug.d.ts.map +1 -0
- package/lib/screenplay/debugging/Debug.js +131 -0
- package/lib/screenplay/debugging/Debug.js.map +1 -0
- package/lib/screenplay/debugging/DebuggingResult.d.ts +11 -0
- package/lib/screenplay/debugging/DebuggingResult.d.ts.map +1 -0
- package/lib/screenplay/debugging/DebuggingResult.js +3 -0
- package/lib/screenplay/debugging/DebuggingResult.js.map +1 -0
- package/lib/screenplay/debugging/Log.d.ts +47 -0
- package/lib/screenplay/debugging/Log.d.ts.map +1 -0
- package/lib/screenplay/debugging/Log.js +59 -0
- package/lib/screenplay/debugging/Log.js.map +1 -0
- package/lib/screenplay/debugging/index.d.ts +4 -0
- package/lib/screenplay/debugging/index.d.ts.map +1 -0
- package/lib/screenplay/debugging/index.js +20 -0
- package/lib/screenplay/debugging/index.js.map +1 -0
- package/lib/screenplay/index.d.ts +10 -4
- package/lib/screenplay/index.d.ts.map +1 -0
- package/lib/screenplay/index.js +14 -5
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/notes/ChainableSetter.d.ts +9 -0
- package/lib/screenplay/notes/ChainableSetter.d.ts.map +1 -0
- package/lib/screenplay/notes/ChainableSetter.js +3 -0
- package/lib/screenplay/notes/ChainableSetter.js.map +1 -0
- package/lib/screenplay/notes/Notepad.d.ts +164 -0
- package/lib/screenplay/notes/Notepad.d.ts.map +1 -0
- package/lib/screenplay/notes/Notepad.js +200 -0
- package/lib/screenplay/notes/Notepad.js.map +1 -0
- package/lib/screenplay/notes/NotepadAdapter.d.ts +245 -0
- package/lib/screenplay/notes/NotepadAdapter.d.ts.map +1 -0
- package/lib/screenplay/notes/NotepadAdapter.js +298 -0
- package/lib/screenplay/notes/NotepadAdapter.js.map +1 -0
- package/lib/screenplay/notes/TakeNotes.d.ts +249 -0
- package/lib/screenplay/notes/TakeNotes.d.ts.map +1 -0
- package/lib/screenplay/notes/TakeNotes.js +259 -0
- package/lib/screenplay/notes/TakeNotes.js.map +1 -0
- package/lib/screenplay/notes/index.d.ts +6 -0
- package/lib/screenplay/notes/index.d.ts.map +1 -0
- package/lib/screenplay/notes/index.js +22 -0
- package/lib/screenplay/notes/index.js.map +1 -0
- package/lib/screenplay/notes/notes.d.ts +117 -0
- package/lib/screenplay/notes/notes.d.ts.map +1 -0
- package/lib/screenplay/notes/notes.js +123 -0
- package/lib/screenplay/notes/notes.js.map +1 -0
- package/lib/screenplay/questions/AnswersQuestions.d.ts +19 -0
- package/lib/screenplay/questions/AnswersQuestions.d.ts.map +1 -0
- package/lib/screenplay/questions/AnswersQuestions.js.map +1 -0
- package/lib/screenplay/questions/Check.d.ts +39 -57
- package/lib/screenplay/questions/Check.d.ts.map +1 -0
- package/lib/screenplay/questions/Check.js +41 -63
- package/lib/screenplay/questions/Check.js.map +1 -1
- package/lib/screenplay/questions/Expectation.d.ts +155 -44
- package/lib/screenplay/questions/Expectation.d.ts.map +1 -0
- package/lib/screenplay/questions/Expectation.js +172 -46
- package/lib/screenplay/questions/Expectation.js.map +1 -1
- package/lib/screenplay/questions/List.d.ts +14 -2
- package/lib/screenplay/questions/List.d.ts.map +1 -0
- package/lib/screenplay/questions/List.js +14 -11
- package/lib/screenplay/questions/List.js.map +1 -1
- package/lib/screenplay/questions/MetaQuestion.d.ts +18 -22
- package/lib/screenplay/questions/MetaQuestion.d.ts.map +1 -0
- package/lib/screenplay/questions/Unanswered.d.ts +20 -0
- package/lib/screenplay/questions/Unanswered.d.ts.map +1 -0
- package/lib/screenplay/questions/Unanswered.js +52 -0
- package/lib/screenplay/questions/Unanswered.js.map +1 -0
- package/lib/screenplay/questions/expectations/ExpectationDetails.d.ts +24 -0
- package/lib/screenplay/questions/expectations/ExpectationDetails.d.ts.map +1 -0
- package/lib/screenplay/questions/expectations/ExpectationDetails.js +55 -0
- package/lib/screenplay/questions/expectations/ExpectationDetails.js.map +1 -0
- package/lib/screenplay/questions/expectations/ExpectationMet.d.ts +7 -1
- package/lib/screenplay/questions/expectations/ExpectationMet.d.ts.map +1 -0
- package/lib/screenplay/questions/expectations/ExpectationMet.js +5 -0
- package/lib/screenplay/questions/expectations/ExpectationMet.js.map +1 -1
- package/lib/screenplay/questions/expectations/ExpectationNotMet.d.ts +7 -1
- package/lib/screenplay/questions/expectations/ExpectationNotMet.d.ts.map +1 -0
- package/lib/screenplay/questions/expectations/ExpectationNotMet.js +5 -0
- package/lib/screenplay/questions/expectations/ExpectationNotMet.js.map +1 -1
- package/lib/screenplay/questions/expectations/ExpectationOutcome.d.ts +13 -4
- package/lib/screenplay/questions/expectations/ExpectationOutcome.d.ts.map +1 -0
- package/lib/screenplay/questions/expectations/ExpectationOutcome.js +8 -1
- package/lib/screenplay/questions/expectations/ExpectationOutcome.js.map +1 -1
- package/lib/screenplay/questions/expectations/index.d.ts +2 -0
- package/lib/screenplay/questions/expectations/index.d.ts.map +1 -0
- package/lib/screenplay/questions/expectations/index.js +6 -1
- package/lib/screenplay/questions/expectations/index.js.map +1 -1
- package/lib/screenplay/questions/index.d.ts +3 -1
- package/lib/screenplay/questions/index.d.ts.map +1 -0
- package/lib/screenplay/questions/index.js +7 -2
- package/lib/screenplay/questions/index.js.map +1 -1
- package/lib/screenplay/questions/q.d.ts +56 -25
- package/lib/screenplay/questions/q.d.ts.map +1 -0
- package/lib/screenplay/questions/q.js +53 -23
- package/lib/screenplay/questions/q.js.map +1 -1
- package/lib/screenplay/time/abilities/ScheduleWork.d.ts +26 -0
- package/lib/screenplay/time/abilities/ScheduleWork.d.ts.map +1 -0
- package/lib/screenplay/time/abilities/ScheduleWork.js +45 -0
- package/lib/screenplay/time/abilities/ScheduleWork.js.map +1 -0
- package/lib/screenplay/time/abilities/index.d.ts +2 -0
- package/lib/screenplay/time/abilities/index.d.ts.map +1 -0
- package/lib/{io/json → screenplay/time/abilities}/index.js +6 -2
- package/lib/screenplay/time/abilities/index.js.map +1 -0
- package/lib/screenplay/time/activities/Wait.d.ts +212 -0
- package/lib/screenplay/time/activities/Wait.d.ts.map +1 -0
- package/lib/screenplay/time/activities/Wait.js +270 -0
- package/lib/screenplay/time/activities/Wait.js.map +1 -0
- package/lib/screenplay/time/activities/index.d.ts +2 -0
- package/lib/screenplay/time/activities/index.d.ts.map +1 -0
- package/lib/screenplay/{interactions → time/activities}/index.js +6 -3
- package/lib/screenplay/time/activities/index.js.map +1 -0
- package/lib/screenplay/time/index.d.ts +4 -0
- package/lib/screenplay/time/index.d.ts.map +1 -0
- package/lib/screenplay/time/index.js +20 -0
- package/lib/screenplay/time/index.js.map +1 -0
- package/lib/screenplay/time/models/Clock.d.ts +24 -0
- package/lib/screenplay/time/models/Clock.d.ts.map +1 -0
- package/lib/screenplay/time/models/Clock.js +31 -0
- package/lib/screenplay/time/models/Clock.js.map +1 -0
- package/lib/screenplay/time/models/DelayedCallback.d.ts +11 -0
- package/lib/screenplay/time/models/DelayedCallback.d.ts.map +1 -0
- package/lib/screenplay/time/models/DelayedCallback.js +3 -0
- package/lib/screenplay/time/models/DelayedCallback.js.map +1 -0
- package/lib/{model → screenplay/time/models}/Duration.d.ts +11 -1
- package/lib/screenplay/time/models/Duration.d.ts.map +1 -0
- package/lib/{model → screenplay/time/models}/Duration.js +14 -0
- package/lib/screenplay/time/models/Duration.js.map +1 -0
- package/lib/screenplay/time/models/RepeatUntilLimits.d.ts +12 -0
- package/lib/screenplay/time/models/RepeatUntilLimits.d.ts.map +1 -0
- package/lib/screenplay/time/models/RepeatUntilLimits.js +3 -0
- package/lib/screenplay/time/models/RepeatUntilLimits.js.map +1 -0
- package/lib/screenplay/time/models/Scheduler.d.ts +43 -0
- package/lib/screenplay/time/models/Scheduler.d.ts.map +1 -0
- package/lib/screenplay/time/models/Scheduler.js +166 -0
- package/lib/screenplay/time/models/Scheduler.js.map +1 -0
- package/lib/{model → screenplay/time/models}/Timestamp.d.ts +16 -0
- package/lib/screenplay/time/models/Timestamp.d.ts.map +1 -0
- package/lib/screenplay/time/models/Timestamp.js +81 -0
- package/lib/screenplay/time/models/Timestamp.js.map +1 -0
- package/lib/screenplay/time/models/index.d.ts +7 -0
- package/lib/screenplay/time/models/index.d.ts.map +1 -0
- package/lib/screenplay/time/models/index.js +23 -0
- package/lib/screenplay/time/models/index.js.map +1 -0
- package/lib/stage/Cast.d.ts +142 -49
- package/lib/stage/Cast.d.ts.map +1 -0
- package/lib/stage/Cast.js +141 -55
- package/lib/stage/Cast.js.map +1 -1
- package/lib/stage/Extras.d.ts +2 -4
- package/lib/stage/Extras.d.ts.map +1 -0
- package/lib/stage/Extras.js +1 -4
- package/lib/stage/Extras.js.map +1 -1
- package/lib/stage/ListensToDomainEvents.d.ts +14 -11
- package/lib/stage/ListensToDomainEvents.d.ts.map +1 -0
- package/lib/stage/Stage.d.ts +81 -100
- package/lib/stage/Stage.d.ts.map +1 -0
- package/lib/stage/Stage.js +122 -119
- package/lib/stage/Stage.js.map +1 -1
- package/lib/stage/StageCrewMember.d.ts +67 -15
- package/lib/stage/StageCrewMember.d.ts.map +1 -0
- package/lib/stage/StageCrewMemberBuilder.d.ts +14 -12
- package/lib/stage/StageCrewMemberBuilder.d.ts.map +1 -0
- package/lib/stage/StageCrewMemberBuilderDependencies.d.ts +6 -13
- package/lib/stage/StageCrewMemberBuilderDependencies.d.ts.map +1 -0
- package/lib/stage/StageManager.d.ts +6 -2
- package/lib/stage/StageManager.d.ts.map +1 -0
- package/lib/stage/StageManager.js +22 -20
- package/lib/stage/StageManager.js.map +1 -1
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.d.ts +70 -47
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.d.ts.map +1 -0
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.js +80 -56
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.js.map +1 -1
- package/lib/stage/crew/artifact-archiver/Hash.d.ts +1 -0
- package/lib/stage/crew/artifact-archiver/Hash.d.ts.map +1 -0
- package/lib/stage/crew/artifact-archiver/Hash.js +3 -3
- package/lib/stage/crew/artifact-archiver/Hash.js.map +1 -1
- package/lib/stage/crew/artifact-archiver/index.d.ts +1 -0
- package/lib/stage/crew/artifact-archiver/index.d.ts.map +1 -0
- package/lib/stage/crew/artifact-archiver/index.js +5 -1
- package/lib/stage/crew/artifact-archiver/index.js.map +1 -1
- package/lib/stage/crew/index.d.ts +1 -0
- package/lib/stage/crew/index.d.ts.map +1 -0
- package/lib/stage/crew/index.js +5 -1
- package/lib/stage/crew/index.js.map +1 -1
- package/lib/stage/crew/stream-reporter/StreamReporter.d.ts +82 -54
- package/lib/stage/crew/stream-reporter/StreamReporter.d.ts.map +1 -0
- package/lib/stage/crew/stream-reporter/StreamReporter.js +81 -54
- package/lib/stage/crew/stream-reporter/StreamReporter.js.map +1 -1
- package/lib/stage/crew/stream-reporter/index.d.ts +1 -0
- package/lib/stage/crew/stream-reporter/index.d.ts.map +1 -0
- package/lib/stage/crew/stream-reporter/index.js +5 -1
- package/lib/stage/crew/stream-reporter/index.js.map +1 -1
- package/lib/stage/index.d.ts +2 -1
- package/lib/stage/index.d.ts.map +1 -0
- package/lib/stage/index.js +6 -2
- package/lib/stage/index.js.map +1 -1
- package/lib/stage/queues/DomainEventQueue.d.ts +25 -0
- package/lib/stage/queues/DomainEventQueue.d.ts.map +1 -0
- package/lib/stage/queues/DomainEventQueue.js +33 -0
- package/lib/stage/queues/DomainEventQueue.js.map +1 -0
- package/lib/stage/queues/DomainEventQueues.d.ts +22 -0
- package/lib/stage/queues/DomainEventQueues.d.ts.map +1 -0
- package/lib/stage/queues/DomainEventQueues.js +76 -0
- package/lib/stage/queues/DomainEventQueues.js.map +1 -0
- package/lib/stage/queues/index.d.ts +3 -0
- package/lib/stage/queues/index.d.ts.map +1 -0
- package/lib/stage/queues/index.js +19 -0
- package/lib/stage/queues/index.js.map +1 -0
- package/package.json +31 -51
- package/src/Serenity.ts +183 -88
- package/src/adapter/OutputStream.ts +13 -0
- package/src/adapter/TestRunnerAdapter.ts +35 -0
- package/src/adapter/index.ts +2 -0
- package/src/config/ClassDescription.ts +55 -0
- package/src/config/SerenityConfig.ts +79 -0
- package/src/config/index.ts +2 -0
- package/src/errors/ErrorFactory.ts +329 -0
- package/src/errors/ErrorOptions.ts +16 -0
- package/src/errors/ErrorSerialiser.ts +106 -0
- package/src/{io → errors}/ErrorStackParser.ts +4 -4
- package/src/errors/RaiseErrors.ts +61 -0
- package/src/errors/diff/AnsiDiffFormatter.ts +41 -0
- package/src/errors/diff/DiffFormatter.ts +12 -0
- package/src/errors/diff/NoOpDiffFormatter.ts +20 -0
- package/src/errors/diff/index.ts +3 -0
- package/src/errors/index.ts +28 -7
- package/src/errors/model/AssertionError.ts +31 -0
- package/src/errors/model/ConfigurationError.ts +31 -0
- package/src/errors/model/ImplementationPendingError.ts +52 -0
- package/src/errors/model/ListItemNotFoundError.ts +35 -0
- package/src/errors/model/LogicError.ts +35 -0
- package/src/errors/model/OperationInterruptedError.ts +38 -0
- package/src/errors/model/RuntimeError.ts +101 -0
- package/src/errors/model/TestCompromisedError.ts +46 -0
- package/src/errors/model/TimeoutExpiredError.ts +38 -0
- package/src/errors/model/UnknownError.ts +31 -0
- package/src/errors/model/index.ts +10 -0
- package/src/events/ActivityFinished.ts +4 -5
- package/src/events/ActivityRelatedArtifactArchived.ts +6 -1
- package/src/events/ActivityRelatedArtifactGenerated.ts +5 -1
- package/src/events/ActivityStarts.ts +4 -5
- package/src/events/ArtifactArchived.ts +5 -1
- package/src/events/ArtifactGenerated.ts +5 -1
- package/src/events/AsyncOperationAborted.ts +28 -0
- package/src/events/AsyncOperationAttempted.ts +11 -4
- package/src/events/AsyncOperationCompleted.ts +5 -4
- package/src/events/AsyncOperationFailed.ts +6 -2
- package/src/events/BusinessRuleDetected.ts +5 -5
- package/src/events/DomainEvent.ts +4 -7
- package/src/events/FeatureNarrativeDetected.ts +5 -1
- package/src/events/InteractionFinished.ts +5 -1
- package/src/events/InteractionStarts.ts +5 -1
- package/src/events/RetryableSceneDetected.ts +8 -10
- package/src/events/SceneBackgroundDetected.ts +6 -1
- package/src/events/SceneDescriptionDetected.ts +5 -1
- package/src/events/SceneFinished.ts +5 -1
- package/src/events/SceneFinishes.ts +8 -7
- package/src/events/SceneParametersDetected.ts +5 -1
- package/src/events/SceneSequenceDetected.ts +5 -1
- package/src/events/SceneStarts.ts +5 -1
- package/src/events/SceneTagged.ts +5 -1
- package/src/events/SceneTemplateDetected.ts +5 -1
- package/src/events/TaskFinished.ts +5 -1
- package/src/events/TaskStarts.ts +5 -1
- package/src/events/TestRunFinished.ts +14 -6
- package/src/events/TestRunFinishes.ts +5 -4
- package/src/events/TestRunStarts.ts +3 -4
- package/src/events/TestRunnerDetected.ts +7 -4
- package/src/events/TestSuiteFinished.ts +5 -1
- package/src/events/TestSuiteStarts.ts +5 -1
- package/src/events/index.ts +1 -0
- package/src/index.ts +1 -2
- package/src/instance.ts +180 -91
- package/src/io/FileFinder.ts +2 -1
- package/src/io/FileSystem.ts +1 -1
- package/src/io/Path.ts +6 -3
- package/src/io/asyncMap.ts +6 -5
- package/src/io/commaSeparated.ts +8 -9
- package/src/io/format.ts +49 -22
- package/src/io/index.ts +3 -9
- package/src/io/inspected.ts +13 -271
- package/src/io/inspectedObject.ts +38 -0
- package/src/io/loader/ClassDescriptionParser.ts +67 -0
- package/src/io/loader/ClassDescriptor.ts +7 -0
- package/src/io/loader/ClassLoader.ts +42 -0
- package/src/io/{ModuleLoader.ts → loader/ModuleLoader.ts} +11 -19
- package/src/io/{Version.ts → loader/Version.ts} +2 -5
- package/src/io/loader/index.ts +5 -0
- package/src/io/reflection/has.ts +3 -5
- package/src/io/reflection/index.ts +2 -0
- package/src/io/reflection/isPrimitive.ts +20 -0
- package/src/io/reflection/typeOf.ts +31 -0
- package/src/io/stringified.ts +266 -0
- package/src/io/trimmed.ts +7 -9
- package/src/model/ActivityDetails.ts +8 -2
- package/src/model/CorrelationId.ts +1 -1
- package/src/model/ScenarioDetails.ts +4 -1
- package/src/model/artifacts/HTTPRequestResponse.ts +6 -10
- package/src/model/artifacts/Photo.ts +0 -8
- package/src/model/artifacts/index.ts +0 -1
- package/src/model/index.ts +0 -2
- package/src/model/outcomes.ts +5 -4
- package/src/model/tags/ArbitraryTag.ts +2 -5
- package/src/model/tags/ExecutionRetriedTag.ts +2 -5
- package/src/model/tags/index.ts +0 -1
- package/src/screenplay/Activity.ts +78 -20
- package/src/screenplay/Actor.ts +370 -0
- package/src/screenplay/Answerable.ts +3 -6
- package/src/screenplay/Answered.ts +16 -0
- package/src/screenplay/Interaction.ts +85 -42
- package/src/screenplay/Optional.ts +14 -18
- package/src/screenplay/Question.ts +369 -114
- package/src/screenplay/RecursivelyAnswered.ts +43 -0
- package/src/screenplay/Task.ts +185 -88
- package/src/screenplay/WithAnswerableProperties.ts +36 -0
- package/src/screenplay/abilities/Ability.ts +403 -0
- package/src/screenplay/abilities/AbilityType.ts +46 -0
- package/src/screenplay/abilities/CanHaveAbilities.ts +20 -0
- package/src/screenplay/abilities/Discardable.ts +19 -7
- package/src/screenplay/abilities/Initialisable.ts +17 -16
- package/src/screenplay/abilities/UsesAbilities.ts +24 -0
- package/src/screenplay/abilities/index.ts +4 -1
- package/src/screenplay/activities/PerformsActivities.ts +21 -0
- package/src/screenplay/activities/index.ts +1 -1
- package/src/screenplay/artifacts/CollectsArtifacts.ts +25 -0
- package/src/screenplay/artifacts/index.ts +1 -0
- package/src/screenplay/debugging/Debug.ts +161 -0
- package/src/screenplay/debugging/DebuggingResult.ts +10 -0
- package/src/screenplay/debugging/Log.ts +68 -0
- package/src/screenplay/debugging/index.ts +3 -0
- package/src/screenplay/index.ts +9 -4
- package/src/screenplay/notes/ChainableSetter.ts +9 -0
- package/src/screenplay/notes/Notepad.ts +208 -0
- package/src/screenplay/notes/NotepadAdapter.ts +317 -0
- package/src/screenplay/notes/TakeNotes.ts +257 -0
- package/src/screenplay/notes/index.ts +5 -0
- package/src/screenplay/notes/notes.ts +120 -0
- package/src/screenplay/questions/AnswersQuestions.ts +20 -0
- package/src/screenplay/questions/Check.ts +41 -62
- package/src/screenplay/questions/Expectation.ts +211 -65
- package/src/screenplay/questions/List.ts +18 -11
- package/src/screenplay/questions/MetaQuestion.ts +18 -22
- package/src/screenplay/questions/Unanswered.ts +27 -0
- package/src/screenplay/questions/expectations/ExpectationDetails.ts +64 -0
- package/src/screenplay/questions/expectations/ExpectationMet.ts +6 -1
- package/src/screenplay/questions/expectations/ExpectationNotMet.ts +6 -1
- package/src/screenplay/questions/expectations/ExpectationOutcome.ts +12 -3
- package/src/screenplay/questions/expectations/index.ts +1 -0
- package/src/screenplay/questions/index.ts +2 -1
- package/src/screenplay/questions/q.ts +55 -25
- package/src/screenplay/time/abilities/ScheduleWork.ts +52 -0
- package/src/screenplay/time/abilities/index.ts +1 -0
- package/src/screenplay/time/activities/Wait.ts +294 -0
- package/src/screenplay/time/activities/index.ts +1 -0
- package/src/screenplay/time/index.ts +3 -0
- package/src/screenplay/time/models/Clock.ts +28 -0
- package/src/screenplay/time/models/DelayedCallback.ts +8 -0
- package/src/{model → screenplay/time/models}/Duration.ts +17 -1
- package/src/screenplay/time/models/RepeatUntilLimits.ts +12 -0
- package/src/screenplay/time/models/Scheduler.ts +226 -0
- package/src/{model → screenplay/time/models}/Timestamp.ts +36 -2
- package/src/screenplay/time/models/index.ts +6 -0
- package/src/stage/Cast.ts +147 -62
- package/src/stage/Extras.ts +1 -4
- package/src/stage/ListensToDomainEvents.ts +13 -11
- package/src/stage/Stage.ts +140 -130
- package/src/stage/StageCrewMember.ts +66 -15
- package/src/stage/StageCrewMemberBuilder.ts +13 -12
- package/src/stage/StageCrewMemberBuilderDependencies.ts +5 -15
- package/src/stage/StageManager.ts +44 -44
- package/src/stage/crew/artifact-archiver/ArtifactArchiver.ts +81 -53
- package/src/stage/crew/stream-reporter/StreamReporter.ts +81 -54
- package/src/stage/index.ts +1 -1
- package/src/stage/queues/DomainEventQueue.ts +41 -0
- package/src/stage/queues/DomainEventQueues.ts +88 -0
- package/src/stage/queues/index.ts +2 -0
- package/tsconfig.build.json +10 -0
- package/lib/SerenityConfig.d.ts +0 -45
- package/lib/SerenityConfig.js +0 -12
- package/lib/SerenityConfig.js.map +0 -1
- package/lib/errors/AssertionError.d.ts +0 -18
- package/lib/errors/AssertionError.js +0 -25
- package/lib/errors/AssertionError.js.map +0 -1
- package/lib/errors/ConfigurationError.d.ts +0 -14
- package/lib/errors/ConfigurationError.js +0 -21
- package/lib/errors/ConfigurationError.js.map +0 -1
- package/lib/errors/ImplementationPendingError.d.ts +0 -29
- package/lib/errors/ImplementationPendingError.js +0 -36
- package/lib/errors/ImplementationPendingError.js.map +0 -1
- package/lib/errors/LogicError.d.ts +0 -17
- package/lib/errors/LogicError.js +0 -24
- package/lib/errors/LogicError.js.map +0 -1
- package/lib/errors/RuntimeError.d.ts +0 -43
- package/lib/errors/RuntimeError.js +0 -58
- package/lib/errors/RuntimeError.js.map +0 -1
- package/lib/errors/TestCompromisedError.d.ts +0 -26
- package/lib/errors/TestCompromisedError.js +0 -33
- package/lib/errors/TestCompromisedError.js.map +0 -1
- package/lib/errors/UnknownError.d.ts +0 -14
- package/lib/errors/UnknownError.js +0 -21
- package/lib/errors/UnknownError.js.map +0 -1
- package/lib/io/AssertionReportDiffer.d.ts +0 -12
- package/lib/io/AssertionReportDiffer.js +0 -34
- package/lib/io/AssertionReportDiffer.js.map +0 -1
- package/lib/io/ErrorSerialiser.d.ts +0 -27
- package/lib/io/ErrorSerialiser.js.map +0 -1
- package/lib/io/ErrorStackParser.d.ts +0 -12
- package/lib/io/ErrorStackParser.js +0 -19
- package/lib/io/ErrorStackParser.js.map +0 -1
- package/lib/io/ModuleLoader.js +0 -81
- package/lib/io/ModuleLoader.js.map +0 -1
- package/lib/io/OutputStream.d.ts +0 -16
- package/lib/io/TestRunnerAdapter.d.ts +0 -47
- package/lib/io/TestRunnerAdapter.js.map +0 -1
- package/lib/io/Version.js.map +0 -1
- package/lib/io/formatted.d.ts +0 -16
- package/lib/io/formatted.js +0 -23
- package/lib/io/formatted.js.map +0 -1
- package/lib/io/json/cycle.d.ts +0 -11
- package/lib/io/json/cycle.js +0 -165
- package/lib/io/json/cycle.js.map +0 -1
- package/lib/io/json/index.d.ts +0 -1
- package/lib/io/json/index.js.map +0 -1
- package/lib/model/Duration.js.map +0 -1
- package/lib/model/Timestamp.js +0 -48
- package/lib/model/Timestamp.js.map +0 -1
- package/lib/model/artifacts/AssertionReport.d.ts +0 -7
- package/lib/model/artifacts/AssertionReport.js +0 -11
- package/lib/model/artifacts/AssertionReport.js.map +0 -1
- package/lib/model/tags/ContextTag.d.ts +0 -17
- package/lib/model/tags/ContextTag.js +0 -24
- package/lib/model/tags/ContextTag.js.map +0 -1
- package/lib/screenplay/Ability.d.ts +0 -100
- package/lib/screenplay/Ability.js.map +0 -1
- package/lib/screenplay/AbilityType.d.ts +0 -42
- package/lib/screenplay/AbilityType.js.map +0 -1
- package/lib/screenplay/abilities/TakeNotes.d.ts +0 -151
- package/lib/screenplay/abilities/TakeNotes.js +0 -205
- package/lib/screenplay/abilities/TakeNotes.js.map +0 -1
- package/lib/screenplay/activities/ActivityDescriber.d.ts +0 -9
- package/lib/screenplay/activities/ActivityDescriber.js +0 -18
- package/lib/screenplay/activities/ActivityDescriber.js.map +0 -1
- package/lib/screenplay/activities/OutcomeMatcher.d.ts +0 -5
- package/lib/screenplay/activities/OutcomeMatcher.js +0 -21
- package/lib/screenplay/activities/OutcomeMatcher.js.map +0 -1
- package/lib/screenplay/activities/TrackedActivity.d.ts +0 -17
- package/lib/screenplay/activities/TrackedActivity.js +0 -40
- package/lib/screenplay/activities/TrackedActivity.js.map +0 -1
- package/lib/screenplay/actor/Actor.d.ts +0 -106
- package/lib/screenplay/actor/Actor.js +0 -189
- package/lib/screenplay/actor/Actor.js.map +0 -1
- package/lib/screenplay/actor/AnswersQuestions.d.ts +0 -10
- package/lib/screenplay/actor/AnswersQuestions.js.map +0 -1
- package/lib/screenplay/actor/CanHaveAbilities.d.ts +0 -15
- package/lib/screenplay/actor/CanHaveAbilities.js.map +0 -1
- package/lib/screenplay/actor/CollectsArtifacts.d.ts +0 -17
- package/lib/screenplay/actor/CollectsArtifacts.js.map +0 -1
- package/lib/screenplay/actor/PerformsActivities.d.ts +0 -10
- package/lib/screenplay/actor/PerformsActivities.js.map +0 -1
- package/lib/screenplay/actor/UsesAbilities.d.ts +0 -18
- package/lib/screenplay/actor/UsesAbilities.js.map +0 -1
- package/lib/screenplay/actor/index.d.ts +0 -6
- package/lib/screenplay/actor/index.js.map +0 -1
- package/lib/screenplay/interactions/Log.d.ts +0 -57
- package/lib/screenplay/interactions/Log.js +0 -74
- package/lib/screenplay/interactions/Log.js.map +0 -1
- package/lib/screenplay/interactions/TakeNote.d.ts +0 -87
- package/lib/screenplay/interactions/TakeNote.js +0 -103
- package/lib/screenplay/interactions/TakeNote.js.map +0 -1
- package/lib/screenplay/interactions/index.d.ts +0 -2
- package/lib/screenplay/interactions/index.js.map +0 -1
- package/lib/screenplay/questions/Note.d.ts +0 -79
- package/lib/screenplay/questions/Note.js +0 -96
- package/lib/screenplay/questions/Note.js.map +0 -1
- package/lib/stage/Clock.d.ts +0 -15
- package/lib/stage/Clock.js +0 -23
- package/lib/stage/Clock.js.map +0 -1
- package/src/SerenityConfig.ts +0 -49
- package/src/errors/AssertionError.ts +0 -20
- package/src/errors/ConfigurationError.ts +0 -18
- package/src/errors/ImplementationPendingError.ts +0 -33
- package/src/errors/LogicError.ts +0 -21
- package/src/errors/RuntimeError.ts +0 -60
- package/src/errors/TestCompromisedError.ts +0 -30
- package/src/errors/UnknownError.ts +0 -18
- package/src/io/AssertionReportDiffer.ts +0 -43
- package/src/io/ErrorSerialiser.ts +0 -78
- package/src/io/OutputStream.ts +0 -16
- package/src/io/TestRunnerAdapter.ts +0 -50
- package/src/io/formatted.ts +0 -20
- package/src/io/json/cycle.ts +0 -177
- package/src/io/json/index.ts +0 -1
- package/src/model/artifacts/AssertionReport.ts +0 -7
- package/src/model/tags/ContextTag.ts +0 -21
- package/src/screenplay/Ability.ts +0 -100
- package/src/screenplay/AbilityType.ts +0 -44
- package/src/screenplay/abilities/TakeNotes.ts +0 -216
- package/src/screenplay/activities/ActivityDescriber.ts +0 -20
- package/src/screenplay/activities/OutcomeMatcher.ts +0 -25
- package/src/screenplay/activities/TrackedActivity.ts +0 -50
- package/src/screenplay/actor/Actor.ts +0 -243
- package/src/screenplay/actor/AnswersQuestions.ts +0 -11
- package/src/screenplay/actor/CanHaveAbilities.ts +0 -16
- package/src/screenplay/actor/CollectsArtifacts.ts +0 -18
- package/src/screenplay/actor/PerformsActivities.ts +0 -11
- package/src/screenplay/actor/UsesAbilities.ts +0 -20
- package/src/screenplay/actor/index.ts +0 -6
- package/src/screenplay/interactions/Log.ts +0 -81
- package/src/screenplay/interactions/TakeNote.ts +0 -107
- package/src/screenplay/interactions/index.ts +0 -2
- package/src/screenplay/questions/Note.ts +0 -99
- package/src/stage/Clock.ts +0 -19
- package/tsconfig.eslint.json +0 -10
- /package/lib/{io → adapter}/OutputStream.js +0 -0
- /package/lib/{io → adapter}/TestRunnerAdapter.js +0 -0
- /package/lib/screenplay/{AbilityType.js → abilities/AbilityType.js} +0 -0
- /package/lib/screenplay/{actor → abilities}/CanHaveAbilities.js +0 -0
- /package/lib/screenplay/{actor → abilities}/UsesAbilities.js +0 -0
- /package/lib/screenplay/{actor → activities}/PerformsActivities.js +0 -0
- /package/lib/screenplay/{actor → artifacts}/CollectsArtifacts.js +0 -0
- /package/lib/screenplay/{actor → questions}/AnswersQuestions.js +0 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { AbilityType } from './AbilityType';
|
|
2
|
+
import { UsesAbilities } from './UsesAbilities';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* **Abilities** enable {@apilink Actor|actors}
|
|
6
|
+
* to perform {@apilink Interaction|interactions} with the system under test
|
|
7
|
+
* and answer {@apilink Question|questions} about its state.
|
|
8
|
+
*
|
|
9
|
+
* From the technical perspective, **abilities** act as **wrappers** around any **integration libraries** required
|
|
10
|
+
* to communicate with the external interfaces of system under test,
|
|
11
|
+
* such as {@apilink BrowseTheWeb|web browser drivers} or a {@apilink CallAnApi|HTTP client}.
|
|
12
|
+
* They also enable [portability](/handbook/design/portable-test-code)
|
|
13
|
+
* of your test code across such integration libraries.
|
|
14
|
+
*
|
|
15
|
+
* Abilities are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
|
|
16
|
+
* along with {@apilink Actor|Actors}, {@apilink Interaction|Interactions}, {@apilink Question|Questions}, and {@apilink Task|Tasks}.
|
|
17
|
+
*
|
|
18
|
+
* 
|
|
19
|
+
*
|
|
20
|
+
* Learn more about:
|
|
21
|
+
* - {@apilink Actor|Actors}
|
|
22
|
+
* - {@apilink Cast|Configuring actors using Casts}
|
|
23
|
+
* - {@apilink Interaction|Interactions}
|
|
24
|
+
* - {@apilink Question|Questions}
|
|
25
|
+
* - [Web testing](/handbook/web-testing/)
|
|
26
|
+
* - [API testing](/handbook/api-testing/)
|
|
27
|
+
* - [Mobile testing](/handbook/mobile-testing/)
|
|
28
|
+
*
|
|
29
|
+
* ## Giving actors the abilities to interact
|
|
30
|
+
*
|
|
31
|
+
* Serenity/JS actors are capable of interacting with **any interface** of the system under test,
|
|
32
|
+
* be it a [web UI](/handbook/web-testing/), a [mobile app](/handbook/mobile-testing/), a [web service](/handbook/api-testing/),
|
|
33
|
+
* or {@apilink Ability|anything else} that a Node.js program can talk to.
|
|
34
|
+
* This flexibility is enabled by a mechanism called _**abilities**_
|
|
35
|
+
* and achieved without introducing any unnecessary dependencies to your code base thanks to the [modular architecture](/handbook/about/architecture) of Serenity/JS.
|
|
36
|
+
*
|
|
37
|
+
* :::tip Remember
|
|
38
|
+
* **Actors** have **abilities** that enable them to **perform interactions** and **answer questions**.
|
|
39
|
+
* :::
|
|
40
|
+
*
|
|
41
|
+
* From the technical perspective, an **ability** is an [adapter](https://en.wikipedia.org/wiki/Adapter_pattern)
|
|
42
|
+
* around an interface-specific integration library, such as a web browser driver, an HTTP client, a database client, and so on.
|
|
43
|
+
* You give an actor an ability, and it's the ability's responsibility to provide a consistent API around the integration library and deal with any of its quirks.
|
|
44
|
+
* Abilities **encapsulate integration libraries** and handle their {@apilink Initialisable|configuration and initialisation},
|
|
45
|
+
* the process of {@apilink Discardable|freeing up any resources} they hold,
|
|
46
|
+
* as well as managing any state associated with the library.
|
|
47
|
+
*
|
|
48
|
+
* ### Portable interactions with web interfaces
|
|
49
|
+
*
|
|
50
|
+
* To make your Serenity/JS actors interact with web interfaces,
|
|
51
|
+
* you call the [`Actor.whoCan`](/api/core/class/Actor#whoCan) method and give them an implementation of the ability to [`BrowseTheWeb`](/api/web/class/BrowseTheWeb),
|
|
52
|
+
* specific to your web integration tool of choice.
|
|
53
|
+
*
|
|
54
|
+
* Note how {@apilink BrowseTheWebWithPlaywright}, {@apilink BrowseTheWebWithWebdriverIO}, and {@apilink BrowseTheWebWithProtractor}
|
|
55
|
+
* all **extend** the base ability to {@apilink BrowseTheWeb}.
|
|
56
|
+
*
|
|
57
|
+
* #### Playwright Test
|
|
58
|
+
*
|
|
59
|
+
* ```typescript
|
|
60
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
61
|
+
* import { BrowseTheWebWithPlaywright } from '@serenity-js/playwright' // Serenity/JS integration module
|
|
62
|
+
* import { chromium } from 'playwright'
|
|
63
|
+
*
|
|
64
|
+
* const browser = await chromium.launch({ headless: true }) // integration library
|
|
65
|
+
*
|
|
66
|
+
* actorCalled('Trevor') // generic actor
|
|
67
|
+
* .whoCan(BrowseTheWebWithPlaywright.using(browser)) // tool-specific ability
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* #### WebdriverIO
|
|
71
|
+
*
|
|
72
|
+
* ```typescript
|
|
73
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
74
|
+
* import { BrowseTheWebWithWebdriverIO } from '@serenity-js/webdriverio' // Serenity/JS integration module
|
|
75
|
+
*
|
|
76
|
+
* actorCalled('Trevor') // generic actor
|
|
77
|
+
* .whoCan(BrowseTheWebWithWebdriverIO.using(browser)) // tool-specific ability
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* #### Protractor
|
|
81
|
+
*
|
|
82
|
+
* ```typescript
|
|
83
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
84
|
+
* import { BrowseTheWebWithProtractor } from '@serenity-js/protractor' // Serenity/JS integration module
|
|
85
|
+
* import { protractor } from 'protractor' // integration library
|
|
86
|
+
*
|
|
87
|
+
* actorCalled('Trevor') // generic actor
|
|
88
|
+
* .whoCan(BrowseTheWebWithProtractor.using(protractor.browser)) // tool-specific ability
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* ### Retrieving an ability
|
|
92
|
+
*
|
|
93
|
+
* Use {@apilink Ability.as} to retrieve an ability in a custom {@apilink Interaction} or {@apilink Question} implementation.
|
|
94
|
+
*
|
|
95
|
+
* Here, `Ability` can be the integration library-specific class, for example {@apilink BrowseTheWebWithPlaywright},
|
|
96
|
+
* or its library-agnostic parent class, like {@apilink BrowseTheWeb}.
|
|
97
|
+
*
|
|
98
|
+
* To make your code portable across the various integration libraries, retrieve the ability
|
|
99
|
+
* using the library-agnostic parent class:
|
|
100
|
+
*
|
|
101
|
+
* ```typescript
|
|
102
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
103
|
+
* import { BrowseTheWeb } from '@serenity-js/web' // Serenity/JS web module
|
|
104
|
+
*
|
|
105
|
+
* const actor = actorCalled('Trevor')
|
|
106
|
+
* const ability = await BrowseTheWeb.as(actor) // retrieve implementation of BrowseTheWeb
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* As you can already see, providing **encapsulation** and a **cleaner API** around the integration libraries are not the only reasons why you'd want to use the abilities.
|
|
110
|
+
*
|
|
111
|
+
* Another reason is that the Serenity/JS implementation of the Screenplay Pattern lets you **completely decouple the actor from the integration libraries**
|
|
112
|
+
* and make the abilities of the same type **interchangeable**.
|
|
113
|
+
* For example, [Serenity/JS web modules](/handbook/web-testing/serenity-js-web-modules) offer an abstraction that lets you switch between web integration libraries
|
|
114
|
+
* as vastly different as Selenium, WebdriverIO, or Playwright without having to change _anything whatsoever_ in your test scenarios.
|
|
115
|
+
*
|
|
116
|
+
* What this means is that your test code can become [portable and reusable across projects and teams](/handbook/design/portable-test-code),
|
|
117
|
+
* even if they don't use the same low-level integration tools. It also helps you to **avoid vendor lock-in**, as you can wrap any third-party integration library
|
|
118
|
+
* into an ability and swap it out for another implementation if you need to.
|
|
119
|
+
*
|
|
120
|
+
* However, Serenity/JS **doesn't prevent you** from using the integration libraries directly.
|
|
121
|
+
* When you need to, you can use a library-specific ability like {@apilink BrowseTheWebWithPlaywright}
|
|
122
|
+
* to trade portability for access to library-specific low-level methods:
|
|
123
|
+
*
|
|
124
|
+
* ```typescript
|
|
125
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
126
|
+
* import { BrowseTheWebWithPlaywright, PlaywrightPage } from '@serenity-js/playwright'
|
|
127
|
+
*
|
|
128
|
+
* const actor = actorCalled('Trevor')
|
|
129
|
+
* const ability = await BrowseTheWebWithPlaywright.as(actor)
|
|
130
|
+
* const page = (await ability.currentPage()) as PlaywrightPage;
|
|
131
|
+
* const playwrightPage = await page.nativePage();
|
|
132
|
+
* // use any Playwright-specific APIs on playwrightPage
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* :::warning Using integration library-specific APIs reduces portability
|
|
136
|
+
* While Serenity/JS provides you with escape hatches and ways to access the low-level APIs of your integration libraries,
|
|
137
|
+
* doing so can reduce the portability of your code. Only do it when you have a good reason to trade portability for low-level access.
|
|
138
|
+
* :::
|
|
139
|
+
*
|
|
140
|
+
*
|
|
141
|
+
* ## Associating actors with data
|
|
142
|
+
*
|
|
143
|
+
* One more reason to use abilities is that abilities can also help you to **associate actors with data** they need to perform their activities.
|
|
144
|
+
* For example, a commonly used ability is one to [`TakeNotes`](/api/core/class/TakeNotes), which allows your actors to start the test scenario
|
|
145
|
+
* equipped with some data set, or record information about what they see in the test scenario so that they can act upon it later:
|
|
146
|
+
*
|
|
147
|
+
* ```typescript
|
|
148
|
+
* import { actorCalled, Notepad, TakeNotes } from '@serenity-js/core'
|
|
149
|
+
*
|
|
150
|
+
* interface MyNotes {
|
|
151
|
+
* firstName: string;
|
|
152
|
+
* lastName: string;
|
|
153
|
+
* emailAddress: string;
|
|
154
|
+
* }
|
|
155
|
+
*
|
|
156
|
+
* await actorCalled('Trevor')
|
|
157
|
+
* .whoCan(
|
|
158
|
+
* TakeNotes.using(Notepad.with<MyNotes>({
|
|
159
|
+
* firstName: 'Trevor',
|
|
160
|
+
* lastName: 'Traveller',
|
|
161
|
+
* emailAddress: 'Trevor.Traveller@example.org',
|
|
162
|
+
* }))
|
|
163
|
+
* )
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* ## Actors with multiple abilities
|
|
167
|
+
*
|
|
168
|
+
* Of course, an actor can have **any number of abilities** they need to play their role.
|
|
169
|
+
* For example, it is quite common for an actor to be able to [`BrowseTheWeb`](/api/web/class/BrowseTheWeb), [`TakeNotes`](/api/core/class/TakeNotes), and [`CallAnApi`](/api/rest/class/CallAnApi):
|
|
170
|
+
*
|
|
171
|
+
* ```typescript
|
|
172
|
+
* import { actorCalled, Notepad, TakeNotes } from '@serenity-js/core'
|
|
173
|
+
* import { BrowseTheWebWithPlaywright } from '@serenity-js/playwright'
|
|
174
|
+
* import { CallAnApi } from '@serenity-js/rest'
|
|
175
|
+
* import { chromium } from 'playwright'
|
|
176
|
+
*
|
|
177
|
+
* const browser = await chromium.launch({ headless: true })
|
|
178
|
+
* const baseURL = 'https://example.org'
|
|
179
|
+
*
|
|
180
|
+
* interface MyNotes {
|
|
181
|
+
* firstName: string;
|
|
182
|
+
* lastName: string;
|
|
183
|
+
* emailAddress: string;
|
|
184
|
+
* }
|
|
185
|
+
*
|
|
186
|
+
* await actorCalled('Trevor')
|
|
187
|
+
* .whoCan(
|
|
188
|
+
* BrowseTheWebWithPlaywright.using(browser, { baseURL }),
|
|
189
|
+
* CallAnApi.at(`${ baseURL }/api`),
|
|
190
|
+
* TakeNotes.using(Notepad.with<MyNotes>({
|
|
191
|
+
* firstName: 'Trevor',
|
|
192
|
+
* lastName: 'Traveller',
|
|
193
|
+
* emailAddress: 'Trevor.Traveller@example.org',
|
|
194
|
+
* }))
|
|
195
|
+
* )
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* ## Writing custom abilities
|
|
199
|
+
*
|
|
200
|
+
* If your system under test provides a type of interface that Serenity/JS doesn't support yet,
|
|
201
|
+
* you might want to implement a custom {@apilink Ability}, as well as {@apilink Interaction|interactions}
|
|
202
|
+
* and {@apilink Question|questions} to interact with it.
|
|
203
|
+
*
|
|
204
|
+
* The best way to start with that is for you to review the examples in the {@apilink Ability|Screenplay Pattern API docs},
|
|
205
|
+
* as well as the [Serenity/JS code base on GitHub](https://github.com/serenity-js/serenity-js/tree/main/packages).
|
|
206
|
+
* Also note that all the [Serenity/JS modules](/handbook/about/architecture)
|
|
207
|
+
* have their automated tests written in such a way to not only provide an **extremely high test coverage** for the framework itself,
|
|
208
|
+
* but to be **accessible** and act as a **reference implementation for you** to create your own integrations.
|
|
209
|
+
*
|
|
210
|
+
* If you believe that the custom integration you've developed could benefit the wider Serenity/JS community,
|
|
211
|
+
* please consider open-sourcing it yourself, or [contributing it](/contributing) to the main framework.
|
|
212
|
+
*
|
|
213
|
+
* [](https://matrix.to/#/#serenity-js:gitter.im)
|
|
214
|
+
*
|
|
215
|
+
* ### Defining a custom ability to `MakePhoneCalls`
|
|
216
|
+
*
|
|
217
|
+
* ```ts
|
|
218
|
+
* import { Ability, actorCalled, Interaction } from '@serenity-js/core'
|
|
219
|
+
*
|
|
220
|
+
* class MakePhoneCalls extends Ability {
|
|
221
|
+
*
|
|
222
|
+
* // A static method is typically used to inject a client of a given interface
|
|
223
|
+
* // and instantiate the ability, for example:
|
|
224
|
+
* // actorCalled('Phil').whoCan(MakePhoneCalls.using(phone))
|
|
225
|
+
* static using(phone: Phone) {
|
|
226
|
+
* return new MakePhoneCalls(phone);
|
|
227
|
+
* }
|
|
228
|
+
*
|
|
229
|
+
* // Abilities can hold state, for example: the client of a given interface,
|
|
230
|
+
* // additional configuration, or the result of the last interaction with a given interface.
|
|
231
|
+
* protected constructor(private readonly phone: Phone) {
|
|
232
|
+
* }
|
|
233
|
+
*
|
|
234
|
+
* // Abilities expose methods that enable Interactions to call the system under test,
|
|
235
|
+
* // and Questions to retrieve information about its state.
|
|
236
|
+
* dial(phoneNumber: string): Promise<void> {
|
|
237
|
+
* // ...
|
|
238
|
+
* }
|
|
239
|
+
* }
|
|
240
|
+
* ```
|
|
241
|
+
*
|
|
242
|
+
* ### Defining a custom interaction using the custom ability
|
|
243
|
+
*
|
|
244
|
+
* ```ts
|
|
245
|
+
* // A custom interaction using the actor's ability:
|
|
246
|
+
* const Call = (phoneNumber: string) =>
|
|
247
|
+
* Interaction.where(`#actor calls ${ phoneNumber }`, async actor => {
|
|
248
|
+
* await MakePhoneCalls.as(actor).dial(phoneNumber)
|
|
249
|
+
* })
|
|
250
|
+
* ```
|
|
251
|
+
*
|
|
252
|
+
* ### Using the custom ability and interaction in a test scenario
|
|
253
|
+
*
|
|
254
|
+
* ```ts
|
|
255
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
256
|
+
*
|
|
257
|
+
* await actorCalled('Connie')
|
|
258
|
+
* .whoCan(MakePhoneCalls.using(phone))
|
|
259
|
+
* .attemptsTo(
|
|
260
|
+
* Call(phoneNumber)
|
|
261
|
+
* )
|
|
262
|
+
* ```
|
|
263
|
+
*
|
|
264
|
+
* ## Using auto-initialisable and auto-discardable abilities
|
|
265
|
+
*
|
|
266
|
+
* Abilities that rely on resources that need to be initialised before they can be used,
|
|
267
|
+
* or discarded before the actor is dismissed can implement the {@apilink Initialisable}
|
|
268
|
+
* or {@apilink Discardable} interfaces, respectively.
|
|
269
|
+
*
|
|
270
|
+
* ### Defining a custom ability to `QueryPostgresDB`
|
|
271
|
+
*
|
|
272
|
+
* ```ts
|
|
273
|
+
* import {
|
|
274
|
+
* Ability, actorCalled, Discardable, Initialisable, Question, UsesAbilities,
|
|
275
|
+
* } from '@serenity-js/core'
|
|
276
|
+
*
|
|
277
|
+
* // Some low-level interface-specific client we want the Actor to use,
|
|
278
|
+
* // for example a PostgreSQL database client:
|
|
279
|
+
* const { Client } = require('pg');
|
|
280
|
+
*
|
|
281
|
+
* // A custom Ability to give an Actor access to the low-level client:
|
|
282
|
+
* class QueryPostgresDB
|
|
283
|
+
* extends Ability
|
|
284
|
+
* implements Initialisable, Discardable
|
|
285
|
+
* {
|
|
286
|
+
* constructor(private readonly client) {
|
|
287
|
+
* }
|
|
288
|
+
*
|
|
289
|
+
* // Invoked by Serenity/JS upon the first invocation of `actor.attemptsTo`
|
|
290
|
+
* initialise(): Promise<void> | void {
|
|
291
|
+
* return this.client.connect();
|
|
292
|
+
* }
|
|
293
|
+
*
|
|
294
|
+
* // Used to ensure that the Ability is not initialised more than once
|
|
295
|
+
* isInitialised(): boolean {
|
|
296
|
+
* return this.client._connected;
|
|
297
|
+
* }
|
|
298
|
+
*
|
|
299
|
+
* // Discards any resources the Ability uses when the Actor is dismissed,
|
|
300
|
+
* // so when the Stage receives a SceneFinishes event for scenario-scoped actor,
|
|
301
|
+
* // or TestRunFinishes for cross-scenario-scoped actors
|
|
302
|
+
* discard(): Promise<void> | void {
|
|
303
|
+
* return this.client.end();
|
|
304
|
+
* }
|
|
305
|
+
*
|
|
306
|
+
* // Any custom integration APIs the Ability, should make available to the Actor.
|
|
307
|
+
* // Here, we want the ability to enable the actor to query the database.
|
|
308
|
+
* query(query: string) {
|
|
309
|
+
* return this.client.query(query);
|
|
310
|
+
* }
|
|
311
|
+
*
|
|
312
|
+
* // ... other custom integration APIs
|
|
313
|
+
* }
|
|
314
|
+
* ```
|
|
315
|
+
*
|
|
316
|
+
* ### Defining a custom question using the custom ability
|
|
317
|
+
*
|
|
318
|
+
* ```ts
|
|
319
|
+
* // A custom Question to allow the Actor query the database
|
|
320
|
+
* const CurrentDBUser = () =>
|
|
321
|
+
* Question.about('current db user', actor =>
|
|
322
|
+
* QueryPostgresDB.as(actor)
|
|
323
|
+
* .query('SELECT current_user')
|
|
324
|
+
* .then(result => result.rows[0].current_user)
|
|
325
|
+
* );
|
|
326
|
+
* ```
|
|
327
|
+
*
|
|
328
|
+
* ### Using the custom ability and question in a test scenario
|
|
329
|
+
*
|
|
330
|
+
* ```ts
|
|
331
|
+
* // Example test scenario where the Actor uses the Ability to QueryPostgresDB
|
|
332
|
+
* // to assert on the username the connection has been established with
|
|
333
|
+
*
|
|
334
|
+
* import { describe, it } from 'mocha'
|
|
335
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
336
|
+
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
337
|
+
*
|
|
338
|
+
* describe('Serenity/JS', () => {
|
|
339
|
+
* it('can initialise and discard abilities automatically', () =>
|
|
340
|
+
* actorCalled('Debbie')
|
|
341
|
+
* .whoCan(new QueryPostgresDB(new Client()))
|
|
342
|
+
* .attemptsTo(
|
|
343
|
+
* Ensure.that(CurrentDBUser(), equals('jan'))
|
|
344
|
+
* ))
|
|
345
|
+
* })
|
|
346
|
+
* ```
|
|
347
|
+
*
|
|
348
|
+
* ## Learn more
|
|
349
|
+
* - {@apilink AbilityType}
|
|
350
|
+
* - {@apilink Initialisable}
|
|
351
|
+
* - {@apilink Discardable}
|
|
352
|
+
* - {@apilink BrowseTheWeb}
|
|
353
|
+
* - {@apilink CallAnApi}
|
|
354
|
+
* - {@apilink TakeNotes}
|
|
355
|
+
*
|
|
356
|
+
* @group Screenplay Pattern
|
|
357
|
+
*/
|
|
358
|
+
export abstract class Ability {
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Used to access an {@apilink Actor|actor's} {@apilink Ability|ability} of the given type
|
|
362
|
+
* from within the {@apilink Interaction} and {@apilink Question} classes.
|
|
363
|
+
*
|
|
364
|
+
* #### Retrieving an ability in an interaction definition
|
|
365
|
+
*
|
|
366
|
+
* ```ts
|
|
367
|
+
* import { Actor, Interaction } from '@serenity-js/core'
|
|
368
|
+
* import { BrowseTheWeb, Page } from '@serenity-js/web'
|
|
369
|
+
*
|
|
370
|
+
* export const ClearLocalStorage = () =>
|
|
371
|
+
* Interaction.where(`#actor clears local storage`, async (actor: Actor) => {
|
|
372
|
+
* const browseTheWeb: BrowseTheWeb = BrowseTheWeb.as(actor) // retrieve an ability
|
|
373
|
+
* const page: Page = await browseTheWeb.currentPage()
|
|
374
|
+
* await page.executeScript(() => window.localStorage.clear())
|
|
375
|
+
* })
|
|
376
|
+
* ```
|
|
377
|
+
*
|
|
378
|
+
* #### Retrieving an ability in a question definition
|
|
379
|
+
*
|
|
380
|
+
* ```ts
|
|
381
|
+
* import { Actor, Question } from '@serenity-js/core'
|
|
382
|
+
* import { BrowseTheWeb, Page } from '@serenity-js/web'
|
|
383
|
+
* import { CallAnApi } from '@serenity-js/rest'
|
|
384
|
+
*
|
|
385
|
+
* const LocalStorage = {
|
|
386
|
+
* numberOfItems: () =>
|
|
387
|
+
* Question.about<number>(`number of items in local storage`, async (actor: Actor) => {
|
|
388
|
+
* const browseTheWeb: BrowseTheWeb = BrowseTheWeb.as(actor) // retrieve an ability
|
|
389
|
+
* const page: Page = await browseTheWeb.currentPage()
|
|
390
|
+
* return page.executeScript(() => window.localStorage.length)
|
|
391
|
+
* })
|
|
392
|
+
* }
|
|
393
|
+
* ```
|
|
394
|
+
*
|
|
395
|
+
* @param actor
|
|
396
|
+
*/
|
|
397
|
+
static as<A extends Ability>(
|
|
398
|
+
this: AbilityType<A>,
|
|
399
|
+
actor: UsesAbilities
|
|
400
|
+
): A {
|
|
401
|
+
return actor.abilityTo(this) as A;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Ability } from './Ability';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An interface describing the static access method that every {@apilink Ability} class
|
|
5
|
+
* needs to provide in order to be accessible from within the {@apilink Interaction|interactions}.
|
|
6
|
+
*
|
|
7
|
+
* #### Retrieving an ability from an interaction
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { Ability, actorCalled, Interaction } from '@serenity-js/core';
|
|
11
|
+
*
|
|
12
|
+
* class MakePhoneCalls extends Ability {
|
|
13
|
+
* static using(phone: Phone) {
|
|
14
|
+
* return new MakePhoneCalls(phone);
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* protected constructor(private readonly phone: Phone) {
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* // some method that allows us to interact with the external interface of the system under test
|
|
21
|
+
* dial(phoneNumber: string): Promise<void> {
|
|
22
|
+
* // ...
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* const Call = (phoneNumber: string) =>
|
|
27
|
+
* Interaction.where(`#actor calls ${ phoneNumber }`, async actor => {
|
|
28
|
+
* await MakePhoneCalls.as(actor).dial(phoneNumber)
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* await actorCalled('Connie')
|
|
32
|
+
* .whoCan(MakePhoneCalls.using(phone))
|
|
33
|
+
* .attemptsTo(
|
|
34
|
+
* Call(phoneNumber),
|
|
35
|
+
* )
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* ## Learn more
|
|
39
|
+
* - {@apilink Ability}
|
|
40
|
+
* - {@apilink Actor}
|
|
41
|
+
* - {@apilink Interaction}
|
|
42
|
+
*
|
|
43
|
+
* @group Abilities
|
|
44
|
+
*/
|
|
45
|
+
export type AbilityType<A extends Ability> =
|
|
46
|
+
(abstract new (... args: any[]) => A);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Ability } from './Ability';
|
|
2
|
+
import { UsesAbilities } from './UsesAbilities';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Describes an {@apilink Actor} who can have an {@apilink Ability} to perform some {@apilink Activity}.
|
|
6
|
+
*
|
|
7
|
+
* ## Learn more
|
|
8
|
+
*
|
|
9
|
+
* - {@apilink Ability}
|
|
10
|
+
* - {@apilink Actor}
|
|
11
|
+
*
|
|
12
|
+
* @group Actors
|
|
13
|
+
*/
|
|
14
|
+
export interface CanHaveAbilities<Returned_Type = UsesAbilities> {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Assigns an {@apilink Ability} or several abilities to the {@apilink Actor}
|
|
18
|
+
*/
|
|
19
|
+
whoCan(...abilities: Ability[]): Returned_Type;
|
|
20
|
+
}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
3
|
-
*
|
|
4
|
-
* the resources it uses.
|
|
2
|
+
* An interface to be implemented by any {@apilink Ability} that needs to free up
|
|
3
|
+
* the resources it uses, e.g. disconnect from a database.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* This {@apilink Discardable.discard} method is invoked directly by the {@apilink Actor}, and indirectly by {@apilink Stage}:
|
|
6
|
+
* - when {@apilink SceneFinishes}, for actors instantiated after {@apilink SceneStarts} - e.g. within a test scenario or in a "before each" hook
|
|
7
|
+
* - when {@apilink TestRunFinishes}, for actors instantiated before {@apilink SceneStarts} - e.g. in a "before all" hook
|
|
9
8
|
*
|
|
10
|
-
* @
|
|
9
|
+
* Note that events such as {@apilink SceneFinishes} and {@apilink TestRunFinishes} are emitted by Serenity/JS test runner adapters,
|
|
10
|
+
* such as `@serenity-js/cucumber`, `@serenity-js/mocha`, `@serenity-js/jasmine`, and so on.
|
|
11
|
+
* Consult their respective readmes to learn how to register them with your test runner of choice.
|
|
12
|
+
*
|
|
13
|
+
* ## Learn more
|
|
14
|
+
* - {@apilink Ability}
|
|
15
|
+
* - {@apilink AbilityType}
|
|
16
|
+
* - {@apilink Initialisable}
|
|
17
|
+
*
|
|
18
|
+
* @group Abilities
|
|
11
19
|
*/
|
|
12
20
|
export interface Discardable {
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Discards the resources associated with this ability.
|
|
24
|
+
*/
|
|
13
25
|
discard(): Promise<void> | void;
|
|
14
26
|
}
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
3
|
-
*
|
|
4
|
-
* the resources it uses (i.e. establish a database connection).
|
|
2
|
+
* An interface to be implemented by any {@apilink Ability} that needs to initialise
|
|
3
|
+
* the resources it uses, e.g. establish a database connection.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The {@apilink Initialisable.initialise} method is invoked whenever {@apilink Actor.attemptsTo} method is called,
|
|
6
|
+
* but **only when** {@apilink Initialisable.isInitialised} returns false. This is to avoid initialising abilities more than once.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
8
|
+
* ## Learn more
|
|
9
|
+
* - {@apilink Ability}
|
|
10
|
+
* - {@apilink AbilityType}
|
|
11
|
+
* - {@apilink Discardable}
|
|
12
|
+
*
|
|
13
|
+
* @group Abilities
|
|
10
14
|
*/
|
|
11
15
|
export interface Initialisable {
|
|
12
16
|
|
|
13
17
|
/**
|
|
14
|
-
* @
|
|
15
|
-
*
|
|
16
|
-
* but only when {@link isInitialised} returns false.
|
|
17
|
-
*
|
|
18
|
-
* Make sure to implement {@link isInitialised} so that it returns `true`
|
|
19
|
-
* when the ability has been successfully initialised.
|
|
18
|
+
* Initialises the ability. Invoked whenever {@apilink Actor.attemptsTo} method is called,
|
|
19
|
+
* but **only when** {@apilink Initialisable.isInitialised} returns false.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* Make sure to implement {@apilink Initialisable.isInitialised} so that it returns `true`
|
|
22
|
+
* when the ability has been successfully initialised.
|
|
22
23
|
*/
|
|
23
24
|
initialise(): Promise<void> | void;
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* Should return `true` when all the resources that the given ability needs
|
|
28
|
+
* have been initialised. Should return `false` if the {@apilink Actor} should
|
|
29
|
+
* initialise them again when {@apilink Actor.attemptsTo} is called.
|
|
29
30
|
*
|
|
30
31
|
* @returns {boolean}
|
|
31
32
|
*/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Ability } from './Ability';
|
|
2
|
+
import { AbilityType } from './AbilityType';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Describes an {@apilink Actor} who can use their {@apilink Ability|abilities} to perform an {@apilink Activity}
|
|
6
|
+
* or answer a {@apilink Question}.
|
|
7
|
+
*
|
|
8
|
+
* ## Learn more
|
|
9
|
+
*
|
|
10
|
+
* - {@apilink Ability}
|
|
11
|
+
* - {@apilink Actor}
|
|
12
|
+
*
|
|
13
|
+
* @group Actors
|
|
14
|
+
*/
|
|
15
|
+
export interface UsesAbilities {
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Provides access to the {@apilink Actor|actor's} {@apilink Ability} to do something
|
|
19
|
+
*
|
|
20
|
+
* @param doSomething
|
|
21
|
+
* The type of ability to look up, e.g. {@apilink BrowseTheWeb} or {@apilink CallAnApi}
|
|
22
|
+
*/
|
|
23
|
+
abilityTo<T extends Ability>(doSomething: AbilityType<T>): T;
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Activity } from '../Activity';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Describes an {@apilink Actor} who can perform a sequence of {@apilink Activity|Activities},
|
|
5
|
+
* such as {@apilink Task|tasks} or {@apilink Interaction|interactions}.
|
|
6
|
+
*
|
|
7
|
+
* ## Learn more
|
|
8
|
+
* - {@apilink Activity}
|
|
9
|
+
* - {@apilink Interaction}
|
|
10
|
+
* - {@apilink Task}
|
|
11
|
+
* - {@apilink Actor}
|
|
12
|
+
*
|
|
13
|
+
* @group Actors
|
|
14
|
+
*/
|
|
15
|
+
export interface PerformsActivities {
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Makes the {@apilink Actor} attempt to perform a sequence of {@apilink Activity|Activities}.
|
|
19
|
+
*/
|
|
20
|
+
attemptsTo: (...activities: Activity[]) => Promise<void>;
|
|
21
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './PerformsActivities';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Artifact, Name } from '../../model';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Describes an {@apilink Actor} who can collect {@apilink Artifact|Artifacts}, such as {@apilink Photo|Photos} or {@apilink JSONData},
|
|
5
|
+
* while the scenario is being executed
|
|
6
|
+
*
|
|
7
|
+
* ## Learn more
|
|
8
|
+
* - {@apilink Artifact}
|
|
9
|
+
* - {@apilink Actor}
|
|
10
|
+
*
|
|
11
|
+
* @group Actors
|
|
12
|
+
*/
|
|
13
|
+
export interface CollectsArtifacts {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Makes the {@apilink Actor} collect an {@apilink Artifact} so that it can be included in the test report.
|
|
17
|
+
*
|
|
18
|
+
* @param artifact
|
|
19
|
+
* The artifact to be collected, such as {@apilink JSONData}
|
|
20
|
+
*
|
|
21
|
+
* @param name
|
|
22
|
+
* The name of the artifact to make it easy to recognise in the test report
|
|
23
|
+
*/
|
|
24
|
+
collect(artifact: Artifact, name?: Name): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CollectsArtifacts';
|