playwright-ruby-client 0.0.8 → 1.58.1.alpha1

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 (209) hide show
  1. checksums.yaml +4 -4
  2. data/AGENTS.md +4 -0
  3. data/CLAUDE/api_generation.md +28 -0
  4. data/CLAUDE/ci_expectations.md +23 -0
  5. data/CLAUDE/gem_release_flow.md +39 -0
  6. data/CLAUDE/past_upgrade_pr_patterns.md +42 -0
  7. data/CLAUDE/playwright_upgrade_workflow.md +35 -0
  8. data/CLAUDE/rspec_debugging.md +30 -0
  9. data/CLAUDE/unimplemented_examples.md +18 -0
  10. data/CLAUDE.md +32 -0
  11. data/CONTRIBUTING.md +5 -0
  12. data/README.md +60 -16
  13. data/documentation/README.md +33 -0
  14. data/documentation/babel.config.js +3 -0
  15. data/documentation/docs/api/api_request.md +7 -0
  16. data/documentation/docs/api/api_request_context.md +298 -0
  17. data/documentation/docs/api/api_response.md +114 -0
  18. data/documentation/docs/api/browser.md +237 -0
  19. data/documentation/docs/api/browser_context.md +503 -0
  20. data/documentation/docs/api/browser_type.md +184 -0
  21. data/documentation/docs/api/cdp_session.md +44 -0
  22. data/documentation/docs/api/clock.md +154 -0
  23. data/documentation/docs/api/console_message.md +85 -0
  24. data/documentation/docs/api/dialog.md +84 -0
  25. data/documentation/docs/api/download.md +111 -0
  26. data/documentation/docs/api/element_handle.md +694 -0
  27. data/documentation/docs/api/experimental/_category_.yml +3 -0
  28. data/documentation/docs/api/experimental/android.md +42 -0
  29. data/documentation/docs/api/experimental/android_device.md +109 -0
  30. data/documentation/docs/api/experimental/android_input.md +43 -0
  31. data/documentation/docs/api/experimental/android_socket.md +7 -0
  32. data/documentation/docs/api/experimental/android_web_view.md +7 -0
  33. data/documentation/docs/api/file_chooser.md +53 -0
  34. data/documentation/docs/api/frame.md +1218 -0
  35. data/documentation/docs/api/frame_locator.md +348 -0
  36. data/documentation/docs/api/js_handle.md +121 -0
  37. data/documentation/docs/api/keyboard.md +170 -0
  38. data/documentation/docs/api/locator.md +1495 -0
  39. data/documentation/docs/api/locator_assertions.md +827 -0
  40. data/documentation/docs/api/mouse.md +86 -0
  41. data/documentation/docs/api/page.md +1946 -0
  42. data/documentation/docs/api/page_assertions.md +65 -0
  43. data/documentation/docs/api/playwright.md +66 -0
  44. data/documentation/docs/api/request.md +255 -0
  45. data/documentation/docs/api/response.md +176 -0
  46. data/documentation/docs/api/route.md +205 -0
  47. data/documentation/docs/api/selectors.md +63 -0
  48. data/documentation/docs/api/touchscreen.md +22 -0
  49. data/documentation/docs/api/tracing.md +129 -0
  50. data/documentation/docs/api/web_socket.md +51 -0
  51. data/documentation/docs/api/worker.md +83 -0
  52. data/documentation/docs/article/api_coverage.mdx +11 -0
  53. data/documentation/docs/article/getting_started.md +161 -0
  54. data/documentation/docs/article/guides/_category_.yml +3 -0
  55. data/documentation/docs/article/guides/download_playwright_driver.md +55 -0
  56. data/documentation/docs/article/guides/inspector.md +31 -0
  57. data/documentation/docs/article/guides/launch_browser.md +121 -0
  58. data/documentation/docs/article/guides/playwright_on_alpine_linux.md +112 -0
  59. data/documentation/docs/article/guides/rails_integration.md +278 -0
  60. data/documentation/docs/article/guides/rails_integration_with_null_driver.md +145 -0
  61. data/documentation/docs/article/guides/recording_video.md +79 -0
  62. data/documentation/docs/article/guides/rspec_integration.md +59 -0
  63. data/documentation/docs/article/guides/semi_automation.md +71 -0
  64. data/documentation/docs/article/guides/use_storage_state.md +78 -0
  65. data/documentation/docs/include/api_coverage.md +671 -0
  66. data/documentation/docusaurus.config.js +114 -0
  67. data/documentation/package.json +39 -0
  68. data/documentation/sidebars.js +15 -0
  69. data/documentation/src/components/HomepageFeatures.js +61 -0
  70. data/documentation/src/components/HomepageFeatures.module.css +13 -0
  71. data/documentation/src/css/custom.css +44 -0
  72. data/documentation/src/pages/index.js +49 -0
  73. data/documentation/src/pages/index.module.css +41 -0
  74. data/documentation/src/pages/markdown-page.md +7 -0
  75. data/documentation/static/.nojekyll +0 -0
  76. data/documentation/static/img/playwright-logo.svg +9 -0
  77. data/documentation/static/img/playwright-ruby-client.png +0 -0
  78. data/documentation/static/img/undraw_dropdown_menu.svg +1 -0
  79. data/documentation/static/img/undraw_web_development.svg +1 -0
  80. data/documentation/static/img/undraw_windows.svg +1 -0
  81. data/documentation/yarn.lock +9005 -0
  82. data/lib/playwright/{input_types/android_input.rb → android_input_impl.rb} +5 -1
  83. data/lib/playwright/api_implementation.rb +18 -0
  84. data/lib/playwright/api_response_impl.rb +77 -0
  85. data/lib/playwright/channel.rb +62 -1
  86. data/lib/playwright/channel_owner.rb +70 -7
  87. data/lib/playwright/channel_owners/android.rb +16 -3
  88. data/lib/playwright/channel_owners/android_device.rb +22 -66
  89. data/lib/playwright/channel_owners/api_request_context.rb +247 -0
  90. data/lib/playwright/channel_owners/artifact.rb +40 -0
  91. data/lib/playwright/channel_owners/binding_call.rb +70 -0
  92. data/lib/playwright/channel_owners/browser.rb +114 -22
  93. data/lib/playwright/channel_owners/browser_context.rb +589 -15
  94. data/lib/playwright/channel_owners/browser_type.rb +90 -1
  95. data/lib/playwright/channel_owners/cdp_session.rb +19 -0
  96. data/lib/playwright/channel_owners/dialog.rb +32 -0
  97. data/lib/playwright/channel_owners/element_handle.rb +107 -43
  98. data/lib/playwright/channel_owners/fetch_request.rb +8 -0
  99. data/lib/playwright/channel_owners/frame.rb +334 -104
  100. data/lib/playwright/channel_owners/js_handle.rb +9 -13
  101. data/lib/playwright/channel_owners/local_utils.rb +82 -0
  102. data/lib/playwright/channel_owners/page.rb +778 -95
  103. data/lib/playwright/channel_owners/playwright.rb +25 -30
  104. data/lib/playwright/channel_owners/request.rb +120 -18
  105. data/lib/playwright/channel_owners/response.rb +113 -0
  106. data/lib/playwright/channel_owners/route.rb +181 -0
  107. data/lib/playwright/channel_owners/stream.rb +30 -0
  108. data/lib/playwright/channel_owners/tracing.rb +117 -0
  109. data/lib/playwright/channel_owners/web_socket.rb +96 -0
  110. data/lib/playwright/channel_owners/worker.rb +46 -0
  111. data/lib/playwright/channel_owners/writable_stream.rb +14 -0
  112. data/lib/playwright/clock_impl.rb +67 -0
  113. data/lib/playwright/connection.rb +111 -63
  114. data/lib/playwright/console_message_impl.rb +29 -0
  115. data/lib/playwright/download_impl.rb +32 -0
  116. data/lib/playwright/errors.rb +42 -5
  117. data/lib/playwright/event_emitter.rb +17 -3
  118. data/lib/playwright/event_emitter_proxy.rb +49 -0
  119. data/lib/playwright/events.rb +10 -5
  120. data/lib/playwright/file_chooser_impl.rb +24 -0
  121. data/lib/playwright/frame_locator_impl.rb +66 -0
  122. data/lib/playwright/har_router.rb +89 -0
  123. data/lib/playwright/http_headers.rb +14 -0
  124. data/lib/playwright/input_files.rb +102 -15
  125. data/lib/playwright/javascript/expression.rb +7 -11
  126. data/lib/playwright/javascript/regex.rb +23 -0
  127. data/lib/playwright/javascript/source_url.rb +16 -0
  128. data/lib/playwright/javascript/value_parser.rb +108 -19
  129. data/lib/playwright/javascript/value_serializer.rb +47 -8
  130. data/lib/playwright/javascript/visitor_info.rb +26 -0
  131. data/lib/playwright/javascript.rb +2 -10
  132. data/lib/playwright/{input_types/keyboard.rb → keyboard_impl.rb} +6 -2
  133. data/lib/playwright/locator_assertions_impl.rb +571 -0
  134. data/lib/playwright/locator_impl.rb +544 -0
  135. data/lib/playwright/locator_utils.rb +136 -0
  136. data/lib/playwright/mouse_impl.rb +57 -0
  137. data/lib/playwright/page_assertions_impl.rb +154 -0
  138. data/lib/playwright/playwright_api.rb +102 -30
  139. data/lib/playwright/raw_headers.rb +61 -0
  140. data/lib/playwright/route_handler.rb +78 -0
  141. data/lib/playwright/select_option_values.rb +34 -13
  142. data/lib/playwright/selectors_impl.rb +45 -0
  143. data/lib/playwright/test.rb +102 -0
  144. data/lib/playwright/timeout_settings.rb +9 -4
  145. data/lib/playwright/touchscreen_impl.rb +14 -0
  146. data/lib/playwright/transport.rb +61 -10
  147. data/lib/playwright/url_matcher.rb +24 -2
  148. data/lib/playwright/utils.rb +48 -13
  149. data/lib/playwright/version.rb +2 -1
  150. data/lib/playwright/video.rb +54 -0
  151. data/lib/playwright/waiter.rb +166 -0
  152. data/lib/playwright/web_socket_client.rb +167 -0
  153. data/lib/playwright/web_socket_transport.rb +116 -0
  154. data/lib/playwright.rb +188 -11
  155. data/lib/playwright_api/android.rb +46 -11
  156. data/lib/playwright_api/android_device.rb +182 -31
  157. data/lib/playwright_api/android_input.rb +22 -13
  158. data/lib/playwright_api/android_socket.rb +18 -0
  159. data/lib/playwright_api/android_web_view.rb +24 -0
  160. data/lib/playwright_api/api_request.rb +26 -0
  161. data/lib/playwright_api/api_request_context.rb +311 -0
  162. data/lib/playwright_api/api_response.rb +92 -0
  163. data/lib/playwright_api/browser.rb +116 -103
  164. data/lib/playwright_api/browser_context.rb +290 -389
  165. data/lib/playwright_api/browser_type.rb +96 -118
  166. data/lib/playwright_api/cdp_session.rb +36 -39
  167. data/lib/playwright_api/clock.rb +121 -0
  168. data/lib/playwright_api/console_message.rb +35 -19
  169. data/lib/playwright_api/dialog.rb +53 -50
  170. data/lib/playwright_api/download.rb +49 -43
  171. data/lib/playwright_api/element_handle.rb +354 -402
  172. data/lib/playwright_api/file_chooser.rb +15 -18
  173. data/lib/playwright_api/frame.rb +703 -603
  174. data/lib/playwright_api/frame_locator.rb +285 -0
  175. data/lib/playwright_api/js_handle.rb +50 -76
  176. data/lib/playwright_api/keyboard.rb +67 -146
  177. data/lib/playwright_api/locator.rb +1304 -0
  178. data/lib/playwright_api/locator_assertions.rb +704 -0
  179. data/lib/playwright_api/mouse.rb +23 -29
  180. data/lib/playwright_api/page.rb +1196 -1176
  181. data/lib/playwright_api/page_assertions.rb +60 -0
  182. data/lib/playwright_api/playwright.rb +54 -122
  183. data/lib/playwright_api/request.rb +112 -74
  184. data/lib/playwright_api/response.rb +92 -20
  185. data/lib/playwright_api/route.rb +152 -62
  186. data/lib/playwright_api/selectors.rb +47 -61
  187. data/lib/playwright_api/touchscreen.rb +8 -2
  188. data/lib/playwright_api/tracing.rb +128 -0
  189. data/lib/playwright_api/web_socket.rb +43 -5
  190. data/lib/playwright_api/worker.rb +74 -34
  191. data/playwright.gemspec +14 -9
  192. data/sig/playwright.rbs +658 -0
  193. metadata +216 -50
  194. data/docs/api_coverage.md +0 -354
  195. data/lib/playwright/channel_owners/chromium_browser.rb +0 -8
  196. data/lib/playwright/channel_owners/chromium_browser_context.rb +0 -8
  197. data/lib/playwright/channel_owners/console_message.rb +0 -21
  198. data/lib/playwright/channel_owners/firefox_browser.rb +0 -8
  199. data/lib/playwright/channel_owners/selectors.rb +0 -4
  200. data/lib/playwright/channel_owners/webkit_browser.rb +0 -8
  201. data/lib/playwright/input_type.rb +0 -19
  202. data/lib/playwright/input_types/mouse.rb +0 -4
  203. data/lib/playwright/input_types/touchscreen.rb +0 -4
  204. data/lib/playwright/javascript/function.rb +0 -67
  205. data/lib/playwright/wait_helper.rb +0 -73
  206. data/lib/playwright_api/accessibility.rb +0 -93
  207. data/lib/playwright_api/binding_call.rb +0 -23
  208. data/lib/playwright_api/chromium_browser_context.rb +0 -57
  209. data/lib/playwright_api/video.rb +0 -24
