@serenity-js/core 3.25.0 → 3.25.2
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 +19 -0
- package/README.md +1 -1
- package/lib/Serenity.d.ts +22 -22
- package/lib/Serenity.js +22 -22
- package/lib/adapter/OutputStream.d.ts +5 -4
- package/lib/adapter/OutputStream.d.ts.map +1 -1
- package/lib/adapter/TestRunnerAdapter.d.ts +2 -2
- package/lib/config/ClassDescription.d.ts +1 -1
- package/lib/config/SerenityConfig.d.ts +22 -20
- package/lib/config/SerenityConfig.d.ts.map +1 -1
- package/lib/config/SerenityConfig.js +22 -20
- package/lib/config/SerenityConfig.js.map +1 -1
- package/lib/errors/ErrorFactory.d.ts +2 -1
- package/lib/errors/ErrorFactory.d.ts.map +1 -1
- package/lib/errors/ErrorFactory.js +2 -1
- package/lib/errors/ErrorFactory.js.map +1 -1
- package/lib/errors/RaiseErrors.d.ts +9 -9
- package/lib/errors/RaiseErrors.js +9 -9
- package/lib/errors/diff/AnsiDiffFormatter.d.ts +1 -1
- package/lib/errors/diff/AnsiDiffFormatter.js +1 -1
- package/lib/errors/diff/DiffFormatter.d.ts +1 -1
- package/lib/errors/diff/NoOpDiffFormatter.d.ts +1 -1
- package/lib/errors/diff/NoOpDiffFormatter.js +1 -1
- package/lib/errors/model/AssertionError.d.ts +1 -1
- package/lib/errors/model/AssertionError.js +1 -1
- package/lib/errors/model/ConfigurationError.d.ts +1 -1
- package/lib/errors/model/ConfigurationError.js +1 -1
- package/lib/errors/model/ImplementationPendingError.d.ts +3 -3
- package/lib/errors/model/ImplementationPendingError.js +3 -3
- package/lib/errors/model/ListItemNotFoundError.d.ts +2 -2
- package/lib/errors/model/ListItemNotFoundError.js +2 -2
- package/lib/errors/model/LogicError.d.ts +2 -2
- package/lib/errors/model/LogicError.js +2 -2
- package/lib/errors/model/OperationInterruptedError.d.ts +2 -2
- package/lib/errors/model/OperationInterruptedError.js +2 -2
- package/lib/errors/model/RuntimeError.d.ts +2 -2
- package/lib/errors/model/RuntimeError.js +2 -2
- package/lib/errors/model/TestCompromisedError.d.ts +1 -1
- package/lib/errors/model/TestCompromisedError.js +1 -1
- package/lib/errors/model/TimeoutExpiredError.d.ts +2 -2
- package/lib/errors/model/TimeoutExpiredError.js +2 -2
- package/lib/errors/model/UnknownError.d.ts +1 -1
- package/lib/errors/model/UnknownError.js +1 -1
- package/lib/events/ActivityFinished.d.ts +1 -1
- package/lib/events/ActivityFinished.js +1 -1
- package/lib/events/ActivityStarts.d.ts +1 -1
- package/lib/events/ActivityStarts.js +1 -1
- package/lib/events/BusinessRuleDetected.d.ts +1 -1
- package/lib/events/BusinessRuleDetected.js +1 -1
- package/lib/events/SceneFinishes.d.ts +2 -1
- package/lib/events/SceneFinishes.d.ts.map +1 -1
- package/lib/events/SceneFinishes.js +2 -1
- package/lib/events/SceneFinishes.js.map +1 -1
- package/lib/instance.d.ts +30 -30
- package/lib/instance.js +30 -30
- package/lib/io/format.d.ts +15 -6
- package/lib/io/format.d.ts.map +1 -1
- package/lib/io/format.js +15 -6
- package/lib/io/format.js.map +1 -1
- package/lib/io/loader/ModuleLoader.d.ts +1 -1
- package/lib/io/loader/ModuleLoader.js +1 -1
- package/lib/io/reflection/ValueInspector.d.ts +1 -1
- package/lib/io/reflection/ValueInspector.js +2 -2
- package/lib/io/reflection/ValueInspector.js.map +1 -1
- package/lib/io/stringified.d.ts +1 -1
- package/lib/io/stringified.js +1 -1
- package/lib/io/trimmed.d.ts +1 -1
- package/lib/io/trimmed.js +1 -1
- package/lib/model/artifacts/HTTPRequestResponse.d.ts +2 -2
- package/lib/model/artifacts/HTTPRequestResponse.js +1 -1
- package/lib/screenplay/Activity.d.ts +10 -10
- package/lib/screenplay/Activity.js +5 -5
- package/lib/screenplay/Actor.d.ts +28 -28
- package/lib/screenplay/Actor.js +28 -28
- package/lib/screenplay/Answerable.d.ts +1 -1
- package/lib/screenplay/Answered.d.ts +2 -2
- package/lib/screenplay/Interaction.d.ts +17 -17
- package/lib/screenplay/Interaction.js +12 -12
- package/lib/screenplay/Optional.d.ts +1 -1
- package/lib/screenplay/Question.d.ts +48 -45
- package/lib/screenplay/Question.d.ts.map +1 -1
- package/lib/screenplay/Question.js +39 -36
- package/lib/screenplay/Question.js.map +1 -1
- package/lib/screenplay/RecursivelyAnswered.d.ts +2 -2
- package/lib/screenplay/Task.d.ts +19 -19
- package/lib/screenplay/Task.js +15 -15
- package/lib/screenplay/WithAnswerableProperties.d.ts +2 -2
- package/lib/screenplay/abilities/Ability.d.ts +48 -46
- package/lib/screenplay/abilities/Ability.d.ts.map +1 -1
- package/lib/screenplay/abilities/Ability.js +48 -46
- package/lib/screenplay/abilities/Ability.js.map +1 -1
- package/lib/screenplay/abilities/AbilityType.d.ts +5 -5
- package/lib/screenplay/abilities/AnswerQuestions.d.ts +3 -3
- package/lib/screenplay/abilities/AnswerQuestions.js +3 -3
- package/lib/screenplay/abilities/CanHaveAbilities.d.ts +4 -4
- package/lib/screenplay/abilities/Discardable.d.ts +8 -8
- package/lib/screenplay/abilities/Initialisable.d.ts +11 -11
- package/lib/screenplay/abilities/PerformActivities.d.ts +3 -3
- package/lib/screenplay/abilities/PerformActivities.js +3 -3
- package/lib/screenplay/abilities/UsesAbilities.d.ts +6 -6
- package/lib/screenplay/activities/PerformsActivities.d.ts +7 -7
- package/lib/screenplay/artifacts/CollectsArtifacts.d.ts +4 -5
- package/lib/screenplay/artifacts/CollectsArtifacts.d.ts.map +1 -1
- package/lib/screenplay/debugging/Debug.d.ts +7 -6
- package/lib/screenplay/debugging/Debug.d.ts.map +1 -1
- package/lib/screenplay/debugging/Debug.js +7 -6
- package/lib/screenplay/debugging/Debug.js.map +1 -1
- package/lib/screenplay/debugging/DebuggingResult.d.ts +1 -1
- package/lib/screenplay/debugging/Log.d.ts +7 -5
- package/lib/screenplay/debugging/Log.d.ts.map +1 -1
- package/lib/screenplay/debugging/Log.js +7 -5
- package/lib/screenplay/debugging/Log.js.map +1 -1
- package/lib/screenplay/notes/Notepad.d.ts +13 -13
- package/lib/screenplay/notes/Notepad.js +13 -13
- package/lib/screenplay/notes/NotepadAdapter.d.ts +16 -16
- package/lib/screenplay/notes/NotepadAdapter.js +16 -16
- package/lib/screenplay/notes/TakeNotes.d.ts +9 -9
- package/lib/screenplay/notes/TakeNotes.js +9 -9
- package/lib/screenplay/notes/notes.d.ts +6 -6
- package/lib/screenplay/notes/notes.js +6 -6
- package/lib/screenplay/questions/AnswersQuestions.d.ts +4 -4
- package/lib/screenplay/questions/ChainableMetaQuestion.d.ts +6 -6
- package/lib/screenplay/questions/Check.d.ts +2 -2
- package/lib/screenplay/questions/Check.js +2 -2
- package/lib/screenplay/questions/DescriptionFormattingOptions.d.ts +2 -2
- package/lib/screenplay/questions/Expectation.d.ts +17 -14
- package/lib/screenplay/questions/Expectation.d.ts.map +1 -1
- package/lib/screenplay/questions/Expectation.js +17 -14
- package/lib/screenplay/questions/Expectation.js.map +1 -1
- package/lib/screenplay/questions/List.d.ts +5 -5
- package/lib/screenplay/questions/List.js +5 -5
- package/lib/screenplay/questions/Masked.d.ts +4 -2
- package/lib/screenplay/questions/Masked.d.ts.map +1 -1
- package/lib/screenplay/questions/Masked.js +4 -2
- package/lib/screenplay/questions/Masked.js.map +1 -1
- package/lib/screenplay/questions/MetaQuestion.d.ts +9 -9
- package/lib/screenplay/questions/Unanswered.d.ts +2 -2
- package/lib/screenplay/questions/Unanswered.js +2 -2
- package/lib/screenplay/questions/expectations/ExpectationDetails.d.ts +1 -1
- package/lib/screenplay/questions/expectations/ExpectationDetails.js +1 -1
- package/lib/screenplay/questions/expectations/ExpectationMet.d.ts +1 -1
- package/lib/screenplay/questions/expectations/ExpectationMet.js +1 -1
- package/lib/screenplay/questions/expectations/ExpectationNotMet.d.ts +1 -1
- package/lib/screenplay/questions/expectations/ExpectationNotMet.js +1 -1
- package/lib/screenplay/questions/expectations/ExpectationOutcome.d.ts +2 -2
- package/lib/screenplay/questions/expectations/ExpectationOutcome.js +2 -2
- package/lib/screenplay/questions/tag-functions.d.ts +23 -21
- package/lib/screenplay/questions/tag-functions.d.ts.map +1 -1
- package/lib/screenplay/questions/tag-functions.js +5 -5
- package/lib/screenplay/questions/tag-functions.js.map +1 -1
- package/lib/screenplay/time/TellsTime.d.ts +4 -4
- package/lib/screenplay/time/abilities/ScheduleWork.d.ts +2 -2
- package/lib/screenplay/time/abilities/ScheduleWork.js +2 -2
- package/lib/screenplay/time/activities/Wait.d.ts +29 -27
- package/lib/screenplay/time/activities/Wait.d.ts.map +1 -1
- package/lib/screenplay/time/activities/Wait.js +29 -27
- package/lib/screenplay/time/activities/Wait.js.map +1 -1
- package/lib/screenplay/time/models/Clock.d.ts +4 -4
- package/lib/screenplay/time/models/Clock.js +4 -4
- package/lib/screenplay/time/models/Duration.d.ts +1 -1
- package/lib/screenplay/time/models/Duration.js +1 -1
- package/lib/screenplay/time/models/Timestamp.d.ts +2 -2
- package/lib/screenplay/time/models/Timestamp.js +2 -2
- package/lib/stage/Cast.d.ts +21 -21
- package/lib/stage/Cast.js +19 -19
- package/lib/stage/Extras.d.ts +1 -1
- package/lib/stage/Extras.js +1 -1
- package/lib/stage/ListensToDomainEvents.d.ts +7 -7
- package/lib/stage/Stage.d.ts +30 -30
- package/lib/stage/Stage.d.ts.map +1 -1
- package/lib/stage/Stage.js +30 -30
- package/lib/stage/Stage.js.map +1 -1
- package/lib/stage/StageCrewMember.d.ts +11 -11
- package/lib/stage/StageCrewMemberBuilder.d.ts +7 -7
- package/lib/stage/StageCrewMemberBuilderDependencies.d.ts +2 -2
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.d.ts +4 -4
- package/lib/stage/crew/artifact-archiver/ArtifactArchiver.js +4 -4
- package/lib/stage/crew/stream-reporter/StreamReporter.d.ts +7 -7
- package/lib/stage/crew/stream-reporter/StreamReporter.js +7 -7
- package/package.json +4 -4
- package/src/Serenity.ts +22 -22
- package/src/adapter/OutputStream.ts +5 -4
- package/src/adapter/TestRunnerAdapter.ts +2 -2
- package/src/config/ClassDescription.ts +1 -1
- package/src/config/SerenityConfig.ts +22 -20
- package/src/errors/ErrorFactory.ts +2 -1
- package/src/errors/ErrorSerialiser.ts +3 -3
- package/src/errors/RaiseErrors.ts +9 -9
- package/src/errors/diff/AnsiDiffFormatter.ts +1 -1
- package/src/errors/diff/DiffFormatter.ts +1 -1
- package/src/errors/diff/NoOpDiffFormatter.ts +1 -1
- package/src/errors/model/AssertionError.ts +1 -1
- package/src/errors/model/ConfigurationError.ts +1 -1
- package/src/errors/model/ImplementationPendingError.ts +3 -3
- package/src/errors/model/ListItemNotFoundError.ts +2 -2
- package/src/errors/model/LogicError.ts +2 -2
- package/src/errors/model/OperationInterruptedError.ts +2 -2
- package/src/errors/model/RuntimeError.ts +2 -2
- package/src/errors/model/TestCompromisedError.ts +1 -1
- package/src/errors/model/TimeoutExpiredError.ts +2 -2
- package/src/errors/model/UnknownError.ts +1 -1
- package/src/events/ActivityFinished.ts +1 -1
- package/src/events/ActivityStarts.ts +1 -1
- package/src/events/BusinessRuleDetected.ts +1 -1
- package/src/events/SceneFinishes.ts +2 -1
- package/src/instance.ts +30 -30
- package/src/io/format.ts +15 -6
- package/src/io/loader/ModuleLoader.ts +1 -1
- package/src/io/reflection/ValueInspector.ts +3 -3
- package/src/io/stringified.ts +1 -1
- package/src/io/trimmed.ts +1 -1
- package/src/model/artifacts/HTTPRequestResponse.ts +2 -2
- package/src/screenplay/Activity.ts +10 -10
- package/src/screenplay/Actor.ts +28 -28
- package/src/screenplay/Answerable.ts +1 -1
- package/src/screenplay/Answered.ts +2 -2
- package/src/screenplay/Interaction.ts +17 -17
- package/src/screenplay/Optional.ts +1 -1
- package/src/screenplay/Question.ts +48 -45
- package/src/screenplay/RecursivelyAnswered.ts +2 -2
- package/src/screenplay/Task.ts +19 -19
- package/src/screenplay/WithAnswerableProperties.ts +2 -2
- package/src/screenplay/abilities/Ability.ts +48 -46
- package/src/screenplay/abilities/AbilityType.ts +5 -5
- package/src/screenplay/abilities/AnswerQuestions.ts +3 -3
- package/src/screenplay/abilities/CanHaveAbilities.ts +4 -4
- package/src/screenplay/abilities/Discardable.ts +8 -8
- package/src/screenplay/abilities/Initialisable.ts +11 -11
- package/src/screenplay/abilities/PerformActivities.ts +3 -3
- package/src/screenplay/abilities/UsesAbilities.ts +6 -6
- package/src/screenplay/activities/PerformsActivities.ts +7 -7
- package/src/screenplay/artifacts/CollectsArtifacts.ts +4 -5
- package/src/screenplay/debugging/Debug.ts +7 -6
- package/src/screenplay/debugging/DebuggingResult.ts +1 -1
- package/src/screenplay/debugging/Log.ts +7 -5
- package/src/screenplay/notes/Notepad.ts +13 -13
- package/src/screenplay/notes/NotepadAdapter.ts +16 -16
- package/src/screenplay/notes/TakeNotes.ts +9 -9
- package/src/screenplay/notes/notes.ts +6 -6
- package/src/screenplay/questions/AnswersQuestions.ts +4 -4
- package/src/screenplay/questions/ChainableMetaQuestion.ts +6 -6
- package/src/screenplay/questions/Check.ts +2 -2
- package/src/screenplay/questions/DescriptionFormattingOptions.ts +2 -2
- package/src/screenplay/questions/Expectation.ts +17 -14
- package/src/screenplay/questions/List.ts +5 -5
- package/src/screenplay/questions/Masked.ts +4 -2
- package/src/screenplay/questions/MetaQuestion.ts +9 -9
- package/src/screenplay/questions/Unanswered.ts +2 -2
- package/src/screenplay/questions/expectations/ExpectationDetails.ts +1 -1
- package/src/screenplay/questions/expectations/ExpectationMet.ts +1 -1
- package/src/screenplay/questions/expectations/ExpectationNotMet.ts +1 -1
- package/src/screenplay/questions/expectations/ExpectationOutcome.ts +2 -2
- package/src/screenplay/questions/tag-functions.ts +23 -21
- package/src/screenplay/time/TellsTime.ts +4 -4
- package/src/screenplay/time/abilities/ScheduleWork.ts +2 -2
- package/src/screenplay/time/activities/Wait.ts +29 -27
- package/src/screenplay/time/models/Clock.ts +4 -4
- package/src/screenplay/time/models/Duration.ts +1 -1
- package/src/screenplay/time/models/Timestamp.ts +2 -2
- package/src/stage/Cast.ts +21 -21
- package/src/stage/Extras.ts +1 -1
- package/src/stage/ListensToDomainEvents.ts +7 -7
- package/src/stage/Stage.ts +30 -30
- package/src/stage/StageCrewMember.ts +11 -11
- package/src/stage/StageCrewMemberBuilder.ts +7 -7
- package/src/stage/StageCrewMemberBuilderDependencies.ts +2 -2
- package/src/stage/crew/artifact-archiver/ArtifactArchiver.ts +4 -4
- package/src/stage/crew/stream-reporter/StreamReporter.ts +7 -7
package/lib/instance.js
CHANGED
|
@@ -16,10 +16,10 @@ exports.serenity = new Serenity_1.Serenity(clock);
|
|
|
16
16
|
* so this function should be called exactly once
|
|
17
17
|
* in your test suite.
|
|
18
18
|
*
|
|
19
|
-
* This function is an alias for
|
|
19
|
+
* This function is an alias for [`Serenity.configure`](https://serenity-js.org/api/core/class/Serenity/#configure).
|
|
20
20
|
*
|
|
21
21
|
* :::tip configure vs engage
|
|
22
|
-
* If you want to retain the configuration but reset the
|
|
22
|
+
* If you want to retain the configuration but reset the [cast of actors](https://serenity-js.org/api/core/class/Cast/), use [`engage`](https://serenity-js.org/api/core/function/engage/) instead.
|
|
23
23
|
* :::
|
|
24
24
|
*
|
|
25
25
|
* @param config
|
|
@@ -31,26 +31,26 @@ function configure(config) {
|
|
|
31
31
|
}
|
|
32
32
|
exports.configure = configure;
|
|
33
33
|
/**
|
|
34
|
-
* Re-configures Serenity/JS with a new
|
|
35
|
-
* you want to use in any subsequent calls to
|
|
34
|
+
* Re-configures Serenity/JS with a new [cast](https://serenity-js.org/api/core/class/Cast/) of [actors](https://serenity-js.org/api/core/class/Actor/)
|
|
35
|
+
* you want to use in any subsequent calls to [`actorCalled`](https://serenity-js.org/api/core/function/actorCalled/).
|
|
36
36
|
*
|
|
37
|
-
* This function is an alias for
|
|
38
|
-
* which provides an alternative to calling
|
|
37
|
+
* This function is an alias for [`Serenity.engage`](https://serenity-js.org/api/core/class/Serenity/#engage),
|
|
38
|
+
* which provides an alternative to calling [`Actor.whoCan`](https://serenity-js.org/api/core/class/Actor/#whoCan) directly in your tests
|
|
39
39
|
* and is typically invoked in a "before all" or "before each" hook of your test runner of choice.
|
|
40
40
|
*
|
|
41
41
|
* :::tip configure vs engage
|
|
42
|
-
* Calling
|
|
42
|
+
* Calling [`engage`](https://serenity-js.org/api/core/function/engage/) replaces the currently configured [cast of actors](https://serenity-js.org/api/core/class/Cast/),
|
|
43
43
|
* but doesn't affect any other configuration.
|
|
44
|
-
* If you want to reset the Serenity/JS configuration completely, use
|
|
44
|
+
* If you want to reset the Serenity/JS configuration completely, use [`configure`](https://serenity-js.org/api/core/function/configure/) instead.
|
|
45
45
|
* :::
|
|
46
46
|
*
|
|
47
|
-
* If your implementation of the
|
|
47
|
+
* If your implementation of the [cast](https://serenity-js.org/api/core/class/Cast/) interface is stateless,
|
|
48
48
|
* you can invoke this function just once before your entire test suite is executed, see
|
|
49
49
|
* - [`beforeAll`](https://jasmine.github.io/api/3.6/global.html#beforeAll) in Jasmine,
|
|
50
50
|
* - [`before`](https://mochajs.org/#hooks) in Mocha,
|
|
51
51
|
* - [`BeforeAll`](https://github.com/cucumber/cucumber-js/blob/master/docs/support_files/hooks.md#beforeall--afterall) in Cucumber.js
|
|
52
52
|
*
|
|
53
|
-
* However, if your
|
|
53
|
+
* However, if your [cast](https://serenity-js.org/api/core/class/Cast/) holds state that you want to reset before each scenario,
|
|
54
54
|
* it's better to invoke `engage` before each test using:
|
|
55
55
|
* - [`beforeEach`](https://jasmine.github.io/api/3.6/global.html#beforeEach) in Jasmine
|
|
56
56
|
* - [`beforeEach`](https://mochajs.org/#hooks) in Mocha,
|
|
@@ -113,8 +113,8 @@ exports.configure = configure;
|
|
|
113
113
|
*
|
|
114
114
|
* ### Using with Playwright Test runner
|
|
115
115
|
*
|
|
116
|
-
* [Serenity/JS Playwright Test module](/api/playwright-test) will configure the cast on your behalf,
|
|
117
|
-
* so you don't need to call
|
|
116
|
+
* [Serenity/JS Playwright Test module](https://serenity-js.org/api/playwright-test) will configure the cast on your behalf,
|
|
117
|
+
* so you don't need to call [`engage`](https://serenity-js.org/api/core/function/engage/).
|
|
118
118
|
*
|
|
119
119
|
* ```ts
|
|
120
120
|
* import { describe, it, test } from '@serenity-js/playwright-test'
|
|
@@ -131,9 +131,9 @@ exports.configure = configure;
|
|
|
131
131
|
* ```
|
|
132
132
|
*
|
|
133
133
|
* ## Learn more
|
|
134
|
-
* -
|
|
135
|
-
* -
|
|
136
|
-
* -
|
|
134
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
135
|
+
* - [`Cast`](https://serenity-js.org/api/core/class/Cast/)
|
|
136
|
+
* - [`Serenity.engage`](https://serenity-js.org/api/core/class/Serenity/#engage)
|
|
137
137
|
*
|
|
138
138
|
* @param actors
|
|
139
139
|
*
|
|
@@ -144,10 +144,10 @@ function engage(actors) {
|
|
|
144
144
|
}
|
|
145
145
|
exports.engage = engage;
|
|
146
146
|
/**
|
|
147
|
-
* Instantiates or retrieves an
|
|
147
|
+
* Instantiates or retrieves an [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
148
148
|
* called `name` if one has already been instantiated.
|
|
149
149
|
*
|
|
150
|
-
* This method is an alias for
|
|
150
|
+
* This method is an alias for [`Serenity.theActorCalled`](https://serenity-js.org/api/core/class/Serenity/#theActorCalled).
|
|
151
151
|
*
|
|
152
152
|
* ## Usage with Cucumber
|
|
153
153
|
*
|
|
@@ -196,9 +196,9 @@ exports.engage = engage;
|
|
|
196
196
|
*
|
|
197
197
|
* ## Usage with Playwright Test
|
|
198
198
|
*
|
|
199
|
-
* When using [Serenity/JS with Playwright Test](/api/playwright-test/), you should use either
|
|
200
|
-
* the default [`actor`](/api/playwright-test/interface/SerenityFixtures/#actorCalled) fixture
|
|
201
|
-
* or the injected [`actorCalled`](/api/playwright-test/interface/SerenityFixtures/#actorCalled) function
|
|
199
|
+
* When using [Serenity/JS with Playwright Test](https://serenity-js.org/api/playwright-test/), you should use either
|
|
200
|
+
* the default [`actor`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#actorCalled) fixture
|
|
201
|
+
* or the injected [`actorCalled`](https://serenity-js.org/api/playwright-test/interface/SerenityFixtures/#actorCalled) function
|
|
202
202
|
* instead of importing it from `@serenity-js/core`.
|
|
203
203
|
*
|
|
204
204
|
* ```typescript
|
|
@@ -216,10 +216,10 @@ exports.engage = engage;
|
|
|
216
216
|
*
|
|
217
217
|
* ## Learn more
|
|
218
218
|
*
|
|
219
|
-
* -
|
|
220
|
-
* -
|
|
221
|
-
* -
|
|
222
|
-
* -
|
|
219
|
+
* - [`engage`](https://serenity-js.org/api/core/function/engage/)
|
|
220
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
221
|
+
* - [`Cast`](https://serenity-js.org/api/core/class/Cast/)
|
|
222
|
+
* - [`Serenity.theActorCalled`](https://serenity-js.org/api/core/class/Serenity/#theActorCalled)
|
|
223
223
|
*
|
|
224
224
|
* @param name
|
|
225
225
|
* The name of the actor to instantiate or retrieve
|
|
@@ -232,11 +232,11 @@ function actorCalled(name) {
|
|
|
232
232
|
exports.actorCalled = actorCalled;
|
|
233
233
|
/**
|
|
234
234
|
* Retrieves an actor who was last instantiated or retrieved
|
|
235
|
-
* using
|
|
235
|
+
* using [`actorCalled`](https://serenity-js.org/api/core/function/actorCalled/).
|
|
236
236
|
*
|
|
237
237
|
* This function is particularly useful when automating Cucumber scenarios.
|
|
238
238
|
*
|
|
239
|
-
* This function is an alias for
|
|
239
|
+
* This function is an alias for [`Serenity.theActorInTheSpotlight`](https://serenity-js.org/api/core/class/Serenity/#theActorInTheSpotlight).
|
|
240
240
|
*
|
|
241
241
|
* ## Usage with Cucumber
|
|
242
242
|
*
|
|
@@ -257,10 +257,10 @@ exports.actorCalled = actorCalled;
|
|
|
257
257
|
*
|
|
258
258
|
* ## Learn more
|
|
259
259
|
*
|
|
260
|
-
* -
|
|
261
|
-
* -
|
|
262
|
-
* -
|
|
263
|
-
* -
|
|
260
|
+
* - [`engage`](https://serenity-js.org/api/core/function/engage/)
|
|
261
|
+
* - [`actorCalled`](https://serenity-js.org/api/core/function/actorCalled/)
|
|
262
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
263
|
+
* - [`Cast`](https://serenity-js.org/api/core/class/Cast/)
|
|
264
264
|
*
|
|
265
265
|
* @group Actors
|
|
266
266
|
*/
|
package/lib/io/format.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import type { Answerable } from '../screenplay';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* `format` is a factory function returning
|
|
4
4
|
* a [tag function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals)
|
|
5
|
-
* that produces a human-readable description of a template containing
|
|
6
|
-
* one or more
|
|
5
|
+
* that produces a human-readable `string` description of a template containing
|
|
6
|
+
* one or more [answerables](https://serenity-js.org/api/core/#Answerable).
|
|
7
7
|
*
|
|
8
|
-
* Typically, you'll want to use
|
|
9
|
-
* - the
|
|
10
|
-
* - the
|
|
8
|
+
* Typically, you'll want to use `d` and `f` shorthands instead, or the modern alternative - `the`:
|
|
9
|
+
* - the [`d`](https://serenity-js.org/api/core/function/d/) function works best for generating a **static description** of a parameterised [`Activity`](https://serenity-js.org/api/core/class/Activity/)
|
|
10
|
+
* - the [`f`](https://serenity-js.org/api/core/function/f/) function is better suited for debugging
|
|
11
|
+
* - the [`the`](https://serenity-js.org/api/core/function/f/) function works best for generating a **dynamic description** of a parameterised [`Activity`](https://serenity-js.org/api/core/class/Activity/)
|
|
12
|
+
*
|
|
13
|
+
* :::tip Use `the` instead of `format`
|
|
14
|
+
* `format`, `d` and `f` are the original Serenity/JS string formatting functions,
|
|
15
|
+
* still present in the framework for backwards compatibility purposes.
|
|
16
|
+
*
|
|
17
|
+
* To generate a dynamic description of a `Question` or `Interaction`,
|
|
18
|
+
* use [`the`](https://serenity-js.org/api/core/function/the/) function instead.
|
|
19
|
+
* :::
|
|
11
20
|
*
|
|
12
21
|
* ## Using `format`
|
|
13
22
|
*
|
package/lib/io/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,CAAC,SAAS,EAAE,oBAAoB,EAAE,GAAG,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,MAAM,CAS/I;AAED,uBAAuB;AACvB,eAAO,MAAM,CAAC,cAZ0D,oBAAoB,mBAAmB,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,MAY1F,CAAC;AAEjD,uBAAuB;AACvB,eAAO,MAAM,CAAC,cAf0D,oBAAoB,mBAAmB,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,MAezF,CAAC"}
|
package/lib/io/format.js
CHANGED
|
@@ -3,14 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.d = exports.f = exports.format = void 0;
|
|
4
4
|
const stringified_1 = require("./stringified");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* `format` is a factory function returning
|
|
7
7
|
* a [tag function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals)
|
|
8
|
-
* that produces a human-readable description of a template containing
|
|
9
|
-
* one or more
|
|
8
|
+
* that produces a human-readable `string` description of a template containing
|
|
9
|
+
* one or more [answerables](https://serenity-js.org/api/core/#Answerable).
|
|
10
10
|
*
|
|
11
|
-
* Typically, you'll want to use
|
|
12
|
-
* - the
|
|
13
|
-
* - the
|
|
11
|
+
* Typically, you'll want to use `d` and `f` shorthands instead, or the modern alternative - `the`:
|
|
12
|
+
* - the [`d`](https://serenity-js.org/api/core/function/d/) function works best for generating a **static description** of a parameterised [`Activity`](https://serenity-js.org/api/core/class/Activity/)
|
|
13
|
+
* - the [`f`](https://serenity-js.org/api/core/function/f/) function is better suited for debugging
|
|
14
|
+
* - the [`the`](https://serenity-js.org/api/core/function/f/) function works best for generating a **dynamic description** of a parameterised [`Activity`](https://serenity-js.org/api/core/class/Activity/)
|
|
15
|
+
*
|
|
16
|
+
* :::tip Use `the` instead of `format`
|
|
17
|
+
* `format`, `d` and `f` are the original Serenity/JS string formatting functions,
|
|
18
|
+
* still present in the framework for backwards compatibility purposes.
|
|
19
|
+
*
|
|
20
|
+
* To generate a dynamic description of a `Question` or `Interaction`,
|
|
21
|
+
* use [`the`](https://serenity-js.org/api/core/function/the/) function instead.
|
|
22
|
+
* :::
|
|
14
23
|
*
|
|
15
24
|
* ## Using `format`
|
|
16
25
|
*
|
package/lib/io/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/io/format.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,SAAgB,MAAM,CAAC,MAAkC;IACrD,OAAO,CAAC,SAA+B,EAAE,GAAG,YAAoC,EAAU,EAAE;QACxF,OAAO,SAAS;aACX,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,MAAM;YACzC,CAAC,CAAC,CAAE,QAAQ,EAAE,IAAA,yBAAW,EAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAE;YACnG,CAAC,CAAC,CAAE,QAAQ,CAAE,CAAC;aAClB,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;aAC7C,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAA;AACL,CAAC;AATD,wBASC;AAED,uBAAuB;AACV,QAAA,CAAC,GAAG,MAAM,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AAEjD,uBAAuB;AACV,QAAA,CAAC,GAAG,MAAM,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC"}
|
|
@@ -38,7 +38,7 @@ export declare class ModuleLoader {
|
|
|
38
38
|
require(moduleId: string): any;
|
|
39
39
|
private cachedIfNeeded;
|
|
40
40
|
/**
|
|
41
|
-
* Returns
|
|
41
|
+
* Returns `Version` of module specified by `moduleId`, based on its `package.json`.
|
|
42
42
|
*
|
|
43
43
|
* @param moduleId
|
|
44
44
|
*/
|
|
@@ -96,7 +96,7 @@ class ModuleLoader {
|
|
|
96
96
|
return moduleId;
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
|
-
* Returns
|
|
99
|
+
* Returns `Version` of module specified by `moduleId`, based on its `package.json`.
|
|
100
100
|
*
|
|
101
101
|
* @param moduleId
|
|
102
102
|
*/
|
|
@@ -2,7 +2,7 @@ export declare class ValueInspector {
|
|
|
2
2
|
static isPromise(value: unknown): value is Promise<unknown>;
|
|
3
3
|
static isDate(value: unknown): value is Date;
|
|
4
4
|
/**
|
|
5
|
-
* Checks if the value is a named
|
|
5
|
+
* Checks if the value is a named [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
|
|
6
6
|
*
|
|
7
7
|
* @param value
|
|
8
8
|
*/
|
|
@@ -11,7 +11,7 @@ class ValueInspector {
|
|
|
11
11
|
return value instanceof Date;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Checks if the value is a named
|
|
14
|
+
* Checks if the value is a named [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
|
|
15
15
|
*
|
|
16
16
|
* @param value
|
|
17
17
|
*/
|
|
@@ -103,7 +103,7 @@ class ValueInspector {
|
|
|
103
103
|
* @param value
|
|
104
104
|
*/
|
|
105
105
|
static isNative(value) {
|
|
106
|
-
const toString = Object.prototype.toString, // Used to resolve the internal `
|
|
106
|
+
const toString = Object.prototype.toString, // Used to resolve the internal `Class` of values
|
|
107
107
|
fnToString = Function.prototype.toString, // Used to resolve the decompiled source of functions
|
|
108
108
|
hostConstructor = /^\[object .+?Constructor]$/; // Used to detect host constructors (Safari > 4; really typed array specific)
|
|
109
109
|
// Compile a regexp using a common native method as a template.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValueInspector.js","sourceRoot":"","sources":["../../../src/io/reflection/ValueInspector.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAElC,MAAa,cAAc;IACvB,MAAM,CAAC,SAAS,CAAC,KAAc;QAC3B,OAAO,KAAK,YAAY,OAAO;eACxB,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAc;QACxB,OAAO,KAAK,YAAY,IAAI,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,KAAc;QAC5B,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,mBAAmB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,IAAI,GAAG,OAAO,KAAK,CAAC;QAC1B,OAAO,IAAI,KAAK,UAAU;YACtB,sEAAsE;YACtE,6BAA6B;YAC7B,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrD,2EAA2E;YAC3E,uEAAuE;YACvE,yBAAyB;YACzB,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,QAAQ,IAAI,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;IAC9F,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAAC,KAAc;QAC/B,OAAO,CAAC,CAAG,KAAa,CAAC,OAAO,IAAI,OAAQ,KAAa,CAAC,OAAO,KAAK,UAAU,CAAC;IACrF,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,KAAc;QAC7C,OAAO,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,CAAC;IACpE,CAAC;CACJ;AAlKD,wCAkKC"}
|
package/lib/io/stringified.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface StringifyConfig {
|
|
|
5
5
|
markQuestions?: boolean;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Provides a human-readable description of the
|
|
8
|
+
* Provides a human-readable description of the [`Answerable<T>`](https://serenity-js.org/api/core/#Answerable).
|
|
9
9
|
* Similar to [Node util~inspect](https://nodejs.org/api/util.html#utilinspectobject-options).
|
|
10
10
|
*
|
|
11
11
|
* @param value
|
package/lib/io/stringified.js
CHANGED
|
@@ -6,7 +6,7 @@ const Question_1 = require("../screenplay/Question");
|
|
|
6
6
|
const ValueInspector_1 = require("./reflection/ValueInspector");
|
|
7
7
|
const indentationPrefix = ' ';
|
|
8
8
|
/**
|
|
9
|
-
* Provides a human-readable description of the
|
|
9
|
+
* Provides a human-readable description of the [`Answerable<T>`](https://serenity-js.org/api/core/#Answerable).
|
|
10
10
|
* Similar to [Node util~inspect](https://nodejs.org/api/util.html#utilinspectobject-options).
|
|
11
11
|
*
|
|
12
12
|
* @param value
|
package/lib/io/trimmed.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A tag function trimming the leading and trailing whitespace from multi-line strings.
|
|
3
3
|
*
|
|
4
|
-
* @
|
|
4
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals
|
|
5
5
|
*
|
|
6
6
|
* @param templates
|
|
7
7
|
* @param placeholders
|
package/lib/io/trimmed.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.trimmed = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* A tag function trimming the leading and trailing whitespace from multi-line strings.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals
|
|
8
8
|
*
|
|
9
9
|
* @param templates
|
|
10
10
|
* @param placeholders
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JSONObject } from 'tiny-types';
|
|
2
2
|
import { JSONData } from './JSONData';
|
|
3
3
|
/**
|
|
4
|
-
* The value of the
|
|
4
|
+
* The value of the `HTTPRequestResponse` artifact describing an HTTP request/response pair.
|
|
5
5
|
*/
|
|
6
6
|
export interface RequestAndResponse extends JSONObject {
|
|
7
7
|
request: {
|
|
@@ -19,7 +19,7 @@ export interface RequestAndResponse extends JSONObject {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* An
|
|
22
|
+
* An artifact describing a HTTP request/response pair.
|
|
23
23
|
*/
|
|
24
24
|
export declare class HTTPRequestResponse extends JSONData {
|
|
25
25
|
static fromJSON(value: RequestAndResponse): HTTPRequestResponse;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HTTPRequestResponse = void 0;
|
|
4
4
|
const JSONData_1 = require("./JSONData");
|
|
5
5
|
/**
|
|
6
|
-
* An
|
|
6
|
+
* An artifact describing a HTTP request/response pair.
|
|
7
7
|
*/
|
|
8
8
|
class HTTPRequestResponse extends JSONData_1.JSONData {
|
|
9
9
|
static fromJSON(value) {
|
|
@@ -5,12 +5,12 @@ import type { Answerable } from './Answerable';
|
|
|
5
5
|
import type { AnswersQuestions } from './questions/AnswersQuestions';
|
|
6
6
|
import { Describable } from './questions/Describable';
|
|
7
7
|
/**
|
|
8
|
-
* **Activities** represents
|
|
8
|
+
* **Activities** represents [tasks](https://serenity-js.org/api/core/class/Task/) and [interactions](https://serenity-js.org/api/core/class/Interaction/) to be performed by an [actor](https://serenity-js.org/api/core/class/Actor/).
|
|
9
9
|
*
|
|
10
10
|
* Learn more about:
|
|
11
|
-
* - [Performing activities at multiple levels](/handbook/design/screenplay-pattern#performing-activities-at-multiple-levels)
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
11
|
+
* - [Performing activities at multiple levels](https://serenity-js.org/handbook/design/screenplay-pattern#performing-activities-at-multiple-levels)
|
|
12
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
13
|
+
* - [`PerformsActivities`](https://serenity-js.org/api/core/interface/PerformsActivities/)
|
|
14
14
|
* - [Command design pattern on Wikipedia](https://en.wikipedia.org/wiki/Command_pattern)
|
|
15
15
|
*
|
|
16
16
|
* @group Screenplay Pattern
|
|
@@ -20,19 +20,19 @@ export declare abstract class Activity extends Describable {
|
|
|
20
20
|
private static errorStackParser;
|
|
21
21
|
constructor(description: Answerable<string>, location?: FileSystemLocation);
|
|
22
22
|
/**
|
|
23
|
-
* Returns the location where this
|
|
23
|
+
* Returns the location where this [`Activity`](https://serenity-js.org/api/core/class/Activity/) was instantiated.
|
|
24
24
|
*/
|
|
25
25
|
instantiationLocation(): FileSystemLocation;
|
|
26
26
|
/**
|
|
27
|
-
* Instructs the provided
|
|
27
|
+
* Instructs the provided [`Actor`](https://serenity-js.org/api/core/class/Actor/) to perform this [`Activity`](https://serenity-js.org/api/core/class/Activity/).
|
|
28
28
|
*
|
|
29
29
|
* @param actor
|
|
30
30
|
*
|
|
31
31
|
* #### Learn more
|
|
32
|
-
* -
|
|
33
|
-
* -
|
|
34
|
-
* -
|
|
35
|
-
* -
|
|
32
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
33
|
+
* - [`PerformsActivities`](https://serenity-js.org/api/core/interface/PerformsActivities/)
|
|
34
|
+
* - [`UsesAbilities`](https://serenity-js.org/api/core/interface/UsesAbilities/)
|
|
35
|
+
* - [`AnswersQuestions`](https://serenity-js.org/api/core/interface/AnswersQuestions/)
|
|
36
36
|
*/
|
|
37
37
|
abstract performAs(actor: PerformsActivities | UsesAbilities | AnswersQuestions): Promise<any>;
|
|
38
38
|
protected static callerLocation(frameOffset: number): FileSystemLocation;
|
|
@@ -9,12 +9,12 @@ const errors_1 = require("../errors");
|
|
|
9
9
|
const io_1 = require("../io");
|
|
10
10
|
const Describable_1 = require("./questions/Describable");
|
|
11
11
|
/**
|
|
12
|
-
* **Activities** represents
|
|
12
|
+
* **Activities** represents [tasks](https://serenity-js.org/api/core/class/Task/) and [interactions](https://serenity-js.org/api/core/class/Interaction/) to be performed by an [actor](https://serenity-js.org/api/core/class/Actor/).
|
|
13
13
|
*
|
|
14
14
|
* Learn more about:
|
|
15
|
-
* - [Performing activities at multiple levels](/handbook/design/screenplay-pattern#performing-activities-at-multiple-levels)
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
15
|
+
* - [Performing activities at multiple levels](https://serenity-js.org/handbook/design/screenplay-pattern#performing-activities-at-multiple-levels)
|
|
16
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
17
|
+
* - [`PerformsActivities`](https://serenity-js.org/api/core/interface/PerformsActivities/)
|
|
18
18
|
* - [Command design pattern on Wikipedia](https://en.wikipedia.org/wiki/Command_pattern)
|
|
19
19
|
*
|
|
20
20
|
* @group Screenplay Pattern
|
|
@@ -27,7 +27,7 @@ class Activity extends Describable_1.Describable {
|
|
|
27
27
|
this.#location = location;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Returns the location where this
|
|
30
|
+
* Returns the location where this [`Activity`](https://serenity-js.org/api/core/class/Activity/) was instantiated.
|
|
31
31
|
*/
|
|
32
32
|
instantiationLocation() {
|
|
33
33
|
return this.#location;
|
|
@@ -11,26 +11,26 @@ import type { AnswersQuestions } from './questions';
|
|
|
11
11
|
import type { TellsTime, Timestamp } from './time';
|
|
12
12
|
/**
|
|
13
13
|
* **Actors** represent **people** and **external systems** interacting with the system under test.
|
|
14
|
-
* Their role is to perform
|
|
14
|
+
* Their role is to perform [activities](https://serenity-js.org/api/core/class/Activity/) that demonstrate how to accomplish a given goal.
|
|
15
15
|
*
|
|
16
|
-
* Actors are the core building block of the [Screenplay Pattern](/handbook/design/screenplay-pattern),
|
|
17
|
-
* along with
|
|
16
|
+
* Actors are the core building block of the [Screenplay Pattern](https://serenity-js.org/handbook/design/screenplay-pattern),
|
|
17
|
+
* along with [abilities](https://serenity-js.org/api/core/class/Ability/), [interactions](https://serenity-js.org/api/core/class/Interaction/), [tasks](https://serenity-js.org/api/core/class/Task/), and [questions](https://serenity-js.org/api/core/class/Question/).
|
|
18
18
|
* Actors are also the first thing you see in a typical Serenity/JS test scenario.
|
|
19
19
|
*
|
|
20
|
-
* 
|
|
20
|
+
* 
|
|
21
21
|
*
|
|
22
22
|
* Learn more about:
|
|
23
|
-
* -
|
|
24
|
-
* -
|
|
25
|
-
* -
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
23
|
+
* - [`Cast`](https://serenity-js.org/api/core/class/Cast/)
|
|
24
|
+
* - [`Stage`](https://serenity-js.org/api/core/class/Stage/)
|
|
25
|
+
* - [`Ability`](https://serenity-js.org/api/core/class/Ability/)
|
|
26
|
+
* - [`Activity`](https://serenity-js.org/api/core/class/Activity/)
|
|
27
|
+
* - [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
28
|
+
* - [`Task`](https://serenity-js.org/api/core/class/Task/)
|
|
29
|
+
* - [`Question`](https://serenity-js.org/api/core/class/Question/)
|
|
30
30
|
*
|
|
31
31
|
* ## Representing people and systems as actors
|
|
32
32
|
*
|
|
33
|
-
* To use a Serenity/JS
|
|
33
|
+
* To use a Serenity/JS [`Actor`](https://serenity-js.org/api/core/class/Actor/), all you need is to say their name:
|
|
34
34
|
*
|
|
35
35
|
* ```typescript
|
|
36
36
|
* import { actorCalled } from '@serenity-js/core'
|
|
@@ -39,8 +39,8 @@ import type { TellsTime, Timestamp } from './time';
|
|
|
39
39
|
* // returns: Actor
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
|
-
* Serenity/JS actors perform within the scope of a test scenario, so the first time you invoke
|
|
43
|
-
* Serenity/JS instantiates a new actor from the default
|
|
42
|
+
* Serenity/JS actors perform within the scope of a test scenario, so the first time you invoke [`actorCalled`](https://serenity-js.org/api/core/function/actorCalled/),
|
|
43
|
+
* Serenity/JS instantiates a new actor from the default [cast](https://serenity-js.org/api/core/class/Cast/) of actors (or any custom cast you might have [configured](https://serenity-js.org/api/core/function/configure/)).
|
|
44
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
45
|
*
|
|
46
46
|
* ```typescript
|
|
@@ -74,27 +74,27 @@ export declare class Actor implements PerformsActivities, UsesAbilities, CanHave
|
|
|
74
74
|
private readonly abilities;
|
|
75
75
|
constructor(name: string, stage: Stage, abilities?: Ability[]);
|
|
76
76
|
/**
|
|
77
|
-
* Retrieves actor's
|
|
77
|
+
* Retrieves actor's [`Ability`](https://serenity-js.org/api/core/class/Ability/) of `abilityType`, or one that extends `abilityType`.
|
|
78
78
|
*
|
|
79
|
-
* Please note that this method performs an
|
|
80
|
-
* given to this actor via
|
|
79
|
+
* Please note that this method performs an [`instanceof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof) check against abilities
|
|
80
|
+
* given to this actor via [`Actor.whoCan`](https://serenity-js.org/api/core/class/Actor/#whoCan).
|
|
81
81
|
*
|
|
82
|
-
* Please also note that
|
|
82
|
+
* Please also note that [`Actor.whoCan`](https://serenity-js.org/api/core/class/Actor/#whoCan) performs the same check when abilities are assigned to the actor
|
|
83
83
|
* to ensure the actor has at most one instance of a given ability type.
|
|
84
84
|
*
|
|
85
85
|
* @param abilityType
|
|
86
86
|
*/
|
|
87
87
|
abilityTo<T extends Ability>(abilityType: AbilityType<T>): T;
|
|
88
88
|
/**
|
|
89
|
-
* Instructs the actor to attempt to perform a number of
|
|
90
|
-
* so either
|
|
89
|
+
* Instructs the actor to attempt to perform a number of [activities](https://serenity-js.org/api/core/class/Activity/),
|
|
90
|
+
* so either [tasks](https://serenity-js.org/api/core/class/Task/) or [interactions](https://serenity-js.org/api/core/class/Interaction/)),
|
|
91
91
|
* one by one.
|
|
92
92
|
*
|
|
93
93
|
* @param {...activities: Activity[]} activities
|
|
94
94
|
*/
|
|
95
95
|
attemptsTo(...activities: Activity[]): Promise<void>;
|
|
96
96
|
/**
|
|
97
|
-
* Gives this Actor a list of
|
|
97
|
+
* Gives this Actor a list of [abilities](https://serenity-js.org/api/core/class/Ability/) they can use
|
|
98
98
|
* to interact with the system under test or the test environment.
|
|
99
99
|
*
|
|
100
100
|
* @param abilities
|
|
@@ -103,13 +103,13 @@ export declare class Actor implements PerformsActivities, UsesAbilities, CanHave
|
|
|
103
103
|
* @returns
|
|
104
104
|
* The actor with newly gained abilities
|
|
105
105
|
*
|
|
106
|
-
* @throws
|
|
106
|
+
* @throws [`ConfigurationError`](https://serenity-js.org/api/core/class/ConfigurationError/)
|
|
107
107
|
* Throws a ConfigurationError if the actor already has an ability of this type.
|
|
108
108
|
*/
|
|
109
109
|
whoCan(...abilities: Ability[]): Actor;
|
|
110
110
|
/**
|
|
111
111
|
* @param answerable -
|
|
112
|
-
* An
|
|
112
|
+
* An [`Answerable`](https://serenity-js.org/api/core/#Answerable) to answer (resolve the value of).
|
|
113
113
|
*
|
|
114
114
|
* @returns
|
|
115
115
|
* The answer to the Answerable
|
|
@@ -124,14 +124,14 @@ export declare class Actor implements PerformsActivities, UsesAbilities, CanHave
|
|
|
124
124
|
*/
|
|
125
125
|
currentTime(): Timestamp;
|
|
126
126
|
/**
|
|
127
|
-
* Instructs the actor to invoke
|
|
128
|
-
*
|
|
127
|
+
* Instructs the actor to invoke [`Discardable.discard`](https://serenity-js.org/api/core/interface/Discardable/#discard) method on any
|
|
128
|
+
* [discardable](https://serenity-js.org/api/core/interface/Discardable/) [ability](https://serenity-js.org/api/core/class/Ability/) it's been configured with.
|
|
129
129
|
*/
|
|
130
130
|
dismiss(): Promise<void>;
|
|
131
131
|
/**
|
|
132
132
|
* Returns a human-readable, string representation of this actor and their abilities.
|
|
133
133
|
*
|
|
134
|
-
* **PRO TIP:** To get the name of the actor, use
|
|
134
|
+
* **PRO TIP:** To get the name of the actor, use [`Actor.name`](https://serenity-js.org/api/core/class/Actor/#name)
|
|
135
135
|
*/
|
|
136
136
|
toString(): string;
|
|
137
137
|
private initialiseAbilities;
|
|
@@ -140,8 +140,8 @@ export declare class Actor implements PerformsActivities, UsesAbilities, CanHave
|
|
|
140
140
|
private acquireAbility;
|
|
141
141
|
private mostGenericTypeOf;
|
|
142
142
|
/**
|
|
143
|
-
* Instantiates a
|
|
144
|
-
* or returns the argument if it's already an instance of
|
|
143
|
+
* Instantiates a `Name` based on the string value of the parameter,
|
|
144
|
+
* or returns the argument if it's already an instance of `Name`.
|
|
145
145
|
*
|
|
146
146
|
* @param maybeName
|
|
147
147
|
*/
|