@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,21 +1,21 @@
|
|
|
1
1
|
import { Ability } from '../abilities';
|
|
2
2
|
import { Notepad } from './Notepad';
|
|
3
3
|
/**
|
|
4
|
-
* An
|
|
4
|
+
* 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
|
|
5
5
|
* to be recalled during a test scenario.
|
|
6
6
|
*
|
|
7
|
-
* Under the hood,
|
|
7
|
+
* 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
|
|
8
8
|
* can be populated both during initialisation or while the test scenario is executed.
|
|
9
9
|
* Populating the notepad when it's initialised can be useful to associate authentication credentials
|
|
10
10
|
* or personal details with a given actor, while dynamic recording of notes during a test scenario
|
|
11
11
|
* can be useful when the data to be recorded is not known upfront - for example when we want
|
|
12
12
|
* the actor to remember a JWT stored in the browser and then use it when sending API requests.
|
|
13
13
|
*
|
|
14
|
-
* **Pro tip:**
|
|
14
|
+
* **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
|
|
15
15
|
* using [TypeScript generics](https://www.typescriptlang.org/docs/handbook/2/generics.html)
|
|
16
16
|
* to help you avoid typos when specifying note names.
|
|
17
17
|
*
|
|
18
|
-
* See [notes](/api/core/function/notes) and
|
|
18
|
+
* See [notes](https://serenity-js.org/api/core/function/notes) and [`Notepad`](https://serenity-js.org/api/core/class/Notepad/) for more usage examples.
|
|
19
19
|
*
|
|
20
20
|
* ## Remembering and retrieving a value
|
|
21
21
|
*
|
|
@@ -223,20 +223,20 @@ import { Notepad } from './Notepad';
|
|
|
223
223
|
*
|
|
224
224
|
* ## Learn more
|
|
225
225
|
*
|
|
226
|
-
* - [notes](/api/core/function/notes)
|
|
227
|
-
* -
|
|
226
|
+
* - [notes](https://serenity-js.org/api/core/function/notes)
|
|
227
|
+
* - [`Notepad`](https://serenity-js.org/api/core/class/Notepad/)
|
|
228
228
|
*
|
|
229
229
|
* @group Notes
|
|
230
230
|
*/
|
|
231
231
|
export declare class TakeNotes<Notes_Type extends Record<any, any>> extends Ability {
|
|
232
232
|
readonly notepad: Notepad<Notes_Type>;
|
|
233
233
|
/**
|
|
234
|
-
* Initialises an
|
|
234
|
+
* 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).
|
|
235
235
|
*/
|
|
236
236
|
static usingAnEmptyNotepad<N extends Record<any, any>>(): TakeNotes<N>;
|
|
237
237
|
/**
|
|
238
|
-
* Initialises an
|
|
239
|
-
* a
|
|
238
|
+
* Initialises an [`Ability`](https://serenity-js.org/api/core/class/Ability/) to [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/) using
|
|
239
|
+
* a [`Notepad.with`](https://serenity-js.org/api/core/class/Notepad/#with) some initial state.
|
|
240
240
|
*
|
|
241
241
|
* @param notepad
|
|
242
242
|
*/
|
|
@@ -4,21 +4,21 @@ exports.TakeNotes = void 0;
|
|
|
4
4
|
const abilities_1 = require("../abilities");
|
|
5
5
|
const Notepad_1 = require("./Notepad");
|
|
6
6
|
/**
|
|
7
|
-
* An
|
|
7
|
+
* 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
|
|
8
8
|
* to be recalled during a test scenario.
|
|
9
9
|
*
|
|
10
|
-
* Under the hood,
|
|
10
|
+
* 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
|
|
11
11
|
* can be populated both during initialisation or while the test scenario is executed.
|
|
12
12
|
* Populating the notepad when it's initialised can be useful to associate authentication credentials
|
|
13
13
|
* or personal details with a given actor, while dynamic recording of notes during a test scenario
|
|
14
14
|
* can be useful when the data to be recorded is not known upfront - for example when we want
|
|
15
15
|
* the actor to remember a JWT stored in the browser and then use it when sending API requests.
|
|
16
16
|
*
|
|
17
|
-
* **Pro tip:**
|
|
17
|
+
* **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
|
|
18
18
|
* using [TypeScript generics](https://www.typescriptlang.org/docs/handbook/2/generics.html)
|
|
19
19
|
* to help you avoid typos when specifying note names.
|
|
20
20
|
*
|
|
21
|
-
* See [notes](/api/core/function/notes) and
|
|
21
|
+
* See [notes](https://serenity-js.org/api/core/function/notes) and [`Notepad`](https://serenity-js.org/api/core/class/Notepad/) for more usage examples.
|
|
22
22
|
*
|
|
23
23
|
* ## Remembering and retrieving a value
|
|
24
24
|
*
|
|
@@ -226,22 +226,22 @@ const Notepad_1 = require("./Notepad");
|
|
|
226
226
|
*
|
|
227
227
|
* ## Learn more
|
|
228
228
|
*
|
|
229
|
-
* - [notes](/api/core/function/notes)
|
|
230
|
-
* -
|
|
229
|
+
* - [notes](https://serenity-js.org/api/core/function/notes)
|
|
230
|
+
* - [`Notepad`](https://serenity-js.org/api/core/class/Notepad/)
|
|
231
231
|
*
|
|
232
232
|
* @group Notes
|
|
233
233
|
*/
|
|
234
234
|
class TakeNotes extends abilities_1.Ability {
|
|
235
235
|
notepad;
|
|
236
236
|
/**
|
|
237
|
-
* Initialises an
|
|
237
|
+
* 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).
|
|
238
238
|
*/
|
|
239
239
|
static usingAnEmptyNotepad() {
|
|
240
240
|
return TakeNotes.using(Notepad_1.Notepad.empty());
|
|
241
241
|
}
|
|
242
242
|
/**
|
|
243
|
-
* Initialises an
|
|
244
|
-
* a
|
|
243
|
+
* Initialises an [`Ability`](https://serenity-js.org/api/core/class/Ability/) to [`TakeNotes`](https://serenity-js.org/api/core/class/TakeNotes/) using
|
|
244
|
+
* a [`Notepad.with`](https://serenity-js.org/api/core/class/Notepad/#with) some initial state.
|
|
245
245
|
*
|
|
246
246
|
* @param notepad
|
|
247
247
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { NotepadAdapter } from './NotepadAdapter';
|
|
2
2
|
/**
|
|
3
|
-
* Alias for
|
|
3
|
+
* Alias for [`Notepad.notes`](https://serenity-js.org/api/core/class/Notepad/#notes).
|
|
4
4
|
*
|
|
5
|
-
* **Pro tip:** `notes<T>().get(subject)` returns a
|
|
6
|
-
* of the underlying type easier. Check
|
|
5
|
+
* **Pro tip:** `notes<T>().get(subject)` returns a [`NotepadAdapter`](https://serenity-js.org/api/core/class/NotepadAdapter/) to make accessing the APIs
|
|
6
|
+
* of the underlying type easier. Check [`NotepadAdapter`](https://serenity-js.org/api/core/class/NotepadAdapter/) for more examples.
|
|
7
7
|
*
|
|
8
8
|
* ## Working with untyped notes
|
|
9
9
|
*
|
|
@@ -107,9 +107,9 @@ import type { NotepadAdapter } from './NotepadAdapter';
|
|
|
107
107
|
*
|
|
108
108
|
* ## Learn more
|
|
109
109
|
*
|
|
110
|
-
* -
|
|
111
|
-
* -
|
|
112
|
-
* -
|
|
110
|
+
* - [`NotepadAdapter`](https://serenity-js.org/api/core/class/NotepadAdapter/)
|
|
111
|
+
* - [`Notepad.notes`](https://serenity-js.org/api/core/class/Notepad/#notes)
|
|
112
|
+
* - [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter)
|
|
113
113
|
*
|
|
114
114
|
* @group Notes
|
|
115
115
|
*/
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.notes = void 0;
|
|
4
4
|
const Notepad_1 = require("./Notepad");
|
|
5
5
|
/**
|
|
6
|
-
* Alias for
|
|
6
|
+
* Alias for [`Notepad.notes`](https://serenity-js.org/api/core/class/Notepad/#notes).
|
|
7
7
|
*
|
|
8
|
-
* **Pro tip:** `notes<T>().get(subject)` returns a
|
|
9
|
-
* of the underlying type easier. Check
|
|
8
|
+
* **Pro tip:** `notes<T>().get(subject)` returns a [`NotepadAdapter`](https://serenity-js.org/api/core/class/NotepadAdapter/) to make accessing the APIs
|
|
9
|
+
* of the underlying type easier. Check [`NotepadAdapter`](https://serenity-js.org/api/core/class/NotepadAdapter/) for more examples.
|
|
10
10
|
*
|
|
11
11
|
* ## Working with untyped notes
|
|
12
12
|
*
|
|
@@ -110,9 +110,9 @@ const Notepad_1 = require("./Notepad");
|
|
|
110
110
|
*
|
|
111
111
|
* ## Learn more
|
|
112
112
|
*
|
|
113
|
-
* -
|
|
114
|
-
* -
|
|
115
|
-
* -
|
|
113
|
+
* - [`NotepadAdapter`](https://serenity-js.org/api/core/class/NotepadAdapter/)
|
|
114
|
+
* - [`Notepad.notes`](https://serenity-js.org/api/core/class/Notepad/#notes)
|
|
115
|
+
* - [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter)
|
|
116
116
|
*
|
|
117
117
|
* @group Notes
|
|
118
118
|
*/
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { Answerable } from '../Answerable';
|
|
2
2
|
/**
|
|
3
|
-
* Describes an
|
|
3
|
+
* 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.
|
|
4
4
|
*
|
|
5
5
|
* ## Learn more
|
|
6
6
|
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
7
|
+
* - [`Question`](https://serenity-js.org/api/core/class/Question/)
|
|
8
|
+
* - [`Actor`](https://serenity-js.org/api/core/class/Actor/)
|
|
9
9
|
*
|
|
10
10
|
* @group Actors
|
|
11
11
|
*/
|
|
12
12
|
export interface AnswersQuestions {
|
|
13
13
|
/**
|
|
14
|
-
* Makes the
|
|
14
|
+
* Makes the [`Actor`](https://serenity-js.org/api/core/class/Actor/) evaluate an [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
|
15
15
|
* and return the value it holds.
|
|
16
16
|
*/
|
|
17
17
|
answer<T>(answerable: Answerable<T>): Promise<T>;
|
|
@@ -2,24 +2,24 @@ import type { Answerable } from '../Answerable';
|
|
|
2
2
|
import type { Question } from '../Question';
|
|
3
3
|
import type { MetaQuestion } from './MetaQuestion';
|
|
4
4
|
/**
|
|
5
|
-
* A chainable meta-question is a
|
|
6
|
-
* in the context of another
|
|
5
|
+
* A chainable meta-question is a [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/) that can be answered
|
|
6
|
+
* in the context of another [`Answerable`](https://serenity-js.org/api/core/#Answerable),
|
|
7
7
|
* and form a chain of transformations.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* [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/).
|
|
10
10
|
*
|
|
11
11
|
* ## Learn more
|
|
12
|
-
* -
|
|
12
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
13
13
|
*
|
|
14
14
|
* @group Questions
|
|
15
15
|
*/
|
|
16
16
|
export interface ChainableMetaQuestion<Supported_Context_Type, Returned_Question_Type extends Question<unknown>> extends MetaQuestion<Supported_Context_Type, Returned_Question_Type & ChainableMetaQuestion<Supported_Context_Type, Returned_Question_Type>> {
|
|
17
17
|
/**
|
|
18
|
-
* Answers the given `ChainableMetaQuestion` in the context of another
|
|
18
|
+
* Answers the given `ChainableMetaQuestion` in the context of another [`Answerable`](https://serenity-js.org/api/core/#Answerable)
|
|
19
19
|
* and returns another `ChainableMetaQuestion` ready for further chaining.
|
|
20
20
|
*
|
|
21
21
|
* #### Learn more
|
|
22
|
-
* -
|
|
22
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
23
23
|
*/
|
|
24
24
|
of(context: Answerable<Supported_Context_Type>): Returned_Question_Type & ChainableMetaQuestion<Supported_Context_Type, Returned_Question_Type>;
|
|
25
25
|
}
|
|
@@ -6,7 +6,7 @@ import { Task } from '../Task';
|
|
|
6
6
|
import type { Expectation } from './Expectation';
|
|
7
7
|
/**
|
|
8
8
|
* A [flow control statement](https://en.wikipedia.org/wiki/Control_flow)
|
|
9
|
-
* that enables an
|
|
9
|
+
* 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/).
|
|
10
10
|
*
|
|
11
11
|
* Think of it as a Screenplay Pattern equivalent of the traditional `if` statement.
|
|
12
12
|
*
|
|
@@ -54,7 +54,7 @@ export declare class Check<Actual> extends Task {
|
|
|
54
54
|
protected constructor(actual: Answerable<Actual>, expectation: Expectation<Actual>, activities: Activity[], alternativeActivities?: Activity[]);
|
|
55
55
|
/**
|
|
56
56
|
* @param alternativeActivities
|
|
57
|
-
* A sequence of
|
|
57
|
+
* 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.
|
|
58
58
|
*/
|
|
59
59
|
otherwise(...alternativeActivities: Activity[]): Task;
|
|
60
60
|
/**
|
|
@@ -6,7 +6,7 @@ const Task_1 = require("../Task");
|
|
|
6
6
|
const expectations_1 = require("./expectations");
|
|
7
7
|
/**
|
|
8
8
|
* A [flow control statement](https://en.wikipedia.org/wiki/Control_flow)
|
|
9
|
-
* that enables an
|
|
9
|
+
* 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/).
|
|
10
10
|
*
|
|
11
11
|
* Think of it as a Screenplay Pattern equivalent of the traditional `if` statement.
|
|
12
12
|
*
|
|
@@ -63,7 +63,7 @@ class Check extends Task_1.Task {
|
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* @param alternativeActivities
|
|
66
|
-
* A sequence of
|
|
66
|
+
* 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.
|
|
67
67
|
*/
|
|
68
68
|
otherwise(...alternativeActivities) {
|
|
69
69
|
return new Check(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
|
*/
|
|
@@ -9,8 +9,11 @@ type AnswerableArguments<Arguments extends Array<unknown>> = {
|
|
|
9
9
|
[Index in keyof Arguments]: Answerable<Arguments[Index]>;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* Defines an expectation to be used with
|
|
13
|
-
*
|
|
12
|
+
* Defines an expectation to be used with [`Wait.until`](https://serenity-js.org/api/core/class/Wait/#until),
|
|
13
|
+
* [`Check.whether`](https://serenity-js.org/api/core/class/Check/#whether),
|
|
14
|
+
* [`Ensure.that`](https://serenity-js.org/api/assertions/class/Ensure/#that)
|
|
15
|
+
* and as part of the Page Element Query Language with [`PageElements.where`](https://serenity-js.org/api/web/class/PageElements/#where)
|
|
16
|
+
* and [`List.where`](https://serenity-js.org/api/core/class/List/#where).
|
|
14
17
|
*
|
|
15
18
|
* @group Expectations
|
|
16
19
|
*/
|
|
@@ -18,7 +21,7 @@ export declare class Expectation<Actual> extends Describable {
|
|
|
18
21
|
private readonly functionName;
|
|
19
22
|
private readonly predicate;
|
|
20
23
|
/**
|
|
21
|
-
* A factory method to that makes defining custom
|
|
24
|
+
* A factory method to that makes defining custom [expectations](https://serenity-js.org/api/core/class/Expectation/) easier
|
|
22
25
|
*
|
|
23
26
|
* #### Defining a custom expectation
|
|
24
27
|
*
|
|
@@ -89,22 +92,22 @@ export declare class Expectation<Actual> extends Describable {
|
|
|
89
92
|
* ```
|
|
90
93
|
*
|
|
91
94
|
* #### Learn more
|
|
92
|
-
* -
|
|
93
|
-
* -
|
|
94
|
-
* -
|
|
95
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
96
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
97
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
95
98
|
*
|
|
96
99
|
* @param functionName
|
|
97
|
-
* Name of the expectation function to be used when producing an
|
|
100
|
+
* Name of the expectation function to be used when producing an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/)
|
|
98
101
|
*
|
|
99
102
|
* @param relationship
|
|
100
103
|
* Human-readable description of the relationship between the `expected` and the `actual` values.
|
|
101
|
-
* Used when reporting
|
|
104
|
+
* Used when reporting [activities](https://serenity-js.org/api/core/class/Activity/) performed by an [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
102
105
|
*
|
|
103
106
|
* @param predicate
|
|
104
107
|
*/
|
|
105
108
|
static define<Actual_Type, PredicateArguments extends Array<unknown>>(functionName: string, relationship: ((...answerableArguments: AnswerableArguments<PredicateArguments>) => Answerable<string>) | Answerable<string>, predicate: (actual: Actual_Type, ...predicateArguments: PredicateArguments) => Promise<boolean> | boolean): (...answerableArguments: AnswerableArguments<PredicateArguments>) => Expectation<Actual_Type>;
|
|
106
109
|
/**
|
|
107
|
-
* Used to define a simple
|
|
110
|
+
* Used to define a simple [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
108
111
|
*
|
|
109
112
|
* #### Simple parameterised expectation
|
|
110
113
|
*
|
|
@@ -133,9 +136,9 @@ export declare class Expectation<Actual> extends Describable {
|
|
|
133
136
|
soThat: (simplifiedPredicate: (actualValue: Actual_Type, expectedValue: Expected_Type) => Promise<boolean> | boolean) => Expectation<Actual_Type>;
|
|
134
137
|
};
|
|
135
138
|
/**
|
|
136
|
-
* Used to compose
|
|
139
|
+
* Used to compose [expectations](https://serenity-js.org/api/core/class/Expectation/).
|
|
137
140
|
*
|
|
138
|
-
* #### Composing
|
|
141
|
+
* #### Composing [expectations](https://serenity-js.org/api/core/class/Expectation/)
|
|
139
142
|
*
|
|
140
143
|
* ```ts
|
|
141
144
|
* import { actorCalled, Expectation } from '@serenity-js/core'
|
|
@@ -167,9 +170,9 @@ export declare class Expectation<Actual> extends Describable {
|
|
|
167
170
|
};
|
|
168
171
|
protected constructor(functionName: string, description: Answerable<string>, predicate: Predicate<Actual>);
|
|
169
172
|
/**
|
|
170
|
-
* Returns a
|
|
171
|
-
* indicating that the
|
|
172
|
-
* or that the
|
|
173
|
+
* Returns a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to [`ExpectationOutcome`](https://serenity-js.org/api/core/class/ExpectationOutcome/)
|
|
174
|
+
* indicating that the [expectation was met](https://serenity-js.org/api/core/class/ExpectationMet/)
|
|
175
|
+
* or that the [expectation was not met](https://serenity-js.org/api/core/class/ExpectationNotMet/)
|
|
173
176
|
*
|
|
174
177
|
* @param actual
|
|
175
178
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expectation.d.ts","sourceRoot":"","sources":["../../../src/screenplay/questions/Expectation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAC,MAAM,UAAU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AS,CAAC,MAAM,CAAC;IAKjD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,kBAAkB,CAAC;IAIzE;;OAEG;IACH,WAAW,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI;CAKrD"}
|
|
@@ -7,8 +7,11 @@ const index_1 = require("../index");
|
|
|
7
7
|
const Question_1 = require("../Question");
|
|
8
8
|
const questions_1 = require("../questions");
|
|
9
9
|
/**
|
|
10
|
-
* Defines an expectation to be used with
|
|
11
|
-
*
|
|
10
|
+
* Defines an expectation to be used with [`Wait.until`](https://serenity-js.org/api/core/class/Wait/#until),
|
|
11
|
+
* [`Check.whether`](https://serenity-js.org/api/core/class/Check/#whether),
|
|
12
|
+
* [`Ensure.that`](https://serenity-js.org/api/assertions/class/Ensure/#that)
|
|
13
|
+
* and as part of the Page Element Query Language with [`PageElements.where`](https://serenity-js.org/api/web/class/PageElements/#where)
|
|
14
|
+
* and [`List.where`](https://serenity-js.org/api/core/class/List/#where).
|
|
12
15
|
*
|
|
13
16
|
* @group Expectations
|
|
14
17
|
*/
|
|
@@ -16,7 +19,7 @@ class Expectation extends questions_1.Describable {
|
|
|
16
19
|
functionName;
|
|
17
20
|
predicate;
|
|
18
21
|
/**
|
|
19
|
-
* A factory method to that makes defining custom
|
|
22
|
+
* A factory method to that makes defining custom [expectations](https://serenity-js.org/api/core/class/Expectation/) easier
|
|
20
23
|
*
|
|
21
24
|
* #### Defining a custom expectation
|
|
22
25
|
*
|
|
@@ -87,16 +90,16 @@ class Expectation extends questions_1.Describable {
|
|
|
87
90
|
* ```
|
|
88
91
|
*
|
|
89
92
|
* #### Learn more
|
|
90
|
-
* -
|
|
91
|
-
* -
|
|
92
|
-
* -
|
|
93
|
+
* - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/)
|
|
94
|
+
* - [`Check`](https://serenity-js.org/api/core/class/Check/)
|
|
95
|
+
* - [`Wait`](https://serenity-js.org/api/core/class/Wait/)
|
|
93
96
|
*
|
|
94
97
|
* @param functionName
|
|
95
|
-
* Name of the expectation function to be used when producing an
|
|
98
|
+
* Name of the expectation function to be used when producing an [`AssertionError`](https://serenity-js.org/api/core/class/AssertionError/)
|
|
96
99
|
*
|
|
97
100
|
* @param relationship
|
|
98
101
|
* Human-readable description of the relationship between the `expected` and the `actual` values.
|
|
99
|
-
* Used when reporting
|
|
102
|
+
* Used when reporting [activities](https://serenity-js.org/api/core/class/Activity/) performed by an [actor](https://serenity-js.org/api/core/class/Actor/)
|
|
100
103
|
*
|
|
101
104
|
* @param predicate
|
|
102
105
|
*/
|
|
@@ -121,7 +124,7 @@ class Expectation extends questions_1.Describable {
|
|
|
121
124
|
}, 'name', { value: functionName, writable: false });
|
|
122
125
|
}
|
|
123
126
|
/**
|
|
124
|
-
* Used to define a simple
|
|
127
|
+
* Used to define a simple [`Expectation`](https://serenity-js.org/api/core/class/Expectation/)
|
|
125
128
|
*
|
|
126
129
|
* #### Simple parameterised expectation
|
|
127
130
|
*
|
|
@@ -163,9 +166,9 @@ class Expectation extends questions_1.Describable {
|
|
|
163
166
|
});
|
|
164
167
|
}
|
|
165
168
|
/**
|
|
166
|
-
* Used to compose
|
|
169
|
+
* Used to compose [expectations](https://serenity-js.org/api/core/class/Expectation/).
|
|
167
170
|
*
|
|
168
|
-
* #### Composing
|
|
171
|
+
* #### Composing [expectations](https://serenity-js.org/api/core/class/Expectation/)
|
|
169
172
|
*
|
|
170
173
|
* ```ts
|
|
171
174
|
* import { actorCalled, Expectation } from '@serenity-js/core'
|
|
@@ -207,9 +210,9 @@ class Expectation extends questions_1.Describable {
|
|
|
207
210
|
this.predicate = predicate;
|
|
208
211
|
}
|
|
209
212
|
/**
|
|
210
|
-
* Returns a
|
|
211
|
-
* indicating that the
|
|
212
|
-
* or that the
|
|
213
|
+
* Returns a [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) that resolves to [`ExpectationOutcome`](https://serenity-js.org/api/core/class/ExpectationOutcome/)
|
|
214
|
+
* indicating that the [expectation was met](https://serenity-js.org/api/core/class/ExpectationMet/)
|
|
215
|
+
* or that the [expectation was not met](https://serenity-js.org/api/core/class/ExpectationNotMet/)
|
|
213
216
|
*
|
|
214
217
|
* @param actual
|
|
215
218
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expectation.js","sourceRoot":"","sources":["../../../src/screenplay/questions/Expectation.ts"],"names":[],"mappings":";;;AAEA,iCAAuC;AACvC,2BAA4E;AAE5E,oCAA+B;AAC/B,0CAAuC;AACvC,4CAA2C;AAW3C
|
|
1
|
+
{"version":3,"file":"Expectation.js","sourceRoot":"","sources":["../../../src/screenplay/questions/Expectation.ts"],"names":[],"mappings":";;;AAEA,iCAAuC;AACvC,2BAA4E;AAE5E,oCAA+B;AAC/B,0CAAuC;AACvC,4CAA2C;AAW3C;;;;;;;;GAQG;AACH,MAAa,WAAoB,SAAQ,uBAAW;IAiO3B;IAEA;IAjOrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoFG;IACH,MAAM,CAAC,MAAM,CACT,YAAoB,EACpB,YAA4H,EAC5H,SAAyG;QAGzG,OAAO,MAAM,CAAC,cAAc,CAAC,UAAS,GAAG,mBAA4D;YACjG,MAAM,WAAW,GAAuB,OAAO,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,mBAAmB,CAAC;gBAC7G,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAA,WAAG,EAAA,GAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,EAAG,IAAK,mBAAmB,CAAC,CAAC,CAAE,EAAE;oBACxG,CAAC,CAAC,YAAY,CAAC,CAAC;YAExB,OAAO,IAAI,WAAW,CAClB,YAAY,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B,cAAS,GAAT,SAAS,CAAmB;IAGjD,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,MAA0B;QAC/B,OAAO,mBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,WAA+B;QACvC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAElC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AA3PD,kCA2PC"}
|
|
@@ -7,8 +7,8 @@ import type { AnswersQuestions, ChainableMetaQuestion, MetaQuestion } from '../q
|
|
|
7
7
|
import { Task } from '../Task';
|
|
8
8
|
import type { Expectation } from './Expectation';
|
|
9
9
|
/**
|
|
10
|
-
* Serenity/JS Screenplay Pattern-style wrapper around
|
|
11
|
-
* and array-like structures - see
|
|
10
|
+
* Serenity/JS Screenplay Pattern-style wrapper around [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
|
|
11
|
+
* and array-like structures - see [`PageElement`](https://serenity-js.org/api/web/class/PageElements/).
|
|
12
12
|
*
|
|
13
13
|
* @group Questions
|
|
14
14
|
*/
|
|
@@ -33,10 +33,10 @@ export declare abstract class List<Item_Type> extends Question<Promise<Array<Ite
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Serenity/JS Screenplay Pattern-style wrapper around
|
|
36
|
-
* a
|
|
37
|
-
* that can be resolved in `Supported_Context_Type` of another
|
|
36
|
+
* a [`ChainableMetaQuestion`](https://serenity-js.org/api/core/interface/ChainableMetaQuestion/) representing a collection
|
|
37
|
+
* that can be resolved in `Supported_Context_Type` of another [`Question`](https://serenity-js.org/api/core/class/Question/).
|
|
38
38
|
*
|
|
39
|
-
* For example,
|
|
39
|
+
* For example, [`PageElements.located`](https://serenity-js.org/api/web/class/PageElements/#located) returns `MetaList<PageElement>`,
|
|
40
40
|
* which allows for the collection of page elements to be resolved in the context
|
|
41
41
|
* of dynamically-provided root element.
|
|
42
42
|
*
|
|
@@ -7,8 +7,8 @@ const Question_1 = require("../Question");
|
|
|
7
7
|
const Task_1 = require("../Task");
|
|
8
8
|
const expectations_1 = require("./expectations");
|
|
9
9
|
/**
|
|
10
|
-
* Serenity/JS Screenplay Pattern-style wrapper around
|
|
11
|
-
* and array-like structures - see
|
|
10
|
+
* Serenity/JS Screenplay Pattern-style wrapper around [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
|
|
11
|
+
* and array-like structures - see [`PageElement`](https://serenity-js.org/api/web/class/PageElements/).
|
|
12
12
|
*
|
|
13
13
|
* @group Questions
|
|
14
14
|
*/
|
|
@@ -99,10 +99,10 @@ class ArrayList extends List {
|
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Serenity/JS Screenplay Pattern-style wrapper around
|
|
102
|
-
* a
|
|
103
|
-
* that can be resolved in `Supported_Context_Type` of another
|
|
102
|
+
* a [`ChainableMetaQuestion`](https://serenity-js.org/api/core/interface/ChainableMetaQuestion/) representing a collection
|
|
103
|
+
* that can be resolved in `Supported_Context_Type` of another [`Question`](https://serenity-js.org/api/core/class/Question/).
|
|
104
104
|
*
|
|
105
|
-
* For example,
|
|
105
|
+
* For example, [`PageElements.located`](https://serenity-js.org/api/web/class/PageElements/#located) returns `MetaList<PageElement>`,
|
|
106
106
|
* which allows for the collection of page elements to be resolved in the context
|
|
107
107
|
* of dynamically-provided root element.
|
|
108
108
|
*
|
|
@@ -27,8 +27,10 @@ export declare class Masked {
|
|
|
27
27
|
* );
|
|
28
28
|
* ```
|
|
29
29
|
*
|
|
30
|
-
* @param parameter
|
|
31
|
-
*
|
|
30
|
+
* @param parameter
|
|
31
|
+
* An [`Answerable`](https://serenity-js.org/api/core/#Answerable) representing the masked value.
|
|
32
|
+
* @returns
|
|
33
|
+
* A [`QuestionAdapter`](https://serenity-js.org/api/core/#QuestionAdapter) representing the masked value.
|
|
32
34
|
*/
|
|
33
35
|
static valueOf(parameter: Answerable<string>): QuestionAdapter<string>;
|
|
34
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Masked.d.ts","sourceRoot":"","sources":["../../../src/screenplay/questions/Masked.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,qBAAa,MAAM;IAEf
|
|
1
|
+
{"version":3,"file":"Masked.d.ts","sourceRoot":"","sources":["../../../src/screenplay/questions/Masked.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,qBAAa,MAAM;IAEf;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC;CAGzE"}
|
|
@@ -29,8 +29,10 @@ 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) {
|
|
36
38
|
return Question_1.Question.about('[a masked value]', async (actor) => actor.answer(parameter));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Masked.js","sourceRoot":"","sources":["../../../src/screenplay/questions/Masked.ts"],"names":[],"mappings":";;;AACA,0CAA6D;AAE7D;;;;;;;;;;GAUG;AACH,MAAa,MAAM;IAEf
|
|
1
|
+
{"version":3,"file":"Masked.js","sourceRoot":"","sources":["../../../src/screenplay/questions/Masked.ts"],"names":[],"mappings":";;;AACA,0CAA6D;AAE7D;;;;;;;;;;GAUG;AACH,MAAa,MAAM;IAEf;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,OAAO,CAAC,SAA6B;QACxC,OAAO,mBAAQ,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IACtF,CAAC;CACJ;AAzBD,wBAyBC"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import type { Answerable } from '../Answerable';
|
|
2
2
|
import type { Question } from '../Question';
|
|
3
3
|
/**
|
|
4
|
-
* A meta-question is a
|
|
5
|
-
* in the context of another
|
|
4
|
+
* A meta-question is a [`Question`](https://serenity-js.org/api/core/class/Question/) that can be answered
|
|
5
|
+
* in the context of another [`Answerable`](https://serenity-js.org/api/core/#Answerable),
|
|
6
6
|
* typically to transform its value.
|
|
7
7
|
*
|
|
8
|
-
* For example, the question
|
|
9
|
-
* of a
|
|
8
|
+
* For example, the question [`Text.of`](https://serenity-js.org/api/web/class/Text/#of) can be answered in the context
|
|
9
|
+
* of a [`PageElement`](https://serenity-js.org/api/web/class/PageElement/) to return its text content.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* [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/).
|
|
12
12
|
*
|
|
13
13
|
* ## Learn more
|
|
14
|
-
* -
|
|
14
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
15
15
|
*
|
|
16
16
|
* @group Questions
|
|
17
17
|
*/
|
|
18
18
|
export interface MetaQuestion<Supported_Context_Type, Returned_Question_Type extends Question<unknown>> {
|
|
19
19
|
/**
|
|
20
|
-
* Answers the given `MetaQuestion` in the context of another
|
|
20
|
+
* Answers the given `MetaQuestion` in the context of another [`Answerable`](https://serenity-js.org/api/core/#Answerable).
|
|
21
21
|
*
|
|
22
22
|
* #### Learn more
|
|
23
|
-
* -
|
|
23
|
+
* - [`List`](https://serenity-js.org/api/core/class/List/)
|
|
24
24
|
*/
|
|
25
25
|
of(context: Answerable<Supported_Context_Type>): Returned_Question_Type;
|
|
26
26
|
/**
|
|
27
|
-
* Human-readable description of this
|
|
27
|
+
* Human-readable description of this [`MetaQuestion`](https://serenity-js.org/api/core/interface/MetaQuestion/),
|
|
28
28
|
* typically involving the description of the subject.
|
|
29
29
|
*
|
|
30
30
|
* For example, a description of a meta question obout "the text of an element"
|
|
@@ -3,8 +3,8 @@ import type { JSONValue } from 'tiny-types';
|
|
|
3
3
|
import { TinyType } from 'tiny-types';
|
|
4
4
|
import * as util from 'util';
|
|
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
|
*
|
|
@@ -27,8 +27,8 @@ exports.Unanswered = void 0;
|
|
|
27
27
|
const tiny_types_1 = require("tiny-types");
|
|
28
28
|
const util = __importStar(require("util")); // eslint-disable-line unicorn/import-style
|
|
29
29
|
/**
|
|
30
|
-
* A placeholder value signifying that a
|
|
31
|
-
* has not been answered by an
|
|
30
|
+
* A placeholder value signifying that a [`Question`](https://serenity-js.org/api/core/class/Question/)
|
|
31
|
+
* 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/).
|
|
32
32
|
* This happens when Serenity/JS decides that answering a given question
|
|
33
33
|
* won't affect the outcome.
|
|
34
34
|
*
|