@serenity-js/core 3.25.0 → 3.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -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 +29 -30
- package/lib/stage/Stage.d.ts.map +1 -1
- package/lib/stage/Stage.js +29 -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 +2 -2
- 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 +29 -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
|
@@ -8,10 +8,12 @@ import { Interaction } from '../Interaction';
|
|
|
8
8
|
import type { AnswersQuestions } from '../questions';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Instructs the
|
|
12
|
-
*
|
|
13
|
-
* and
|
|
14
|
-
*
|
|
11
|
+
* Instructs the [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
12
|
+
* to [collect](https://serenity-js.org/api/core/interface/CollectsArtifacts/) arbitrary static values
|
|
13
|
+
* and answers to [answerables](https://serenity-js.org/api/core/#Answerable),
|
|
14
|
+
* so that they can be sent to the [stage crew members](https://serenity-js.org/api/core/interface/StageCrewMember/)
|
|
15
|
+
* and printed to the terminal by the [`ConsoleReporter`](https://serenity-js.org/api/console-reporter/class/ConsoleReporter/)
|
|
16
|
+
* or attached to the HTML report by the [`SerenityBDDReporter`](https://serenity-js.org/api/serenity-bdd/class/SerenityBDDReporter/).
|
|
15
17
|
*
|
|
16
18
|
* ## Logging static and `Answerable` values
|
|
17
19
|
*
|
|
@@ -29,7 +31,7 @@ import type { AnswersQuestions } from '../questions';
|
|
|
29
31
|
export class Log extends Interaction {
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
|
-
* Instantiates a new
|
|
34
|
+
* Instantiates a new [interaction](https://serenity-js.org/api/core/class/Interaction/) to [`Log`](https://serenity-js.org/api/core/class/Log/)
|
|
33
35
|
*
|
|
34
36
|
* Note that this method accepts [variable number of arguments](https://www.typescriptlang.org/docs/handbook/functions.html#rest-parameters),
|
|
35
37
|
* so that you can easily log several values at the same time.
|
|
@@ -5,9 +5,9 @@ import { d } from '../../io';
|
|
|
5
5
|
import { NotepadAdapter } from './NotepadAdapter';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Stores notes recorded by an
|
|
8
|
+
* Stores notes recorded by an [`Actor`](https://serenity-js.org/api/core/class/Actor/).
|
|
9
9
|
*
|
|
10
|
-
* See
|
|
10
|
+
* See [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/) and [notes](https://serenity-js.org/api/core/function/notes) for more usage examples.
|
|
11
11
|
*
|
|
12
12
|
* ## Sharing a notepad between actors
|
|
13
13
|
*
|
|
@@ -47,9 +47,9 @@ import { NotepadAdapter } from './NotepadAdapter';
|
|
|
47
47
|
*
|
|
48
48
|
* ## Learn more
|
|
49
49
|
*
|
|
50
|
-
* -
|
|
51
|
-
* - [notes](/api/core/function/notes)
|
|
52
|
-
* -
|
|
50
|
+
* - [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/)
|
|
51
|
+
* - [notes](https://serenity-js.org/api/core/function/notes)
|
|
52
|
+
* - [`Cast`](https://serenity-js.org/api/core/class/Cast/)
|
|
53
53
|
*
|
|
54
54
|
* @group Notes
|
|
55
55
|
*/
|
|
@@ -102,20 +102,20 @@ export class Notepad<Notes extends Record<any, any>> extends TinyType {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
* Creates a
|
|
106
|
-
* stored in this notepad. Allows the
|
|
105
|
+
* Creates a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that simplifies access to the notes
|
|
106
|
+
* stored in this notepad. Allows the [`Actor`](https://serenity-js.org/api/core/class/Actor/) to record, read, and remove notes.
|
|
107
107
|
*
|
|
108
108
|
* #### Learn more
|
|
109
|
-
* - [notes](/api/core/function/notes)
|
|
110
|
-
* -
|
|
111
|
-
* -
|
|
109
|
+
* - [notes](https://serenity-js.org/api/core/function/notes)
|
|
110
|
+
* - [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/)
|
|
111
|
+
* - [`Notepad`](https://serenity-js.org/api/core/class/Notepad/)
|
|
112
112
|
*/
|
|
113
113
|
static notes<N extends Record<any, any>>(): NotepadAdapter<N> {
|
|
114
114
|
return new NotepadAdapter<N>();
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
|
-
* Instantiates a
|
|
118
|
+
* Instantiates a [`Notepad`](https://serenity-js.org/api/core/class/Notepad/) with an initial state.
|
|
119
119
|
*
|
|
120
120
|
* @param recordedNotes
|
|
121
121
|
* Initial state of the notepad
|
|
@@ -146,8 +146,8 @@ export class Notepad<Notes extends Record<any, any>> extends TinyType {
|
|
|
146
146
|
* @returns
|
|
147
147
|
* The value of the previously recorded note.
|
|
148
148
|
*
|
|
149
|
-
* @throws
|
|
150
|
-
* Throws a
|
|
149
|
+
* @throws [`LogicError`](https://serenity-js.org/api/core/class/LogicError/)
|
|
150
|
+
* Throws a [`LogicError`](https://serenity-js.org/api/core/class/LogicError/) if the note with a given `subject`
|
|
151
151
|
* has never been recorded.
|
|
152
152
|
*/
|
|
153
153
|
get<Subject extends keyof Notes>(subject: Subject): Notes[Subject] {
|
|
@@ -12,10 +12,10 @@ import type { ChainableSetter } from './ChainableSetter';
|
|
|
12
12
|
import { TakeNotes } from './TakeNotes';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Serenity/JS Screenplay Pattern-style adapter for the
|
|
16
|
-
* that makes it easier for the
|
|
15
|
+
* Serenity/JS Screenplay Pattern-style adapter for the [`Notepad`](https://serenity-js.org/api/core/class/Notepad/),
|
|
16
|
+
* that makes it easier for the [actors](https://serenity-js.org/api/core/class/Actor/) to access its APIs.
|
|
17
17
|
*
|
|
18
|
-
* See
|
|
18
|
+
* 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.
|
|
19
19
|
*
|
|
20
20
|
* @group Notes
|
|
21
21
|
*/
|
|
@@ -25,7 +25,7 @@ export class NotepadAdapter<Notes extends Record<any, any>> implements Chainable
|
|
|
25
25
|
* Checks if a note identified by `subject` exists in the notepad.
|
|
26
26
|
*
|
|
27
27
|
* #### Learn more
|
|
28
|
-
* -
|
|
28
|
+
* - [`Notepad.has`](https://serenity-js.org/api/core/class/Notepad/#has)}
|
|
29
29
|
*
|
|
30
30
|
* @param subject
|
|
31
31
|
* A subject (name) that uniquely identifies a given note
|
|
@@ -43,7 +43,7 @@ export class NotepadAdapter<Notes extends Record<any, any>> implements Chainable
|
|
|
43
43
|
* Retrieves a note, identified by `subject`, from the notepad.
|
|
44
44
|
*
|
|
45
45
|
* #### Learn more
|
|
46
|
-
* -
|
|
46
|
+
* - [`Notepad.get`](https://serenity-js.org/api/core/class/Notepad/#get)}
|
|
47
47
|
*
|
|
48
48
|
* @param subject
|
|
49
49
|
* A subject (name) that uniquely identifies a given note
|
|
@@ -51,8 +51,8 @@ export class NotepadAdapter<Notes extends Record<any, any>> implements Chainable
|
|
|
51
51
|
* @returns
|
|
52
52
|
* The value of the previously recorded note.
|
|
53
53
|
*
|
|
54
|
-
* @throws
|
|
55
|
-
* Throws a
|
|
54
|
+
* @throws
|
|
55
|
+
* Throws a [`LogicError`](https://serenity-js.org/api/core/class/LogicError/) if the note with a given `subject`
|
|
56
56
|
* has never been recorded.
|
|
57
57
|
*/
|
|
58
58
|
get<Subject extends keyof Notes>(subject: Subject): QuestionAdapter<Notes[Subject]> {
|
|
@@ -66,9 +66,9 @@ export class NotepadAdapter<Notes extends Record<any, any>> implements Chainable
|
|
|
66
66
|
* uniquely identified by its `subject`.
|
|
67
67
|
*
|
|
68
68
|
* **Pro tip:** calls to `set` can be chained and result in an accumulation
|
|
69
|
-
* of values to be recorded in the
|
|
70
|
-
* Those values are resolved and recorded when the
|
|
71
|
-
* returned by this method is performed by an
|
|
69
|
+
* of values to be recorded in the [`Notepad`](https://serenity-js.org/api/core/class/Notepad/).
|
|
70
|
+
* Those values are resolved and recorded when the [`Interaction`](https://serenity-js.org/api/core/class/Interaction/)
|
|
71
|
+
* returned by this method is performed by an [`Actor`](https://serenity-js.org/api/core/class/Actor/).
|
|
72
72
|
*
|
|
73
73
|
* If a note identified by a given `subject` is set multiple times,
|
|
74
74
|
* the last call wins.
|
|
@@ -99,7 +99,7 @@ export class NotepadAdapter<Notes extends Record<any, any>> implements Chainable
|
|
|
99
99
|
* ```
|
|
100
100
|
*
|
|
101
101
|
* #### Learn more
|
|
102
|
-
* -
|
|
102
|
+
* - [`Notepad.set`](https://serenity-js.org/api/core/class/Notepad/#set)
|
|
103
103
|
*
|
|
104
104
|
* @param subject
|
|
105
105
|
* A subject (name) that uniquely identifies a given note
|
|
@@ -169,7 +169,7 @@ export class NotepadAdapter<Notes extends Record<any, any>> implements Chainable
|
|
|
169
169
|
* ```
|
|
170
170
|
*
|
|
171
171
|
* #### Learn more
|
|
172
|
-
* -
|
|
172
|
+
* - [`Notepad.delete`](https://serenity-js.org/api/core/class/Notepad/#delete)
|
|
173
173
|
*
|
|
174
174
|
* @param subject
|
|
175
175
|
*
|
|
@@ -205,7 +205,7 @@ export class NotepadAdapter<Notes extends Record<any, any>> implements Chainable
|
|
|
205
205
|
* ```
|
|
206
206
|
*
|
|
207
207
|
* #### Learn more
|
|
208
|
-
* -
|
|
208
|
+
* - [`Notepad.clear`](https://serenity-js.org/api/core/class/Notepad/#clear)
|
|
209
209
|
*/
|
|
210
210
|
clear(): Interaction {
|
|
211
211
|
return Interaction.where(the`#actor clears ${ new NumberOfNotes() } from their notepad`, actor => {
|
|
@@ -234,7 +234,7 @@ export class NotepadAdapter<Notes extends Record<any, any>> implements Chainable
|
|
|
234
234
|
* ```
|
|
235
235
|
*
|
|
236
236
|
* #### Learn more
|
|
237
|
-
* -
|
|
237
|
+
* - [`Notepad.size`](https://serenity-js.org/api/core/class/Notepad/#size)
|
|
238
238
|
*/
|
|
239
239
|
size(): QuestionAdapter<number> {
|
|
240
240
|
return Question.about(the`${ new NumberOfNotes() }`, async actor => {
|
|
@@ -243,12 +243,12 @@ export class NotepadAdapter<Notes extends Record<any, any>> implements Chainable
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
/**
|
|
246
|
-
* Produces a
|
|
246
|
+
* Produces a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to a `JSONObject`
|
|
247
247
|
* representing the resolved notes stored in the notepad.
|
|
248
248
|
*
|
|
249
249
|
* Note that serialisation to JSON will simplify some data types that might not be serialisable by default,
|
|
250
250
|
* but are commonly used in data structures representing actor's notes.
|
|
251
|
-
* For example a
|
|
251
|
+
* 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).
|
|
252
252
|
*
|
|
253
253
|
* Additionally, notepad assumes that the data structure you use it with does not contain cyclic references.
|
|
254
254
|
*
|
|
@@ -2,21 +2,21 @@ import { Ability } from '../abilities';
|
|
|
2
2
|
import { Notepad } from './Notepad';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* An
|
|
5
|
+
* An [`Ability`](https://serenity-js.org/api/core/class/Ability/) that enables an [`Actor`](https://serenity-js.org/api/core/class/Actor/) to remember information
|
|
6
6
|
* to be recalled during a test scenario.
|
|
7
7
|
*
|
|
8
|
-
* Under the hood,
|
|
8
|
+
* Under the hood, [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/) uses a [`Notepad`](https://serenity-js.org/api/core/class/Notepad/), which state
|
|
9
9
|
* can be populated both during initialisation or while the test scenario is executed.
|
|
10
10
|
* Populating the notepad when it's initialised can be useful to associate authentication credentials
|
|
11
11
|
* or personal details with a given actor, while dynamic recording of notes during a test scenario
|
|
12
12
|
* can be useful when the data to be recorded is not known upfront - for example when we want
|
|
13
13
|
* the actor to remember a JWT stored in the browser and then use it when sending API requests.
|
|
14
14
|
*
|
|
15
|
-
* **Pro tip:**
|
|
15
|
+
* **Pro tip:** [`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/) can be typed
|
|
16
16
|
* using [TypeScript generics](https://www.typescriptlang.org/docs/handbook/2/generics.html)
|
|
17
17
|
* to help you avoid typos when specifying note names.
|
|
18
18
|
*
|
|
19
|
-
* See [notes](/api/core/function/notes) and
|
|
19
|
+
* See [notes](https://serenity-js.org/api/core/function/notes) and [`Notepad`](https://serenity-js.org/api/core/class/Notepad/) for more usage examples.
|
|
20
20
|
*
|
|
21
21
|
* ## Remembering and retrieving a value
|
|
22
22
|
*
|
|
@@ -224,23 +224,23 @@ import { Notepad } from './Notepad';
|
|
|
224
224
|
*
|
|
225
225
|
* ## Learn more
|
|
226
226
|
*
|
|
227
|
-
* - [notes](/api/core/function/notes)
|
|
228
|
-
* -
|
|
227
|
+
* - [notes](https://serenity-js.org/api/core/function/notes)
|
|
228
|
+
* - [`Notepad`](https://serenity-js.org/api/core/class/Notepad/)
|
|
229
229
|
*
|
|
230
230
|
* @group Notes
|
|
231
231
|
*/
|
|
232
232
|
export class TakeNotes<Notes_Type extends Record<any, any>> extends Ability {
|
|
233
233
|
|
|
234
234
|
/**
|
|
235
|
-
* Initialises an
|
|
235
|
+
* Initialises an [`Ability`](https://serenity-js.org/api/core/class/Ability/) to [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/) with [`Notepad.empty`](https://serenity-js.org/api/core/class/Notepad/#empty).
|
|
236
236
|
*/
|
|
237
237
|
static usingAnEmptyNotepad<N extends Record<any, any>>(): TakeNotes<N> {
|
|
238
238
|
return TakeNotes.using<N>(Notepad.empty<N>());
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
|
-
* Initialises an
|
|
243
|
-
* a
|
|
242
|
+
* Initialises an [`Ability`](https://serenity-js.org/api/core/class/Ability/) to [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/) using
|
|
243
|
+
* a [`Notepad.with`](https://serenity-js.org/api/core/class/Notepad/#with) some initial state.
|
|
244
244
|
*
|
|
245
245
|
* @param notepad
|
|
246
246
|
*/
|
|
@@ -2,10 +2,10 @@ import { Notepad } from './Notepad';
|
|
|
2
2
|
import type { NotepadAdapter } from './NotepadAdapter';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Alias for
|
|
5
|
+
* Alias for [`Notepad.notes`](https://serenity-js.org/api/core/class/Notepad/#notes).
|
|
6
6
|
*
|
|
7
|
-
* **Pro tip:** `notes<T>().get(subject)` returns a
|
|
8
|
-
* of the underlying type easier. Check
|
|
7
|
+
* **Pro tip:** `notes<T>().get(subject)` returns a [`NotepadAdapter`](https://serenity-js.org/api/core/class/NotepadAdapter/) to make accessing the APIs
|
|
8
|
+
* of the underlying type easier. Check [`NotepadAdapter`](https://serenity-js.org/api/core/class/NotepadAdapter/) for more examples.
|
|
9
9
|
*
|
|
10
10
|
* ## Working with untyped notes
|
|
11
11
|
*
|
|
@@ -109,9 +109,9 @@ import type { NotepadAdapter } from './NotepadAdapter';
|
|
|
109
109
|
*
|
|
110
110
|
* ## Learn more
|
|
111
111
|
*
|
|
112
|
-
* -
|
|
113
|
-
* -
|
|
114
|
-
* -
|
|
112
|
+
* - [`NotepadAdapter`](https://serenity-js.org/api/core/class/NotepadAdapter/)
|
|
113
|
+
* - [`Notepad.notes`](https://serenity-js.org/api/core/class/Notepad/#notes)
|
|
114
|
+
* - [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter)
|
|
115
115
|
*
|
|
116
116
|
* @group Notes
|
|
117
117
|
*/
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { Answerable } from '../Answerable';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Describes an
|
|
4
|
+
* Describes an [`Actor`](https://serenity-js.org/api/core/class/Actor/) who can answer a [`Question`](https://serenity-js.org/api/core/class/Question/) about the system under test.
|
|
5
5
|
*
|
|
6
6
|
* ## Learn more
|
|
7
7
|
*
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
8
|
+
* - [`Question`](https://serenity-js.org/api/core/class/Question/)
|
|
9
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
10
10
|
*
|
|
11
11
|
* @group Actors
|
|
12
12
|
*/
|
|
13
13
|
export interface AnswersQuestions {
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Makes the
|
|
16
|
+
* Makes the [`Actor`](https://serenity-js.org/api/core/class/Actor/) evaluate an [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
|
17
17
|
* and return the value it holds.
|
|
18
18
|
*/
|
|
19
19
|
answer<T>(answerable: Answerable<T>): Promise<T>;
|
|
@@ -3,14 +3,14 @@ import type { Question } from '../Question';
|
|
|
3
3
|
import type { MetaQuestion } from './MetaQuestion';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* A chainable meta-question is a
|
|
7
|
-
* in the context of another
|
|
6
|
+
* A chainable meta-question is a [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/) that can be answered
|
|
7
|
+
* in the context of another [`Answerable`](https://serenity-js.org/api/core/#Answerable),
|
|
8
8
|
* and form a chain of transformations.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* [Meta-questions](https://serenity-js.org/api/core/interface/MetaQuestion/) are typically used when filtering a [`List`](https://serenity-js.org/api/core/class/List/).
|
|
11
11
|
*
|
|
12
12
|
* ## Learn more
|
|
13
|
-
* -
|
|
13
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
14
14
|
*
|
|
15
15
|
* @group Questions
|
|
16
16
|
*/
|
|
@@ -20,11 +20,11 @@ export interface ChainableMetaQuestion<
|
|
|
20
20
|
> extends MetaQuestion<Supported_Context_Type, Returned_Question_Type & ChainableMetaQuestion<Supported_Context_Type, Returned_Question_Type>> {
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Answers the given `ChainableMetaQuestion` in the context of another
|
|
23
|
+
* Answers the given `ChainableMetaQuestion` in the context of another [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
|
24
24
|
* and returns another `ChainableMetaQuestion` ready for further chaining.
|
|
25
25
|
*
|
|
26
26
|
* #### Learn more
|
|
27
|
-
* -
|
|
27
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
28
28
|
*/
|
|
29
29
|
of(context: Answerable<Supported_Context_Type>): Returned_Question_Type & ChainableMetaQuestion<Supported_Context_Type, Returned_Question_Type>;
|
|
30
30
|
}
|
|
@@ -9,7 +9,7 @@ import { ExpectationMet } from './expectations';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A [flow control statement](https://en.wikipedia.org/wiki/Control_flow)
|
|
12
|
-
* that enables an
|
|
12
|
+
* that enables an [`Actor`](https://serenity-js.org/api/core/class/Actor/) to decide between two alternate series of [activities](https://serenity-js.org/api/core/class/Activity/).
|
|
13
13
|
*
|
|
14
14
|
* Think of it as a Screenplay Pattern equivalent of the traditional `if` statement.
|
|
15
15
|
*
|
|
@@ -66,7 +66,7 @@ export class Check<Actual> extends Task {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* @param alternativeActivities
|
|
69
|
-
* A sequence of
|
|
69
|
+
* A sequence of [activities](https://serenity-js.org/api/core/class/Activity/) to perform when the [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) is not met.
|
|
70
70
|
*/
|
|
71
71
|
otherwise(...alternativeActivities: Activity[]): Task {
|
|
72
72
|
return new Check<Actual>(this.actual, this.expectation, this.activities, alternativeActivities);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Configuration options for
|
|
3
|
-
* the [`the`](/api/core/function/the/) function.
|
|
2
|
+
* Configuration options for [`Question.formattedValue`](https://serenity-js.org/api/core/class/Question/#formattedValue) and
|
|
3
|
+
* the [`the`](https://serenity-js.org/api/core/function/the/) function.
|
|
4
4
|
*
|
|
5
5
|
* @group Questions
|
|
6
6
|
*/
|
|
@@ -17,15 +17,18 @@ export type Predicate<Actual> = (actor: AnswersQuestions, actual: Answerable<Act
|
|
|
17
17
|
type AnswerableArguments<Arguments extends Array<unknown>> = { [Index in keyof Arguments]: Answerable<Arguments[Index]> };
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Defines an expectation to be used with
|
|
21
|
-
*
|
|
20
|
+
* Defines an expectation to be used with [`Wait.until`](https://serenity-js.org/api/core/class/Wait/#until),
|
|
21
|
+
* [`Check.whether`](https://serenity-js.org/api/core/class/Check/#whether),
|
|
22
|
+
* [`Ensure.that`](https://serenity-js.org/api/assertions/class/Ensure/#that)
|
|
23
|
+
* and as part of the Page Element Query Language with [`PageElements.where`](https://serenity-js.org/api/web/class/PageElements/#where)
|
|
24
|
+
* and [`List.where`](https://serenity-js.org/api/core/class/List/#where).
|
|
22
25
|
*
|
|
23
26
|
* @group Expectations
|
|
24
27
|
*/
|
|
25
28
|
export class Expectation<Actual> extends Describable {
|
|
26
29
|
|
|
27
30
|
/**
|
|
28
|
-
* A factory method to that makes defining custom
|
|
31
|
+
* A factory method to that makes defining custom [expectations](https://serenity-js.org/api/core/class/Expectation/) easier
|
|
29
32
|
*
|
|
30
33
|
* #### Defining a custom expectation
|
|
31
34
|
*
|
|
@@ -96,16 +99,16 @@ export class Expectation<Actual> extends Describable {
|
|
|
96
99
|
* ```
|
|
97
100
|
*
|
|
98
101
|
* #### Learn more
|
|
99
|
-
* -
|
|
100
|
-
* -
|
|
101
|
-
* -
|
|
102
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
103
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
104
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
102
105
|
*
|
|
103
106
|
* @param functionName
|
|
104
|
-
* Name of the expectation function to be used when producing an
|
|
107
|
+
* Name of the expectation function to be used when producing an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/)
|
|
105
108
|
*
|
|
106
109
|
* @param relationship
|
|
107
110
|
* Human-readable description of the relationship between the `expected` and the `actual` values.
|
|
108
|
-
* Used when reporting
|
|
111
|
+
* Used when reporting [activities](https://serenity-js.org/api/core/class/Activity/) performed by an [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
109
112
|
*
|
|
110
113
|
* @param predicate
|
|
111
114
|
*/
|
|
@@ -149,7 +152,7 @@ export class Expectation<Actual> extends Describable {
|
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
/**
|
|
152
|
-
* Used to define a simple
|
|
155
|
+
* Used to define a simple [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
153
156
|
*
|
|
154
157
|
* #### Simple parameterised expectation
|
|
155
158
|
*
|
|
@@ -201,9 +204,9 @@ export class Expectation<Actual> extends Describable {
|
|
|
201
204
|
}
|
|
202
205
|
|
|
203
206
|
/**
|
|
204
|
-
* Used to compose
|
|
207
|
+
* Used to compose [expectations](https://serenity-js.org/api/core/class/Expectation/).
|
|
205
208
|
*
|
|
206
|
-
* #### Composing
|
|
209
|
+
* #### Composing [expectations](https://serenity-js.org/api/core/class/Expectation/)
|
|
207
210
|
*
|
|
208
211
|
* ```ts
|
|
209
212
|
* import { actorCalled, Expectation } from '@serenity-js/core'
|
|
@@ -255,9 +258,9 @@ export class Expectation<Actual> extends Describable {
|
|
|
255
258
|
}
|
|
256
259
|
|
|
257
260
|
/**
|
|
258
|
-
* Returns a
|
|
259
|
-
* indicating that the
|
|
260
|
-
* or that the
|
|
261
|
+
* Returns a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to [`ExpectationOutcome`](https://serenity-js.org/api/core/class/ExpectationOutcome/)
|
|
262
|
+
* indicating that the [expectation was met](https://serenity-js.org/api/core/class/ExpectationMet/)
|
|
263
|
+
* or that the [expectation was not met](https://serenity-js.org/api/core/class/ExpectationNotMet/)
|
|
261
264
|
*
|
|
262
265
|
* @param actual
|
|
263
266
|
*/
|
|
@@ -11,8 +11,8 @@ import type { Expectation } from './Expectation';
|
|
|
11
11
|
import { ExpectationMet } from './expectations';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Serenity/JS Screenplay Pattern-style wrapper around
|
|
15
|
-
* and array-like structures - see
|
|
14
|
+
* Serenity/JS Screenplay Pattern-style wrapper around [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
|
|
15
|
+
* and array-like structures - see [`PageElement`](https://serenity-js.org/api/web/class/PageElements/).
|
|
16
16
|
*
|
|
17
17
|
* @group Questions
|
|
18
18
|
*/
|
|
@@ -153,10 +153,10 @@ class ArrayList<Item_Type> extends List<Item_Type> {
|
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
155
|
* Serenity/JS Screenplay Pattern-style wrapper around
|
|
156
|
-
* a
|
|
157
|
-
* that can be resolved in `Supported_Context_Type` of another
|
|
156
|
+
* a [`ChainableMetaQuestion`](https://serenity-js.org/api/core/interface/ChainableMetaQuestion/) representing a collection
|
|
157
|
+
* that can be resolved in `Supported_Context_Type` of another [`Question`](https://serenity-js.org/api/core/class/Question/).
|
|
158
158
|
*
|
|
159
|
-
* For example,
|
|
159
|
+
* For example, [`PageElements.located`](https://serenity-js.org/api/web/class/PageElements/#located) returns `MetaList<PageElement>`,
|
|
160
160
|
* which allows for the collection of page elements to be resolved in the context
|
|
161
161
|
* of dynamically-provided root element.
|
|
162
162
|
*
|
|
@@ -29,8 +29,10 @@ export class Masked {
|
|
|
29
29
|
* );
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
|
-
* @param parameter
|
|
33
|
-
*
|
|
32
|
+
* @param parameter
|
|
33
|
+
* An [`Answerable`](https://serenity-js.org/api/core/#Answerable) representing the masked value.
|
|
34
|
+
* @returns
|
|
35
|
+
* A [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) representing the masked value.
|
|
34
36
|
*/
|
|
35
37
|
static valueOf(parameter: Answerable<string>): QuestionAdapter<string> {
|
|
36
38
|
return Question.about('[a masked value]', async actor => actor.answer(parameter));
|
|
@@ -2,32 +2,32 @@ import type { Answerable } from '../Answerable';
|
|
|
2
2
|
import type { Question } from '../Question';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* A meta-question is a
|
|
6
|
-
* in the context of another
|
|
5
|
+
* A meta-question is a [`Question`](https://serenity-js.org/api/core/class/Question/) that can be answered
|
|
6
|
+
* in the context of another [`Answerable`](https://serenity-js.org/api/core/#Answerable),
|
|
7
7
|
* typically to transform its value.
|
|
8
8
|
*
|
|
9
|
-
* For example, the question
|
|
10
|
-
* of a
|
|
9
|
+
* For example, the question [`Text.of`](https://serenity-js.org/api/web/class/Text/#of) can be answered in the context
|
|
10
|
+
* of a [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) to return its text content.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* [Meta-questions](https://serenity-js.org/api/core/interface/MetaQuestion/) are typically used when filtering a [`List`](https://serenity-js.org/api/core/class/List/).
|
|
13
13
|
*
|
|
14
14
|
* ## Learn more
|
|
15
|
-
* -
|
|
15
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
16
16
|
*
|
|
17
17
|
* @group Questions
|
|
18
18
|
*/
|
|
19
19
|
export interface MetaQuestion<Supported_Context_Type, Returned_Question_Type extends Question<unknown>> {
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Answers the given `MetaQuestion` in the context of another
|
|
22
|
+
* Answers the given `MetaQuestion` in the context of another [`Answerable`](https://serenity-js.org/api/core/#Answerable).
|
|
23
23
|
*
|
|
24
24
|
* #### Learn more
|
|
25
|
-
* -
|
|
25
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
26
26
|
*/
|
|
27
27
|
of(context: Answerable<Supported_Context_Type>): Returned_Question_Type;
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Human-readable description of this
|
|
30
|
+
* Human-readable description of this [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/),
|
|
31
31
|
* typically involving the description of the subject.
|
|
32
32
|
*
|
|
33
33
|
* For example, a description of a meta question obout "the text of an element"
|
|
@@ -3,8 +3,8 @@ import { TinyType } from 'tiny-types';
|
|
|
3
3
|
import * as util from 'util'; // eslint-disable-line unicorn/import-style
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* A placeholder value signifying that a
|
|
7
|
-
* has not been answered by an
|
|
6
|
+
* A placeholder value signifying that a [`Question`](https://serenity-js.org/api/core/class/Question/)
|
|
7
|
+
* has not been answered by an [`Actor`](https://serenity-js.org/api/core/class/Actor/) when producing an [`ExpectationOutcome`](https://serenity-js.org/api/core/class/ExpectationOutcome/).
|
|
8
8
|
* This happens when Serenity/JS decides that answering a given question
|
|
9
9
|
* won't affect the outcome.
|
|
10
10
|
*
|
|
@@ -6,7 +6,7 @@ import { Name } from '../../../model';
|
|
|
6
6
|
import { Unanswered } from '../Unanswered';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Used with
|
|
9
|
+
* Used with [`ExpectationOutcome`](https://serenity-js.org/api/core/class/ExpectationOutcome/) to describe an [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) and the arguments it's been executed with.
|
|
10
10
|
*
|
|
11
11
|
* @group Expectations
|
|
12
12
|
*/
|
|
@@ -3,8 +3,8 @@ import { TinyType } from 'tiny-types';
|
|
|
3
3
|
import type { ExpectationDetails } from './ExpectationDetails';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* An outcome of an
|
|
7
|
-
* which could be either
|
|
6
|
+
* An outcome of an [`Expectation`](https://serenity-js.org/api/core/class/Expectation/),
|
|
7
|
+
* which could be either [met](https://serenity-js.org/api/core/class/ExpectationMet/) or [not met](https://serenity-js.org/api/core/class/ExpectationNotMet/).
|
|
8
8
|
*
|
|
9
9
|
* @group Expectations
|
|
10
10
|
*/
|