@serenity-js/webdriverio 2.32.7 → 3.0.0-rc.10

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.
Files changed (243) hide show
  1. package/CHANGELOG.md +340 -0
  2. package/lib/adapter/WebdriverIOFrameworkAdapter.js +1 -1
  3. package/lib/adapter/WebdriverIOFrameworkAdapter.js.map +1 -1
  4. package/lib/adapter/WebdriverIONotifier.d.ts +35 -1
  5. package/lib/adapter/WebdriverIONotifier.js +174 -13
  6. package/lib/adapter/WebdriverIONotifier.js.map +1 -1
  7. package/lib/index.d.ts +0 -3
  8. package/lib/index.js +0 -3
  9. package/lib/index.js.map +1 -1
  10. package/lib/screenplay/abilities/{BrowseTheWeb.d.ts → BrowseTheWebWithWebdriverIO.d.ts} +44 -27
  11. package/lib/screenplay/abilities/{BrowseTheWeb.js → BrowseTheWebWithWebdriverIO.js} +112 -32
  12. package/lib/screenplay/abilities/BrowseTheWebWithWebdriverIO.js.map +1 -0
  13. package/lib/screenplay/abilities/index.d.ts +1 -1
  14. package/lib/screenplay/abilities/index.js +1 -1
  15. package/lib/screenplay/abilities/index.js.map +1 -1
  16. package/lib/screenplay/index.d.ts +1 -2
  17. package/lib/screenplay/index.js +1 -2
  18. package/lib/screenplay/index.js.map +1 -1
  19. package/lib/screenplay/models/WebdriverIOCookie.d.ts +8 -0
  20. package/lib/screenplay/models/WebdriverIOCookie.js +39 -0
  21. package/lib/screenplay/models/WebdriverIOCookie.js.map +1 -0
  22. package/lib/screenplay/models/WebdriverIOModalDialog.d.ts +11 -0
  23. package/lib/screenplay/models/WebdriverIOModalDialog.js +40 -0
  24. package/lib/screenplay/models/WebdriverIOModalDialog.js.map +1 -0
  25. package/lib/screenplay/models/WebdriverIOPage.d.ts +24 -0
  26. package/lib/screenplay/models/WebdriverIOPage.js +98 -0
  27. package/lib/screenplay/models/WebdriverIOPage.js.map +1 -0
  28. package/lib/screenplay/models/WebdriverIOPageElement.d.ts +31 -0
  29. package/lib/screenplay/models/WebdriverIOPageElement.js +185 -0
  30. package/lib/screenplay/models/WebdriverIOPageElement.js.map +1 -0
  31. package/lib/screenplay/models/index.d.ts +4 -0
  32. package/lib/{stage → screenplay/models}/index.js +4 -1
  33. package/lib/screenplay/models/index.js.map +1 -0
  34. package/lib/screenplay/models/locators/WebdriverIOLocator.d.ts +9 -0
  35. package/lib/screenplay/models/locators/WebdriverIOLocator.js +22 -0
  36. package/lib/screenplay/models/locators/WebdriverIOLocator.js.map +1 -0
  37. package/lib/screenplay/models/locators/WebdriverIONativeElementRoot.d.ts +2 -0
  38. package/lib/screenplay/{interactions/EnterBuilder.js → models/locators/WebdriverIONativeElementRoot.js} +1 -1
  39. package/lib/screenplay/models/locators/WebdriverIONativeElementRoot.js.map +1 -0
  40. package/lib/screenplay/models/locators/index.d.ts +2 -0
  41. package/lib/{stage/crew/photographer → screenplay/models/locators}/index.js +2 -2
  42. package/lib/screenplay/models/locators/index.js.map +1 -0
  43. package/package.json +15 -25
  44. package/src/adapter/WebdriverIOFrameworkAdapter.ts +2 -0
  45. package/src/adapter/WebdriverIONotifier.ts +225 -23
  46. package/src/index.ts +0 -3
  47. package/src/screenplay/abilities/{BrowseTheWeb.ts → BrowseTheWebWithWebdriverIO.ts} +133 -35
  48. package/src/screenplay/abilities/index.ts +1 -1
  49. package/src/screenplay/index.ts +1 -2
  50. package/src/screenplay/models/WebdriverIOCookie.ts +44 -0
  51. package/src/screenplay/models/WebdriverIOModalDialog.ts +45 -0
  52. package/src/screenplay/models/WebdriverIOPage.ts +120 -0
  53. package/src/screenplay/models/WebdriverIOPageElement.ts +227 -0
  54. package/src/screenplay/models/index.ts +4 -0
  55. package/src/screenplay/models/locators/WebdriverIOLocator.ts +43 -0
  56. package/src/screenplay/models/locators/WebdriverIONativeElementRoot.ts +3 -0
  57. package/src/screenplay/models/locators/index.ts +2 -0
  58. package/lib/expectations/ElementExpectation.d.ts +0 -11
  59. package/lib/expectations/ElementExpectation.js +0 -27
  60. package/lib/expectations/ElementExpectation.js.map +0 -1
  61. package/lib/expectations/index.d.ts +0 -6
  62. package/lib/expectations/index.js +0 -19
  63. package/lib/expectations/index.js.map +0 -1
  64. package/lib/expectations/isActive.d.ts +0 -15
  65. package/lib/expectations/isActive.js +0 -21
  66. package/lib/expectations/isActive.js.map +0 -1
  67. package/lib/expectations/isClickable.d.ts +0 -20
  68. package/lib/expectations/isClickable.js +0 -26
  69. package/lib/expectations/isClickable.js.map +0 -1
  70. package/lib/expectations/isEnabled.d.ts +0 -14
  71. package/lib/expectations/isEnabled.js +0 -20
  72. package/lib/expectations/isEnabled.js.map +0 -1
  73. package/lib/expectations/isPresent.d.ts +0 -15
  74. package/lib/expectations/isPresent.js +0 -21
  75. package/lib/expectations/isPresent.js.map +0 -1
  76. package/lib/expectations/isSelected.d.ts +0 -14
  77. package/lib/expectations/isSelected.js +0 -20
  78. package/lib/expectations/isSelected.js.map +0 -1
  79. package/lib/expectations/isVisible.d.ts +0 -14
  80. package/lib/expectations/isVisible.js +0 -20
  81. package/lib/expectations/isVisible.js.map +0 -1
  82. package/lib/input/Key.d.ts +0 -73
  83. package/lib/input/Key.js +0 -84
  84. package/lib/input/Key.js.map +0 -1
  85. package/lib/input/index.d.ts +0 -1
  86. package/lib/input/index.js +0 -14
  87. package/lib/input/index.js.map +0 -1
  88. package/lib/screenplay/abilities/BrowseTheWeb.js.map +0 -1
  89. package/lib/screenplay/interactions/Clear.d.ts +0 -79
  90. package/lib/screenplay/interactions/Clear.js +0 -97
  91. package/lib/screenplay/interactions/Clear.js.map +0 -1
  92. package/lib/screenplay/interactions/Click.d.ts +0 -73
  93. package/lib/screenplay/interactions/Click.js +0 -84
  94. package/lib/screenplay/interactions/Click.js.map +0 -1
  95. package/lib/screenplay/interactions/DoubleClick.d.ts +0 -90
  96. package/lib/screenplay/interactions/DoubleClick.js +0 -101
  97. package/lib/screenplay/interactions/DoubleClick.js.map +0 -1
  98. package/lib/screenplay/interactions/Enter.d.ts +0 -73
  99. package/lib/screenplay/interactions/Enter.js +0 -87
  100. package/lib/screenplay/interactions/Enter.js.map +0 -1
  101. package/lib/screenplay/interactions/EnterBuilder.d.ts +0 -25
  102. package/lib/screenplay/interactions/EnterBuilder.js.map +0 -1
  103. package/lib/screenplay/interactions/ExecuteScript.d.ts +0 -206
  104. package/lib/screenplay/interactions/ExecuteScript.js +0 -311
  105. package/lib/screenplay/interactions/ExecuteScript.js.map +0 -1
  106. package/lib/screenplay/interactions/Hover.d.ts +0 -78
  107. package/lib/screenplay/interactions/Hover.js +0 -89
  108. package/lib/screenplay/interactions/Hover.js.map +0 -1
  109. package/lib/screenplay/interactions/Navigate.d.ts +0 -141
  110. package/lib/screenplay/interactions/Navigate.js +0 -197
  111. package/lib/screenplay/interactions/Navigate.js.map +0 -1
  112. package/lib/screenplay/interactions/Press.d.ts +0 -84
  113. package/lib/screenplay/interactions/Press.js +0 -152
  114. package/lib/screenplay/interactions/Press.js.map +0 -1
  115. package/lib/screenplay/interactions/PressBuilder.d.ts +0 -26
  116. package/lib/screenplay/interactions/PressBuilder.js +0 -3
  117. package/lib/screenplay/interactions/PressBuilder.js.map +0 -1
  118. package/lib/screenplay/interactions/RightClick.d.ts +0 -89
  119. package/lib/screenplay/interactions/RightClick.js +0 -100
  120. package/lib/screenplay/interactions/RightClick.js.map +0 -1
  121. package/lib/screenplay/interactions/Scroll.d.ts +0 -75
  122. package/lib/screenplay/interactions/Scroll.js +0 -86
  123. package/lib/screenplay/interactions/Scroll.js.map +0 -1
  124. package/lib/screenplay/interactions/Wait.d.ts +0 -143
  125. package/lib/screenplay/interactions/Wait.js +0 -247
  126. package/lib/screenplay/interactions/Wait.js.map +0 -1
  127. package/lib/screenplay/interactions/WaitBuilder.d.ts +0 -32
  128. package/lib/screenplay/interactions/WaitBuilder.js +0 -3
  129. package/lib/screenplay/interactions/WaitBuilder.js.map +0 -1
  130. package/lib/screenplay/interactions/WebElementInteraction.d.ts +0 -37
  131. package/lib/screenplay/interactions/WebElementInteraction.js +0 -52
  132. package/lib/screenplay/interactions/WebElementInteraction.js.map +0 -1
  133. package/lib/screenplay/interactions/index.d.ts +0 -13
  134. package/lib/screenplay/interactions/index.js +0 -26
  135. package/lib/screenplay/interactions/index.js.map +0 -1
  136. package/lib/screenplay/questions/Attribute.d.ts +0 -82
  137. package/lib/screenplay/questions/Attribute.js +0 -102
  138. package/lib/screenplay/questions/Attribute.js.map +0 -1
  139. package/lib/screenplay/questions/CSSClasses.d.ts +0 -92
  140. package/lib/screenplay/questions/CSSClasses.js +0 -112
  141. package/lib/screenplay/questions/CSSClasses.js.map +0 -1
  142. package/lib/screenplay/questions/LastScriptExecution.d.ts +0 -14
  143. package/lib/screenplay/questions/LastScriptExecution.js +0 -22
  144. package/lib/screenplay/questions/LastScriptExecution.js.map +0 -1
  145. package/lib/screenplay/questions/NestedTargetBuilder.d.ts +0 -27
  146. package/lib/screenplay/questions/NestedTargetBuilder.js +0 -3
  147. package/lib/screenplay/questions/NestedTargetBuilder.js.map +0 -1
  148. package/lib/screenplay/questions/TargetBuilder.d.ts +0 -25
  149. package/lib/screenplay/questions/TargetBuilder.js +0 -3
  150. package/lib/screenplay/questions/TargetBuilder.js.map +0 -1
  151. package/lib/screenplay/questions/Text.d.ts +0 -95
  152. package/lib/screenplay/questions/Text.js +0 -130
  153. package/lib/screenplay/questions/Text.js.map +0 -1
  154. package/lib/screenplay/questions/Value.d.ts +0 -63
  155. package/lib/screenplay/questions/Value.js +0 -78
  156. package/lib/screenplay/questions/Value.js.map +0 -1
  157. package/lib/screenplay/questions/Website.d.ts +0 -21
  158. package/lib/screenplay/questions/Website.js +0 -31
  159. package/lib/screenplay/questions/Website.js.map +0 -1
  160. package/lib/screenplay/questions/index.d.ts +0 -10
  161. package/lib/screenplay/questions/index.js +0 -23
  162. package/lib/screenplay/questions/index.js.map +0 -1
  163. package/lib/screenplay/questions/lists.d.ts +0 -86
  164. package/lib/screenplay/questions/lists.js +0 -137
  165. package/lib/screenplay/questions/lists.js.map +0 -1
  166. package/lib/screenplay/questions/locators.d.ts +0 -196
  167. package/lib/screenplay/questions/locators.js +0 -219
  168. package/lib/screenplay/questions/locators.js.map +0 -1
  169. package/lib/screenplay/questions/targets.d.ts +0 -254
  170. package/lib/screenplay/questions/targets.js +0 -334
  171. package/lib/screenplay/questions/targets.js.map +0 -1
  172. package/lib/stage/crew/index.d.ts +0 -1
  173. package/lib/stage/crew/index.js +0 -14
  174. package/lib/stage/crew/index.js.map +0 -1
  175. package/lib/stage/crew/photographer/Photographer.d.ts +0 -83
  176. package/lib/stage/crew/photographer/Photographer.js +0 -102
  177. package/lib/stage/crew/photographer/Photographer.js.map +0 -1
  178. package/lib/stage/crew/photographer/index.d.ts +0 -2
  179. package/lib/stage/crew/photographer/index.js.map +0 -1
  180. package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts +0 -28
  181. package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js +0 -65
  182. package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js.map +0 -1
  183. package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts +0 -18
  184. package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js +0 -30
  185. package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js.map +0 -1
  186. package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts +0 -17
  187. package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js +0 -28
  188. package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js.map +0 -1
  189. package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts +0 -19
  190. package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js +0 -28
  191. package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js.map +0 -1
  192. package/lib/stage/crew/photographer/strategies/index.d.ts +0 -4
  193. package/lib/stage/crew/photographer/strategies/index.js +0 -17
  194. package/lib/stage/crew/photographer/strategies/index.js.map +0 -1
  195. package/lib/stage/index.d.ts +0 -1
  196. package/lib/stage/index.js.map +0 -1
  197. package/src/expectations/ElementExpectation.ts +0 -31
  198. package/src/expectations/index.ts +0 -6
  199. package/src/expectations/isActive.ts +0 -21
  200. package/src/expectations/isClickable.ts +0 -26
  201. package/src/expectations/isEnabled.ts +0 -19
  202. package/src/expectations/isPresent.ts +0 -20
  203. package/src/expectations/isSelected.ts +0 -19
  204. package/src/expectations/isVisible.ts +0 -19
  205. package/src/input/Key.ts +0 -83
  206. package/src/input/index.ts +0 -1
  207. package/src/screenplay/interactions/Clear.ts +0 -102
  208. package/src/screenplay/interactions/Click.ts +0 -85
  209. package/src/screenplay/interactions/DoubleClick.ts +0 -102
  210. package/src/screenplay/interactions/Enter.ts +0 -93
  211. package/src/screenplay/interactions/EnterBuilder.ts +0 -27
  212. package/src/screenplay/interactions/ExecuteScript.ts +0 -344
  213. package/src/screenplay/interactions/Hover.ts +0 -90
  214. package/src/screenplay/interactions/Navigate.ts +0 -208
  215. package/src/screenplay/interactions/Press.ts +0 -172
  216. package/src/screenplay/interactions/PressBuilder.ts +0 -28
  217. package/src/screenplay/interactions/RightClick.ts +0 -100
  218. package/src/screenplay/interactions/Scroll.ts +0 -87
  219. package/src/screenplay/interactions/Wait.ts +0 -267
  220. package/src/screenplay/interactions/WaitBuilder.ts +0 -34
  221. package/src/screenplay/interactions/WebElementInteraction.ts +0 -56
  222. package/src/screenplay/interactions/index.ts +0 -13
  223. package/src/screenplay/questions/Attribute.ts +0 -112
  224. package/src/screenplay/questions/CSSClasses.ts +0 -116
  225. package/src/screenplay/questions/LastScriptExecution.ts +0 -21
  226. package/src/screenplay/questions/NestedTargetBuilder.ts +0 -30
  227. package/src/screenplay/questions/TargetBuilder.ts +0 -27
  228. package/src/screenplay/questions/Text.ts +0 -140
  229. package/src/screenplay/questions/Value.ts +0 -82
  230. package/src/screenplay/questions/Website.ts +0 -34
  231. package/src/screenplay/questions/index.ts +0 -10
  232. package/src/screenplay/questions/lists.ts +0 -161
  233. package/src/screenplay/questions/locators.ts +0 -254
  234. package/src/screenplay/questions/targets.ts +0 -401
  235. package/src/stage/crew/index.ts +0 -1
  236. package/src/stage/crew/photographer/Photographer.ts +0 -108
  237. package/src/stage/crew/photographer/index.ts +0 -2
  238. package/src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts +0 -103
  239. package/src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts +0 -28
  240. package/src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts +0 -26
  241. package/src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts +0 -26
  242. package/src/stage/crew/photographer/strategies/index.ts +0 -4
  243. package/src/stage/index.ts +0 -1
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Click = void 0;
4
- const io_1 = require("@serenity-js/core/lib/io");
5
- const WebElementInteraction_1 = require("./WebElementInteraction");
6
- /**
7
- * @desc
8
- * Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
9
- * [click](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) on a given Web element.
10
- *
11
- * @example <caption>Example widget</caption>
12
- * <form>
13
- * <input type="text" name="example" id="example" />
14
- * </form>
15
- *
16
- * @example <caption>Lean Page Object describing the widget</caption>
17
- * import { by, Target } from '@serenity-js/webdriverio';
18
- *
19
- * class Form {
20
- * static exampleInput = Target.the('example input')
21
- * .located(by.id('example'));
22
- * }
23
- *
24
- * @example <caption>Clicking on an element</caption>
25
- * import { actorCalled } from '@serenity-js/core';
26
- * import { BrowseTheWeb, Click, isSelected } from '@serenity-js/webdriverio';
27
- * import { Ensure } from '@serenity-js/assertions';
28
- *
29
- * actorCalled('Chloé')
30
- * .whoCan(BrowseTheWeb.using(browser))
31
- * .attemptsTo(
32
- * Click.on(Form.exampleInput),
33
- * Ensure.that(Form.exampleInput, isSelected()),
34
- * );
35
- *
36
- * @see {@link BrowseTheWeb}
37
- * @see {@link Target}
38
- * @see {@link @serenity-js/assertions~Ensure}
39
- * @see {@link isSelected}
40
- *
41
- * @extends {WebElementInteraction}
42
- */
43
- class Click extends WebElementInteraction_1.WebElementInteraction {
44
- /**
45
- * @param {Answerable<Element<'async'>>} target
46
- * The element to be clicked on
47
- */
48
- constructor(target) {
49
- super((0, io_1.formatted) `#actor clicks on ${target}`);
50
- this.target = target;
51
- }
52
- /**
53
- * @desc
54
- * Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
55
- *
56
- * @param {Answerable<Element<'async'>>} target
57
- * The element to be clicked on
58
- *
59
- * @returns {@serenity-js/core/lib/screenplay~Interaction}
60
- */
61
- static on(target) {
62
- return new Click(target);
63
- }
64
- /**
65
- * @desc
66
- * Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
67
- * perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
68
- *
69
- * @param {UsesAbilities & AnswersQuestions} actor
70
- * An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
71
- *
72
- * @returns {PromiseLike<void>}
73
- *
74
- * @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
75
- * @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
76
- * @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
77
- */
78
- async performAs(actor) {
79
- const element = await this.resolve(actor, this.target);
80
- return element.click();
81
- }
82
- }
83
- exports.Click = Click;
84
- //# sourceMappingURL=Click.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Click.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Click.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAGrD,mEAAgE;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAa,KAAM,SAAQ,6CAAqB;IAe5C;;;OAGG;IACH,YAA6B,MAAoC;QAC7D,KAAK,CAAC,IAAA,cAAS,EAAC,oBAAqB,MAAO,EAAE,CAAC,CAAC;QADvB,WAAM,GAAN,MAAM,CAA8B;IAEjE,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAAC,MAAoC;QAC1C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAUD;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,SAAS,CAAC,KAAuC;QACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACvD,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACJ;AAzCD,sBAyCC"}
@@ -1,90 +0,0 @@
1
- import { Answerable, AnswersQuestions, Interaction, UsesAbilities } from '@serenity-js/core';
2
- import { Element } from 'webdriverio';
3
- import { WebElementInteraction } from './WebElementInteraction';
4
- /**
5
- * @desc
6
- * Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
7
- * perform a double-click on a given Web element.
8
- *
9
- * @example <caption>Example widget</caption>
10
- * <!--
11
- * The editor shows up when the user double-clicks
12
- * on one of the properties of their profile
13
- * and let's them change the value of that property.
14
- * -->
15
- * <div id="user-profile">
16
- * <ul>
17
- * <li id="display-name" ondblclick="edit(this)">User12345</li>
18
- * <li id="email-address" ondblclick="edit(this)">tester@example.org</li>
19
- * </ul>
20
- * <form id="editor" class="hidden">
21
- * <input type="text" value="" />
22
- * </form>
23
- * </div>
24
- *
25
- * @example <caption>Lean Page Object describing the widget</caption>
26
- * import { by, Target } from '@serenity-js/webdriverio';
27
- *
28
- * class UserProfile {
29
- * static displayName = Target.the('display name')
30
- * .located(by.id('display-name'));
31
- * static emailAddress = Target.the('email address')
32
- * .located(by.id('email-address'));
33
- * static editor = Target.the('editor')
34
- * .located(by.id('editor'));
35
- * }
36
- *
37
- * @example <caption>Double-clicking on an element</caption>
38
- * import { actorCalled } from '@serenity-js/core';
39
- * import { BrowseTheWeb, DoubleClick, isVisible, Enter, Text, Wait } from '@serenity-js/webdriverio';
40
- * import { Ensure, equals, not } from '@serenity-js/assertions';
41
- *
42
- * actorCalled('Dorothy')
43
- * .whoCan(BrowseTheWeb.using(browser))
44
- * .attemptsTo(
45
- * DoubleClick.on(UserProfile.displayName),
46
- * Wait.until(UserProfile.editor, isVisible()),
47
- *
48
- * Enter.theValue('New username').into(UserProfile.editor),
49
- *
50
- * Ensure.that(Text.of(UserProfile.displayName), equals('New username')),
51
- * Ensure.that(UserProfile.editor, not(isVisible()))
52
- * );
53
- *
54
- * @see {@link Target}
55
- *
56
- * @extends {WebElementInteraction}
57
- */
58
- export declare class DoubleClick extends WebElementInteraction {
59
- private readonly target;
60
- /**
61
- * @desc
62
- * Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
63
- *
64
- * @param {Answerable<Element<'async'>>} target
65
- * The element to be double-clicked on
66
- *
67
- * @returns {@serenity-js/core/lib/screenplay~Interaction}
68
- */
69
- static on(target: Answerable<Element<'async'>>): Interaction;
70
- /**
71
- * @param {Answerable<Element<'async'>>} target
72
- * The element to be double-clicked on
73
- */
74
- constructor(target: Answerable<Element<'async'>>);
75
- /**
76
- * @desc
77
- * Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
78
- * perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
79
- *
80
- * @param {UsesAbilities & AnswersQuestions} actor
81
- * An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
82
- *
83
- * @returns {PromiseLike<void>}
84
- *
85
- * @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
86
- * @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
87
- * @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
88
- */
89
- performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
90
- }
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DoubleClick = void 0;
4
- const io_1 = require("@serenity-js/core/lib/io");
5
- const WebElementInteraction_1 = require("./WebElementInteraction");
6
- /**
7
- * @desc
8
- * Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
9
- * perform a double-click on a given Web element.
10
- *
11
- * @example <caption>Example widget</caption>
12
- * <!--
13
- * The editor shows up when the user double-clicks
14
- * on one of the properties of their profile
15
- * and let's them change the value of that property.
16
- * -->
17
- * <div id="user-profile">
18
- * <ul>
19
- * <li id="display-name" ondblclick="edit(this)">User12345</li>
20
- * <li id="email-address" ondblclick="edit(this)">tester@example.org</li>
21
- * </ul>
22
- * <form id="editor" class="hidden">
23
- * <input type="text" value="" />
24
- * </form>
25
- * </div>
26
- *
27
- * @example <caption>Lean Page Object describing the widget</caption>
28
- * import { by, Target } from '@serenity-js/webdriverio';
29
- *
30
- * class UserProfile {
31
- * static displayName = Target.the('display name')
32
- * .located(by.id('display-name'));
33
- * static emailAddress = Target.the('email address')
34
- * .located(by.id('email-address'));
35
- * static editor = Target.the('editor')
36
- * .located(by.id('editor'));
37
- * }
38
- *
39
- * @example <caption>Double-clicking on an element</caption>
40
- * import { actorCalled } from '@serenity-js/core';
41
- * import { BrowseTheWeb, DoubleClick, isVisible, Enter, Text, Wait } from '@serenity-js/webdriverio';
42
- * import { Ensure, equals, not } from '@serenity-js/assertions';
43
- *
44
- * actorCalled('Dorothy')
45
- * .whoCan(BrowseTheWeb.using(browser))
46
- * .attemptsTo(
47
- * DoubleClick.on(UserProfile.displayName),
48
- * Wait.until(UserProfile.editor, isVisible()),
49
- *
50
- * Enter.theValue('New username').into(UserProfile.editor),
51
- *
52
- * Ensure.that(Text.of(UserProfile.displayName), equals('New username')),
53
- * Ensure.that(UserProfile.editor, not(isVisible()))
54
- * );
55
- *
56
- * @see {@link Target}
57
- *
58
- * @extends {WebElementInteraction}
59
- */
60
- class DoubleClick extends WebElementInteraction_1.WebElementInteraction {
61
- /**
62
- * @param {Answerable<Element<'async'>>} target
63
- * The element to be double-clicked on
64
- */
65
- constructor(target) {
66
- super((0, io_1.formatted) `#actor double-clicks on ${target}`);
67
- this.target = target;
68
- }
69
- /**
70
- * @desc
71
- * Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
72
- *
73
- * @param {Answerable<Element<'async'>>} target
74
- * The element to be double-clicked on
75
- *
76
- * @returns {@serenity-js/core/lib/screenplay~Interaction}
77
- */
78
- static on(target) {
79
- return new DoubleClick(target);
80
- }
81
- /**
82
- * @desc
83
- * Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
84
- * perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
85
- *
86
- * @param {UsesAbilities & AnswersQuestions} actor
87
- * An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
88
- *
89
- * @returns {PromiseLike<void>}
90
- *
91
- * @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
92
- * @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
93
- * @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
94
- */
95
- async performAs(actor) {
96
- const element = await this.resolve(actor, this.target);
97
- return element.doubleClick();
98
- }
99
- }
100
- exports.DoubleClick = DoubleClick;
101
- //# sourceMappingURL=DoubleClick.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DoubleClick.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/DoubleClick.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAGrD,mEAAgE;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAa,WAAY,SAAQ,6CAAqB;IAelD;;;OAGG;IACH,YAA6B,MAAoC;QAC7D,KAAK,CAAC,IAAA,cAAS,EAAC,2BAA4B,MAAO,EAAE,CAAC,CAAC;QAD9B,WAAM,GAAN,MAAM,CAA8B;IAEjE,CAAC;IAnBD;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAAC,MAAoC;QAC1C,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAUD;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,SAAS,CAAC,KAAuC;QACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACvD,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;IACjC,CAAC;CACJ;AAzCD,kCAyCC"}
@@ -1,73 +0,0 @@
1
- import { Answerable, AnswersQuestions, UsesAbilities } from '@serenity-js/core';
2
- import { Element } from 'webdriverio';
3
- import { EnterBuilder } from './EnterBuilder';
4
- import { WebElementInteraction } from './WebElementInteraction';
5
- /**
6
- * @desc
7
- * Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
8
- * enter a value into a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) field.
9
- *
10
- * @example <caption>Example widget</caption>
11
- * <form>
12
- * <input type="text" name="example" id="example" />
13
- * </form>
14
- *
15
- * @example <caption>Lean Page Object describing the widget</caption>
16
- * import { by, Target } from '@serenity-js/webdriverio';
17
- *
18
- * class Form {
19
- * static exampleInput = Target.the('example input')
20
- * .located(by.id('example'));
21
- * }
22
- *
23
- * @example <caption>Entering the value into a form field</caption>
24
- * import { actorCalled } from '@serenity-js/core';
25
- * import { BrowseTheWeb, Enter } from '@serenity-js/webdriverio';
26
- *
27
- * actorCalled('Esme')
28
- * .whoCan(BrowseTheWeb.using(browser))
29
- * .attemptsTo(
30
- * Enter.theValue('Hello world!').into(Form.exampleInput),
31
- * );
32
- *
33
- * @see {@link Target}
34
- *
35
- * @extends {WebElementInteraction}
36
- */
37
- export declare class Enter extends WebElementInteraction {
38
- private readonly value;
39
- private readonly field;
40
- /**
41
- * @desc
42
- * Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
43
- *
44
- * @param {Array<Answerable<string | number | string[] | number[]>>} value
45
- * The value to be entered
46
- *
47
- * @returns {EnterBuilder}
48
- */
49
- static theValue(...value: Array<Answerable<string | number | string[] | number[]>>): EnterBuilder;
50
- /**
51
- * @param {Array<Answerable<string | number | string[] | number[]>>} value
52
- * The value to be entered
53
- *
54
- * @param {Answerable<Element<'async'>>} field
55
- * The field to enter the value into
56
- */
57
- constructor(value: Array<Answerable<string | number | string[] | number[]>>, field: Answerable<Element<'async'>>);
58
- /**
59
- * @desc
60
- * Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
61
- * perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
62
- *
63
- * @param {UsesAbilities & AnswersQuestions} actor
64
- * An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
65
- *
66
- * @returns {Promise<void>}
67
- *
68
- * @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
69
- * @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
70
- * @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
71
- */
72
- performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
73
- }
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Enter = void 0;
4
- const io_1 = require("@serenity-js/core/lib/io");
5
- const WebElementInteraction_1 = require("./WebElementInteraction");
6
- /**
7
- * @desc
8
- * Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
9
- * enter a value into a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) field.
10
- *
11
- * @example <caption>Example widget</caption>
12
- * <form>
13
- * <input type="text" name="example" id="example" />
14
- * </form>
15
- *
16
- * @example <caption>Lean Page Object describing the widget</caption>
17
- * import { by, Target } from '@serenity-js/webdriverio';
18
- *
19
- * class Form {
20
- * static exampleInput = Target.the('example input')
21
- * .located(by.id('example'));
22
- * }
23
- *
24
- * @example <caption>Entering the value into a form field</caption>
25
- * import { actorCalled } from '@serenity-js/core';
26
- * import { BrowseTheWeb, Enter } from '@serenity-js/webdriverio';
27
- *
28
- * actorCalled('Esme')
29
- * .whoCan(BrowseTheWeb.using(browser))
30
- * .attemptsTo(
31
- * Enter.theValue('Hello world!').into(Form.exampleInput),
32
- * );
33
- *
34
- * @see {@link Target}
35
- *
36
- * @extends {WebElementInteraction}
37
- */
38
- class Enter extends WebElementInteraction_1.WebElementInteraction {
39
- /**
40
- * @param {Array<Answerable<string | number | string[] | number[]>>} value
41
- * The value to be entered
42
- *
43
- * @param {Answerable<Element<'async'>>} field
44
- * The field to enter the value into
45
- */
46
- constructor(value, field /* todo | Question<AlertPromise> | AlertPromise */) {
47
- super((0, io_1.formatted) `#actor enters ${value.join(', ')} into ${field}`);
48
- this.value = value;
49
- this.field = field;
50
- }
51
- /**
52
- * @desc
53
- * Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
54
- *
55
- * @param {Array<Answerable<string | number | string[] | number[]>>} value
56
- * The value to be entered
57
- *
58
- * @returns {EnterBuilder}
59
- */
60
- static theValue(...value) {
61
- return {
62
- into: (field /* todo Question<AlertPromise> | AlertPromise */) => new Enter(value, field),
63
- };
64
- }
65
- /**
66
- * @desc
67
- * Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
68
- * perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
69
- *
70
- * @param {UsesAbilities & AnswersQuestions} actor
71
- * An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
72
- *
73
- * @returns {Promise<void>}
74
- *
75
- * @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
76
- * @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
77
- * @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
78
- */
79
- async performAs(actor) {
80
- const values = await Promise.all(this.value.map(part => actor.answer(part)));
81
- const field = await this.resolve(actor, this.field);
82
- // addValue rather than setValue so that the behaviour is consistent with Selenium sendKeys
83
- return field.addValue(values.flat());
84
- }
85
- }
86
- exports.Enter = Enter;
87
- //# sourceMappingURL=Enter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Enter.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/Enter.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AAIrD,mEAAgE;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAa,KAAM,SAAQ,6CAAqB;IAkB5C;;;;;;OAMG;IACH,YACqB,KAA+D,EAC/D,KAAmC,CAAC,kDAAkD;QAEvG,KAAK,CAAC,IAAA,cAAS,EAAC,iBAAkB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAE,SAAU,KAAM,EAAE,CAAC,CAAC;QAHtD,UAAK,GAAL,KAAK,CAA0D;QAC/D,UAAK,GAAL,KAAK,CAA8B;IAGxD,CAAC;IA5BD;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,KAA+D;QAC9E,OAAO;YACH,IAAI,EAAE,CAAC,KAAmC,CAAE,gDAAgD,EAAE,EAAE,CAC5F,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC;SAC9B,CAAC;IACN,CAAC;IAgBD;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,SAAS,CAAC,KAAuC;QACnD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7E,MAAM,KAAK,GAAI,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAErD,2FAA2F;QAC3F,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;CACJ;AArDD,sBAqDC"}
@@ -1,25 +0,0 @@
1
- import { Answerable, Interaction } from '@serenity-js/core';
2
- import { Element } from 'webdriverio';
3
- /**
4
- * @desc
5
- * Fluent interface to make the instantiation of
6
- * the {@link @serenity-js/core/lib/screenplay~Interaction}
7
- * to {@link Enter} more readable.
8
- *
9
- * @see {@link Enter}
10
- *
11
- * @interface
12
- */
13
- export interface EnterBuilder {
14
- /**
15
- * @desc
16
- * Instantiates an {@link @serenity-js/core/lib/screenplay~Interaction}
17
- * to {@link Enter}.
18
- *
19
- * @param {Answerable<Element<'async'>>} field
20
- * @returns {@serenity-js/core/lib/screenplay~Interaction}
21
- *
22
- * @see {@link Target}
23
- */
24
- into: (field: Answerable<Element<'async'>>) => Interaction;
25
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnterBuilder.js","sourceRoot":"","sources":["../../../src/screenplay/interactions/EnterBuilder.ts"],"names":[],"mappings":""}