@@ -1,78 +1,229 @@
1
1
  module Playwright
2
- # @nodoc
2
+ #
3
+ # `AndroidDevice` represents a connected device, either real hardware or emulated. Devices can be obtained using [`method: Android.devices`].
3
4
  class AndroidDevice < PlaywrightApi
4
5
 
5
- # @nodoc
6
- def tree
7
- wrap_impl(@impl.tree)
6
+ def input # property
7
+ wrap_impl(@impl.input)
8
8
  end
9
9
 
10
- # @nodoc
10
+ #
11
+ # Disconnects from the device.
11
12
  def close
12
13
  wrap_impl(@impl.close)
13
14
  end
14
15
 
15
- # @nodoc
16
- def after_initialize
17
- wrap_impl(@impl.after_initialize)
16
+ #
17
+ # Drags the widget defined by `selector` towards `dest` point.
18
+ def drag(selector, dest, speed: nil)
19
+ raise NotImplementedError.new('drag is not implemented yet.')
18
20
  end
19
21
 
20
- # @nodoc
21
- def tap_on(selector, duration: nil, timeout: nil)
22
- wrap_impl(@impl.tap_on(unwrap_impl(selector), duration: unwrap_impl(duration), timeout: unwrap_impl(timeout)))
22
+ #
23
+ # Fills the specific `selector` input box with `text`.
24
+ def fill(selector, text)
25
+ raise NotImplementedError.new('fill is not implemented yet.')
23
26
  end
