@serenity-js/protractor 2.32.2 → 3.0.0-rc.0

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 (333) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/lib/index.d.ts +0 -2
  3. package/lib/index.js +0 -2
  4. package/lib/index.js.map +1 -1
  5. package/lib/screenplay/abilities/{BrowseTheWeb.d.ts → BrowseTheWebWithProtractor.d.ts} +52 -160
  6. package/lib/screenplay/abilities/{BrowseTheWeb.js → BrowseTheWebWithProtractor.js} +169 -218
  7. package/lib/screenplay/abilities/BrowseTheWebWithProtractor.js.map +1 -0
  8. package/lib/screenplay/abilities/index.d.ts +1 -1
  9. package/lib/screenplay/abilities/index.js +1 -1
  10. package/lib/screenplay/abilities/index.js.map +1 -1
  11. package/lib/screenplay/index.d.ts +1 -0
  12. package/lib/screenplay/index.js +1 -0
  13. package/lib/screenplay/index.js.map +1 -1
  14. package/lib/screenplay/interactions/UseAngular.js +2 -2
  15. package/lib/screenplay/interactions/UseAngular.js.map +1 -1
  16. package/lib/screenplay/interactions/index.d.ts +0 -19
  17. package/lib/screenplay/interactions/index.js +0 -19
  18. package/lib/screenplay/interactions/index.js.map +1 -1
  19. package/lib/screenplay/models/ProtractorCookie.d.ts +11 -0
  20. package/lib/screenplay/models/ProtractorCookie.js +39 -0
  21. package/lib/screenplay/models/ProtractorCookie.js.map +1 -0
  22. package/lib/screenplay/models/ProtractorModalDialog.d.ts +11 -0
  23. package/lib/screenplay/models/ProtractorModalDialog.js +43 -0
  24. package/lib/screenplay/models/ProtractorModalDialog.js.map +1 -0
  25. package/lib/screenplay/models/ProtractorNativeElementRoot.d.ts +5 -0
  26. package/lib/screenplay/{interactions/EnterBuilder.js → models/ProtractorNativeElementRoot.js} +1 -1
  27. package/lib/screenplay/models/ProtractorNativeElementRoot.js.map +1 -0
  28. package/lib/screenplay/models/ProtractorPage.d.ts +24 -0
  29. package/lib/screenplay/models/ProtractorPage.js +92 -0
  30. package/lib/screenplay/models/ProtractorPage.js.map +1 -0
  31. package/lib/screenplay/models/ProtractorPageElement.d.ts +23 -0
  32. package/lib/screenplay/models/ProtractorPageElement.js +112 -0
  33. package/lib/screenplay/models/ProtractorPageElement.js.map +1 -0
  34. package/lib/screenplay/models/ProtractorPageElements.d.ts +16 -0
  35. package/lib/screenplay/models/ProtractorPageElements.js +62 -0
  36. package/lib/screenplay/models/ProtractorPageElements.js.map +1 -0
  37. package/lib/screenplay/models/index.d.ts +6 -0
  38. package/lib/{expectations → screenplay/models}/index.js +6 -6
  39. package/lib/screenplay/models/index.js.map +1 -0
  40. package/lib/{promiseOf.d.ts → screenplay/promised.d.ts} +1 -1
  41. package/lib/{promiseOf.js → screenplay/promised.js} +4 -4
  42. package/lib/screenplay/promised.js.map +1 -0
  43. package/lib/screenplay/promisedWebElement.d.ts +11 -0
  44. package/lib/screenplay/promisedWebElement.js +27 -0
  45. package/lib/screenplay/promisedWebElement.js.map +1 -0
  46. package/lib/screenplay/questions/ProtractorParam.d.ts +24 -29
  47. package/lib/screenplay/questions/ProtractorParam.js +26 -33
  48. package/lib/screenplay/questions/ProtractorParam.js.map +1 -1
  49. package/lib/screenplay/questions/index.d.ts +0 -13
  50. package/lib/screenplay/questions/index.js +0 -16
  51. package/lib/screenplay/questions/index.js.map +1 -1
  52. package/package.json +20 -22
  53. package/src/index.ts +0 -2
  54. package/src/screenplay/abilities/{BrowseTheWeb.ts → BrowseTheWebWithProtractor.ts} +216 -241
  55. package/src/screenplay/abilities/index.ts +1 -1
  56. package/src/screenplay/index.ts +1 -0
  57. package/src/screenplay/interactions/UseAngular.ts +3 -3
  58. package/src/screenplay/interactions/index.ts +0 -19
  59. package/src/screenplay/models/ProtractorCookie.ts +41 -0
  60. package/src/screenplay/models/ProtractorModalDialog.ts +49 -0
  61. package/src/screenplay/models/ProtractorNativeElementRoot.ts +6 -0
  62. package/src/screenplay/models/ProtractorPage.ts +116 -0
  63. package/src/screenplay/models/ProtractorPageElement.ts +167 -0
  64. package/src/screenplay/models/ProtractorPageElements.ts +86 -0
  65. package/src/screenplay/models/index.ts +7 -0
  66. package/src/{promiseOf.ts → screenplay/promised.ts} +1 -1
  67. package/src/screenplay/promisedWebElement.ts +28 -0
  68. package/src/screenplay/questions/ProtractorParam.ts +29 -38
  69. package/src/screenplay/questions/index.ts +0 -13
  70. package/lib/expectations/ElementFinderExpectation.d.ts +0 -11
  71. package/lib/expectations/ElementFinderExpectation.js +0 -24
  72. package/lib/expectations/ElementFinderExpectation.js.map +0 -1
  73. package/lib/expectations/index.d.ts +0 -6
  74. package/lib/expectations/index.js.map +0 -1
  75. package/lib/expectations/isActive.d.ts +0 -13
  76. package/lib/expectations/isActive.js +0 -19
  77. package/lib/expectations/isActive.js.map +0 -1
  78. package/lib/expectations/isClickable.d.ts +0 -13
  79. package/lib/expectations/isClickable.js +0 -22
  80. package/lib/expectations/isClickable.js.map +0 -1
  81. package/lib/expectations/isEnabled.d.ts +0 -13
  82. package/lib/expectations/isEnabled.js +0 -19
  83. package/lib/expectations/isEnabled.js.map +0 -1
  84. package/lib/expectations/isPresent.d.ts +0 -14
  85. package/lib/expectations/isPresent.js +0 -20
  86. package/lib/expectations/isPresent.js.map +0 -1
  87. package/lib/expectations/isSelected.d.ts +0 -13
  88. package/lib/expectations/isSelected.js +0 -22
  89. package/lib/expectations/isSelected.js.map +0 -1
  90. package/lib/expectations/isVisible.d.ts +0 -13
  91. package/lib/expectations/isVisible.js +0 -25
  92. package/lib/expectations/isVisible.js.map +0 -1
  93. package/lib/promiseOf.js.map +0 -1
  94. package/lib/screenplay/abilities/BrowseTheWeb.js.map +0 -1
  95. package/lib/screenplay/interactions/Accept.d.ts +0 -81
  96. package/lib/screenplay/interactions/Accept.js +0 -95
  97. package/lib/screenplay/interactions/Accept.js.map +0 -1
  98. package/lib/screenplay/interactions/Clear.d.ts +0 -88
  99. package/lib/screenplay/interactions/Clear.js +0 -121
  100. package/lib/screenplay/interactions/Clear.js.map +0 -1
  101. package/lib/screenplay/interactions/Click.d.ts +0 -81
  102. package/lib/screenplay/interactions/Click.js +0 -95
  103. package/lib/screenplay/interactions/Click.js.map +0 -1
  104. package/lib/screenplay/interactions/Close.d.ts +0 -89
  105. package/lib/screenplay/interactions/Close.js +0 -169
  106. package/lib/screenplay/interactions/Close.js.map +0 -1
  107. package/lib/screenplay/interactions/DeleteCookies.d.ts +0 -72
  108. package/lib/screenplay/interactions/DeleteCookies.js +0 -149
  109. package/lib/screenplay/interactions/DeleteCookies.js.map +0 -1
  110. package/lib/screenplay/interactions/Dismiss.d.ts +0 -85
  111. package/lib/screenplay/interactions/Dismiss.js +0 -99
  112. package/lib/screenplay/interactions/Dismiss.js.map +0 -1
  113. package/lib/screenplay/interactions/DoubleClick.d.ts +0 -99
  114. package/lib/screenplay/interactions/DoubleClick.js +0 -121
  115. package/lib/screenplay/interactions/DoubleClick.js.map +0 -1
  116. package/lib/screenplay/interactions/Enter.d.ts +0 -81
  117. package/lib/screenplay/interactions/Enter.js +0 -96
  118. package/lib/screenplay/interactions/Enter.js.map +0 -1
  119. package/lib/screenplay/interactions/EnterBuilder.d.ts +0 -27
  120. package/lib/screenplay/interactions/EnterBuilder.js.map +0 -1
  121. package/lib/screenplay/interactions/ExecuteScript.d.ts +0 -171
  122. package/lib/screenplay/interactions/ExecuteScript.js +0 -291
  123. package/lib/screenplay/interactions/ExecuteScript.js.map +0 -1
  124. package/lib/screenplay/interactions/Hover.d.ts +0 -86
  125. package/lib/screenplay/interactions/Hover.js +0 -103
  126. package/lib/screenplay/interactions/Hover.js.map +0 -1
  127. package/lib/screenplay/interactions/Navigate.d.ts +0 -149
  128. package/lib/screenplay/interactions/Navigate.js +0 -345
  129. package/lib/screenplay/interactions/Navigate.js.map +0 -1
  130. package/lib/screenplay/interactions/Press.d.ts +0 -90
  131. package/lib/screenplay/interactions/Press.js +0 -127
  132. package/lib/screenplay/interactions/Press.js.map +0 -1
  133. package/lib/screenplay/interactions/PressBuilder.d.ts +0 -27
  134. package/lib/screenplay/interactions/PressBuilder.js +0 -3
  135. package/lib/screenplay/interactions/PressBuilder.js.map +0 -1
  136. package/lib/screenplay/interactions/ResizeBrowserWindow.d.ts +0 -69
  137. package/lib/screenplay/interactions/ResizeBrowserWindow.js +0 -144
  138. package/lib/screenplay/interactions/ResizeBrowserWindow.js.map +0 -1
  139. package/lib/screenplay/interactions/RightClick.d.ts +0 -97
  140. package/lib/screenplay/interactions/RightClick.js +0 -113
  141. package/lib/screenplay/interactions/RightClick.js.map +0 -1
  142. package/lib/screenplay/interactions/Scroll.d.ts +0 -83
  143. package/lib/screenplay/interactions/Scroll.js +0 -98
  144. package/lib/screenplay/interactions/Scroll.js.map +0 -1
  145. package/lib/screenplay/interactions/Select.d.ts +0 -212
  146. package/lib/screenplay/interactions/Select.js +0 -342
  147. package/lib/screenplay/interactions/Select.js.map +0 -1
  148. package/lib/screenplay/interactions/SelectBuilder.d.ts +0 -33
  149. package/lib/screenplay/interactions/SelectBuilder.js +0 -3
  150. package/lib/screenplay/interactions/SelectBuilder.js.map +0 -1
  151. package/lib/screenplay/interactions/Switch.d.ts +0 -210
  152. package/lib/screenplay/interactions/Switch.js +0 -345
  153. package/lib/screenplay/interactions/Switch.js.map +0 -1
  154. package/lib/screenplay/interactions/TakeScreenshot.d.ts +0 -67
  155. package/lib/screenplay/interactions/TakeScreenshot.js +0 -86
  156. package/lib/screenplay/interactions/TakeScreenshot.js.map +0 -1
  157. package/lib/screenplay/interactions/Wait.d.ts +0 -147
  158. package/lib/screenplay/interactions/Wait.js +0 -247
  159. package/lib/screenplay/interactions/Wait.js.map +0 -1
  160. package/lib/screenplay/interactions/WaitBuilder.d.ts +0 -33
  161. package/lib/screenplay/interactions/WaitBuilder.js +0 -3
  162. package/lib/screenplay/interactions/WaitBuilder.js.map +0 -1
  163. package/lib/screenplay/questions/Attribute.d.ts +0 -29
  164. package/lib/screenplay/questions/Attribute.js +0 -56
  165. package/lib/screenplay/questions/Attribute.js.map +0 -1
  166. package/lib/screenplay/questions/Browser.d.ts +0 -47
  167. package/lib/screenplay/questions/Browser.js +0 -55
  168. package/lib/screenplay/questions/Browser.js.map +0 -1
  169. package/lib/screenplay/questions/CSSClasses.d.ts +0 -94
  170. package/lib/screenplay/questions/CSSClasses.js +0 -118
  171. package/lib/screenplay/questions/CSSClasses.js.map +0 -1
  172. package/lib/screenplay/questions/Cookie.d.ts +0 -9
  173. package/lib/screenplay/questions/Cookie.js +0 -65
  174. package/lib/screenplay/questions/Cookie.js.map +0 -1
  175. package/lib/screenplay/questions/LastScriptExecution.d.ts +0 -14
  176. package/lib/screenplay/questions/LastScriptExecution.js +0 -22
  177. package/lib/screenplay/questions/LastScriptExecution.js.map +0 -1
  178. package/lib/screenplay/questions/ModalDialog.d.ts +0 -120
  179. package/lib/screenplay/questions/ModalDialog.js +0 -142
  180. package/lib/screenplay/questions/ModalDialog.js.map +0 -1
  181. package/lib/screenplay/questions/Pick.d.ts +0 -72
  182. package/lib/screenplay/questions/Pick.js +0 -254
  183. package/lib/screenplay/questions/Pick.js.map +0 -1
  184. package/lib/screenplay/questions/Selected.d.ts +0 -185
  185. package/lib/screenplay/questions/Selected.js +0 -254
  186. package/lib/screenplay/questions/Selected.js.map +0 -1
  187. package/lib/screenplay/questions/Value.d.ts +0 -47
  188. package/lib/screenplay/questions/Value.js +0 -67
  189. package/lib/screenplay/questions/Value.js.map +0 -1
  190. package/lib/screenplay/questions/Website.d.ts +0 -15
  191. package/lib/screenplay/questions/Website.js +0 -25
  192. package/lib/screenplay/questions/Website.js.map +0 -1
  193. package/lib/screenplay/questions/Window.d.ts +0 -23
  194. package/lib/screenplay/questions/Window.js +0 -28
  195. package/lib/screenplay/questions/Window.js.map +0 -1
  196. package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.d.ts +0 -89
  197. package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.js +0 -138
  198. package/lib/screenplay/questions/lists/ElementArrayFinderListAdapter.js.map +0 -1
  199. package/lib/screenplay/questions/lists/index.d.ts +0 -1
  200. package/lib/screenplay/questions/lists/index.js +0 -14
  201. package/lib/screenplay/questions/lists/index.js.map +0 -1
  202. package/lib/screenplay/questions/targets/Target.d.ts +0 -168
  203. package/lib/screenplay/questions/targets/Target.js +0 -190
  204. package/lib/screenplay/questions/targets/Target.js.map +0 -1
  205. package/lib/screenplay/questions/targets/TargetElement.d.ts +0 -50
  206. package/lib/screenplay/questions/targets/TargetElement.js +0 -62
  207. package/lib/screenplay/questions/targets/TargetElement.js.map +0 -1
  208. package/lib/screenplay/questions/targets/TargetElements.d.ts +0 -102
  209. package/lib/screenplay/questions/targets/TargetElements.js +0 -124
  210. package/lib/screenplay/questions/targets/TargetElements.js.map +0 -1
  211. package/lib/screenplay/questions/targets/TargetNestedElement.d.ts +0 -49
  212. package/lib/screenplay/questions/targets/TargetNestedElement.js +0 -61
  213. package/lib/screenplay/questions/targets/TargetNestedElement.js.map +0 -1
  214. package/lib/screenplay/questions/targets/TargetNestedElements.d.ts +0 -101
  215. package/lib/screenplay/questions/targets/TargetNestedElements.js +0 -123
  216. package/lib/screenplay/questions/targets/TargetNestedElements.js.map +0 -1
  217. package/lib/screenplay/questions/targets/builders.d.ts +0 -8
  218. package/lib/screenplay/questions/targets/builders.js +0 -3
  219. package/lib/screenplay/questions/targets/builders.js.map +0 -1
  220. package/lib/screenplay/questions/targets/index.d.ts +0 -5
  221. package/lib/screenplay/questions/targets/index.js +0 -18
  222. package/lib/screenplay/questions/targets/index.js.map +0 -1
  223. package/lib/screenplay/questions/targets/override.d.ts +0 -7
  224. package/lib/screenplay/questions/targets/override.js +0 -21
  225. package/lib/screenplay/questions/targets/override.js.map +0 -1
  226. package/lib/screenplay/questions/text/Text.d.ts +0 -41
  227. package/lib/screenplay/questions/text/Text.js +0 -50
  228. package/lib/screenplay/questions/text/Text.js.map +0 -1
  229. package/lib/screenplay/questions/text/TextOfMultipleElements.d.ts +0 -23
  230. package/lib/screenplay/questions/text/TextOfMultipleElements.js +0 -37
  231. package/lib/screenplay/questions/text/TextOfMultipleElements.js.map +0 -1
  232. package/lib/screenplay/questions/text/TextOfSingleElement.d.ts +0 -23
  233. package/lib/screenplay/questions/text/TextOfSingleElement.js +0 -35
  234. package/lib/screenplay/questions/text/TextOfSingleElement.js.map +0 -1
  235. package/lib/screenplay/questions/text/index.d.ts +0 -1
  236. package/lib/screenplay/questions/text/index.js +0 -14
  237. package/lib/screenplay/questions/text/index.js.map +0 -1
  238. package/lib/screenplay/withAnswerOf.d.ts +0 -8
  239. package/lib/screenplay/withAnswerOf.js +0 -18
  240. package/lib/screenplay/withAnswerOf.js.map +0 -1
  241. package/lib/stage/crew/index.d.ts +0 -1
  242. package/lib/stage/crew/index.js +0 -14
  243. package/lib/stage/crew/index.js.map +0 -1
  244. package/lib/stage/crew/photographer/Photographer.d.ts +0 -83
  245. package/lib/stage/crew/photographer/Photographer.js +0 -102
  246. package/lib/stage/crew/photographer/Photographer.js.map +0 -1
  247. package/lib/stage/crew/photographer/index.d.ts +0 -2
  248. package/lib/stage/crew/photographer/index.js +0 -15
  249. package/lib/stage/crew/photographer/index.js.map +0 -1
  250. package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.d.ts +0 -28
  251. package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js +0 -65
  252. package/lib/stage/crew/photographer/strategies/PhotoTakingStrategy.js.map +0 -1
  253. package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.d.ts +0 -18
  254. package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js +0 -30
  255. package/lib/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.js.map +0 -1
  256. package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.d.ts +0 -17
  257. package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js +0 -28
  258. package/lib/stage/crew/photographer/strategies/TakePhotosOfFailures.js.map +0 -1
  259. package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.d.ts +0 -19
  260. package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js +0 -28
  261. package/lib/stage/crew/photographer/strategies/TakePhotosOfInteractions.js.map +0 -1
  262. package/lib/stage/crew/photographer/strategies/index.d.ts +0 -4
  263. package/lib/stage/crew/photographer/strategies/index.js +0 -17
  264. package/lib/stage/crew/photographer/strategies/index.js.map +0 -1
  265. package/lib/stage/index.d.ts +0 -1
  266. package/lib/stage/index.js +0 -14
  267. package/lib/stage/index.js.map +0 -1
  268. package/src/expectations/ElementFinderExpectation.ts +0 -29
  269. package/src/expectations/index.ts +0 -6
  270. package/src/expectations/isActive.ts +0 -24
  271. package/src/expectations/isClickable.ts +0 -20
  272. package/src/expectations/isEnabled.ts +0 -18
  273. package/src/expectations/isPresent.ts +0 -19
  274. package/src/expectations/isSelected.ts +0 -23
  275. package/src/expectations/isVisible.ts +0 -27
  276. package/src/screenplay/interactions/Accept.ts +0 -95
  277. package/src/screenplay/interactions/Clear.ts +0 -130
  278. package/src/screenplay/interactions/Click.ts +0 -96
  279. package/src/screenplay/interactions/Close.ts +0 -184
  280. package/src/screenplay/interactions/DeleteCookies.ts +0 -154
  281. package/src/screenplay/interactions/Dismiss.ts +0 -99
  282. package/src/screenplay/interactions/DoubleClick.ts +0 -124
  283. package/src/screenplay/interactions/Enter.ts +0 -104
  284. package/src/screenplay/interactions/EnterBuilder.ts +0 -29
  285. package/src/screenplay/interactions/ExecuteScript.ts +0 -325
  286. package/src/screenplay/interactions/Hover.ts +0 -106
  287. package/src/screenplay/interactions/Navigate.ts +0 -363
  288. package/src/screenplay/interactions/Press.ts +0 -137
  289. package/src/screenplay/interactions/PressBuilder.ts +0 -29
  290. package/src/screenplay/interactions/ResizeBrowserWindow.ts +0 -148
  291. package/src/screenplay/interactions/RightClick.ts +0 -114
  292. package/src/screenplay/interactions/Scroll.ts +0 -99
  293. package/src/screenplay/interactions/Select.ts +0 -402
  294. package/src/screenplay/interactions/SelectBuilder.ts +0 -35
  295. package/src/screenplay/interactions/Switch.ts +0 -393
  296. package/src/screenplay/interactions/TakeScreenshot.ts +0 -89
  297. package/src/screenplay/interactions/Wait.ts +0 -267
  298. package/src/screenplay/interactions/WaitBuilder.ts +0 -35
  299. package/src/screenplay/questions/Attribute.ts +0 -67
  300. package/src/screenplay/questions/Browser.ts +0 -55
  301. package/src/screenplay/questions/CSSClasses.ts +0 -121
  302. package/src/screenplay/questions/Cookie.ts +0 -70
  303. package/src/screenplay/questions/LastScriptExecution.ts +0 -21
  304. package/src/screenplay/questions/ModalDialog.ts +0 -149
  305. package/src/screenplay/questions/Pick.ts +0 -334
  306. package/src/screenplay/questions/Selected.ts +0 -268
  307. package/src/screenplay/questions/Value.ts +0 -73
  308. package/src/screenplay/questions/Website.ts +0 -27
  309. package/src/screenplay/questions/Window.ts +0 -29
  310. package/src/screenplay/questions/lists/ElementArrayFinderListAdapter.ts +0 -158
  311. package/src/screenplay/questions/lists/index.ts +0 -1
  312. package/src/screenplay/questions/targets/Target.ts +0 -198
  313. package/src/screenplay/questions/targets/TargetElement.ts +0 -70
  314. package/src/screenplay/questions/targets/TargetElements.ts +0 -142
  315. package/src/screenplay/questions/targets/TargetNestedElement.ts +0 -71
  316. package/src/screenplay/questions/targets/TargetNestedElements.ts +0 -142
  317. package/src/screenplay/questions/targets/builders.ts +0 -10
  318. package/src/screenplay/questions/targets/index.ts +0 -5
  319. package/src/screenplay/questions/targets/override.ts +0 -17
  320. package/src/screenplay/questions/text/Text.ts +0 -55
  321. package/src/screenplay/questions/text/TextOfMultipleElements.ts +0 -40
  322. package/src/screenplay/questions/text/TextOfSingleElement.ts +0 -37
  323. package/src/screenplay/questions/text/index.ts +0 -1
  324. package/src/screenplay/withAnswerOf.ts +0 -19
  325. package/src/stage/crew/index.ts +0 -1
  326. package/src/stage/crew/photographer/Photographer.ts +0 -108
  327. package/src/stage/crew/photographer/index.ts +0 -2
  328. package/src/stage/crew/photographer/strategies/PhotoTakingStrategy.ts +0 -102
  329. package/src/stage/crew/photographer/strategies/TakePhotosBeforeAndAfterInteractions.ts +0 -28
  330. package/src/stage/crew/photographer/strategies/TakePhotosOfFailures.ts +0 -26
  331. package/src/stage/crew/photographer/strategies/TakePhotosOfInteractions.ts +0 -26
  332. package/src/stage/crew/photographer/strategies/index.ts +0 -4
  333. package/src/stage/index.ts +0 -1
