@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
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { Ability } from './Ability';
|
|
2
2
|
import type { AbilityType } from './AbilityType';
|
|
3
3
|
/**
|
|
4
|
-
* Describes an
|
|
5
|
-
* or answer a
|
|
4
|
+
* Describes an [`Actor`](https://serenity-js.org/api/core/class/Actor/) who can use their [abilities](https://serenity-js.org/api/core/class/Ability/) to perform an [`Activity`](https://serenity-js.org/api/core/class/Activity/)
|
|
5
|
+
* or answer a [`Question`](https://serenity-js.org/api/core/class/Question/).
|
|
6
6
|
*
|
|
7
7
|
* ## Learn more
|
|
8
8
|
*
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
9
|
+
* - [`Ability`](https://serenity-js.org/api/core/class/Ability/)
|
|
10
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
11
11
|
*
|
|
12
12
|
* @group Actors
|
|
13
13
|
*/
|
|
14
14
|
export interface UsesAbilities {
|
|
15
15
|
/**
|
|
16
|
-
* Provides access to the
|
|
16
|
+
* Provides access to the [actor's](https://serenity-js.org/api/core/class/Actor/) [`Ability`](https://serenity-js.org/api/core/class/Ability/) to do something
|
|
17
17
|
*
|
|
18
18
|
* @param doSomething
|
|
19
|
-
* The type of ability to look up, e.g.
|
|
19
|
+
* The type of ability to look up, e.g. [`BrowseTheWeb`](https://serenity-js.org/api/web/class/BrowseTheWeb/) or [`CallAnApi`](https://serenity-js.org/api/rest/class/CallAnApi/)
|
|
20
20
|
*/
|
|
21
21
|
abilityTo<T extends Ability>(doSomething: AbilityType<T>): T;
|
|
22
22
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { Activity } from '../Activity';
|
|
2
2
|
/**
|
|
3
|
-
* Describes an
|
|
4
|
-
* such as
|
|
3
|
+
* Describes an [`Actor`](https://serenity-js.org/api/core/class/Actor/) who can perform a sequence of [activities](https://serenity-js.org/api/core/class/Activity/),
|
|
4
|
+
* such as [tasks](https://serenity-js.org/api/core/class/Task/) or [interactions](https://serenity-js.org/api/core/class/Interaction/).
|
|
5
5
|
*
|
|
6
6
|
* ## Learn more
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
7
|
+
* - [`Activity`](https://serenity-js.org/api/core/class/Activity/)
|
|
8
|
+
* - [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
9
|
+
* - [`Task`](https://serenity-js.org/api/core/class/Task/)
|
|
10
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
11
11
|
*
|
|
12
12
|
* @group Actors
|
|
13
13
|
*/
|
|
14
14
|
export interface PerformsActivities {
|
|
15
15
|
/**
|
|
16
|
-
* Makes the
|
|
16
|
+
* Makes the [`Actor`](https://serenity-js.org/api/core/class/Actor/) attempt to perform a sequence of [activities](https://serenity-js.org/api/core/class/Activity/).
|
|
17
17
|
*/
|
|
18
18
|
attemptsTo: (...activities: Activity[]) => Promise<void>;
|
|
19
19
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { Artifact, Name } from '../../model';
|
|
2
2
|
/**
|
|
3
|
-
* Describes an
|
|
3
|
+
* Describes an [`Actor`](https://serenity-js.org/api/core/class/Actor/) who can collect artifacts, such as photos or `JSON` data.,
|
|
4
4
|
* while the scenario is being executed
|
|
5
5
|
*
|
|
6
6
|
* ## Learn more
|
|
7
|
-
* -
|
|
8
|
-
* - {@apilink Actor}
|
|
7
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
9
8
|
*
|
|
10
9
|
* @group Actors
|
|
11
10
|
*/
|
|
12
11
|
export interface CollectsArtifacts {
|
|
13
12
|
/**
|
|
14
|
-
* Makes the
|
|
13
|
+
* Makes the [`Actor`](https://serenity-js.org/api/core/class/Actor/) collect an artifact so that it can be included in the test report.
|
|
15
14
|
*
|
|
16
15
|
* #### Implementing a custom interaction to attach artifacts
|
|
17
16
|
*
|
|
@@ -68,7 +67,7 @@ export interface CollectsArtifacts {
|
|
|
68
67
|
* ```
|
|
69
68
|
*
|
|
70
69
|
* @param artifact
|
|
71
|
-
* The artifact to be collected, such as
|
|
70
|
+
* The artifact to be collected, such as `JSON` data.
|
|
72
71
|
*
|
|
73
72
|
* @param name
|
|
74
73
|
* The name of the artifact to make it easy to recognise in the test report
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectsArtifacts.d.ts","sourceRoot":"","sources":["../../../src/screenplay/artifacts/CollectsArtifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"CollectsArtifacts.d.ts","sourceRoot":"","sources":["../../../src/screenplay/artifacts/CollectsArtifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8DG;IACH,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CAClD"}
|
|
@@ -6,7 +6,7 @@ import { Interaction } from '../Interaction';
|
|
|
6
6
|
import type { AnswersQuestions } from '../questions';
|
|
7
7
|
import type { DebuggingResult } from './DebuggingResult';
|
|
8
8
|
/**
|
|
9
|
-
* Instructs the
|
|
9
|
+
* Instructs the [actor](https://serenity-js.org/api/core/class/Actor/) to evaluate and [log](https://serenity-js.org/api/core/class/Log/) the provided [answerable](https://serenity-js.org/api/core/#Answerable) values.
|
|
10
10
|
*
|
|
11
11
|
* Since this interaction **accepts a callback function** that receives the evaluated results,
|
|
12
12
|
* the best way to use it is while **running the test scenario via a Node.js debugger**.
|
|
@@ -14,8 +14,8 @@ import type { DebuggingResult } from './DebuggingResult';
|
|
|
14
14
|
*
|
|
15
15
|
* ## Debugging Answerable values
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
* as well as the result of evaluating each provided
|
|
17
|
+
* [`Debug.values`](https://serenity-js.org/api/core/class/Debug/#values) accepts a callback function that receives an array of [`DebuggingResult`](https://serenity-js.org/api/core/interface/DebuggingResult/) objects,
|
|
18
|
+
* as well as the result of evaluating each provided [answerable](https://serenity-js.org/api/core/#Answerable) with [`Actor.answer`](https://serenity-js.org/api/core/class/Actor/#answer).
|
|
19
19
|
*
|
|
20
20
|
* ```typescript
|
|
21
21
|
* import { actorCalled, Debug } from '@serenity-js/core'
|
|
@@ -38,8 +38,9 @@ import type { DebuggingResult } from './DebuggingResult';
|
|
|
38
38
|
* provides features that allow for [experimenting with web UI locators](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright#tune-locators)
|
|
39
39
|
* while the test is paused at breakpoint.
|
|
40
40
|
*
|
|
41
|
-
* Since this functionality is specific to [Playwright](/api/playwright),
|
|
42
|
-
*
|
|
41
|
+
* Since this functionality is specific to [Playwright](https://serenity-js.org/api/playwright),
|
|
42
|
+
* you can use it by passing [`PlaywrightPage.current().nativePage()`](https://serenity-js.org/api/playwright/class/PlaywrightPage/#current)
|
|
43
|
+
* to Serenity/JS [`Debug.values`](https://serenity-js.org/api/core/class/Debug/#values). Also make sure to name the evaluated value `page`, as this is the variable name that the Playwright VSCode extension expects.
|
|
43
44
|
*
|
|
44
45
|
* ```typescript
|
|
45
46
|
* import { actorCalled, Debug } from '@serenity-js/core'
|
|
@@ -70,7 +71,7 @@ export declare class Debug<Values extends Array<Answerable<unknown>>> extends In
|
|
|
70
71
|
private readonly debuggerFunction;
|
|
71
72
|
private readonly values;
|
|
72
73
|
/**
|
|
73
|
-
* Instructs the
|
|
74
|
+
* Instructs the [actor](https://serenity-js.org/api/core/class/Actor/) to evaluate the provided `values`,
|
|
74
75
|
* log the results, and then pass them to your `debuggerFunction`.
|
|
75
76
|
*
|
|
76
77
|
* To use this interaction, run your test scenario in the Node.js debugger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Debug.d.ts","sourceRoot":"","sources":["../../../src/screenplay/debugging/Debug.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD
|
|
1
|
+
{"version":3,"file":"Debug.d.ts","sourceRoot":"","sources":["../../../src/screenplay/debugging/Debug.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,qBAAa,KAAK,CAAC,MAAM,SAAS,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAE,SAAQ,WAAW;IAmCzE,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAIjC,OAAO,CAAC,QAAQ,CAAC,MAAM;IArC3B;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,SAAS,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,gBAAgB,EAAE,CACvE,OAAO,EAAE;SAAI,KAAK,IAAI,MAAM,MAAM,GAAI,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAAE,EACtE,GAAG,OAAO,EAAE;SAAI,KAAK,IAAI,MAAM,MAAM,GAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAAE,KACjE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,MAAM,EAAE,MAAM,GAAG,WAAW;IAQ1D;;;;;;;;;OASG;IACH,SAAS,aACL,WAAW,EAAE,MAAM,EACF,gBAAgB,EAAE,CAC/B,gBAAgB,EAAE;SAAI,KAAK,IAAI,MAAM,MAAM,GAAI,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAAE,EAC/E,GAAG,IAAI,EAAE;SAAI,KAAK,IAAI,MAAM,MAAM,GAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAAE,KAC9D,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EACR,MAAM,EAAE,MAAM;IAKnC;;OAEG;IACG,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAuC9F"}
|
|
@@ -7,7 +7,7 @@ const stringified_1 = require("../../io/stringified");
|
|
|
7
7
|
const model_1 = require("../../model");
|
|
8
8
|
const Interaction_1 = require("../Interaction");
|
|
9
9
|
/**
|
|
10
|
-
* Instructs the
|
|
10
|
+
* Instructs the [actor](https://serenity-js.org/api/core/class/Actor/) to evaluate and [log](https://serenity-js.org/api/core/class/Log/) the provided [answerable](https://serenity-js.org/api/core/#Answerable) values.
|
|
11
11
|
*
|
|
12
12
|
* Since this interaction **accepts a callback function** that receives the evaluated results,
|
|
13
13
|
* the best way to use it is while **running the test scenario via a Node.js debugger**.
|
|
@@ -15,8 +15,8 @@ const Interaction_1 = require("../Interaction");
|
|
|
15
15
|
*
|
|
16
16
|
* ## Debugging Answerable values
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
* as well as the result of evaluating each provided
|
|
18
|
+
* [`Debug.values`](https://serenity-js.org/api/core/class/Debug/#values) accepts a callback function that receives an array of [`DebuggingResult`](https://serenity-js.org/api/core/interface/DebuggingResult/) objects,
|
|
19
|
+
* as well as the result of evaluating each provided [answerable](https://serenity-js.org/api/core/#Answerable) with [`Actor.answer`](https://serenity-js.org/api/core/class/Actor/#answer).
|
|
20
20
|
*
|
|
21
21
|
* ```typescript
|
|
22
22
|
* import { actorCalled, Debug } from '@serenity-js/core'
|
|
@@ -39,8 +39,9 @@ const Interaction_1 = require("../Interaction");
|
|
|
39
39
|
* provides features that allow for [experimenting with web UI locators](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright#tune-locators)
|
|
40
40
|
* while the test is paused at breakpoint.
|
|
41
41
|
*
|
|
42
|
-
* Since this functionality is specific to [Playwright](/api/playwright),
|
|
43
|
-
*
|
|
42
|
+
* Since this functionality is specific to [Playwright](https://serenity-js.org/api/playwright),
|
|
43
|
+
* you can use it by passing [`PlaywrightPage.current().nativePage()`](https://serenity-js.org/api/playwright/class/PlaywrightPage/#current)
|
|
44
|
+
* to Serenity/JS [`Debug.values`](https://serenity-js.org/api/core/class/Debug/#values). Also make sure to name the evaluated value `page`, as this is the variable name that the Playwright VSCode extension expects.
|
|
44
45
|
*
|
|
45
46
|
* ```typescript
|
|
46
47
|
* import { actorCalled, Debug } from '@serenity-js/core'
|
|
@@ -71,7 +72,7 @@ class Debug extends Interaction_1.Interaction {
|
|
|
71
72
|
debuggerFunction;
|
|
72
73
|
values;
|
|
73
74
|
/**
|
|
74
|
-
* Instructs the
|
|
75
|
+
* Instructs the [actor](https://serenity-js.org/api/core/class/Actor/) to evaluate the provided `values`,
|
|
75
76
|
* log the results, and then pass them to your `debuggerFunction`.
|
|
76
77
|
*
|
|
77
78
|
* To use this interaction, run your test scenario in the Node.js debugger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Debug.js","sourceRoot":"","sources":["../../../src/screenplay/debugging/Debug.ts"],"names":[],"mappings":";;;AAAA,yCAA+C;AAC/C,iCAA6B;AAC7B,sDAAmD;AACnD,uCAA6C;AAK7C,gDAA6C;AAI7C
|
|
1
|
+
{"version":3,"file":"Debug.js","sourceRoot":"","sources":["../../../src/screenplay/debugging/Debug.ts"],"names":[],"mappings":";;;AAAA,yCAA+C;AAC/C,iCAA6B;AAC7B,sDAAmD;AACnD,uCAA6C;AAK7C,gDAA6C;AAI7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,MAAa,KAAiD,SAAQ,yBAAW;IAmCxD;IAIA;IArCrB;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,CAA4C,gBAGhC,EAAE,GAAG,MAAc;QACxC,OAAO,IAAI,KAAK,CACZ,iBAAkB,MAAM,CAAC,MAAO,SAAS,EACzC,gBAAgB,EAChB,MAAM,CACT,CAAC;IACN,CAAC;IAED;;;;;;;;;OASG;IACH,YACI,WAAmB,EACF,gBAGQ,EACR,MAAc;QAE/B,KAAK,CAAC,WAAW,CAAC,CAAC;QANF,qBAAgB,GAAhB,gBAAgB,CAGR;QACR,WAAM,GAAN,MAAM,CAAQ;IAGnC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,KAA2D;QAEvE,MAAM,OAAO,GAAG,EAAmE,CAAC;QAEpF,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;YAE7B,MAAM,MAAM,GAA6B;gBACrC,WAAW,EAAE,IAAA,MAAC,EAAA,GAAI,KAAM,EAAE;gBAC1B,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,SAAS;aACnB,CAAC;YAEF,IAAI;gBACA,MAAM,CAAC,KAAK,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC5C;YACD,OAAO,KAAK,EAAE;gBACV,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;aACxB;YAED,KAAK,CAAC,OAAO,CACT,gBAAQ,CAAC,QAAQ,CAAC;gBACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;oBACjB,KAAK,EAAE,IAAA,yBAAW,EAAC,MAAM,CAAC,KAAK,CAAC;oBAChC,KAAK,EAAE,MAAM,CAAC,KAAK;wBACf,CAAC,CAAC,wBAAe,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;wBACzC,CAAC,CAAC,MAAM,CAAC,KAAK;iBACrB,CAAC;aACL,CAAC,EACF,IAAI,YAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAC/B,CAAC;YAEF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACxB;QAED,IAAI,CAAC,gBAAgB,CACjB,OAAO,EACP,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAA2D,CACnG,CAAC;IACN,CAAC;CACJ;AAtFD,sBAsFC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* An interface describing debugging data received by the callback function passed to
|
|
2
|
+
* An interface describing debugging data received by the callback function passed to [`Debug.values`](https://serenity-js.org/api/core/class/Debug/#values).
|
|
3
3
|
*
|
|
4
4
|
* @group Activities
|
|
5
5
|
*/
|
|
@@ -4,10 +4,12 @@ import type { CollectsArtifacts } from '../artifacts';
|
|
|
4
4
|
import { Interaction } from '../Interaction';
|
|
5
5
|
import type { AnswersQuestions } from '../questions';
|
|
6
6
|
/**
|
|
7
|
-
* Instructs the
|
|
8
|
-
*
|
|
9
|
-
* and
|
|
10
|
-
*
|
|
7
|
+
* Instructs the [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
8
|
+
* to [collect](https://serenity-js.org/api/core/interface/CollectsArtifacts/) arbitrary static values
|
|
9
|
+
* and answers to [answerables](https://serenity-js.org/api/core/#Answerable),
|
|
10
|
+
* so that they can be sent to the [stage crew members](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
11
|
+
* and printed to the terminal by the [`ConsoleReporter`](https://serenity-js.org/api/console-reporter/class/ConsoleReporter/)
|
|
12
|
+
* or attached to the HTML report by the [`SerenityBDDReporter`](https://serenity-js.org/api/serenity-bdd/class/SerenityBDDReporter/).
|
|
11
13
|
*
|
|
12
14
|
* ## Logging static and `Answerable` values
|
|
13
15
|
*
|
|
@@ -25,7 +27,7 @@ import type { AnswersQuestions } from '../questions';
|
|
|
25
27
|
export declare class Log extends Interaction {
|
|
26
28
|
private readonly items;
|
|
27
29
|
/**
|
|
28
|
-
* Instantiates a new
|
|
30
|
+
* Instantiates a new [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`Log`](https://serenity-js.org/api/core/class/Log/)
|
|
29
31
|
*
|
|
30
32
|
* Note that this method accepts [variable number of arguments](https://www.typescriptlang.org/docs/handbook/functions.html#rest-parameters),
|
|
31
33
|
* so that you can easily log several values at the same time.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Log.d.ts","sourceRoot":"","sources":["../../../src/screenplay/debugging/Log.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"Log.d.ts","sourceRoot":"","sources":["../../../src/screenplay/debugging/Log.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,GAAI,SAAQ,WAAW;IAoB5B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAlB1B;;;;;;;;OAQG;IACH,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;IAIzD;;;OAGG;IACH,SAAS,aACY,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAKlD;;OAEG;IACG,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAW9F"}
|
|
@@ -6,10 +6,12 @@ const stringified_1 = require("../../io/stringified");
|
|
|
6
6
|
const model_1 = require("../../model");
|
|
7
7
|
const Interaction_1 = require("../Interaction");
|
|
8
8
|
/**
|
|
9
|
-
* Instructs the
|
|
10
|
-
*
|
|
11
|
-
* and
|
|
12
|
-
*
|
|
9
|
+
* Instructs the [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
10
|
+
* to [collect](https://serenity-js.org/api/core/interface/CollectsArtifacts/) arbitrary static values
|
|
11
|
+
* and answers to [answerables](https://serenity-js.org/api/core/#Answerable),
|
|
12
|
+
* so that they can be sent to the [stage crew members](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
13
|
+
* and printed to the terminal by the [`ConsoleReporter`](https://serenity-js.org/api/console-reporter/class/ConsoleReporter/)
|
|
14
|
+
* or attached to the HTML report by the [`SerenityBDDReporter`](https://serenity-js.org/api/serenity-bdd/class/SerenityBDDReporter/).
|
|
13
15
|
*
|
|
14
16
|
* ## Logging static and `Answerable` values
|
|
15
17
|
*
|
|
@@ -27,7 +29,7 @@ const Interaction_1 = require("../Interaction");
|
|
|
27
29
|
class Log extends Interaction_1.Interaction {
|
|
28
30
|
items;
|
|
29
31
|
/**
|
|
30
|
-
* Instantiates a new
|
|
32
|
+
* Instantiates a new [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`Log`](https://serenity-js.org/api/core/class/Log/)
|
|
31
33
|
*
|
|
32
34
|
* Note that this method accepts [variable number of arguments](https://www.typescriptlang.org/docs/handbook/functions.html#rest-parameters),
|
|
33
35
|
* so that you can easily log several values at the same time.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Log.js","sourceRoot":"","sources":["../../../src/screenplay/debugging/Log.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,sDAAmD;AACnD,uCAA6C;AAI7C,gDAA6C;AAG7C
|
|
1
|
+
{"version":3,"file":"Log.js","sourceRoot":"","sources":["../../../src/screenplay/debugging/Log.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,sDAAmD;AACnD,uCAA6C;AAI7C,gDAA6C;AAG7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,GAAI,SAAQ,yBAAW;IAoBX;IAlBrB;;;;;;;;OAQG;IACH,MAAM,CAAC,GAAG,CAAC,GAAG,KAA6B;QACvC,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACH,YACqB,KAA6B;QAE9C,KAAK,CAAC,gBAAiB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,MAAC,EAAA,GAAI,IAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAE,EAAE,CAAC,CAAC;QAFrD,UAAK,GAAL,KAAK,CAAwB;IAGlD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,KAA2D;QACvE,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YAE3B,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAEtC,KAAK,CAAC,OAAO,CACT,gBAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAA,yBAAW,EAAC,IAAI,CAAC,EAAE,CAAC,EAC9C,IAAI,YAAI,CAAC,IAAA,MAAC,EAAA,GAAI,IAAK,EAAE,CAAC,CACzB,CAAC;SACL;IACL,CAAC;CACJ;AAvCD,kBAuCC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TinyType } from 'tiny-types';
|
|
2
2
|
import { NotepadAdapter } from './NotepadAdapter';
|
|
3
3
|
/**
|
|
4
|
-
* Stores notes recorded by an
|
|
4
|
+
* Stores notes recorded by an [`Actor`](https://serenity-js.org/api/core/class/Actor/).
|
|
5
5
|
*
|
|
6
|
-
* See
|
|
6
|
+
* See [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/) and [notes](https://serenity-js.org/api/core/function/notes) for more usage examples.
|
|
7
7
|
*
|
|
8
8
|
* ## Sharing a notepad between actors
|
|
9
9
|
*
|
|
@@ -43,9 +43,9 @@ import { NotepadAdapter } from './NotepadAdapter';
|
|
|
43
43
|
*
|
|
44
44
|
* ## Learn more
|
|
45
45
|
*
|
|
46
|
-
* -
|
|
47
|
-
* - [notes](/api/core/function/notes)
|
|
48
|
-
* -
|
|
46
|
+
* - [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/)
|
|
47
|
+
* - [notes](https://serenity-js.org/api/core/function/notes)
|
|
48
|
+
* - [`Cast`](https://serenity-js.org/api/core/class/Cast/)
|
|
49
49
|
*
|
|
50
50
|
* @group Notes
|
|
51
51
|
*/
|
|
@@ -92,17 +92,17 @@ export declare class Notepad<Notes extends Record<any, any>> extends TinyType {
|
|
|
92
92
|
*/
|
|
93
93
|
static with<N extends Record<any, any>>(notes: N): Notepad<N>;
|
|
94
94
|
/**
|
|
95
|
-
* Creates a
|
|
96
|
-
* stored in this notepad. Allows the
|
|
95
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that simplifies access to the notes
|
|
96
|
+
* stored in this notepad. Allows the [`Actor`](https://serenity-js.org/api/core/class/Actor/) to record, read, and remove notes.
|
|
97
97
|
*
|
|
98
98
|
* #### Learn more
|
|
99
|
-
* - [notes](/api/core/function/notes)
|
|
100
|
-
* -
|
|
101
|
-
* -
|
|
99
|
+
* - [notes](https://serenity-js.org/api/core/function/notes)
|
|
100
|
+
* - [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/)
|
|
101
|
+
* - [`Notepad`](https://serenity-js.org/api/core/class/Notepad/)
|
|
102
102
|
*/
|
|
103
103
|
static notes<N extends Record<any, any>>(): NotepadAdapter<N>;
|
|
104
104
|
/**
|
|
105
|
-
* Instantiates a
|
|
105
|
+
* Instantiates a [`Notepad`](https://serenity-js.org/api/core/class/Notepad/) with an initial state.
|
|
106
106
|
*
|
|
107
107
|
* @param recordedNotes
|
|
108
108
|
* Initial state of the notepad
|
|
@@ -127,8 +127,8 @@ export declare class Notepad<Notes extends Record<any, any>> extends TinyType {
|
|
|
127
127
|
* @returns
|
|
128
128
|
* The value of the previously recorded note.
|
|
129
129
|
*
|
|
130
|
-
* @throws
|
|
131
|
-
* Throws a
|
|
130
|
+
* @throws [`LogicError`](https://serenity-js.org/api/core/class/LogicError/)
|
|
131
|
+
* Throws a [`LogicError`](https://serenity-js.org/api/core/class/LogicError/) if the note with a given `subject`
|
|
132
132
|
* has never been recorded.
|
|
133
133
|
*/
|
|
134
134
|
get<Subject extends keyof Notes>(subject: Subject): Notes[Subject];
|
|
@@ -6,9 +6,9 @@ const errors_1 = require("../../errors");
|
|
|
6
6
|
const io_1 = require("../../io");
|
|
7
7
|
const NotepadAdapter_1 = require("./NotepadAdapter");
|
|
8
8
|
/**
|
|
9
|
-
* Stores notes recorded by an
|
|
9
|
+
* Stores notes recorded by an [`Actor`](https://serenity-js.org/api/core/class/Actor/).
|
|
10
10
|
*
|
|
11
|
-
* See
|
|
11
|
+
* See [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/) and [notes](https://serenity-js.org/api/core/function/notes) for more usage examples.
|
|
12
12
|
*
|
|
13
13
|
* ## Sharing a notepad between actors
|
|
14
14
|
*
|
|
@@ -48,9 +48,9 @@ const NotepadAdapter_1 = require("./NotepadAdapter");
|
|
|
48
48
|
*
|
|
49
49
|
* ## Learn more
|
|
50
50
|
*
|
|
51
|
-
* -
|
|
52
|
-
* - [notes](/api/core/function/notes)
|
|
53
|
-
* -
|
|
51
|
+
* - [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/)
|
|
52
|
+
* - [notes](https://serenity-js.org/api/core/function/notes)
|
|
53
|
+
* - [`Cast`](https://serenity-js.org/api/core/class/Cast/)
|
|
54
54
|
*
|
|
55
55
|
* @group Notes
|
|
56
56
|
*/
|
|
@@ -101,19 +101,19 @@ class Notepad extends tiny_types_1.TinyType {
|
|
|
101
101
|
return new Notepad(notes);
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
|
-
* Creates a
|
|
105
|
-
* stored in this notepad. Allows the
|
|
104
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that simplifies access to the notes
|
|
105
|
+
* stored in this notepad. Allows the [`Actor`](https://serenity-js.org/api/core/class/Actor/) to record, read, and remove notes.
|
|
106
106
|
*
|
|
107
107
|
* #### Learn more
|
|
108
|
-
* - [notes](/api/core/function/notes)
|
|
109
|
-
* -
|
|
110
|
-
* -
|
|
108
|
+
* - [notes](https://serenity-js.org/api/core/function/notes)
|
|
109
|
+
* - [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/)
|
|
110
|
+
* - [`Notepad`](https://serenity-js.org/api/core/class/Notepad/)
|
|
111
111
|
*/
|
|
112
112
|
static notes() {
|
|
113
113
|
return new NotepadAdapter_1.NotepadAdapter();
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
* Instantiates a
|
|
116
|
+
* Instantiates a [`Notepad`](https://serenity-js.org/api/core/class/Notepad/) with an initial state.
|
|
117
117
|
*
|
|
118
118
|
* @param recordedNotes
|
|
119
119
|
* Initial state of the notepad
|
|
@@ -143,8 +143,8 @@ class Notepad extends tiny_types_1.TinyType {
|
|
|
143
143
|
* @returns
|
|
144
144
|
* The value of the previously recorded note.
|
|
145
145
|
*
|
|
146
|
-
* @throws
|
|
147
|
-
* Throws a
|
|
146
|
+
* @throws [`LogicError`](https://serenity-js.org/api/core/class/LogicError/)
|
|
147
|
+
* Throws a [`LogicError`](https://serenity-js.org/api/core/class/LogicError/) if the note with a given `subject`
|
|
148
148
|
* has never been recorded.
|
|
149
149
|
*/
|
|
150
150
|
get(subject) {
|
|
@@ -4,10 +4,10 @@ import { Interaction } from '../Interaction';
|
|
|
4
4
|
import type { QuestionAdapter } from '../Question';
|
|
5
5
|
import type { ChainableSetter } from './ChainableSetter';
|
|
6
6
|
/**
|
|
7
|
-
* Serenity/JS Screenplay Pattern-style adapter for the
|
|
8
|
-
* that makes it easier for the
|
|
7
|
+
* Serenity/JS Screenplay Pattern-style adapter for the [`Notepad`](https://serenity-js.org/api/core/class/Notepad/),
|
|
8
|
+
* that makes it easier for the [actors](https://serenity-js.org/api/core/class/Actor/) to access its APIs.
|
|
9
9
|
*
|
|
10
|
-
* See
|
|
10
|
+
* See [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/), [`Notepad`](https://serenity-js.org/api/core/class/Notepad/) and [`notes`](https://serenity-js.org/api/core/function/notes/) for more examples.
|
|
11
11
|
*
|
|
12
12
|
* @group Notes
|
|
13
13
|
*/
|
|
@@ -16,7 +16,7 @@ export declare class NotepadAdapter<Notes extends Record<any, any>> implements C
|
|
|
16
16
|
* Checks if a note identified by `subject` exists in the notepad.
|
|
17
17
|
*
|
|
18
18
|
* #### Learn more
|
|
19
|
-
* -
|
|
19
|
+
* - [`Notepad.has`](https://serenity-js.org/api/core/class/Notepad/#has)}
|
|
20
20
|
*
|
|
21
21
|
* @param subject
|
|
22
22
|
* A subject (name) that uniquely identifies a given note
|
|
@@ -29,7 +29,7 @@ export declare class NotepadAdapter<Notes extends Record<any, any>> implements C
|
|
|
29
29
|
* Retrieves a note, identified by `subject`, from the notepad.
|
|
30
30
|
*
|
|
31
31
|
* #### Learn more
|
|
32
|
-
* -
|
|
32
|
+
* - [`Notepad.get`](https://serenity-js.org/api/core/class/Notepad/#get)}
|
|
33
33
|
*
|
|
34
34
|
* @param subject
|
|
35
35
|
* A subject (name) that uniquely identifies a given note
|
|
@@ -37,8 +37,8 @@ export declare class NotepadAdapter<Notes extends Record<any, any>> implements C
|
|
|
37
37
|
* @returns
|
|
38
38
|
* The value of the previously recorded note.
|
|
39
39
|
*
|
|
40
|
-
* @throws
|
|
41
|
-
* Throws a
|
|
40
|
+
* @throws
|
|
41
|
+
* Throws a [`LogicError`](https://serenity-js.org/api/core/class/LogicError/) if the note with a given `subject`
|
|
42
42
|
* has never been recorded.
|
|
43
43
|
*/
|
|
44
44
|
get<Subject extends keyof Notes>(subject: Subject): QuestionAdapter<Notes[Subject]>;
|
|
@@ -47,9 +47,9 @@ export declare class NotepadAdapter<Notes extends Record<any, any>> implements C
|
|
|
47
47
|
* uniquely identified by its `subject`.
|
|
48
48
|
*
|
|
49
49
|
* **Pro tip:** calls to `set` can be chained and result in an accumulation
|
|
50
|
-
* of values to be recorded in the
|
|
51
|
-
* Those values are resolved and recorded when the
|
|
52
|
-
* returned by this method is performed by an
|
|
50
|
+
* of values to be recorded in the [`Notepad`](https://serenity-js.org/api/core/class/Notepad/).
|
|
51
|
+
* Those values are resolved and recorded when the [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
52
|
+
* returned by this method is performed by an [`Actor`](https://serenity-js.org/api/core/class/Actor/).
|
|
53
53
|
*
|
|
54
54
|
* If a note identified by a given `subject` is set multiple times,
|
|
55
55
|
* the last call wins.
|
|
@@ -80,7 +80,7 @@ export declare class NotepadAdapter<Notes extends Record<any, any>> implements C
|
|
|
80
80
|
* ```
|
|
81
81
|
*
|
|
82
82
|
* #### Learn more
|
|
83
|
-
* -
|
|
83
|
+
* - [`Notepad.set`](https://serenity-js.org/api/core/class/Notepad/#set)
|
|
84
84
|
*
|
|
85
85
|
* @param subject
|
|
86
86
|
* A subject (name) that uniquely identifies a given note
|
|
@@ -147,7 +147,7 @@ export declare class NotepadAdapter<Notes extends Record<any, any>> implements C
|
|
|
147
147
|
* ```
|
|
148
148
|
*
|
|
149
149
|
* #### Learn more
|
|
150
|
-
* -
|
|
150
|
+
* - [`Notepad.delete`](https://serenity-js.org/api/core/class/Notepad/#delete)
|
|
151
151
|
*
|
|
152
152
|
* @param subject
|
|
153
153
|
*
|
|
@@ -178,7 +178,7 @@ export declare class NotepadAdapter<Notes extends Record<any, any>> implements C
|
|
|
178
178
|
* ```
|
|
179
179
|
*
|
|
180
180
|
* #### Learn more
|
|
181
|
-
* -
|
|
181
|
+
* - [`Notepad.clear`](https://serenity-js.org/api/core/class/Notepad/#clear)
|
|
182
182
|
*/
|
|
183
183
|
clear(): Interaction;
|
|
184
184
|
/**
|
|
@@ -202,16 +202,16 @@ export declare class NotepadAdapter<Notes extends Record<any, any>> implements C
|
|
|
202
202
|
* ```
|
|
203
203
|
*
|
|
204
204
|
* #### Learn more
|
|
205
|
-
* -
|
|
205
|
+
* - [`Notepad.size`](https://serenity-js.org/api/core/class/Notepad/#size)
|
|
206
206
|
*/
|
|
207
207
|
size(): QuestionAdapter<number>;
|
|
208
208
|
/**
|
|
209
|
-
* Produces a
|
|
209
|
+
* Produces a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to a `JSONObject`
|
|
210
210
|
* representing the resolved notes stored in the notepad.
|
|
211
211
|
*
|
|
212
212
|
* Note that serialisation to JSON will simplify some data types that might not be serialisable by default,
|
|
213
213
|
* but are commonly used in data structures representing actor's notes.
|
|
214
|
-
* For example a
|
|
214
|
+
* For example a [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) will be serialised as a regular JSON object, a [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) will be serialised as [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).
|
|
215
215
|
*
|
|
216
216
|
* Additionally, notepad assumes that the data structure you use it with does not contain cyclic references.
|
|
217
217
|
*
|
|
@@ -7,10 +7,10 @@ const Question_1 = require("../Question");
|
|
|
7
7
|
const questions_1 = require("../questions");
|
|
8
8
|
const TakeNotes_1 = require("./TakeNotes");
|
|
9
9
|
/**
|
|
10
|
-
* Serenity/JS Screenplay Pattern-style adapter for the
|
|
11
|
-
* that makes it easier for the
|
|
10
|
+
* Serenity/JS Screenplay Pattern-style adapter for the [`Notepad`](https://serenity-js.org/api/core/class/Notepad/),
|
|
11
|
+
* that makes it easier for the [actors](https://serenity-js.org/api/core/class/Actor/) to access its APIs.
|
|
12
12
|
*
|
|
13
|
-
* See
|
|
13
|
+
* See [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/), [`Notepad`](https://serenity-js.org/api/core/class/Notepad/) and [`notes`](https://serenity-js.org/api/core/function/notes/) for more examples.
|
|
14
14
|
*
|
|
15
15
|
* @group Notes
|
|
16
16
|
*/
|
|
@@ -19,7 +19,7 @@ class NotepadAdapter {
|
|
|
19
19
|
* Checks if a note identified by `subject` exists in the notepad.
|
|
20
20
|
*
|
|
21
21
|
* #### Learn more
|
|
22
|
-
* -
|
|
22
|
+
* - [`Notepad.has`](https://serenity-js.org/api/core/class/Notepad/#has)}
|
|
23
23
|
*
|
|
24
24
|
* @param subject
|
|
25
25
|
* A subject (name) that uniquely identifies a given note
|
|
@@ -36,7 +36,7 @@ class NotepadAdapter {
|
|
|
36
36
|
* Retrieves a note, identified by `subject`, from the notepad.
|
|
37
37
|
*
|
|
38
38
|
* #### Learn more
|
|
39
|
-
* -
|
|
39
|
+
* - [`Notepad.get`](https://serenity-js.org/api/core/class/Notepad/#get)}
|
|
40
40
|
*
|
|
41
41
|
* @param subject
|
|
42
42
|
* A subject (name) that uniquely identifies a given note
|
|
@@ -44,8 +44,8 @@ class NotepadAdapter {
|
|
|
44
44
|
* @returns
|
|
45
45
|
* The value of the previously recorded note.
|
|
46
46
|
*
|
|
47
|
-
* @throws
|
|
48
|
-
* Throws a
|
|
47
|
+
* @throws
|
|
48
|
+
* Throws a [`LogicError`](https://serenity-js.org/api/core/class/LogicError/) if the note with a given `subject`
|
|
49
49
|
* has never been recorded.
|
|
50
50
|
*/
|
|
51
51
|
get(subject) {
|
|
@@ -58,9 +58,9 @@ class NotepadAdapter {
|
|
|
58
58
|
* uniquely identified by its `subject`.
|
|
59
59
|
*
|
|
60
60
|
* **Pro tip:** calls to `set` can be chained and result in an accumulation
|
|
61
|
-
* of values to be recorded in the
|
|
62
|
-
* Those values are resolved and recorded when the
|
|
63
|
-
* returned by this method is performed by an
|
|
61
|
+
* of values to be recorded in the [`Notepad`](https://serenity-js.org/api/core/class/Notepad/).
|
|
62
|
+
* Those values are resolved and recorded when the [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
63
|
+
* returned by this method is performed by an [`Actor`](https://serenity-js.org/api/core/class/Actor/).
|
|
64
64
|
*
|
|
65
65
|
* If a note identified by a given `subject` is set multiple times,
|
|
66
66
|
* the last call wins.
|
|
@@ -91,7 +91,7 @@ class NotepadAdapter {
|
|
|
91
91
|
* ```
|
|
92
92
|
*
|
|
93
93
|
* #### Learn more
|
|
94
|
-
* -
|
|
94
|
+
* - [`Notepad.set`](https://serenity-js.org/api/core/class/Notepad/#set)
|
|
95
95
|
*
|
|
96
96
|
* @param subject
|
|
97
97
|
* A subject (name) that uniquely identifies a given note
|
|
@@ -160,7 +160,7 @@ class NotepadAdapter {
|
|
|
160
160
|
* ```
|
|
161
161
|
*
|
|
162
162
|
* #### Learn more
|
|
163
|
-
* -
|
|
163
|
+
* - [`Notepad.delete`](https://serenity-js.org/api/core/class/Notepad/#delete)
|
|
164
164
|
*
|
|
165
165
|
* @param subject
|
|
166
166
|
*
|
|
@@ -195,7 +195,7 @@ class NotepadAdapter {
|
|
|
195
195
|
* ```
|
|
196
196
|
*
|
|
197
197
|
* #### Learn more
|
|
198
|
-
* -
|
|
198
|
+
* - [`Notepad.clear`](https://serenity-js.org/api/core/class/Notepad/#clear)
|
|
199
199
|
*/
|
|
200
200
|
clear() {
|
|
201
201
|
return Interaction_1.Interaction.where((0, questions_1.the) `#actor clears ${new NumberOfNotes()} from their notepad`, actor => {
|
|
@@ -223,7 +223,7 @@ class NotepadAdapter {
|
|
|
223
223
|
* ```
|
|
224
224
|
*
|
|
225
225
|
* #### Learn more
|
|
226
|
-
* -
|
|
226
|
+
* - [`Notepad.size`](https://serenity-js.org/api/core/class/Notepad/#size)
|
|
227
227
|
*/
|
|
228
228
|
size() {
|
|
229
229
|
return Question_1.Question.about((0, questions_1.the) `${new NumberOfNotes()}`, async (actor) => {
|
|
@@ -231,12 +231,12 @@ class NotepadAdapter {
|
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
234
|
-
* Produces a
|
|
234
|
+
* Produces a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to a `JSONObject`
|
|
235
235
|
* representing the resolved notes stored in the notepad.
|
|
236
236
|
*
|
|
237
237
|
* Note that serialisation to JSON will simplify some data types that might not be serialisable by default,
|
|
238
238
|
* but are commonly used in data structures representing actor's notes.
|
|
239
|
-
* For example a
|
|
239
|
+
* For example a [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) will be serialised as a regular JSON object, a [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) will be serialised as [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).
|
|
240
240
|
*
|
|
241
241
|
* Additionally, notepad assumes that the data structure you use it with does not contain cyclic references.
|
|
242
242
|
*
|