24
27
 
25
- # @nodoc
28
+ #
29
+ # Flings the widget defined by `selector` in the specified `direction`.
30
+ def fling(selector, direction, speed: nil)
31
+ raise NotImplementedError.new('fling is not implemented yet.')
32
+ end
33
+
34
+ #
35
+ # Returns information about a widget defined by `selector`.
36
+ def info(selector)
37
+ wrap_impl(@impl.info(unwrap_impl(selector)))
38
+ end
39
+
40
+ #
41
+ # Installs an apk on the device.
42
+ def install_apk(file, args: nil)
43
+ raise NotImplementedError.new('install_apk is not implemented yet.')
44
+ end
45
+
46
+ #
47
+ # Launches Chrome browser on the device, and returns its persistent context.
48
+ def launch_browser(
49
+ acceptDownloads: nil,
50
+ args: nil,
51
+ baseURL: nil,
52
+ bypassCSP: nil,
53
+ colorScheme: nil,
54
+ contrast: nil,
55
+ deviceScaleFactor: nil,
56
+ extraHTTPHeaders: nil,
57
+ forcedColors: nil,
58
+ geolocation: nil,
59
+ hasTouch: nil,
60
+ httpCredentials: nil,
61
+ ignoreHTTPSErrors: nil,
62
+ isMobile: nil,
63
+ javaScriptEnabled: nil,
64
+ locale: nil,
65
+ noViewport: nil,
66
+ offline: nil,
67
+ permissions: nil,
68
+ pkg: nil,
69
+ proxy: nil,
70
+ record_har_content: nil,
71
+ record_har_mode: nil,
72
+ record_har_omit_content: nil,
73
+ record_har_path: nil,
74
+ record_har_url_filter: nil,
75
+ record_video_dir: nil,
76
+ record_video_size: nil,
77
+ reducedMotion: nil,
78
+ screen: nil,
79
+ serviceWorkers: nil,
80
+ strictSelectors: nil,
81
+ timezoneId: nil,
82
+ userAgent: nil,
83
+ viewport: nil,
84
+ &block)
85
+ wrap_impl(@impl.launch_browser(acceptDownloads: unwrap_impl(acceptDownloads), args: unwrap_impl(args), baseURL: unwrap_impl(baseURL), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), contrast: unwrap_impl(contrast), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), forcedColors: unwrap_impl(forcedColors), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), pkg: unwrap_impl(pkg), proxy: unwrap_impl(proxy), record_har_content: unwrap_impl(record_har_content), record_har_mode: unwrap_impl(record_har_mode), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_har_url_filter: unwrap_impl(record_har_url_filter), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), reducedMotion: unwrap_impl(reducedMotion), screen: unwrap_impl(screen), serviceWorkers: unwrap_impl(serviceWorkers), strictSelectors: unwrap_impl(strictSelectors), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
86
+ end
87
+
88
+ #
89
+ # Performs a long tap on the widget defined by `selector`.
90
+ def long_tap(selector)
91
+ raise NotImplementedError.new('long_tap is not implemented yet.')
92
+ end
93
+
94
+ #
95
+ # Device model.
96
+ def model
97
+ wrap_impl(@impl.model)
98
+ end
99
+
100
+ #
101
+ # Launches a process in the shell on the device and returns a socket to communicate with the launched process.
102
+ def open(command)
103
+ raise NotImplementedError.new('open is not implemented yet.')
104
+ end
105
+
106
+ #
107
+ # Pinches the widget defined by `selector` in the closing direction.
108
+ def pinch_close(selector, percent, speed: nil)
109
+ raise NotImplementedError.new('pinch_close is not implemented yet.')
110
+ end
111
+
112
+ #
113
+ # Pinches the widget defined by `selector` in the open direction.
114
+ def pinch_open(selector, percent, speed: nil)
115
+ raise NotImplementedError.new('pinch_open is not implemented yet.')
116
+ end
117
+
118
+ #
119
+ # Presses the specific `key` in the widget defined by `selector`.
120
+ def press(selector, key)
121
+ raise NotImplementedError.new('press is not implemented yet.')
122
+ end
123
+
124
+ #
125
+ # Copies a file to the device.
126
+ def push(file, path, mode: nil)
127
+ raise NotImplementedError.new('push is not implemented yet.')
128
+ end
129
+
130
+ #
131
+ # Returns the buffer with the captured screenshot of the device.
26
132
  def screenshot(path: nil)
