webdriverio 7.16.16 → 7.17.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 (358) hide show
  1. package/package.json +7 -7
  2. package/build/commands/browser/$$.d.ts +0 -50
  3. package/build/commands/browser/$$.d.ts.map +0 -1
  4. package/build/commands/browser/$$.js +0 -57
  5. package/build/commands/browser/$.d.ts +0 -77
  6. package/build/commands/browser/$.d.ts.map +0 -1
  7. package/build/commands/browser/$.js +0 -91
  8. package/build/commands/browser/addCommand.d.ts +0 -37
  9. package/build/commands/browser/addCommand.d.ts.map +0 -1
  10. package/build/commands/browser/addCommand.js +0 -37
  11. package/build/commands/browser/call.d.ts +0 -42
  12. package/build/commands/browser/call.d.ts.map +0 -1
  13. package/build/commands/browser/call.js +0 -49
  14. package/build/commands/browser/custom$$.d.ts +0 -26
  15. package/build/commands/browser/custom$$.d.ts.map +0 -1
  16. package/build/commands/browser/custom$$.js +0 -47
  17. package/build/commands/browser/custom$.d.ts +0 -25
  18. package/build/commands/browser/custom$.d.ts.map +0 -1
  19. package/build/commands/browser/custom$.js +0 -47
  20. package/build/commands/browser/debug.d.ts +0 -32
  21. package/build/commands/browser/debug.d.ts.map +0 -1
  22. package/build/commands/browser/debug.js +0 -108
  23. package/build/commands/browser/deleteCookies.d.ts +0 -45
  24. package/build/commands/browser/deleteCookies.d.ts.map +0 -1
  25. package/build/commands/browser/deleteCookies.js +0 -56
  26. package/build/commands/browser/execute.d.ts +0 -37
  27. package/build/commands/browser/execute.d.ts.map +0 -1
  28. package/build/commands/browser/execute.js +0 -55
  29. package/build/commands/browser/executeAsync.d.ts +0 -45
  30. package/build/commands/browser/executeAsync.d.ts.map +0 -1
  31. package/build/commands/browser/executeAsync.js +0 -63
  32. package/build/commands/browser/getCookies.d.ts +0 -34
  33. package/build/commands/browser/getCookies.d.ts.map +0 -1
  34. package/build/commands/browser/getCookies.js +0 -46
  35. package/build/commands/browser/getPuppeteer.d.ts +0 -38
  36. package/build/commands/browser/getPuppeteer.d.ts.map +0 -1
  37. package/build/commands/browser/getPuppeteer.js +0 -119
  38. package/build/commands/browser/getWindowSize.d.ts +0 -25
  39. package/build/commands/browser/getWindowSize.d.ts.map +0 -1
  40. package/build/commands/browser/getWindowSize.js +0 -30
  41. package/build/commands/browser/keys.d.ts +0 -28
  42. package/build/commands/browser/keys.d.ts.map +0 -1
  43. package/build/commands/browser/keys.js +0 -64
  44. package/build/commands/browser/mock.d.ts +0 -111
  45. package/build/commands/browser/mock.d.ts.map +0 -1
  46. package/build/commands/browser/mock.js +0 -164
  47. package/build/commands/browser/mockClearAll.d.ts +0 -28
  48. package/build/commands/browser/mockClearAll.d.ts.map +0 -1
  49. package/build/commands/browser/mockClearAll.js +0 -43
  50. package/build/commands/browser/mockRestoreAll.d.ts +0 -26
  51. package/build/commands/browser/mockRestoreAll.d.ts.map +0 -1
  52. package/build/commands/browser/mockRestoreAll.js +0 -41
  53. package/build/commands/browser/newWindow.d.ts +0 -41
  54. package/build/commands/browser/newWindow.d.ts.map +0 -1
  55. package/build/commands/browser/newWindow.js +0 -83
  56. package/build/commands/browser/overwriteCommand.d.ts +0 -32
  57. package/build/commands/browser/overwriteCommand.d.ts.map +0 -1
  58. package/build/commands/browser/overwriteCommand.js +0 -32
  59. package/build/commands/browser/pause.d.ts +0 -23
  60. package/build/commands/browser/pause.d.ts.map +0 -1
  61. package/build/commands/browser/pause.js +0 -27
  62. package/build/commands/browser/react$$.d.ts +0 -36
  63. package/build/commands/browser/react$$.d.ts.map +0 -1
  64. package/build/commands/browser/react$$.js +0 -51
  65. package/build/commands/browser/react$.d.ts +0 -46
  66. package/build/commands/browser/react$.d.ts.map +0 -1
  67. package/build/commands/browser/react$.js +0 -59
  68. package/build/commands/browser/reloadSession.d.ts +0 -23
  69. package/build/commands/browser/reloadSession.d.ts.map +0 -1
  70. package/build/commands/browser/reloadSession.js +0 -58
  71. package/build/commands/browser/savePDF.d.ts +0 -46
  72. package/build/commands/browser/savePDF.d.ts.map +0 -1
  73. package/build/commands/browser/savePDF.js +0 -51
  74. package/build/commands/browser/saveRecordingScreen.d.ts +0 -28
  75. package/build/commands/browser/saveRecordingScreen.d.ts.map +0 -1
  76. package/build/commands/browser/saveRecordingScreen.js +0 -47
  77. package/build/commands/browser/saveScreenshot.d.ts +0 -22
  78. package/build/commands/browser/saveScreenshot.d.ts.map +0 -1
  79. package/build/commands/browser/saveScreenshot.js +0 -41
  80. package/build/commands/browser/setCookies.d.ts +0 -57
  81. package/build/commands/browser/setCookies.d.ts.map +0 -1
  82. package/build/commands/browser/setCookies.js +0 -66
  83. package/build/commands/browser/setTimeout.d.ts +0 -31
  84. package/build/commands/browser/setTimeout.d.ts.map +0 -1
  85. package/build/commands/browser/setTimeout.js +0 -61
  86. package/build/commands/browser/setWindowSize.d.ts +0 -20
  87. package/build/commands/browser/setWindowSize.d.ts.map +0 -1
  88. package/build/commands/browser/setWindowSize.js +0 -43
  89. package/build/commands/browser/switchWindow.d.ts +0 -30
  90. package/build/commands/browser/switchWindow.d.ts.map +0 -1
  91. package/build/commands/browser/switchWindow.js +0 -73
  92. package/build/commands/browser/throttle.d.ts +0 -3
  93. package/build/commands/browser/throttle.d.ts.map +0 -1
  94. package/build/commands/browser/throttle.js +0 -144
  95. package/build/commands/browser/touchAction.d.ts +0 -61
  96. package/build/commands/browser/touchAction.d.ts.map +0 -1
  97. package/build/commands/browser/touchAction.js +0 -65
  98. package/build/commands/browser/uploadFile.d.ts +0 -32
  99. package/build/commands/browser/uploadFile.d.ts.map +0 -1
  100. package/build/commands/browser/uploadFile.js +0 -63
  101. package/build/commands/browser/url.d.ts +0 -38
  102. package/build/commands/browser/url.d.ts.map +0 -1
  103. package/build/commands/browser/url.js +0 -49
  104. package/build/commands/browser/waitUntil.d.ts +0 -44
  105. package/build/commands/browser/waitUntil.d.ts.map +0 -1
  106. package/build/commands/browser/waitUntil.js +0 -73
  107. package/build/commands/browser.d.ts +0 -70
  108. package/build/commands/browser.d.ts.map +0 -1
  109. package/build/commands/browser.js +0 -44
  110. package/build/commands/constant.d.ts +0 -19
  111. package/build/commands/constant.d.ts.map +0 -1
  112. package/build/commands/constant.js +0 -91
  113. package/build/commands/element/$$.d.ts +0 -46
  114. package/build/commands/element/$$.d.ts.map +0 -1
  115. package/build/commands/element/$$.js +0 -50
  116. package/build/commands/element/$.d.ts +0 -72
  117. package/build/commands/element/$.d.ts.map +0 -1
  118. package/build/commands/element/$.js +0 -76
  119. package/build/commands/element/addValue.d.ts +0 -33
  120. package/build/commands/element/addValue.d.ts.map +0 -1
  121. package/build/commands/element/addValue.js +0 -48
  122. package/build/commands/element/clearValue.d.ts +0 -28
  123. package/build/commands/element/clearValue.d.ts.map +0 -1
  124. package/build/commands/element/clearValue.js +0 -32
  125. package/build/commands/element/click.d.ts +0 -73
  126. package/build/commands/element/click.d.ts.map +0 -1
  127. package/build/commands/element/click.js +0 -134
  128. package/build/commands/element/custom$$.d.ts +0 -28
  129. package/build/commands/element/custom$$.d.ts.map +0 -1
  130. package/build/commands/element/custom$$.js +0 -57
  131. package/build/commands/element/custom$.d.ts +0 -27
  132. package/build/commands/element/custom$.d.ts.map +0 -1
  133. package/build/commands/element/custom$.js +0 -57
  134. package/build/commands/element/doubleClick.d.ts +0 -25
  135. package/build/commands/element/doubleClick.d.ts.map +0 -1
  136. package/build/commands/element/doubleClick.js +0 -51
  137. package/build/commands/element/dragAndDrop.d.ts +0 -41
  138. package/build/commands/element/dragAndDrop.d.ts.map +0 -1
  139. package/build/commands/element/dragAndDrop.js +0 -98
  140. package/build/commands/element/getAttribute.d.ts +0 -28
  141. package/build/commands/element/getAttribute.d.ts.map +0 -1
  142. package/build/commands/element/getAttribute.js +0 -32
  143. package/build/commands/element/getCSSProperty.d.ts +0 -71
  144. package/build/commands/element/getCSSProperty.d.ts.map +0 -1
  145. package/build/commands/element/getCSSProperty.js +0 -108
  146. package/build/commands/element/getComputedLabel.d.ts +0 -20
  147. package/build/commands/element/getComputedLabel.d.ts.map +0 -1
  148. package/build/commands/element/getComputedLabel.js +0 -24
  149. package/build/commands/element/getComputedRole.d.ts +0 -20
  150. package/build/commands/element/getComputedRole.d.ts.map +0 -1
  151. package/build/commands/element/getComputedRole.js +0 -24
  152. package/build/commands/element/getHTML.d.ts +0 -32
  153. package/build/commands/element/getHTML.d.ts.map +0 -1
  154. package/build/commands/element/getHTML.js +0 -46
  155. package/build/commands/element/getLocation.d.ts +0 -6
  156. package/build/commands/element/getLocation.d.ts.map +0 -1
  157. package/build/commands/element/getLocation.js +0 -46
  158. package/build/commands/element/getProperty.d.ts +0 -53
  159. package/build/commands/element/getProperty.d.ts.map +0 -1
  160. package/build/commands/element/getProperty.js +0 -31
  161. package/build/commands/element/getSize.d.ts +0 -6
  162. package/build/commands/element/getSize.d.ts.map +0 -1
  163. package/build/commands/element/getSize.js +0 -47
  164. package/build/commands/element/getTagName.d.ts +0 -25
  165. package/build/commands/element/getTagName.d.ts.map +0 -1
  166. package/build/commands/element/getTagName.js +0 -29
  167. package/build/commands/element/getText.d.ts +0 -42
  168. package/build/commands/element/getText.d.ts.map +0 -1
  169. package/build/commands/element/getText.js +0 -46
  170. package/build/commands/element/getValue.d.ts +0 -25
  171. package/build/commands/element/getValue.d.ts.map +0 -1
  172. package/build/commands/element/getValue.js +0 -33
  173. package/build/commands/element/isClickable.d.ts +0 -40
  174. package/build/commands/element/isClickable.d.ts.map +0 -1
  175. package/build/commands/element/isClickable.js +0 -57
  176. package/build/commands/element/isDisplayed.d.ts +0 -50
  177. package/build/commands/element/isDisplayed.d.ts.map +0 -1
  178. package/build/commands/element/isDisplayed.js +0 -85
  179. package/build/commands/element/isDisplayedInViewport.d.ts +0 -38
  180. package/build/commands/element/isDisplayedInViewport.d.ts.map +0 -1
  181. package/build/commands/element/isDisplayedInViewport.js +0 -55
  182. package/build/commands/element/isEnabled.d.ts +0 -34
  183. package/build/commands/element/isEnabled.d.ts.map +0 -1
  184. package/build/commands/element/isEnabled.js +0 -38
  185. package/build/commands/element/isEqual.d.ts +0 -24
  186. package/build/commands/element/isEqual.d.ts.map +0 -1
  187. package/build/commands/element/isEqual.js +0 -52
  188. package/build/commands/element/isExisting.d.ts +0 -49
  189. package/build/commands/element/isExisting.d.ts.map +0 -1
  190. package/build/commands/element/isExisting.js +0 -65
  191. package/build/commands/element/isFocused.d.ts +0 -28
  192. package/build/commands/element/isFocused.d.ts.map +0 -1
  193. package/build/commands/element/isFocused.js +0 -42
  194. package/build/commands/element/isSelected.d.ts +0 -31
  195. package/build/commands/element/isSelected.d.ts.map +0 -1
  196. package/build/commands/element/isSelected.js +0 -35
  197. package/build/commands/element/moveTo.d.ts +0 -21
  198. package/build/commands/element/moveTo.d.ts.map +0 -1
  199. package/build/commands/element/moveTo.js +0 -39
  200. package/build/commands/element/nextElement.d.ts +0 -25
  201. package/build/commands/element/nextElement.d.ts.map +0 -1
  202. package/build/commands/element/nextElement.js +0 -31
  203. package/build/commands/element/parentElement.d.ts +0 -25
  204. package/build/commands/element/parentElement.d.ts.map +0 -1
  205. package/build/commands/element/parentElement.js +0 -31
  206. package/build/commands/element/previousElement.d.ts +0 -25
  207. package/build/commands/element/previousElement.d.ts.map +0 -1
  208. package/build/commands/element/previousElement.js +0 -31
  209. package/build/commands/element/react$$.d.ts +0 -36
  210. package/build/commands/element/react$$.d.ts.map +0 -1
  211. package/build/commands/element/react$$.js +0 -51
  212. package/build/commands/element/react$.d.ts +0 -46
  213. package/build/commands/element/react$.d.ts.map +0 -1
  214. package/build/commands/element/react$.js +0 -59
  215. package/build/commands/element/saveScreenshot.d.ts +0 -21
  216. package/build/commands/element/saveScreenshot.d.ts.map +0 -1
  217. package/build/commands/element/saveScreenshot.js +0 -40
  218. package/build/commands/element/scrollIntoView.d.ts +0 -21
  219. package/build/commands/element/scrollIntoView.d.ts.map +0 -1
  220. package/build/commands/element/scrollIntoView.js +0 -31
  221. package/build/commands/element/selectByAttribute.d.ts +0 -37
  222. package/build/commands/element/selectByAttribute.d.ts.map +0 -1
  223. package/build/commands/element/selectByAttribute.js +0 -59
  224. package/build/commands/element/selectByIndex.d.ts +0 -31
  225. package/build/commands/element/selectByIndex.d.ts.map +0 -1
  226. package/build/commands/element/selectByIndex.js +0 -55
  227. package/build/commands/element/selectByVisibleText.d.ts +0 -31
  228. package/build/commands/element/selectByVisibleText.d.ts.map +0 -1
  229. package/build/commands/element/selectByVisibleText.js +0 -66
  230. package/build/commands/element/setValue.d.ts +0 -29
  231. package/build/commands/element/setValue.d.ts.map +0 -1
  232. package/build/commands/element/setValue.js +0 -33
  233. package/build/commands/element/shadow$$.d.ts +0 -22
  234. package/build/commands/element/shadow$$.d.ts.map +0 -1
  235. package/build/commands/element/shadow$$.js +0 -27
  236. package/build/commands/element/shadow$.d.ts +0 -22
  237. package/build/commands/element/shadow$.d.ts.map +0 -1
  238. package/build/commands/element/shadow$.js +0 -27
  239. package/build/commands/element/touchAction.d.ts +0 -54
  240. package/build/commands/element/touchAction.d.ts.map +0 -1
  241. package/build/commands/element/touchAction.js +0 -58
  242. package/build/commands/element/waitForClickable.d.ts +0 -34
  243. package/build/commands/element/waitForClickable.d.ts.map +0 -1
  244. package/build/commands/element/waitForClickable.js +0 -37
  245. package/build/commands/element/waitForDisplayed.d.ts +0 -44
  246. package/build/commands/element/waitForDisplayed.d.ts.map +0 -1
  247. package/build/commands/element/waitForDisplayed.js +0 -47
  248. package/build/commands/element/waitForEnabled.d.ts +0 -46
  249. package/build/commands/element/waitForEnabled.d.ts.map +0 -1
  250. package/build/commands/element/waitForEnabled.js +0 -55
  251. package/build/commands/element/waitForExist.d.ts +0 -46
  252. package/build/commands/element/waitForExist.d.ts.map +0 -1
  253. package/build/commands/element/waitForExist.js +0 -49
  254. package/build/commands/element/waitUntil.d.ts +0 -49
  255. package/build/commands/element/waitUntil.d.ts.map +0 -1
  256. package/build/commands/element/waitUntil.js +0 -53
  257. package/build/commands/element.d.ts +0 -100
  258. package/build/commands/element.d.ts.map +0 -1
  259. package/build/commands/element.js +0 -63
  260. package/build/commands/mock/abort.d.ts +0 -19
  261. package/build/commands/mock/abort.d.ts.map +0 -1
  262. package/build/commands/mock/abort.js +0 -20
  263. package/build/commands/mock/abortOnce.d.ts +0 -27
  264. package/build/commands/mock/abortOnce.d.ts.map +0 -1
  265. package/build/commands/mock/abortOnce.js +0 -28
  266. package/build/commands/mock/clear.d.ts +0 -18
  267. package/build/commands/mock/clear.d.ts.map +0 -1
  268. package/build/commands/mock/clear.js +0 -19
  269. package/build/commands/mock/respond.d.ts +0 -54
  270. package/build/commands/mock/respond.d.ts.map +0 -1
  271. package/build/commands/mock/respond.js +0 -55
  272. package/build/commands/mock/respondOnce.d.ts +0 -55
  273. package/build/commands/mock/respondOnce.d.ts.map +0 -1
  274. package/build/commands/mock/respondOnce.js +0 -56
  275. package/build/commands/mock/restore.d.ts +0 -18
  276. package/build/commands/mock/restore.d.ts.map +0 -1
  277. package/build/commands/mock/restore.js +0 -19
  278. package/build/constants.d.ts +0 -14
  279. package/build/constants.d.ts.map +0 -1
  280. package/build/constants.js +0 -286
  281. package/build/index.d.ts +0 -45
  282. package/build/index.d.ts.map +0 -1
  283. package/build/index.js +0 -171
  284. package/build/middlewares.d.ts +0 -12
  285. package/build/middlewares.d.ts.map +0 -1
  286. package/build/middlewares.js +0 -65
  287. package/build/multiremote.d.ts +0 -71
  288. package/build/multiremote.d.ts.map +0 -1
  289. package/build/multiremote.js +0 -160
  290. package/build/protocol-stub.d.ts +0 -16
  291. package/build/protocol-stub.d.ts.map +0 -1
  292. package/build/protocol-stub.js +0 -77
  293. package/build/scripts/getHTML.d.ts +0 -9
  294. package/build/scripts/getHTML.d.ts.map +0 -1
  295. package/build/scripts/getHTML.js +0 -13
  296. package/build/scripts/getProperty.d.ts +0 -43
  297. package/build/scripts/getProperty.d.ts.map +0 -1
  298. package/build/scripts/getProperty.js +0 -12
  299. package/build/scripts/isElementClickable.d.ts +0 -7
  300. package/build/scripts/isElementClickable.d.ts.map +0 -1
  301. package/build/scripts/isElementClickable.js +0 -121
  302. package/build/scripts/isElementDisplayed.d.ts +0 -7
  303. package/build/scripts/isElementDisplayed.d.ts.map +0 -1
  304. package/build/scripts/isElementDisplayed.js +0 -216
  305. package/build/scripts/isElementInViewport.d.ts +0 -10
  306. package/build/scripts/isElementInViewport.d.ts.map +0 -1
  307. package/build/scripts/isElementInViewport.js +0 -22
  308. package/build/scripts/isFocused.d.ts +0 -7
  309. package/build/scripts/isFocused.d.ts.map +0 -1
  310. package/build/scripts/isFocused.js +0 -11
  311. package/build/scripts/newWindow.d.ts +0 -10
  312. package/build/scripts/newWindow.d.ts.map +0 -1
  313. package/build/scripts/newWindow.js +0 -14
  314. package/build/scripts/resq.d.ts +0 -6
  315. package/build/scripts/resq.d.ts.map +0 -1
  316. package/build/scripts/resq.js +0 -58
  317. package/build/scripts/shadowFnFactory.d.ts +0 -2
  318. package/build/scripts/shadowFnFactory.d.ts.map +0 -1
  319. package/build/scripts/shadowFnFactory.js +0 -17
  320. package/build/types.d.ts +0 -402
  321. package/build/types.d.ts.map +0 -1
  322. package/build/types.js +0 -2
  323. package/build/utils/SevereServiceError.d.ts +0 -7
  324. package/build/utils/SevereServiceError.d.ts.map +0 -1
  325. package/build/utils/SevereServiceError.js +0 -12
  326. package/build/utils/Timer.d.ts +0 -33
  327. package/build/utils/Timer.d.ts.map +0 -1
  328. package/build/utils/Timer.js +0 -126
  329. package/build/utils/detectBackend.d.ts +0 -23
  330. package/build/utils/detectBackend.d.ts.map +0 -1
  331. package/build/utils/detectBackend.js +0 -119
  332. package/build/utils/findStrategy.d.ts +0 -10
  333. package/build/utils/findStrategy.d.ts.map +0 -1
  334. package/build/utils/findStrategy.js +0 -267
  335. package/build/utils/getElementObject.d.ts +0 -17
  336. package/build/utils/getElementObject.d.ts.map +0 -1
  337. package/build/utils/getElementObject.js +0 -107
  338. package/build/utils/implicitWait.d.ts +0 -7
  339. package/build/utils/implicitWait.d.ts.map +0 -1
  340. package/build/utils/implicitWait.js +0 -39
  341. package/build/utils/index.d.ts +0 -102
  342. package/build/utils/index.d.ts.map +0 -1
  343. package/build/utils/index.js +0 -543
  344. package/build/utils/interception/devtools.d.ts +0 -61
  345. package/build/utils/interception/devtools.d.ts.map +0 -1
  346. package/build/utils/interception/devtools.js +0 -247
  347. package/build/utils/interception/index.d.ts +0 -26
  348. package/build/utils/interception/index.d.ts.map +0 -1
  349. package/build/utils/interception/index.js +0 -49
  350. package/build/utils/interception/types.d.ts +0 -94
  351. package/build/utils/interception/types.d.ts.map +0 -1
  352. package/build/utils/interception/types.js +0 -2
  353. package/build/utils/interception/webdriver.d.ts +0 -48
  354. package/build/utils/interception/webdriver.d.ts.map +0 -1
  355. package/build/utils/interception/webdriver.js +0 -75
  356. package/build/utils/refetchElement.d.ts +0 -6
  357. package/build/utils/refetchElement.d.ts.map +0 -1
  358. package/build/utils/refetchElement.js +0 -32