@@ -1,104 +0,0 @@
1
- import { Answerable, AnswersQuestions, Interaction, Question, UsesAbilities } from '@serenity-js/core';
2
- import { formatted } from '@serenity-js/core/lib/io';
3
- import { ElementFinder } from 'protractor';
4
- import { AlertPromise } from 'selenium-webdriver';
5
-
6
- import { withAnswerOf } from '../withAnswerOf';
7
- import { EnterBuilder } from './EnterBuilder';
8
-
9
- /**
10
- * @desc
11
- * Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
12
- * enter a value into a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) field.
13
- *
14
- * @example <caption>Example widget</caption>
15
- * <form>
16
- * <input type="text" name="example" id="example" />
17
- * </form>
18
- *
19
- * @example <caption>Lean Page Object describing the widget</caption>
20
- * import { Target } from '@serenity-js/protractor';
21
- * import { by } from 'protractor';
22
- *
23
- * class Form {
24
- * static exampleInput = Target.the('example input')
25
- * .located(by.id('example'));
26
- * }
27
- *
28
- * @example <caption>Entering the value into a form field</caption>
29
- * import { actorCalled } from '@serenity-js/core';
30
- * import { BrowseTheWeb, Enter } from '@serenity-js/webdriverio';
31
- *
32
- * actorCalled('Esme')
33
- * .whoCan(BrowseTheWeb.using(browser))
34
- * .attemptsTo(
35
- * Enter.theValue('Hello world!').into(Form.exampleInput),
36
- * );
37
- *
38
- * @see {@link Target}
39
- *
40
- * @extends {@serenity-js/core/lib/screenplay~Interaction}
41
- */
42
- export class Enter extends Interaction {
43
-
44
- /**
45
- * @desc
46
- * Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
47
- *
48
- * @param {Answerable<string | number>} value
49
- * The value to be entered
50
- *
51
- * @returns {EnterBuilder}
52
- */
53
- static theValue(value: Answerable<string | number>): EnterBuilder {
54
- return {
55
- into: (field: Question<ElementFinder> | ElementFinder | Question<AlertPromise> | AlertPromise) =>
56
- new Enter(value, field),
57
- };
58
- }
59
-
60
- /**
61
- * @param {@serenity-js/core/lib/screenplay~Answerable<string | number>} value
62
- * The value to be entered
63
- *
64
- * @param {Question<ElementFinder> | ElementFinder | Question<AlertPromise> | AlertPromise} field
65
- * The field to enter the value into
66
- */
67
- constructor(
68
- private readonly value: Answerable<string | number>,
69
- private readonly field: Question<ElementFinder> | ElementFinder | Question<AlertPromise> | AlertPromise,
70
- ) {
71
- super();
72
- }
73
-
74
- /**
75
- * @desc
76
- * Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
77
- * perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
78
- *
79
- * @param {UsesAbilities & AnswersQuestions} actor
80
- * An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
81
- *
82
- * @returns {PromiseLike<void>}
83
- *
84
- * @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
85
- * @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
86
- * @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
87
- */
88
- performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void> {
89
- return actor.answer(this.value)
90
- .then(value => withAnswerOf(actor, this.field, (elf: ElementFinder | AlertPromise) =>
91
- elf.sendKeys(`${ value }`))
92
- );
93
- }
94
-
95
- /**
96
- * @desc
97
- * Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
98
- *
99
- * @returns {string}
100
- */
101
- toString(): string {
102
- return formatted `#actor enters ${ this.value } into ${ this.field }`;
103
- }
104
- }
@@ -1,29 +0,0 @@
1
- import { Question } from '@serenity-js/core';
2
- import { Interaction } from '@serenity-js/core/lib/screenplay';
3
- import { ElementFinder } from 'protractor';
4
- import { AlertPromise } from 'selenium-webdriver';
5
-
6
- /**
7
- * @desc
8
- * Fluent interface to make the instantiation of
9
- * the {@link @serenity-js/core/lib/screenplay~Interaction}
10
- * to {@link Enter} more readable.
11
- *
12
- * @see {@link Enter}
13
- *
14
- * @interface
15
- */
16
- export interface EnterBuilder {
17
-
18
- /**
19
- * @desc
20
- * Instantiates an {@link @serenity-js/core/lib/screenplay~Interaction}
21
- * to {@link Enter}.
22
- *
23
- * @param {Question<ElementFinder> | ElementFinder} field
24
- * @returns {@serenity-js/core/lib/screenplay~Interaction}
25
- *
26
- * @see {@link Target}
27
- */
28
- into: (field: Question<ElementFinder> | ElementFinder | Question<AlertPromise> | AlertPromise) => Interaction;
29
- }
@@ -1,325 +0,0 @@
1
- import { Answerable, AnswersQuestions, CollectsArtifacts, Interaction, LogicError, Question, UsesAbilities } from '@serenity-js/core';
2
- import { formatted } from '@serenity-js/core/lib/io';
3
- import { Name, TextData } from '@serenity-js/core/lib/model';
4
-
5
- import { BrowseTheWeb } from '../abilities';
6
-
7
- /**
8
- * @desc
9
- * Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
10
- * execute a script within the context of the current browser window.
11
- *
12
- * Please see the tests below for usage examples.
13
- *
14
- * @see {@link LastScriptExecution.result}
15
- */
16
- export class ExecuteScript {
17
-
18
- /**
19
- * @desc
20
- * Instantiates a version of this {@link @serenity-js/core/lib/screenplay~Interaction}
21
- * configured to load a script from `sourceUrl`.
22
- *
23
- * @param {string} sourceUrl
24
- * The URL to load the script from
25
- *
26
- * @returns {@serenity-js/core/lib/screenplay~Interaction}
27
- */
28
- static from(sourceUrl: string): Interaction {
29
- return new ExecuteScriptFromUrl(sourceUrl);
30
- }
31
-
32
- /**
33
- * @desc
34
- * Schedules a command to execute asynchronous JavaScript in the context of the currently selected frame or window.
35
- * The script fragment will be executed as the body of an anonymous function.
36
- * If the script is provided as a function object, that function will be converted to a string for injection
37
- * into the target window.
38
- *
39
- * Any arguments provided in addition to the script will be included as script arguments and may be referenced
40
- * using the `arguments` object. Arguments may be a `boolean`, `number`, `string`
41
- * or `Target` (`Question<ElementFinder>`).
42
- * Arrays and objects may also be used as script arguments as long as each item adheres
43
- * to the types previously mentioned.
44
- *
45
- * Unlike executing synchronous JavaScript with {@link ExecuteScript#sync},
46
- * scripts executed with this function must explicitly signal they are finished by invoking the provided callback.
47
- *
48
- * This callback will always be injected into the executed function as the last argument,
49
- * and thus may be referenced with `arguments[arguments.length - 1]`.
50
- *
51
- * If the script invokes the `callback` with a return value, this will be made available
52
- * via the {@link LastScriptExecution.result}.
53
- *
54
- * **Please note** that in order to signal an error in the `script` you need to throw an {@link Error}
55
- * instead of passing it to the callback function.
56
- *
57
- * @example <caption>Executing an async script</caption>
58
- * actor.attemptsTo(ExecuteScript.async(
59
- * var callback = arguments[arguments.length - 1];
60
- *
61
- * // do stuff
62
- *
63
- * callback(result)
64
- * ));
65
- *
66
- * @example <caption>Passing arguments to an async script</caption>
67
- * actor.attemptsTo(ExecuteScript.async(
68
- * var name = arguments[0];
69
- * var age = arguments[1];
70
- * var callback = arguments[arguments.length - 1];
71
- *
72
- * // do stuff
73
- *
74
- * callback(result)
75
- * ).withArguments('Bob', 24));
76
- *
77
- * @example <caption>Passing Target arguments to an async script</caption>
78
- * actor.attemptsTo(ExecuteScript.async(
79
- * var header = arguments[0]; // Target gets converted to a WebElement
80
- * var callback = arguments[arguments.length - 1];
81
- *
82
- * callback(header.innerText)
83
- * ).withArguments(Target.the('header').located(by.css('h1'))));
84
- *
85
- * @param {string | Function} script
86
- * The script to be executed
87
- *
88
- * @returns {ExecuteScriptWithArguments}
89
- *
90
- * @see {@link LastScriptExecution.result}
91
- */
92
- static async(script: string | Function): ExecuteScriptWithArguments { // eslint-disable-line @typescript-eslint/ban-types
93
- return new ExecuteAsynchronousScript(script);
94
- }
95
-
96
- /**
97
- * @desc
98
- * Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
99
- * execute a synchronous script in the context of the currently selected frame or window.
100
- *
101
- * If the script returns a value, it will be made available via {@link LastScriptExecution.result}.
102
- *
103
- * @example <caption>Executing a sync script and reading the result</caption>
104
- * import { actorCalled } from '@serenity-js/core';
105
- * import { BrowseTheWeb, ExecuteScript, LastScriptExecution } from '@serenity-js/protractor';
106
- * import { Ensure, includes } from '@serenity-js/assertions';
107
- * import { protractor } from 'protractor';
108
- *
109
- * actorCalled('Joseph')
110
- * .whoCan(BrowseTheWeb.using(protractor.browser))
111
- * .attemptsTo(
112
- * ExecuteScript.sync('return navigator.userAgent'),
113
- * Ensure.that(LastScriptExecution.result<string>(), includes('Chrome')),
114
- * );
115
- *
116
- * @param {string | Function} script
117
- * The script to be executed
118
- *
119
- * @returns {ExecuteScriptWithArguments}
120
- *
121
- * @see {@link LastScriptExecution.result}
122
- */
123
- static sync(script: string | Function): ExecuteScriptWithArguments { // eslint-disable-line @typescript-eslint/ban-types
124
- return new ExecuteSynchronousScript(script);
125
- }
126
- }
127
-
128
- /**
129
- * @desc
130
- * Allows for a script to be executed to be parametrised.
131
- *
132
- * **Please note** that the arguments can be both synchronous and asynchronous {@link @serenity-js/core/lib/screenplay~Question}s
133
- * as well as regular static values.
134
- *
135
- * @abstract
136
- *
137
- * @see {@link ExecuteScript}
138
- *
139
- * @extends {@serenity-js/core/lib/screenplay~Interaction}
140
- */
141
- export abstract class ExecuteScriptWithArguments extends Interaction {
142
-
143
- /**
144
- * @param {string | Function} script
145
- * The script to be executed
146
- *
147
- * @param {Array<Answerable<any>>} args
148
- * Arguments to parametrise the script with
149
- */
150
- constructor(
151
- protected readonly script: string | Function, // eslint-disable-line @typescript-eslint/ban-types
152
- protected readonly args: Array<Answerable<any>> = [],
153
- ) {
154
- super();
155
- }
156
-
157
- /**
158
- * @desc
159
- * Instantiates an {@link @serenity-js/core/lib/screenplay~Interaction}
160
- * to {@link Enter}.
161
- *
162
- * @param {...Array<Answerable<any>>} args
163
- * Arguments to parametrise the script with
164
- *
165
- * @returns {@serenity-js/core/lib/screenplay~Interaction}
166
- */
167
- public abstract withArguments(...args: Array<Answerable<any>>): Interaction;
168
-
169
- /**
170
- * @desc
171
- * Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
172
- * perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
173
- *
174
- * @param {UsesAbilities & AnswersQuestions} actor
175
- * An {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this {@link @serenity-js/core/lib/screenplay~Interaction}
176
- *
177
- * @returns {PromiseLike<void>}
178
- *
179
- * @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
180
- * @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
181
- * @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
182
- */
183
- performAs(actor: UsesAbilities & CollectsArtifacts & AnswersQuestions): PromiseLike<void> {
184
- return this.answerAll(this.args).as(actor)
185
- .then(args => this.executeAs(actor, args))
186
- .then(() => actor.collect(
187
- TextData.fromJSON({
188
- contentType: 'text/javascript;charset=UTF-8',
189
- data: this.script.toString(),
190
- }),
191
- new Name('Script source'),
192
- ));
193
- }
194
-
195
- protected abstract executeAs(actor: UsesAbilities & AnswersQuestions, args: any[]): Promise<any>;
196
-
197
- /**
198
- * @private
199
- *
200
- * @param {Array<Answerable<any>>} args
201
- */
202
- private answerAll(args: Array<Answerable<any>>) {
203
- return {
204
- as: (actor: AnswersQuestions & UsesAbilities): Promise<any[]> => Promise.all(args.map(arg => {
205
- const maybeElementFinder = Question.isAQuestion(arg)
206
- ? arg.answeredBy(actor)
207
- : arg;
208
-
209
- const maybePromise = maybeElementFinder.getWebElement
210
- ? maybeElementFinder.getWebElement()
211
- : maybeElementFinder;
212
-
213
- return actor.answer(maybePromise);
214
- })),
215
- };
216
- }
217
- }
218
-
219
- /**
220
- * @package
221
- */
222
- class ExecuteAsynchronousScript extends ExecuteScriptWithArguments {
223
- withArguments(...args: Array<Answerable<any>>): Interaction {
224
- return new ExecuteAsynchronousScript(this.script, args);
225
- }
226
-
227
- protected executeAs(actor: UsesAbilities & AnswersQuestions, args: any[]): Promise<any> {
228
- return BrowseTheWeb.as(actor).executeAsyncScript(this.script, ...args);
229
- }
230
-
231
- toString(): string {
232
- return this.args.length > 0
233
- ? formatted `#actor executes an asynchronous script with arguments: ${ this.args }`
234
- : `#actor executes an asynchronous script`;
235
- }
236
- }
237
-
238
- /**
239
- * @package
240
- *
241
- * https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/JavascriptExecutor.html
242
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement
243
- */
244
- class ExecuteScriptFromUrl extends Interaction {
245
- constructor(private readonly sourceUrl: string) {
246
- super();
247
- }
248
-
249
- /**
250
- * @desc
251
- * Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
252
- * perform this {@link @serenity-js/core/lib/screenplay~Interaction}.
253
- *
254
- * @param {UsesAbilities & AnswersQuestions} actor
255
- * @returns {Promise<void>}
256
- *
257
- * @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
258
- * @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
259
- * @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
260
- */
261
- performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<any> {
262
- return BrowseTheWeb.as(actor)
263
- .executeAsyncScript(
264
- ` var src = arguments[0];
265
- var callback = arguments[arguments.length - 1];
266
-
267
- var alreadyLoadedScripts = Array.prototype.slice
268
- .call(document.getElementsByTagName('script'))
269
- .map(script => script.src);
270
-
271
- if (!! ~ alreadyLoadedScripts.indexOf(src)) {
272
- return callback("Script from " + src + " has already been loaded");
273
- }
274
-
275
- var script = document.createElement('script');
276
- script.onload = function () {
277
- return callback();
278
- };
279
- script.onerror = function () {
280
- return callback("Couldn't load script from " + src);
281
- };
282
-
283
- script.src = src;
284
- script.async = true;
285
- document.head.appendChild(script);
286
- `,
287
- this.sourceUrl
288
- )
289
- .then(errorMessage => {
290
- if (errorMessage) {
291
- throw new LogicError(errorMessage);
292
- }
293
- });
294
- }
295
-
296
- /**
297
- * @desc
298
- * Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
299
- *
300
- * @returns {string}
301
- */
302
- toString(): string {
303
- return `#actor executes a script from ${ this.sourceUrl }`;
304
- }
305
- }
306
-
307
- /**
308
- * @package
309
- */
310
- class ExecuteSynchronousScript extends ExecuteScriptWithArguments {
311
-
312
- withArguments(...args: Array<Answerable<any>>): Interaction {
313
- return new ExecuteSynchronousScript(this.script, args);
314
- }
315
-
316
- protected executeAs(actor: UsesAbilities & AnswersQuestions, args: any[]): Promise<any> {
317
- return BrowseTheWeb.as(actor).executeScript(this.toString(), this.script, ...args);
318
- }
319
-
320
- toString(): string {
321
- return this.args.length > 0
322
- ? formatted `#actor executes a synchronous script with arguments: ${ this.args }`
323
- : `#actor executes a synchronous script`;
324
- }
325
- }
@@ -1,106 +0,0 @@
1
- import { AnswersQuestions, Interaction, Question, UsesAbilities } from '@serenity-js/core';
2
- import { formatted } from '@serenity-js/core/lib/io';
3
- import { ElementFinder } from 'protractor';
4
-
5
- import { BrowseTheWeb } from '../abilities';
6
- import { withAnswerOf } from '../withAnswerOf';
7
-
8
- /**
9
- * @desc
10
- * Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor} to
11
- * hover the mouse pointer over a given Web element.
12
- *
13
- * @example <caption>Example widget</caption>
14
- * <a data-test="example-link"
15
- * class="off"
16
- * onmouseover="this.className='on';"
17
- * onmouseout="this.className='off';"
18
- * href="/">hover over me</a>
19
- *
20
- * @example <caption>Lean Page Object describing the widget</caption>
21
- * import { Target } from '@serenity-js/protractor';
22
- * import { by } from 'protractor';
23
- *
24
- * class Example {
25
- * static link = Target.the('example link')
26
- * .located(by.css('[data-test="example-link"]'));
27
- * }
28
- *
29
- * @example <caption>Hovering over an element</caption>
30
- * import { actorCalled } from '@serenity-js/core';
31
- * import { BrowseTheWeb, Hover, CSSClasses } from '@serenity-js/protractor';
32
- * import { Ensure, equals } from '@serenity-js/assertions';
33
- * import { protractor } from 'protractor';
34
- *
35
- * actorCalled('Hank')
36
- * .whoCan(BrowseTheWeb.using(protractor.browser))
37
- * .attemptsTo(
38
- * Ensure.that(CSSClasses.of(Example.link), equals([ 'off' ])),
39
- *
40
- * Hover.over(Example.link),
41
- * Ensure.that(CSSClasses.of(Example.link), equals([ 'on' ])),
42
- * );
43
- *
44
- * @see {@link BrowseTheWeb}
45
- * @see {@link Target}
46
- * @see {@link CSSClasses}
47
- * @see {@link @serenity-js/assertions~Ensure}
48
- * @see {@link @serenity-js/assertions/lib/expectations~equals}
49
- *
50
- * @extends {@serenity-js/core/lib/screenplay~Interaction}
51
- */
52
- export class Hover extends Interaction {
53
-
54
- /**
55
- * @desc
56
- * Instantiates this {@link @serenity-js/core/lib/screenplay~Interaction}.
57
- *
58
- * @param {Question<ElementFinder> | ElementFinder} target
59
- * The element to be hovered over
60
- *
61
- * @returns {@serenity-js/core/lib/screenplay~Interaction}
62
- */
63
- static over(target: Question<ElementFinder> | ElementFinder): Interaction {
64
- return new Hover(target);
65
- }
66
-
67
- /**
68
- * @param {Question<ElementFinder> | ElementFinder} target
69
- * The element to be hovered over
70
- */
71
- constructor(private readonly target: Question<ElementFinder> | ElementFinder) {
72
- super();
73
- }
74
-
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): PromiseLike<void> {
90
- return withAnswerOf(actor, this.target, (elf: ElementFinder) =>
91
- BrowseTheWeb.as(actor).actions()
92
- .mouseMove(elf as unknown as any)
93
- .perform()
94
- );
95
- }
96
-
97
- /**
98
- * @desc
99
- * Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
100
- *
101
- * @returns {string}
102
- */
103
- toString(): string {
104
- return formatted `#actor hovers the mouse over ${this.target}`;
105
- }
106
- }