27
133
  wrap_impl(@impl.screenshot(path: unwrap_impl(path)))
28
134
  end
29
135
 
30
- # @nodoc
136
+ #
137
+ # Scrolls the widget defined by `selector` in the specified `direction`.
138
+ def scroll(selector, direction, percent, speed: nil)
139
+ raise NotImplementedError.new('scroll is not implemented yet.')
140
+ end
141
+
142
+ #
143
+ # Device serial number.
144
+ def serial
145
+ wrap_impl(@impl.serial)
146
+ end
147
+
148
+ #
149
+ # This setting will change the default maximum time for all the methods accepting `timeout` option.
150
+ def set_default_timeout(timeout)
151
+ raise NotImplementedError.new('set_default_timeout is not implemented yet.')
152
+ end
153
+ alias_method :default_timeout=, :set_default_timeout
154
+
155
+ #
156
+ # Executes a shell command on the device and returns its output.
31
157
  def shell(command)
32
158
  wrap_impl(@impl.shell(unwrap_impl(command)))
33
159
  end
34
160
 
35
- # @nodoc
36
- def input
37
- wrap_impl(@impl.input)
161
+ #
162
+ # Swipes the widget defined by `selector` in the specified `direction`.
163
+ def swipe(selector, direction, percent, speed: nil)
164
+ raise NotImplementedError.new('swipe is not implemented yet.')
38
165
  end