@@ -1,54 +0,0 @@
1
- import type { TouchActions } from '../../types';
2
- /**
3
- *
4
- * The Touch Action API provides the basis of all gestures that can be automated in Appium.
5
- * It is currently only available to native apps and can not be used to interact with webapps.
6
- * At its core is the ability to chain together _ad hoc_ individual actions, which will then be
7
- * applied to an element in the application on the device. The basic actions that can be used are:
8
- *
9
- * - press (pass element or (x,y) or both)
10
- * - longPress (pass element or (x,y) or both)
11
- * - tap (pass element or (x,y) or both)
12
- * - moveTo (pass absolute x,y coordinates)
13
- * - wait (pass ms (as milliseconds))
14
- * - release (no arguments)
15
- *
16
- * <example>
17
- :touchAction.js
18
- it('should do a touch gesture', async () => {
19
- const screen = await $('//UITextbox');
20
-
21
- // simple touch action on element
22
- await screen.touchAction('tap');
23
-
24
- // simple touch action using selector and x y variables
25
- // tap location is 30px right and 20px down relative from the center of the element
26
- await screen.touchAction({
27
- action: 'tap', x: 30, y:20
28
- })
29
-
30
- // multi action on an element (drag&drop)
31
- await screen.touchAction([
32
- 'press',
33
- { action: 'moveTo', x: 200, y: 300 },
34
- 'release'
35
- ])
36
-
37
- // drag&drop to element
38
- const otherElement = await $('//UIAApplication[1]/UIAElement[2]')
39
- await screen.touchAction([
40
- 'press',
41
- { action: 'moveTo', element: otherElement },
42
- 'release'
43
- ])
44
- });
45
- * </example>
46
- *
47
- * @param {TouchActions} action action to execute
48
- *
49
- * @see https://saucelabs.com/blog/appium-sauce-labs-bootcamp-chapter-2-touch-actions
50
- * @for android, ios
51
- *
52
- */
53
- export default function touchAction(this: WebdriverIO.Element, actions: TouchActions): Promise<void>;
54
- //# sourceMappingURL=touchAction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"touchAction.d.ts","sourceRoot":"","sources":["../../../src/commands/element/touchAction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAC/B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,YAAY,iBAGxB"}
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const constant_1 = require("../constant");
4
- /**
5
- *
6
- * The Touch Action API provides the basis of all gestures that can be automated in Appium.
7
- * It is currently only available to native apps and can not be used to interact with webapps.
8
- * At its core is the ability to chain together _ad hoc_ individual actions, which will then be
9
- * applied to an element in the application on the device. The basic actions that can be used are:
10
- *
11
- * - press (pass element or (x,y) or both)
12
- * - longPress (pass element or (x,y) or both)
13
- * - tap (pass element or (x,y) or both)
14
- * - moveTo (pass absolute x,y coordinates)
15
- * - wait (pass ms (as milliseconds))
16
- * - release (no arguments)
17
- *
18
- * <example>
19
- :touchAction.js
20
- it('should do a touch gesture', async () => {
21
- const screen = await $('//UITextbox');
22
-
23
- // simple touch action on element
24
- await screen.touchAction('tap');
25
-
26
- // simple touch action using selector and x y variables
27
- // tap location is 30px right and 20px down relative from the center of the element
28
- await screen.touchAction({
29
- action: 'tap', x: 30, y:20
30
- })
31
-
32
- // multi action on an element (drag&drop)
33
- await screen.touchAction([
34
- 'press',
35
- { action: 'moveTo', x: 200, y: 300 },
36
- 'release'
37
- ])
38
-
39
- // drag&drop to element
40
- const otherElement = await $('//UIAApplication[1]/UIAElement[2]')
41
- await screen.touchAction([
42
- 'press',
43
- { action: 'moveTo', element: otherElement },
44
- 'release'
45
- ])
46
- });
47
- * </example>
48
- *
49
- * @param {TouchActions} action action to execute
50
- *
51
- * @see https://saucelabs.com/blog/appium-sauce-labs-bootcamp-chapter-2-touch-actions
52
- * @for android, ios
53
- *
54
- */
55
- function touchAction(actions) {
56
- return constant_1.touchAction.call(this, actions);
57
- }
58
- exports.default = touchAction;
@@ -1,34 +0,0 @@
1
- import type { WaitForOptions } from '../../types';
2
- /**
3
- * Wait for an element for the provided amount of milliseconds to be clickable or not clickable.
4
- *
5
- * :::info
6
- *
7
- * As opposed to other element commands WebdriverIO will not wait for the element to exist to execute
8
- * this command.
9
- *
10
- * :::
11
- *
12
- * <example>
13
- :waitForClickable.js
14
- it('should detect when element is clickable', async () => {
15
- const elem = await $('#elem')
16
- await elem.waitForClickable({ timeout: 3000 });
17
- });
18
- it('should detect when element is no longer clickable', async () => {
19
- const elem = await $('#elem')
20
- await elem.waitForClickable({ reverse: true });
21
- });
22
- * </example>
23
- *
24
- * @alias element.waitForClickable
25
- * @param {WaitForOptions=} options waitForEnabled options (optional)
26
- * @param {Number=} options.timeout time in ms (default: 500)
27
- * @param {Boolean=} options.reverse if true it waits for the opposite (default: false)
28
- * @param {String=} options.timeoutMsg if exists it overrides the default error message
29
- * @param {Number=} options.interval interval between checks (default: `waitforInterval`)
30
- * @return {Boolean} `true` if element is clickable (or doesn't if flag is set)
31
- *
32
- */
33
- export default function waitForClickable(this: WebdriverIO.Element, { timeout, interval, reverse, timeoutMsg }?: WaitForOptions): Promise<true | void>;
34
- //# sourceMappingURL=waitForClickable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"waitForClickable.d.ts","sourceRoot":"","sources":["../../../src/commands/element/waitForClickable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAA8B,gBAAgB,CAC1C,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EACI,OAAqC,EACrC,QAAuC,EACvC,OAAe,EACf,UAAsG,EACzG,GAAE,cAAmB,wBAMzB"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * Wait for an element for the provided amount of milliseconds to be clickable or not clickable.
5
- *
6
- * :::info
7
- *
8
- * As opposed to other element commands WebdriverIO will not wait for the element to exist to execute
9
- * this command.
10
- *
11
- * :::
12
- *
13
- * <example>
14
- :waitForClickable.js
15
- it('should detect when element is clickable', async () => {
16
- const elem = await $('#elem')
17
- await elem.waitForClickable({ timeout: 3000 });
18
- });
19
- it('should detect when element is no longer clickable', async () => {
20
- const elem = await $('#elem')
21
- await elem.waitForClickable({ reverse: true });
22
- });
23
- * </example>
24
- *
25
- * @alias element.waitForClickable
26
- * @param {WaitForOptions=} options waitForEnabled options (optional)
27
- * @param {Number=} options.timeout time in ms (default: 500)
28
- * @param {Boolean=} options.reverse if true it waits for the opposite (default: false)
29
- * @param {String=} options.timeoutMsg if exists it overrides the default error message
30
- * @param {Number=} options.interval interval between checks (default: `waitforInterval`)
31
- * @return {Boolean} `true` if element is clickable (or doesn't if flag is set)
32
- *
33
- */
34
- async function waitForClickable({ timeout = this.options.waitforTimeout, interval = this.options.waitforInterval, reverse = false, timeoutMsg = `element ("${this.selector}") still ${reverse ? '' : 'not '}clickable after ${timeout}ms` } = {}) {
35
- return this.waitUntil(async () => reverse !== await this.isClickable(), { timeout, timeoutMsg, interval });
36
- }
37
- exports.default = waitForClickable;
@@ -1,44 +0,0 @@
1
- import type { WaitForOptions } from '../../types';
2
- /**
3
- *
4
- * Wait for an element for the provided amount of milliseconds to be displayed or not displayed.
5
- *
6
- * :::info
7
- *
8
- * As opposed to other element commands WebdriverIO will not wait for the element to exist to execute
9
- * this command.
10
- *
11
- * :::
12
- *
13
- * <example>
14
- :index.html
15
- <div id="elem" style="visibility: hidden;">Hello World!</div>
16
- <script type="text/javascript">
17
- setTimeout(() => {
18
- document.getElementById('elem').style.visibility = 'visible';
19
- }, 2000);
20
- </script>
21
- :waitForDisplayedExample.js
22
- it('should detect when element is visible', async () => {
23
- const elem = await $('#elem')
24
- await elem.waitForDisplayed({ timeout: 3000 });
25
- });
26
- it('should detect when element is no longer visible', async () => {
27
- const elem = await $('#elem')
28
- await elem.waitForDisplayed({ reverse: true });
29
- });
30
- * </example>
31
- *
32
- * @alias element.waitForDisplayed
33
- * @param {WaitForOptions=} options waitForEnabled options (optional)
34
- * @param {Number=} options.timeout time in ms (default: 500)
35
- * @param {Boolean=} options.reverse if true it waits for the opposite (default: false)
36
- * @param {String=} options.timeoutMsg if exists it overrides the default error message
37
- * @param {Number=} options.interval interval between checks (default: `waitforInterval`)
38
- * @return {Boolean} true if element is displayed (or doesn't if flag is set)
39
- * @uses utility/waitUntil, state/isDisplayed
40
- * @type utility
41
- *
42
- */
43
- export default function waitForDisplayed(this: WebdriverIO.Element, { timeout, interval, reverse, timeoutMsg }?: WaitForOptions): Promise<true | void>;
44
- //# sourceMappingURL=waitForDisplayed.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"waitForDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/waitForDisplayed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAA8B,gBAAgB,CAC1C,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EACI,OAAqC,EACrC,QAAuC,EACvC,OAAe,EACf,UAAsG,EACzG,GAAE,cAAmB,wBAMzB"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- *
5
- * Wait for an element for the provided amount of milliseconds to be displayed or not displayed.
6
- *
7
- * :::info
8
- *
9
- * As opposed to other element commands WebdriverIO will not wait for the element to exist to execute
10
- * this command.
11
- *
12
- * :::
13
- *
14
- * <example>
15
- :index.html
16
- <div id="elem" style="visibility: hidden;">Hello World!</div>
17
- <script type="text/javascript">
18
- setTimeout(() => {
19
- document.getElementById('elem').style.visibility = 'visible';
20
- }, 2000);
21
- </script>
22
- :waitForDisplayedExample.js
23
- it('should detect when element is visible', async () => {
24
- const elem = await $('#elem')
25
- await elem.waitForDisplayed({ timeout: 3000 });
26
- });
27
- it('should detect when element is no longer visible', async () => {
28
- const elem = await $('#elem')
29
- await elem.waitForDisplayed({ reverse: true });
30
- });
31
- * </example>
32
- *
33
- * @alias element.waitForDisplayed
34
- * @param {WaitForOptions=} options waitForEnabled options (optional)
35
- * @param {Number=} options.timeout time in ms (default: 500)
36
- * @param {Boolean=} options.reverse if true it waits for the opposite (default: false)
37
- * @param {String=} options.timeoutMsg if exists it overrides the default error message
38
- * @param {Number=} options.interval interval between checks (default: `waitforInterval`)
39
- * @return {Boolean} true if element is displayed (or doesn't if flag is set)
40
- * @uses utility/waitUntil, state/isDisplayed
41
- * @type utility
42
- *
43
- */
44
- async function waitForDisplayed({ timeout = this.options.waitforTimeout, interval = this.options.waitforInterval, reverse = false, timeoutMsg = `element ("${this.selector}") still ${reverse ? '' : 'not '}displayed after ${timeout}ms` } = {}) {
45
- return this.waitUntil(async () => reverse !== await this.isDisplayed(), { timeout, interval, timeoutMsg });
46
- }
47
- exports.default = waitForDisplayed;
@@ -1,46 +0,0 @@
1
- import type { WaitForOptions } from '../../types';
2
- /**
3
- *
4
- * Wait for an element (selected by css selector) for the provided amount of
5
- * milliseconds to be (dis/en)abled. If multiple elements get queried by given
6
- * selector, it returns true if at least one element is (dis/en)abled.
7
- *
8
- * :::info
9
- *
10
- * As opposed to other element commands WebdriverIO will not wait for the element
11
- * to exist to execute this command.
12
- *
13
- * :::
14
- *
15
- * <example>
16
- :index.html
17
- <input type="text" id="username" value="foobar" disabled="disabled"></input>
18
- <script type="text/javascript">
19
- setTimeout(() => {
20
- document.getElementById('username').disabled = false
21
- }, 2000);
22
- </script>
23
- :waitForEnabledExample.js
24
- it('should detect when element is enabled', async () => {
25
- await $('#username').waitForEnabled({ timeout: 3000 });
26
- });
27
-
28
- it('should detect when element is disabled', async () => {
29
- elem = await $('#username');
30
- await elem.waitForEnabled({ reverse: true })
31
- });
32
- * </example>
33
- *
34
- * @alias element.waitForEnabled
35
- * @param {WaitForOptions=} options waitForEnabled options (optional)
36
- * @param {Number=} options.timeout time in ms (default: 500)
37
- * @param {Boolean=} options.reverse if true it waits for the opposite (default: false)
38
- * @param {String=} options.timeoutMsg if exists it overrides the default error message
39
- * @param {Number=} options.interval interval between checks (default: `waitforInterval`)
40
- * @return {Boolean} true if element is (dis/en)abled
41
- * @uses utility/waitUntil, state/isEnabled
42
- * @type utility
43
- *
44
- */
45
- export default function waitForEnabled(this: WebdriverIO.Element, { timeout, interval, reverse, timeoutMsg }?: WaitForOptions): Promise<true | void>;
46
- //# sourceMappingURL=waitForEnabled.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"waitForEnabled.d.ts","sourceRoot":"","sources":["../../../src/commands/element/waitForEnabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAA8B,cAAc,CACxC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EACI,OAAqC,EACrC,QAAuC,EACvC,OAAe,EACf,UAAoG,EACvG,GAAE,cAAmB,wBAazB"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- *
5
- * Wait for an element (selected by css selector) for the provided amount of
6
- * milliseconds to be (dis/en)abled. If multiple elements get queried by given
7
- * selector, it returns true if at least one element is (dis/en)abled.
8
- *
9
- * :::info
10
- *
11
- * As opposed to other element commands WebdriverIO will not wait for the element
12
- * to exist to execute this command.
13
- *
14
- * :::
15
- *
16
- * <example>
17
- :index.html
18
- <input type="text" id="username" value="foobar" disabled="disabled"></input>
19
- <script type="text/javascript">
20
- setTimeout(() => {
21
- document.getElementById('username').disabled = false
22
- }, 2000);
23
- </script>
24
- :waitForEnabledExample.js
25
- it('should detect when element is enabled', async () => {
26
- await $('#username').waitForEnabled({ timeout: 3000 });
27
- });
28
-
29
- it('should detect when element is disabled', async () => {
30
- elem = await $('#username');
31
- await elem.waitForEnabled({ reverse: true })
32
- });
33
- * </example>
34
- *
35
- * @alias element.waitForEnabled
36
- * @param {WaitForOptions=} options waitForEnabled options (optional)
37
- * @param {Number=} options.timeout time in ms (default: 500)
38
- * @param {Boolean=} options.reverse if true it waits for the opposite (default: false)
39
- * @param {String=} options.timeoutMsg if exists it overrides the default error message
40
- * @param {Number=} options.interval interval between checks (default: `waitforInterval`)
41
- * @return {Boolean} true if element is (dis/en)abled
42
- * @uses utility/waitUntil, state/isEnabled
43
- * @type utility
44
- *
45
- */
46
- async function waitForEnabled({ timeout = this.options.waitforTimeout, interval = this.options.waitforInterval, reverse = false, timeoutMsg = `element ("${this.selector}") still ${reverse ? '' : 'not '}enabled after ${timeout}ms` } = {}) {
47
- /**
48
- * if the element doesn't already exist, wait for it to exist
49
- */
50
- if (!this.elementId && !reverse) {
51
- await this.waitForExist({ timeout, interval, timeoutMsg });
52
- }
53
- return this.waitUntil(async () => reverse !== await this.isEnabled(), { timeout, interval, timeoutMsg });
54
- }
55
- exports.default = waitForEnabled;
@@ -1,46 +0,0 @@
1
- import type { WaitForOptions } from '../../types';
2
- /**
3
- *
4
- * Wait for an element for the provided amount of
5
- * milliseconds to be present within the DOM. Returns true if the selector
6
- * matches at least one element that exists in the DOM, otherwise throws an
7
- * error. If the reverse flag is true, the command will instead return true
8
- * if the selector does not match any elements.
9
- *
10
- * :::info
11
- *
12
- * As opposed to other element commands WebdriverIO will not wait for the
13
- * element to exist to execute this command.
14
- *
15
- * :::
16
- *
17
- * <example>
18
- :waitForExistSyncExample.js
19
- it('should display a notification message after successful form submit', async () => {
20
- const form = await $('form');
21
- const notification = await $('.notification');
22
- await form.$(".send").click();
23
- await notification.waitForExist({ timeout: 5000 });
24
- expect(await notification.getText()).to.be.equal('Data transmitted successfully!')
25
- });
26
- it('should remove a message after successful form submit', async () => {
27
- const form = await $('form');
28
- const message = await $('.message');
29
- await form.$(".send").click();
30
- await message.waitForExist({ reverse: true });
31
- });
32
- * </example>
33
- *
34
- * @alias element.waitForExist
35
- * @param {WaitForOptions=} options waitForEnabled options (optional)
36
- * @param {Number=} options.timeout time in ms (default: 500)
37
- * @param {Boolean=} options.reverse if true it waits for the opposite (default: false)
38
- * @param {String=} options.timeoutMsg if exists it overrides the default error message
39
- * @param {Number=} options.interval interval between checks (default: `waitforInterval`)
40
- * @return {Boolean} true if element exists (or doesn't if flag is set)
41
- * @uses utility/waitUntil, state/isExisting
42
- * @type utility
43
- *
44
- */
45
- export default function waitForExist(this: WebdriverIO.Element, { timeout, interval, reverse, timeoutMsg }?: WaitForOptions): Promise<true | void>;
46
- //# sourceMappingURL=waitForExist.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"waitForExist.d.ts","sourceRoot":"","sources":["../../../src/commands/element/waitForExist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EACI,OAAqC,EACrC,QAAuC,EACvC,OAAe,EACf,UAAqG,EACxG,GAAE,cAAmB,wBAMzB"}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- *
5
- * Wait for an element for the provided amount of
6
- * milliseconds to be present within the DOM. Returns true if the selector
7
- * matches at least one element that exists in the DOM, otherwise throws an
8
- * error. If the reverse flag is true, the command will instead return true
9
- * if the selector does not match any elements.
10
- *
11
- * :::info
12
- *
13
- * As opposed to other element commands WebdriverIO will not wait for the
14
- * element to exist to execute this command.
15
- *
16
- * :::
17
- *
18
- * <example>
19
- :waitForExistSyncExample.js
20
- it('should display a notification message after successful form submit', async () => {
21
- const form = await $('form');
22
- const notification = await $('.notification');
23
- await form.$(".send").click();
24
- await notification.waitForExist({ timeout: 5000 });
25
- expect(await notification.getText()).to.be.equal('Data transmitted successfully!')
26
- });
27
- it('should remove a message after successful form submit', async () => {
28
- const form = await $('form');
29
- const message = await $('.message');
30
- await form.$(".send").click();
31
- await message.waitForExist({ reverse: true });
32
- });
33
- * </example>
34
- *
35
- * @alias element.waitForExist
36
- * @param {WaitForOptions=} options waitForEnabled options (optional)
37
- * @param {Number=} options.timeout time in ms (default: 500)
38
- * @param {Boolean=} options.reverse if true it waits for the opposite (default: false)
39
- * @param {String=} options.timeoutMsg if exists it overrides the default error message
40
- * @param {Number=} options.interval interval between checks (default: `waitforInterval`)
41
- * @return {Boolean} true if element exists (or doesn't if flag is set)
42
- * @uses utility/waitUntil, state/isExisting
43
- * @type utility
44
- *
45
- */
46
- function waitForExist({ timeout = this.options.waitforTimeout, interval = this.options.waitforInterval, reverse = false, timeoutMsg = `element ("${this.selector}") still ${reverse ? '' : 'not '}existing after ${timeout}ms` } = {}) {
47
- return this.waitUntil(async () => reverse !== await this.isExisting(), { timeout, interval, timeoutMsg });
48
- }
49
- exports.default = waitForExist;
@@ -1,49 +0,0 @@
1
- /**
2
- *
3
- * This wait command is your universal weapon if you want to wait on something. It expects a condition
4
- * and waits until that condition is fulfilled with a truthy value. If you use the WDIO testrunner the
5
- * commands within the condition are getting executed synchronously like in your test.
6
- *
7
- * :::info
8
- *
9
- * As opposed to other element commands WebdriverIO will not wait for the element to exist to execute
10
- * this command.
11
- *
12
- * :::
13
- *
14
- * A common example is to wait until a certain element contains a certain text (see example).
15
- *
16
- * <example>
17
- :example.html
18
- <div id="someText">I am some text</div>
19
- <script>
20
- setTimeout(() => {
21
- await $('#someText').html('I am now different');
22
- }, 1000);
23
- </script>
24
-
25
- :waitUntil.js
26
- it('should wait until text has changed', async () => {
27
- const elem = await $('#someText')
28
- await elem.waitUntil(async function () {
29
- return (await this.getText()) === 'I am now different'
30
- }, {
31
- timeout: 5000,
32
- timeoutMsg: 'expected text to be different after 5s'
33
- });
34
- });
35
- * </example>
36
- *
37
- * @alias element.waitUntil
38
- * @param {Function#Boolean} condition condition to wait on
39
- * @param {WaitUntilOptions=} options command options
40
- * @param {Number=} options.timeout timeout in ms (default: 5000)
41
- * @param {String=} options.timeoutMsg error message to throw when waitUntil times out
42
- * @param {Number=} options.interval interval between condition checks (default: 500)
43
- * @return {Boolean} true if condition is fulfilled
44
- * @type utility
45
- *
46
- */
47
- import waitUntil from '../browser/waitUntil';
48
- export default waitUntil;
49
- //# sourceMappingURL=waitUntil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"waitUntil.d.ts","sourceRoot":"","sources":["../../../src/commands/element/waitUntil.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAC5C,eAAe,SAAS,CAAA"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- /**
7
- *
8
- * This wait command is your universal weapon if you want to wait on something. It expects a condition
9
- * and waits until that condition is fulfilled with a truthy value. If you use the WDIO testrunner the
10
- * commands within the condition are getting executed synchronously like in your test.
11
- *
12
- * :::info
13
- *
14
- * As opposed to other element commands WebdriverIO will not wait for the element to exist to execute
15
- * this command.
16
- *
17
- * :::
18
- *
19
- * A common example is to wait until a certain element contains a certain text (see example).
20
- *
21
- * <example>
22
- :example.html
23
- <div id="someText">I am some text</div>
24
- <script>
25
- setTimeout(() => {
26
- await $('#someText').html('I am now different');
27
- }, 1000);
28
- </script>
29
-
30
- :waitUntil.js
31
- it('should wait until text has changed', async () => {
32
- const elem = await $('#someText')
33
- await elem.waitUntil(async function () {
34
- return (await this.getText()) === 'I am now different'
35
- }, {
36
- timeout: 5000,
37
- timeoutMsg: 'expected text to be different after 5s'
38
- });
39
- });
40
- * </example>
41
- *
42
- * @alias element.waitUntil
43
- * @param {Function#Boolean} condition condition to wait on
44
- * @param {WaitUntilOptions=} options command options
45
- * @param {Number=} options.timeout timeout in ms (default: 5000)
46
- * @param {String=} options.timeoutMsg error message to throw when waitUntil times out
47
- * @param {Number=} options.interval interval between condition checks (default: 500)
48
- * @return {Boolean} true if condition is fulfilled
49
- * @type utility
50
- *
51
- */
52
- const waitUntil_1 = __importDefault(require("../browser/waitUntil"));
53
- exports.default = waitUntil_1.default;