@serenity-js/webdriverio 2.32.3 → 3.0.0-rc.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 +70 -0
- package/lib/adapter/WebdriverIOFrameworkAdapter.js +1 -1
- package/lib/adapter/WebdriverIOFrameworkAdapter.js.map +1 -1
- package/lib/adapter/WebdriverIONotifier.d.ts +35 -1
- package/lib/adapter/WebdriverIONotifier.js +174 -13
- package/lib/adapter/WebdriverIONotifier.js.map +1 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -3
- package/lib/index.js.map +1 -1
- package/lib/screenplay/abilities/{BrowseTheWeb.d.ts → BrowseTheWebWithWebdriverIO.d.ts} +79 -23
- package/lib/screenplay/abilities/{BrowseTheWeb.js → BrowseTheWebWithWebdriverIO.js} +160 -25
- package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.js.map +1 -0
- package/lib/screenplay/abilities/index.d.ts +1 -1
- package/lib/screenplay/abilities/index.js +1 -1
- package/lib/screenplay/abilities/index.js.map +1 -1
- package/lib/screenplay/index.d.ts +1 -2
- package/lib/screenplay/index.js +1 -2
- package/lib/screenplay/index.js.map +1 -1
- package/lib/screenplay/models/WebdriverIOCookie.d.ts +8 -0
- package/lib/screenplay/models/WebdriverIOCookie.js +39 -0
- package/lib/screenplay/models/WebdriverIOCookie.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOModalDialog.d.ts +11 -0
- package/lib/screenplay/models/WebdriverIOModalDialog.js +40 -0
- package/lib/screenplay/models/WebdriverIOModalDialog.js.map +1 -0
- package/lib/screenplay/models/WebdriverIONativeElementRoot.d.ts +2 -0
- package/lib/screenplay/{interactions/EnterBuilder.js → models/WebdriverIONativeElementRoot.js} +1 -1
- package/lib/screenplay/models/WebdriverIONativeElementRoot.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOPage.d.ts +24 -0
- package/lib/screenplay/models/WebdriverIOPage.js +98 -0
- package/lib/screenplay/models/WebdriverIOPage.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOPageElement.d.ts +22 -0
- package/lib/screenplay/models/WebdriverIOPageElement.js +75 -0
- package/lib/screenplay/models/WebdriverIOPageElement.js.map +1 -0
- package/lib/screenplay/models/WebdriverIOPageElements.d.ts +15 -0
- package/lib/screenplay/models/WebdriverIOPageElements.js +65 -0
- package/lib/screenplay/models/WebdriverIOPageElements.js.map +1 -0
- package/lib/screenplay/models/index.d.ts +6 -0
- package/lib/{input → screenplay/models}/index.js +6 -1
- package/lib/screenplay/models/index.js.map +1 -0
- package/package.json +21 -31
- package/src/adapter/WebdriverIOFrameworkAdapter.ts +2 -0
- package/src/adapter/WebdriverIONotifier.ts +225 -23
- package/src/index.ts +0 -3
- package/src/screenplay/abilities/{BrowseTheWeb.ts → BrowseTheWebWithWebdriverIO.ts} +200 -31
- package/src/screenplay/abilities/index.ts +1 -1
- package/src/screenplay/index.ts +1 -2
- package/src/screenplay/models/WebdriverIOCookie.ts +44 -0
- package/src/screenplay/models/WebdriverIOModalDialog.ts +45 -0
- package/src/screenplay/models/WebdriverIONativeElementRoot.ts +3 -0
- package/src/screenplay/models/WebdriverIOPage.ts +120 -0
- package/src/screenplay/models/WebdriverIOPageElement.ts +92 -0
- package/src/screenplay/models/WebdriverIOPageElements.ts +91 -0
- package/src/screenplay/models/index.ts +6 -0
- package/lib/expectations/ElementExpectation.d.ts +0 -11
- package/lib/expectations/ElementExpectation.js +0 -27
- package/lib/expectations/ElementExpectation.js.map +0 -1
- package/lib/expectations/index.d.ts +0 -6
- package/lib/expectations/index.js +0 -19
- package/lib/expectations/index.js.map +0 -1
- package/lib/expectations/isActive.d.ts +0 -15
- package/lib/expectations/isActive.js +0 -21
- package/lib/expectations/isActive.js.map +0 -1
- package/lib/expectations/isClickable.d.ts +0 -20
- package/lib/expectations/isClickable.js +0 -26
- package/lib/expectations/isClickable.js.map +0 -1
- package/lib/expectations/isEnabled.d.ts +0 -14
- package/lib/expectations/isEnabled.js +0 -20
- package/lib/expectations/isEnabled.js.map +0 -1
- package/lib/expectations/isPresent.d.ts +0 -15
- package/lib/expectations/isPresent.js +0 -21
- package/lib/expectations/isPresent.js.map +0 -1
- package/lib/expectations/isSelected.d.ts +0 -14
- package/lib/expectations/isSelected.js +0 -20
- package/lib/expectations/isSelected.js.map +0 -1
- package/lib/expectations/isVisible.d.ts +0 -14
- package/lib/expectations/isVisible.js +0 -20
- package/lib/expectations/isVisible.js.map +0 -1
- package/lib/input/Key.d.ts +0 -73
- package/lib/input/Key.js +0 -84
- package/lib/input/Key.js.map +0 -1
- package/lib/input/index.d.ts +0 -1
- package/lib/input/index.js.map +0 -1
- package/lib/screenplay/abilities/BrowseTheWeb.js.map +0 -1
- package/lib/screenplay/interactions/Clear.d.ts +0 -79
- package/lib/screenplay/interactions/Clear.js +0 -97
- package/lib/screenplay/interactions/Clear.js.map +0 -1
- package/lib/screenplay/interactions/Click.d.ts +0 -73
- package/lib/screenplay/interactions/Click.js +0 -84
- package/lib/screenplay/interactions/Click.js.map +0 -1
- package/lib/screenplay/interactions/DoubleClick.d.ts +0 -90
- package/lib/screenplay/interactions/DoubleClick.js +0 -101
- package/lib/screenplay/interactions/DoubleClick.js.map +0 -1
- package/lib/screenplay/interactions/Enter.d.ts +0 -73
- package/lib/screenplay/interactions/Enter.js +0 -87
- package/lib/screenplay/interactions/Enter.js.map +0 -1
- package/lib/screenplay/interactions/EnterBuilder.d.ts +0 -25
- package/lib/screenplay/interactions/EnterBuilder.js.map +0 -1
- package/lib/screenplay/interactions/ExecuteScript.d.ts +0 -206
- package/lib/screenplay/interactions/ExecuteScript.js +0 -311
- package/lib/screenplay/interactions/ExecuteScript.js.map +0 -1
- package/lib/screenplay/interactions/Hover.d.ts +0 -78
- package/lib/screenplay/interactions/Hover.js +0 -89
- package/lib/screenplay/interactions/Hover.js.map +0 -1
- package/lib/screenplay/interactions/Navigate.d.ts +0 -141
- package/lib/screenplay/interactions/Navigate.js +0 -197
- package/lib/screenplay/interactions/Navigate.js.map +0 -1
- package/lib/screenplay/interactions/Press.d.ts +0 -84
- package/lib/screenplay/interactions/Press.js +0 -152
- package/lib/screenplay/interactions/Press.js.map +0 -1
- package/lib/screenplay/interactions/PressBuilder.d.ts +0 -26
- package/lib/screenplay/interactions/PressBuilder.js +0 -3
- package/lib/screenplay/interactions/PressBuilder.js.map +0 -1
- package/lib/screenplay/interactions/RightClick.d.ts +0 -89
- package/lib/screenplay/interactions/RightClick.js +0 -100
- package/lib/screenplay/interactions/RightClick.js.map +0 -1
- package/lib/screenplay/interactions/Scroll.d.ts +0 -75
- package/lib/screenplay/interactions/Scroll.js +0 -86
- package/lib/screenplay/interactions/Scroll.js.map +0 -1
- package/lib/screenplay/interactions/Wait.d.ts +0 -143
- package/lib/screenplay/interactions/Wait.js +0 -247
- package/lib/screenplay/interactions/Wait.js.map +0 -1
- package/lib/screenplay/interactions/WaitBuilder.d.ts +0 -32
- package/lib/screenplay/interactions/WaitBuilder.js +0 -3
- package/lib/screenplay/interactions/WaitBuilder.js.map +0 -1
- package/lib/screenplay/interactions/WebElementInteraction.d.ts +0 -37
- package/lib/screenplay/interactions/WebElementInteraction.js +0 -52
- package/lib/screenplay/interactions/WebElementInteraction.js.map +0 -1
- package/lib/screenplay/interactions/index.d.ts +0 -13
- package/lib/screenplay/interactions/index.js +0 -26
- package/lib/screenplay/interactions/index.js.map +0 -1
- package/lib/screenplay/questions/Attribute.d.ts +0 -82
- package/lib/screenplay/questions/Attribute.js +0 -102
- package/lib/screenplay/questions/Attribute.js.map +0 -1
- package/lib/screenplay/questions/CSSClasses.d.ts +0 -92
- package/lib/screenplay/questions/CSSClasses.js +0 -112
- package/lib/screenplay/questions/CSSClasses.js.map +0 -1
- package/lib/screenplay/questions/LastScriptExecution.d.ts +0 -14
- package/lib/screenplay/questions/LastScriptExecution.js +0 -22
- package/lib/screenplay/questions/LastScriptExecution.js.map +0 -1
- package/lib/screenplay/questions/NestedTargetBuilder.d.ts +0 -27
- package/lib/screenplay/questions/NestedTargetBuilder.js +0 -3
- package/lib/screenplay/questions/NestedTargetBuilder.js.map +0 -1
- package/lib/screenplay/questions/TargetBuilder.d.ts +0 -25
- package/lib/screenplay/questions/TargetBuilder.js +0 -3
- package/lib/screenplay/questions/TargetBuilder.js.map +0 -1
- package/lib/screenplay/questions/Text.d.ts +0 -95
- package/lib/screenplay/questions/Text.js +0 -130
- package/lib/screenplay/questions/Text.js.map +0 -1
- package/lib/screenplay/questions/Value.d.ts +0 -63
- package/lib/screenplay/questions/Value.js +0 -78
- package/lib/screenplay/questions/Value.js.map +0 -1
- package/lib/screenplay/questions/Website.d.ts +0 -21
- package/lib/screenplay/questions/Website.js +0 -31
- package/lib/screenplay/questions/Website.js.map +0 -1
- package/lib/screenplay/questions/index.d.ts +0 -10
- package/lib/screenplay/questions/index.js +0 -23
- package/lib/screenplay/questions/index.js.map +0 -1
- package/lib/screenplay/questions/lists.d.ts +0 -86
- package/lib/screenplay/questions/lists.js +0 -137
- package/lib/screenplay/questions/lists.js.map +0 -1
- package/lib/screenplay/questions/locators.d.ts +0 -196
- package/lib/screenplay/questions/locators.js +0 -219
- package/lib/screenplay/questions/locators.js.map +0 -1
- package/lib/screenplay/questions/targets.d.ts +0 -254
- package/lib/screenplay/questions/targets.js +0 -334
- package/lib/screenplay/questions/targets.js.map +0 -1
- package/lib/stage/crew/index.d.ts +0 -1
- package/lib/stage/crew/index.js +0 -14
- package/lib/stage/crew/index.js.map +0 -1
- package/lib/stage/crew/photographer/Photographer.d.ts +0 -83
- package/lib/stage/crew/photographer/Photographer.js +0 -102
- package/lib/stage/crew/photographer/Photographer.js.map +0 -1
- package/lib/stage/crew/photographer/index.d.ts +0 -2
- package/lib/stage/crew/photographer/index.js +0 -15
- package/lib/stage/crew/photographer/index.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts +0 -28
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js +0 -65
- package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts +0 -18
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js +0 -30
- package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts +0 -17
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js +0 -28
- package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts +0 -19
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js +0 -28
- package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js.map +0 -1
- package/lib/stage/crew/photographer/strategies/index.d.ts +0 -4
- package/lib/stage/crew/photographer/strategies/index.js +0 -17
- package/lib/stage/crew/photographer/strategies/index.js.map +0 -1
- package/lib/stage/index.d.ts +0 -1
- package/lib/stage/index.js +0 -14
- package/lib/stage/index.js.map +0 -1
- package/src/expectations/ElementExpectation.ts +0 -31
- package/src/expectations/index.ts +0 -6
- package/src/expectations/isActive.ts +0 -21
- package/src/expectations/isClickable.ts +0 -26
- package/src/expectations/isEnabled.ts +0 -19
- package/src/expectations/isPresent.ts +0 -20
- package/src/expectations/isSelected.ts +0 -19
- package/src/expectations/isVisible.ts +0 -19
- package/src/input/Key.ts +0 -83
- package/src/input/index.ts +0 -1
- package/src/screenplay/interactions/Clear.ts +0 -102
- package/src/screenplay/interactions/Click.ts +0 -85
- package/src/screenplay/interactions/DoubleClick.ts +0 -102
- package/src/screenplay/interactions/Enter.ts +0 -93
- package/src/screenplay/interactions/EnterBuilder.ts +0 -27
- package/src/screenplay/interactions/ExecuteScript.ts +0 -344
- package/src/screenplay/interactions/Hover.ts +0 -90
- package/src/screenplay/interactions/Navigate.ts +0 -208
- package/src/screenplay/interactions/Press.ts +0 -172
- package/src/screenplay/interactions/PressBuilder.ts +0 -28
- package/src/screenplay/interactions/RightClick.ts +0 -100
- package/src/screenplay/interactions/Scroll.ts +0 -87
- package/src/screenplay/interactions/Wait.ts +0 -267
- package/src/screenplay/interactions/WaitBuilder.ts +0 -34
- package/src/screenplay/interactions/WebElementInteraction.ts +0 -56
- package/src/screenplay/interactions/index.ts +0 -13
- package/src/screenplay/questions/Attribute.ts +0 -112
- package/src/screenplay/questions/CSSClasses.ts +0 -116
- package/src/screenplay/questions/LastScriptExecution.ts +0 -21
- package/src/screenplay/questions/NestedTargetBuilder.ts +0 -30
- package/src/screenplay/questions/TargetBuilder.ts +0 -27
- package/src/screenplay/questions/Text.ts +0 -140
- package/src/screenplay/questions/Value.ts +0 -82
- package/src/screenplay/questions/Website.ts +0 -34
- package/src/screenplay/questions/index.ts +0 -10
- package/src/screenplay/questions/lists.ts +0 -161
- package/src/screenplay/questions/locators.ts +0 -254
- package/src/screenplay/questions/targets.ts +0 -401
- package/src/stage/crew/index.ts +0 -1
- package/src/stage/crew/photographer/Photographer.ts +0 -108
- package/src/stage/crew/photographer/index.ts +0 -2
- package/src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts +0 -103
- package/src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts +0 -28
- package/src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts +0 -26
- package/src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts +0 -26
- package/src/stage/crew/photographer/strategies/index.ts +0 -4
- package/src/stage/index.ts +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PhotoTakingStrategy.js","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts"],"names":[],"mappings":";;;AACA,yDAQsC;AACtC,uDAAsF;AAGtF,uDAAsD;AAEtD;;;;;;;;GAQG;AACH,MAAsB,mBAAmB;IAErC;;;;;;;;;OASG;IACH,mBAAmB,CAAC,KAAwC,EAAE,KAAY;QACtE,IAAI,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE;YAChC,IAAI,YAA0B,CAAC;YAE/B,IAAI;gBACA,YAAY,GAAG,yBAAY,CAAC,EAAE,CAAC,KAAK,CAAC,sBAAsB,EAAE,CAAC,CAAC;aAClE;YAAC,MAAM;gBACJ,OAAO,KAAK,CAAC,CAAC;aACjB;YAED,MACI,EAAE,GAAgB,qBAAa,CAAC,MAAM,EAAE,EACxC,UAAU,GAAQ,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;YAC1C,6FAA6F;YAC7F,YAAY,GAAM,YAAY,CAAC,OAAO,CAAC,YAAgD,CAAC;YAE5F,KAAK,CAAC,QAAQ,CAAC,IAAI,gCAAuB,CACtC,IAAI,mBAAW,CAAC,iBAAkB,IAAI,CAAC,WAAW,CAAC,IAAK,2BAA4B,UAAW,MAAM,CAAC,EACtG,EAAE,CACL,CAAC,CAAC;YAEH,YAAY,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;gBAE5C,MACI,OAAO,GAAK,CAAE,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,cAAc,CAAE,EAChG,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,OAAO,EAAE,UAAU,CAAC,CAAC;gBAE9D,KAAK,CAAC,QAAQ,CAAC,IAAI,yCAAgC,CAC/C,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,UAAU,EAChB,SAAS,EACT,aAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAC/B,CAAC,CAAC;gBAEH,KAAK,CAAC,QAAQ,CAAC,IAAI,gCAAuB,CACtC,IAAI,mBAAW,CAAC,IAAK,IAAI,CAAC,WAAW,CAAC,IAAK,yBAA0B,UAAW,QAAS,OAAQ,EAAE,CAAC,EACpG,EAAE,CACL,CAAC,CAAC;YACP,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACb,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;oBAC1B,KAAK,CAAC,QAAQ,CAAC,IAAI,gCAAuB,CACtC,IAAI,mBAAW,CAAC,IAAK,IAAI,CAAC,WAAW,CAAC,IAAK,mCAAoC,UAAW,gBAAiB,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,CAAC,IAAK,EAAE,CAAC,EAC1J,EAAE,CACL,CAAC,CAAC;iBACN;qBACI;oBACD,KAAK,CAAC,QAAQ,CAAC,IAAI,6BAAoB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;iBACvD;YACL,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAMO,gBAAgB,CAAC,GAAG,KAAe;QACvC,OAAO,IAAI,YAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,CAAC;IAEO,YAAY,CAAC,KAAY;QAC7B,OAAO;QACP,uDAAuD;QACvD,6DAA6D;QAC7D,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA9ED,kDA8EC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DomainEvent, InteractionFinished, InteractionStarts } from '@serenity-js/core/lib/events';
|
|
2
|
-
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
3
|
-
/**
|
|
4
|
-
* @desc
|
|
5
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots) both before and after
|
|
6
|
-
* every single {@link @serenity-js/core/lib/screenplay~Interaction} performed
|
|
7
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight.
|
|
8
|
-
*
|
|
9
|
-
* *Please note* that this strategy will result in _a lot_ of screenshots being taken,
|
|
10
|
-
* which will seriously affect the performance of your tests.
|
|
11
|
-
* For this reason, it's best to use it only for debugging purposes.
|
|
12
|
-
*
|
|
13
|
-
* @extends {PhotoTakingStrategy}
|
|
14
|
-
*/
|
|
15
|
-
export declare class TakePhotosBeforeAndAfterInteractions extends PhotoTakingStrategy {
|
|
16
|
-
protected shouldTakeAPhotoOf(event: DomainEvent): boolean;
|
|
17
|
-
protected photoNameFor(event: InteractionStarts | InteractionFinished): string;
|
|
18
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TakePhotosBeforeAndAfterInteractions = void 0;
|
|
4
|
-
const events_1 = require("@serenity-js/core/lib/events");
|
|
5
|
-
const PhotoTakingStrategy_1 = require("./PhotoTakingStrategy");
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots) both before and after
|
|
9
|
-
* every single {@link @serenity-js/core/lib/screenplay~Interaction} performed
|
|
10
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight.
|
|
11
|
-
*
|
|
12
|
-
* *Please note* that this strategy will result in _a lot_ of screenshots being taken,
|
|
13
|
-
* which will seriously affect the performance of your tests.
|
|
14
|
-
* For this reason, it's best to use it only for debugging purposes.
|
|
15
|
-
*
|
|
16
|
-
* @extends {PhotoTakingStrategy}
|
|
17
|
-
*/
|
|
18
|
-
class TakePhotosBeforeAndAfterInteractions extends PhotoTakingStrategy_1.PhotoTakingStrategy {
|
|
19
|
-
shouldTakeAPhotoOf(event) {
|
|
20
|
-
return event instanceof events_1.InteractionStarts
|
|
21
|
-
|| event instanceof events_1.InteractionFinished;
|
|
22
|
-
}
|
|
23
|
-
photoNameFor(event) {
|
|
24
|
-
return event instanceof events_1.InteractionStarts
|
|
25
|
-
? `Before ${event.details.name.value}`
|
|
26
|
-
: `After ${event.details.name.value}`;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.TakePhotosBeforeAndAfterInteractions = TakePhotosBeforeAndAfterInteractions;
|
|
30
|
-
//# sourceMappingURL=TakePhotosBeforeAndAfterInteractions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TakePhotosBeforeAndAfterInteractions.js","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts"],"names":[],"mappings":";;;AAAA,yDAAmG;AAEnG,+DAA4D;AAE5D;;;;;;;;;;;GAWG;AACH,MAAa,oCAAqC,SAAQ,yCAAmB;IAC/D,kBAAkB,CAAC,KAAkB;QAC3C,OAAO,KAAK,YAAY,0BAAiB;eAClC,KAAK,YAAY,4BAAmB,CAAC;IAChD,CAAC;IAES,YAAY,CAAC,KAA8C;QACjE,OAAO,KAAK,YAAY,0BAAiB;YACrC,CAAC,CAAC,UAAW,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAM,EAAE;YACxC,CAAC,CAAC,SAAU,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAM,EAAE,CAAC;IAChD,CAAC;CACJ;AAXD,oFAWC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DomainEvent, InteractionFinished } from '@serenity-js/core/lib/events';
|
|
2
|
-
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
3
|
-
/**
|
|
4
|
-
* @desc
|
|
5
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots) when
|
|
6
|
-
* the {@link @serenity-js/core/lib/screenplay~Interaction} performed
|
|
7
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight results in an error.
|
|
8
|
-
*
|
|
9
|
-
* This strategy works best when you are interested in the screenshots only when
|
|
10
|
-
* a scenario fails.
|
|
11
|
-
*
|
|
12
|
-
* @extends {PhotoTakingStrategy}
|
|
13
|
-
*/
|
|
14
|
-
export declare class TakePhotosOfFailures extends PhotoTakingStrategy {
|
|
15
|
-
protected shouldTakeAPhotoOf(event: DomainEvent): boolean;
|
|
16
|
-
protected photoNameFor(event: InteractionFinished): string;
|
|
17
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TakePhotosOfFailures = void 0;
|
|
4
|
-
const events_1 = require("@serenity-js/core/lib/events");
|
|
5
|
-
const model_1 = require("@serenity-js/core/lib/model");
|
|
6
|
-
const PhotoTakingStrategy_1 = require("./PhotoTakingStrategy");
|
|
7
|
-
/**
|
|
8
|
-
* @desc
|
|
9
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots) when
|
|
10
|
-
* the {@link @serenity-js/core/lib/screenplay~Interaction} performed
|
|
11
|
-
* by the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight results in an error.
|
|
12
|
-
*
|
|
13
|
-
* This strategy works best when you are interested in the screenshots only when
|
|
14
|
-
* a scenario fails.
|
|
15
|
-
*
|
|
16
|
-
* @extends {PhotoTakingStrategy}
|
|
17
|
-
*/
|
|
18
|
-
class TakePhotosOfFailures extends PhotoTakingStrategy_1.PhotoTakingStrategy {
|
|
19
|
-
shouldTakeAPhotoOf(event) {
|
|
20
|
-
return event instanceof events_1.InteractionFinished
|
|
21
|
-
&& event.outcome.isWorseThan(model_1.ImplementationPending);
|
|
22
|
-
}
|
|
23
|
-
photoNameFor(event) {
|
|
24
|
-
return event.details.name.value;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.TakePhotosOfFailures = TakePhotosOfFailures;
|
|
28
|
-
//# sourceMappingURL=TakePhotosOfFailures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TakePhotosOfFailures.js","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts"],"names":[],"mappings":";;;AAAA,yDAAgF;AAChF,uDAAoE;AAEpE,+DAA4D;AAE5D;;;;;;;;;;GAUG;AACH,MAAa,oBAAqB,SAAQ,yCAAmB;IAC/C,kBAAkB,CAAC,KAAkB;QAC3C,OAAO,KAAK,YAAY,4BAAmB;eACpC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,6BAAqB,CAAC,CAAC;IAC5D,CAAC;IAES,YAAY,CAAC,KAA0B;QAC7C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;IACpC,CAAC;CACJ;AATD,oDASC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { DomainEvent, InteractionFinished } from '@serenity-js/core/lib/events';
|
|
2
|
-
import { PhotoTakingStrategy } from './PhotoTakingStrategy';
|
|
3
|
-
/**
|
|
4
|
-
* @desc
|
|
5
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots) when
|
|
6
|
-
* the the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight
|
|
7
|
-
* performs any {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
8
|
-
*
|
|
9
|
-
* This strategy works best when you want the results of your automated tests
|
|
10
|
-
* to become comprehensive living documentation of your system.
|
|
11
|
-
*
|
|
12
|
-
* *Please note* that taking screenshots affects the performance of your tests.
|
|
13
|
-
*
|
|
14
|
-
* @extends {PhotoTakingStrategy}
|
|
15
|
-
*/
|
|
16
|
-
export declare class TakePhotosOfInteractions extends PhotoTakingStrategy {
|
|
17
|
-
protected shouldTakeAPhotoOf(event: DomainEvent): boolean;
|
|
18
|
-
protected photoNameFor(event: InteractionFinished): string;
|
|
19
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TakePhotosOfInteractions = void 0;
|
|
4
|
-
const events_1 = require("@serenity-js/core/lib/events");
|
|
5
|
-
const PhotoTakingStrategy_1 = require("./PhotoTakingStrategy");
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Configures the {@link Photographer} to take photos (a.k.a. screenshots) when
|
|
9
|
-
* the the {@link @serenity-js/core/lib/screenplay/actor~Actor} in the spotlight
|
|
10
|
-
* performs any {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
11
|
-
*
|
|
12
|
-
* This strategy works best when you want the results of your automated tests
|
|
13
|
-
* to become comprehensive living documentation of your system.
|
|
14
|
-
*
|
|
15
|
-
* *Please note* that taking screenshots affects the performance of your tests.
|
|
16
|
-
*
|
|
17
|
-
* @extends {PhotoTakingStrategy}
|
|
18
|
-
*/
|
|
19
|
-
class TakePhotosOfInteractions extends PhotoTakingStrategy_1.PhotoTakingStrategy {
|
|
20
|
-
shouldTakeAPhotoOf(event) {
|
|
21
|
-
return event instanceof events_1.InteractionFinished;
|
|
22
|
-
}
|
|
23
|
-
photoNameFor(event) {
|
|
24
|
-
return event.details.name.value;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.TakePhotosOfInteractions = TakePhotosOfInteractions;
|
|
28
|
-
//# sourceMappingURL=TakePhotosOfInteractions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TakePhotosOfInteractions.js","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts"],"names":[],"mappings":";;;AAAA,yDAAgF;AAEhF,+DAA4D;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAa,wBAAyB,SAAQ,yCAAmB;IACnD,kBAAkB,CAAC,KAAkB;QAC3C,OAAO,KAAK,YAAY,4BAAmB,CAAC;IAChD,CAAC;IAES,YAAY,CAAC,KAA0B;QAC7C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;IACpC,CAAC;CACJ;AARD,4DAQC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./PhotoTakingStrategy"), exports);
|
|
14
|
-
__exportStar(require("./TakePhotosBeforeAndAfterInteractions"), exports);
|
|
15
|
-
__exportStar(require("./TakePhotosOfFailures"), exports);
|
|
16
|
-
__exportStar(require("./TakePhotosOfInteractions"), exports);
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/stage/crew/photographer/strategies/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAAsC;AACtC,yEAAuD;AACvD,yDAAuC;AACvC,6DAA2C"}
|
package/lib/stage/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './crew';
|
package/lib/stage/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./crew"), exports);
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
package/lib/stage/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AnswersQuestions, Expectation, ExpectationMet, ExpectationNotMet, ExpectationOutcome } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @access private
|
|
6
|
-
*/
|
|
7
|
-
export class ElementExpectation extends Expectation<any, Element<'async'>> {
|
|
8
|
-
static forElementTo(message: string, fn: (actual: Element<'async'>) => Promise<boolean>): Expectation<any, Element<'async'>> {
|
|
9
|
-
return new ElementExpectation(message, fn);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
constructor(
|
|
13
|
-
subject: string,
|
|
14
|
-
private readonly fn: (actual: Element<'async'>) => Promise<boolean>,
|
|
15
|
-
) {
|
|
16
|
-
super(subject);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
answeredBy(actor: AnswersQuestions): (actual: Element<'async'>) => Promise<ExpectationOutcome<boolean, Element<'async'>>> {
|
|
20
|
-
return (actual: Element<'async'>) =>
|
|
21
|
-
this.fn(actual)
|
|
22
|
-
.then(expectationMet =>
|
|
23
|
-
expectationMet
|
|
24
|
-
? new ExpectationMet(this.toString(), undefined, actual)
|
|
25
|
-
: new ExpectationNotMet(this.toString(), undefined, actual),
|
|
26
|
-
)
|
|
27
|
-
.catch(error => {
|
|
28
|
-
return new ExpectationNotMet(`${ this.toString() } (${ error.message })`, undefined, actual);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Expectation } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
|
|
4
|
-
import { ElementExpectation } from './ElementExpectation';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Expectation that the element is active (has focus).
|
|
9
|
-
* If the selector matches multiple elements, it will return true if one of the elements has focus.
|
|
10
|
-
*
|
|
11
|
-
* @returns {@serenity-js/core/lib/screenplay/questions~Expectation<boolean, Element<'async'>>}
|
|
12
|
-
*
|
|
13
|
-
* @see https://webdriver.io/docs/api/element/isFocused/
|
|
14
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
15
|
-
* @see {@link @serenity-js/core/lib/screenplay/questions~Check}
|
|
16
|
-
* @see {@link Wait}
|
|
17
|
-
*/
|
|
18
|
-
export function isActive(): Expectation<boolean, Element<'async'>> {
|
|
19
|
-
return ElementExpectation.forElementTo('become active', actual => actual.isFocused());
|
|
20
|
-
}
|
|
21
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Expectation } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
|
|
4
|
-
import { ElementExpectation } from './ElementExpectation';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Expectation that an element is clickable, which means:
|
|
9
|
-
* - it exists
|
|
10
|
-
* - it is visible
|
|
11
|
-
* - it is within viewport (if not, try to scroll to it)
|
|
12
|
-
* - its center is not overlapped with another element
|
|
13
|
-
* - it is not disabled
|
|
14
|
-
* otherwise return false.
|
|
15
|
-
*
|
|
16
|
-
* @returns {@serenity-js/core/lib/screenplay/questions~Expectation<boolean, Element<'async'>>}
|
|
17
|
-
*
|
|
18
|
-
* @see https://webdriver.io/docs/api/element/isClickable/
|
|
19
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
20
|
-
* @see {@link @serenity-js/core/lib/screenplay/questions~Check}
|
|
21
|
-
* @see {@link Wait}
|
|
22
|
-
*/
|
|
23
|
-
export function isClickable(): Expectation<boolean, Element<'async'>> {
|
|
24
|
-
return ElementExpectation.forElementTo('become clickable', actual => actual.isClickable());
|
|
25
|
-
}
|
|
26
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Expectation } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
|
|
4
|
-
import { ElementExpectation } from './ElementExpectation';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Expectation that the element is enabled.
|
|
9
|
-
*
|
|
10
|
-
* @returns {@serenity-js/core/lib/screenplay/questions~Expectation<boolean, Element<'async'>>}
|
|
11
|
-
*
|
|
12
|
-
* @see https://webdriver.io/docs/api/element/isEnabled/
|
|
13
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
14
|
-
* @see {@link @serenity-js/core/lib/screenplay/questions~Check}
|
|
15
|
-
* @see {@link Wait}
|
|
16
|
-
*/
|
|
17
|
-
export function isEnabled(): Expectation<boolean, Element<'async'>> {
|
|
18
|
-
return ElementExpectation.forElementTo('become enabled', actual => actual.isEnabled());
|
|
19
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Expectation } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
|
|
4
|
-
import { ElementExpectation } from './ElementExpectation';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Expectation that the element is present in the DOM of a page.
|
|
9
|
-
* Please note that this does not necessarily mean that the element is visible.
|
|
10
|
-
*
|
|
11
|
-
* @returns {@serenity-js/core/lib/screenplay/questions~Expectation<boolean, Element<'async'>>}
|
|
12
|
-
*
|
|
13
|
-
* @see https://webdriver.io/docs/api/element/isExisting/
|
|
14
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
15
|
-
* @see {@link @serenity-js/core/lib/screenplay/questions~Check}
|
|
16
|
-
* @see {@link Wait}
|
|
17
|
-
*/
|
|
18
|
-
export function isPresent(): Expectation<boolean, Element<'async'>> {
|
|
19
|
-
return ElementExpectation.forElementTo('become present', actual => actual.isExisting());
|
|
20
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Expectation } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
|
|
4
|
-
import { ElementExpectation } from './ElementExpectation';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Expectation that an `<option>` or `<input>` element of type checkbox or radio is currently selected.
|
|
9
|
-
*
|
|
10
|
-
* @returns {@serenity-js/core/lib/screenplay/questions~Expectation<boolean, Element<'async'>>}
|
|
11
|
-
*
|
|
12
|
-
* @see https://webdriver.io/docs/api/element/isSelected/
|
|
13
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
14
|
-
* @see {@link @serenity-js/core/lib/screenplay/questions~Check}
|
|
15
|
-
* @see {@link Wait}
|
|
16
|
-
*/
|
|
17
|
-
export function isSelected(): Expectation<boolean, Element<'async'>> {
|
|
18
|
-
return ElementExpectation.forElementTo('become selected', actual => actual.isSelected());
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Expectation } from '@serenity-js/core';
|
|
2
|
-
import { Element } from 'webdriverio';
|
|
3
|
-
|
|
4
|
-
import { ElementExpectation } from './ElementExpectation';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @desc
|
|
8
|
-
* Expectation that the element is present in the DOM of the page and visible.
|
|
9
|
-
*
|
|
10
|
-
* @returns {@serenity-js/core/lib/screenplay/questions~Expectation<boolean, Element<'async'>>}
|
|
11
|
-
*
|
|
12
|
-
* @see https://webdriver.io/docs/api/element/isDisplayed/
|
|
13
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
14
|
-
* @see {@link @serenity-js/core/lib/screenplay/questions~Check}
|
|
15
|
-
* @see {@link Wait}
|
|
16
|
-
*/
|
|
17
|
-
export function isVisible(): Expectation<boolean, Element<'async'>> {
|
|
18
|
-
return ElementExpectation.forElementTo('become visible', actual => actual.isDisplayed());
|
|
19
|
-
}
|
package/src/input/Key.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @desc
|
|
3
|
-
* Represents pressable keys that aren't text to be used with {@link Press}.
|
|
4
|
-
*
|
|
5
|
-
* Note that modifier like Shift, Alt and Meta (a.k.a. Command on Mac) will stay pressed
|
|
6
|
-
*
|
|
7
|
-
* @enum {string}
|
|
8
|
-
* @see {@link Press}
|
|
9
|
-
* @see https://w3c.github.io/webdriver/webdriver-spec.html#keyboard-actions
|
|
10
|
-
* @see https://github.com/puppeteer/puppeteer/blob/v7.1.0/src/common/USKeyboardLayout.ts
|
|
11
|
-
* @see https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/lib/input.js#L46
|
|
12
|
-
* @see https://github.com/webdriverio/webdriverio/blob/main/packages/wdio-utils/src/constants.ts#L5
|
|
13
|
-
*/
|
|
14
|
-
export class Key {
|
|
15
|
-
public static Alt = new Key('Alt', '\uE00A', true);
|
|
16
|
-
public static ArrowDown = new Key('ArrowDown', '\uE015');
|
|
17
|
-
public static ArrowLeft = new Key('ArrowLeft', '\uE012');
|
|
18
|
-
public static ArrowRight = new Key('ArrowRight', '\uE014');
|
|
19
|
-
public static ArrowUp = new Key('ArrowUp', '\uE013');
|
|
20
|
-
public static Backspace = new Key('Backspace', '\uE003');
|
|
21
|
-
public static Cancel = new Key('Cancel', '\uE001');
|
|
22
|
-
public static Clear = new Key('Clear', '\uE005');
|
|
23
|
-
public static Control = new Key('Control', '\uE009', true);
|
|
24
|
-
public static Delete = new Key('Delete', '\uE017');
|
|
25
|
-
public static End = new Key('End', '\uE010');
|
|
26
|
-
public static Enter = new Key('Enter', '\uE007');
|
|
27
|
-
public static Escape = new Key('Escape', '\uE00C');
|
|
28
|
-
public static F1 = new Key('F1', '\uE031');
|
|
29
|
-
public static F2 = new Key('F2', '\uE032');
|
|
30
|
-
public static F3 = new Key('F3', '\uE033');
|
|
31
|
-
public static F4 = new Key('F4', '\uE034');
|
|
32
|
-
public static F5 = new Key('F5', '\uE035');
|
|
33
|
-
public static F6 = new Key('F6', '\uE036');
|
|
34
|
-
public static F7 = new Key('F7', '\uE037');
|
|
35
|
-
public static F8 = new Key('F8', '\uE038');
|
|
36
|
-
public static F9 = new Key('F9', '\uE039');
|
|
37
|
-
public static F10 = new Key('F10', '\uE03A');
|
|
38
|
-
public static F11 = new Key('F11', '\uE03B');
|
|
39
|
-
public static F12 = new Key('F12', '\uE03C');
|
|
40
|
-
public static Help = new Key('Help', '\uE002');
|
|
41
|
-
public static Home = new Key('Home', '\uE011');
|
|
42
|
-
public static Insert = new Key('Insert', '\uE016');
|
|
43
|
-
public static Meta = new Key('Meta', '\uE03D', true);
|
|
44
|
-
public static Numpad0 = new Key('Numpad0', '\uE01A');
|
|
45
|
-
public static Numpad1 = new Key('Numpad1', '\uE01B');
|
|
46
|
-
public static Numpad2 = new Key('Numpad2', '\uE01C');
|
|
47
|
-
public static Numpad3 = new Key('Numpad3', '\uE01D');
|
|
48
|
-
public static Numpad4 = new Key('Numpad4', '\uE01E');
|
|
49
|
-
public static Numpad5 = new Key('Numpad5', '\uE01F');
|
|
50
|
-
public static Numpad6 = new Key('Numpad6', '\uE020');
|
|
51
|
-
public static Numpad7 = new Key('Numpad7', '\uE021');
|
|
52
|
-
public static Numpad8 = new Key('Numpad8', '\uE022');
|
|
53
|
-
public static Numpad9 = new Key('Numpad9', '\uE023');
|
|
54
|
-
public static NumpadAdd = new Key('NumpadAdd', '\uE025');
|
|
55
|
-
public static NumpadDecimal = new Key('NumpadDecimal', '\uE028');
|
|
56
|
-
public static NumpadDivide = new Key('NumpadDivide', '\uE029');
|
|
57
|
-
public static NumpadEqual = new Key('NumpadEqual', '\uE019');
|
|
58
|
-
public static NumpadMultiply = new Key('NumpadMultiply', '\uE024');
|
|
59
|
-
public static NumpadSubtract = new Key('NumpadSubtract', '\uE027');
|
|
60
|
-
public static PageDown = new Key('PageDown', '\uE00F');
|
|
61
|
-
public static PageUp = new Key('PageUp', '\uE00E');
|
|
62
|
-
public static Pause = new Key('Pause', '\uE00B');
|
|
63
|
-
public static Semicolon = new Key('Semicolon', '\uE018');
|
|
64
|
-
public static Shift = new Key('Shift', '\uE008', true);
|
|
65
|
-
public static Space = new Key('Space', '\uE00D');
|
|
66
|
-
public static Tab = new Key('Tab', '\uE004');
|
|
67
|
-
|
|
68
|
-
public static isKey(maybeKey: unknown): maybeKey is Key {
|
|
69
|
-
return !! maybeKey
|
|
70
|
-
&& maybeKey instanceof Key;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
constructor(
|
|
74
|
-
public readonly devtoolsName: string,
|
|
75
|
-
public readonly utf16codePoint: string,
|
|
76
|
-
public readonly isModifier: boolean = false,
|
|
77
|
-
) {
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
toString(): string {
|
|
81
|
-
return this.devtoolsName;
|
|
82
|
-
}
|
|
83
|
-
}
|
package/src/input/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Key';
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { Answerable, AnswersQuestions, Interaction, LogicError, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import { formatted } from '@serenity-js/core/lib/io';
|
|
3
|
-
import { Element } from 'webdriverio';
|
|
4
|
-
|
|
5
|
-
import { WebElementInteraction } from './WebElementInteraction';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @desc
|
|
9
|
-
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
|
|
10
|
-
* clear the `value` of a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).
|
|
11
|
-
*
|
|
12
|
-
* @example <caption>Example widget</caption>
|
|
13
|
-
* <form>
|
|
14
|
-
* <input type="text" name="example" id="example" />
|
|
15
|
-
* </form>
|
|
16
|
-
*
|
|
17
|
-
* @example <caption>Lean Page Object describing the widget</caption>
|
|
18
|
-
* import { by, Target } from '@serenity-js/webdriverio';
|
|
19
|
-
*
|
|
20
|
-
* class Form {
|
|
21
|
-
* static exampleInput = Target.the('example input')
|
|
22
|
-
* .located(by.id('example'));
|
|
23
|
-
* }
|
|
24
|
-
*
|
|
25
|
-
* @example <caption>Clearing the value of an input field</caption>
|
|
26
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
27
|
-
* import { BrowseTheWeb, Clear, Enter, Value } from '@serenity-js/webdriverio';
|
|
28
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
29
|
-
*
|
|
30
|
-
* actorCalled('Inés')
|
|
31
|
-
* .whoCan(BrowseTheWeb.using(browser))
|
|
32
|
-
* .attemptsTo(
|
|
33
|
-
* Enter.theValue('Hello world!').into(Form.exampleInput),
|
|
34
|
-
* Ensure.that(Value.of(Form.exampleInput), equals('Hello world!')),
|
|
35
|
-
*
|
|
36
|
-
* Clear.theValueOf(Form.exampleInput),
|
|
37
|
-
* Ensure.that(Value.of(Form.exampleInput), equals('')),
|
|
38
|
-
* );
|
|
39
|
-
*
|
|
40
|
-
* @see {@link BrowseTheWeb}
|
|
41
|
-
* @see {@link Enter}
|
|
42
|
-
* @see {@link Value}
|
|
43
|
-
* @see {@link Target}
|
|
44
|
-
* @see {@link @serenity-js/assertions~Ensure}
|
|
45
|
-
* @see {@link @serenity-js/assertions/lib/expectations~equals}
|
|
46
|
-
*
|
|
47
|
-
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
48
|
-
*/
|
|
49
|
-
export class Clear extends WebElementInteraction {
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* @desc
|
|
53
|
-
* Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
54
|
-
*
|
|
55
|
-
* @param {Answerable<Element<'async'>>} field
|
|
56
|
-
* The field to be cleared
|
|
57
|
-
*
|
|
58
|
-
* @returns {@serenity-js/core/lib/screenplay~Interaction}
|
|
59
|
-
*/
|
|
60
|
-
static theValueOf(field: Answerable<Element<'async'>>): Interaction {
|
|
61
|
-
return new Clear(field);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* @param {Answerable<Element<'async'>>} field
|
|
66
|
-
* The element to be clicked on
|
|
67
|
-
*/
|
|
68
|
-
constructor(private readonly field: Answerable<Element<'async'>>) {
|
|
69
|
-
super(formatted `#actor clears the value of ${ field }`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @desc
|
|
74
|
-
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
75
|
-
* perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
|
|
76
|
-
*
|
|
77
|
-
* @param {UsesAbilities & AnswersQuestions} actor
|
|
78
|
-
* An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
|
|
79
|
-
*
|
|
80
|
-
* @returns {PromiseLike<void>}
|
|
81
|
-
*
|
|
82
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
83
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
84
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
85
|
-
*/
|
|
86
|
-
async performAs(actor: UsesAbilities & AnswersQuestions): Promise<void> {
|
|
87
|
-
const element = await this.resolve(actor, this.field);
|
|
88
|
-
const value = await element.getValue();
|
|
89
|
-
|
|
90
|
-
if (value === undefined) {
|
|
91
|
-
throw new LogicError(
|
|
92
|
-
this.capitaliseFirstLetter(formatted `${ this.field } doesn't seem to have a 'value' attribute that could be cleared.`),
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return element.clearValue();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
private capitaliseFirstLetter(text: string) {
|
|
100
|
-
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
101
|
-
}
|
|
102
|
-
}
|