39
166
 
40
- # @nodoc
41
- def launch_browser(pkg: nil, acceptDownloads: nil, bypassCSP: nil, colorScheme: nil, deviceScaleFactor: nil, extraHTTPHeaders: nil, geolocation: nil, hasTouch: nil, httpCredentials: nil, ignoreHTTPSErrors: nil, isMobile: nil, javaScriptEnabled: nil, locale: nil, logger: nil, offline: nil, permissions: nil, proxy: nil, recordHar: nil, recordVideo: nil, storageState: nil, timezoneId: nil, userAgent: nil, videoSize: nil, videosPath: nil, viewport: nil, &block)
42
- wrap_impl(@impl.launch_browser(pkg: unwrap_impl(pkg), acceptDownloads: unwrap_impl(acceptDownloads), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), deviceScaleFactor: unwrap_impl(deviceScaleFactor), extraHTTPHeaders: unwrap_impl(extraHTTPHeaders), geolocation: unwrap_impl(geolocation), hasTouch: unwrap_impl(hasTouch), httpCredentials: unwrap_impl(httpCredentials), ignoreHTTPSErrors: unwrap_impl(ignoreHTTPSErrors), isMobile: unwrap_impl(isMobile), javaScriptEnabled: unwrap_impl(javaScriptEnabled), locale: unwrap_impl(locale), logger: unwrap_impl(logger), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), recordHar: unwrap_impl(recordHar), recordVideo: unwrap_impl(recordVideo), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), videoSize: unwrap_impl(videoSize), videosPath: unwrap_impl(videosPath), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
167
+ #
168
+ # Taps on the widget defined by `selector`.
169
+ def tap_point(selector, duration: nil)
170
+ raise NotImplementedError.new('tap_point is not implemented yet.')
171
+ end
172
+
173
+ #
174
+ # Waits for the specific `selector` to either appear or disappear, depending on the `state`.
175
+ def wait(selector, state: nil)
176
+ raise NotImplementedError.new('wait is not implemented yet.')
177
+ end
178
+
179
+ #
180
+ # Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy value.
181
+ def wait_for_event(event, optionsOrPredicate: nil)
182
+ raise NotImplementedError.new('wait_for_event is not implemented yet.')
183
+ end
184
+
185
+ #
186
+ # This method waits until `AndroidWebView` matching the `selector` is opened and returns it. If there is already an open `AndroidWebView` matching the `selector`, returns immediately.
187
+ def web_view(selector)
188
+ raise NotImplementedError.new('web_view is not implemented yet.')
189
+ end
190
+
191
+ #
192
+ # Currently open WebViews.
193
+ def web_views
194
+ raise NotImplementedError.new('web_views is not implemented yet.')
43
195
  end
44
196
 
45
197
  # @nodoc
46
- def info(selector)
47
- wrap_impl(@impl.info(unwrap_impl(selector)))
198
+ def should_close_connection_on_close!
199
+ wrap_impl(@impl.should_close_connection_on_close!)
48
200
  end
49
201
 
50
202
  # @nodoc
51
- def serial
52
- wrap_impl(@impl.serial)
203
+ def tap_on(selector, duration: nil, timeout: nil)
204
+ wrap_impl(@impl.tap_on(unwrap_impl(selector), duration: unwrap_impl(duration), timeout: unwrap_impl(timeout)))
53
205
  end
54
206
 
207
+ # -- inherited from EventEmitter --
55
208
  # @nodoc
56
- def model
57
- wrap_impl(@impl.model)
209
+ def once(event, callback)
210
+ event_emitter_proxy.once(event, callback)
58
211
  end
59
212
 
60
213
  # -- inherited from EventEmitter --
61
214
  # @nodoc
62
215
  def on(event, callback)
63
- wrap_impl(@impl.on(unwrap_impl(event), unwrap_impl(callback)))
216
+ event_emitter_proxy.on(event, callback)
64
217
  end
65
218
 
66
219
  # -- inherited from EventEmitter --
67
220
  # @nodoc
68
221
  def off(event, callback)
69
- wrap_impl(@impl.off(unwrap_impl(event), unwrap_impl(callback)))
222
+ event_emitter_proxy.off(event, callback)
70
223
  end
71
224
 
72
- # -- inherited from EventEmitter --
73
- # @nodoc
74
- def once(event, callback)
75
- wrap_impl(@impl.once(unwrap_impl(event), unwrap_impl(callback)))
225
+ private def event_emitter_proxy
226
+ @event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
76
227
  end
77
228
  end
78
229
  end
@@ -1,25 +1,34 @@
1
1
  module Playwright
2
- # @nodoc
3
2
  class AndroidInput < PlaywrightApi
4
3
 
5
- # @nodoc
6
- def type(text)
7
- wrap_impl(@impl.type(unwrap_impl(text)))
8
- end
9
-
10
- # @nodoc
11
- def tap_point(point)
12
- wrap_impl(@impl.tap_point(unwrap_impl(point)))
4
+ #
5
+ # Performs a drag between `from` and `to` points.
6
+ def drag(from, to, steps)
7
+ wrap_impl(@impl.drag(unwrap_impl(from), unwrap_impl(to), unwrap_impl(steps)))
13
8
  end
14
9
 
15
- # @nodoc
10
+ #
11
+ # Presses the `key`.
16
12
  def press(key)
17
13
  wrap_impl(@impl.press(unwrap_impl(key)))
18
14
  end
19
15
 
20
- # @nodoc
21
- def drag(from, to, steps)
22
- wrap_impl(@impl.drag(unwrap_impl(from), unwrap_impl(to), unwrap_impl(steps)))
16
+ #
17
+ # Swipes following the path defined by `segments`.
18
+ def swipe(from, segments, steps)
19
+ raise NotImplementedError.new('swipe is not implemented yet.')
20
+ end
21
+
22
+ #
23
+ # Taps at the specified `point`.
24
+ def tap_point(point)
25
+ wrap_impl(@impl.tap_point(unwrap_impl(point)))
26
+ end
27
+
28
+ #
29
+ # Types `text` into currently focused widget.
30
+ def type(text)
31
+ wrap_impl(@impl.type(unwrap_impl(text)))
23
32
  end
24
33
  end
25
34
  end
@@ -0,0 +1,18 @@
1
+ module Playwright
2
+ #
3
+ # `AndroidSocket` is a way to communicate with a process launched on the `AndroidDevice`. Use [`method: AndroidDevice.open`] to open a socket.
4
+ class AndroidSocket < PlaywrightApi
5
+
6
+ #
7
+ # Closes the socket.
8
+ def close
9
+ raise NotImplementedError.new('close is not implemented yet.')
10
+ end
11
+
12
+ #
13
+ # Writes some `data` to the socket.
14
+ def write(data)
15
+ raise NotImplementedError.new('write is not implemented yet.')
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ module Playwright
2
+ #
3
+ # `AndroidWebView` represents a WebView open on the `AndroidDevice`. WebView is usually obtained using [`method: AndroidDevice.webView`].
4
+ class AndroidWebView < PlaywrightApi
5
+
6
+ #
7
+ # Connects to the WebView and returns a regular Playwright `Page` to interact with.
8
+ def page
9
+ raise NotImplementedError.new('page is not implemented yet.')
10
+ end
11
+
12
+ #
13
+ # WebView process PID.
14
+ def pid
15
+ raise NotImplementedError.new('pid is not implemented yet.')
16
+ end
17
+
18
+ #
19
+ # WebView package identifier.
20
+ def pkg
21
+ raise NotImplementedError.new('pkg is not implemented yet.')
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,26 @@
1
+ module Playwright
2
+ #
3
+ # Exposes API that can be used for the Web API testing. This class is used for creating
4
+ # `APIRequestContext` instance which in turn can be used for sending web requests. An instance
5
+ # of this class can be obtained via [`property: Playwright.request`]. For more information
6
+ # see `APIRequestContext`.
7
+ class APIRequest < PlaywrightApi
8
+
9
+ #
10
+ # Creates new instances of `APIRequestContext`.
11
+ def new_context(
12
+ baseURL: nil,
13
+ clientCertificates: nil,
14
+ extraHTTPHeaders: nil,
15
+ failOnStatusCode: nil,
16
+ httpCredentials: nil,
17
+ ignoreHTTPSErrors: nil,
18
+ maxRedirects: nil,
19
+ proxy: nil,
20
+ storageState: nil,
21
+ timeout: nil,
22
+ userAgent: nil)
23
+ raise NotImplementedError.new('new_context is not implemented yet.')
24
+ end
25
+ end
26
+ end