playwright-ruby-client 0.1.0 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -8
  3. data/docs/api_coverage.md +123 -73
  4. data/lib/playwright.rb +48 -9
  5. data/lib/playwright/channel.rb +12 -2
  6. data/lib/playwright/channel_owner.rb +3 -5
  7. data/lib/playwright/channel_owners/android.rb +1 -1
  8. data/lib/playwright/channel_owners/android_device.rb +11 -11
  9. data/lib/playwright/channel_owners/artifact.rb +30 -0
  10. data/lib/playwright/channel_owners/binding_call.rb +3 -0
  11. data/lib/playwright/channel_owners/browser.rb +22 -1
  12. data/lib/playwright/channel_owners/browser_context.rb +155 -4
  13. data/lib/playwright/channel_owners/browser_type.rb +28 -0
  14. data/lib/playwright/channel_owners/dialog.rb +28 -0
  15. data/lib/playwright/channel_owners/element_handle.rb +18 -5
  16. data/lib/playwright/channel_owners/frame.rb +40 -5
  17. data/lib/playwright/channel_owners/js_handle.rb +3 -3
  18. data/lib/playwright/channel_owners/page.rb +172 -51
  19. data/lib/playwright/channel_owners/playwright.rb +24 -27
  20. data/lib/playwright/channel_owners/request.rb +27 -3
  21. data/lib/playwright/channel_owners/response.rb +60 -0
  22. data/lib/playwright/channel_owners/route.rb +78 -0
  23. data/lib/playwright/channel_owners/selectors.rb +19 -1
  24. data/lib/playwright/channel_owners/stream.rb +15 -0
  25. data/lib/playwright/connection.rb +11 -32
  26. data/lib/playwright/download.rb +27 -0
  27. data/lib/playwright/errors.rb +6 -0
  28. data/lib/playwright/events.rb +2 -5
  29. data/lib/playwright/keyboard_impl.rb +1 -1
  30. data/lib/playwright/mouse_impl.rb +41 -0
  31. data/lib/playwright/playwright_api.rb +3 -1
  32. data/lib/playwright/route_handler_entry.rb +28 -0
  33. data/lib/playwright/select_option_values.rb +14 -4
  34. data/lib/playwright/transport.rb +28 -7
  35. data/lib/playwright/url_matcher.rb +1 -1
  36. data/lib/playwright/utils.rb +11 -2
  37. data/lib/playwright/version.rb +1 -1
  38. data/lib/playwright/video.rb +51 -0
  39. data/lib/playwright/wait_helper.rb +2 -2
  40. data/lib/playwright_api/accessibility.rb +39 -1
  41. data/lib/playwright_api/android.rb +72 -5
  42. data/lib/playwright_api/android_device.rb +139 -26
  43. data/lib/playwright_api/android_input.rb +17 -13
  44. data/lib/playwright_api/android_socket.rb +16 -0
  45. data/lib/playwright_api/android_web_view.rb +21 -0
  46. data/lib/playwright_api/browser.rb +87 -19
  47. data/lib/playwright_api/browser_context.rb +216 -32
  48. data/lib/playwright_api/browser_type.rb +45 -58
  49. data/lib/playwright_api/dialog.rb +54 -7
  50. data/lib/playwright_api/element_handle.rb +113 -33
  51. data/lib/playwright_api/file_chooser.rb +6 -1
  52. data/lib/playwright_api/frame.rb +238 -43
  53. data/lib/playwright_api/js_handle.rb +20 -2
  54. data/lib/playwright_api/keyboard.rb +48 -1
  55. data/lib/playwright_api/mouse.rb +26 -5
  56. data/lib/playwright_api/page.rb +534 -63
  57. data/lib/playwright_api/playwright.rb +43 -47
  58. data/lib/playwright_api/request.rb +38 -12
  59. data/lib/playwright_api/response.rb +27 -10
  60. data/lib/playwright_api/route.rb +51 -6
  61. data/lib/playwright_api/selectors.rb +28 -2
  62. data/lib/playwright_api/touchscreen.rb +1 -1
  63. data/lib/playwright_api/web_socket.rb +15 -0
  64. data/lib/playwright_api/worker.rb +25 -1
  65. data/playwright.gemspec +4 -2
  66. metadata +42 -14
  67. data/lib/playwright/channel_owners/chromium_browser.rb +0 -8
  68. data/lib/playwright/channel_owners/chromium_browser_context.rb +0 -8
  69. data/lib/playwright/channel_owners/download.rb +0 -27
  70. data/lib/playwright/channel_owners/firefox_browser.rb +0 -8
  71. data/lib/playwright/channel_owners/webkit_browser.rb +0 -8
  72. data/lib/playwright_api/binding_call.rb +0 -27
  73. data/lib/playwright_api/chromium_browser_context.rb +0 -59
  74. data/lib/playwright_api/download.rb +0 -100
  75. data/lib/playwright_api/video.rb +0 -24
@@ -1,60 +1,173 @@
1
1
  module Playwright
2
- # @nodoc
2
+ # `AndroidDevice` represents a connected device, either real hardware or emulated. Devices can be obtained using
3
+ # [`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
+ # Disconnects from the device.
11
11
  def close
12
12
  wrap_impl(@impl.close)
13
13
  end
14
14
 
15
- # @nodoc
16
- def after_initialize
17
- wrap_impl(@impl.after_initialize)
15
+ # Drags the widget defined by `selector` towards `dest` point.
16
+ def drag(selector, dest, speed: nil)
17
+ raise NotImplementedError.new('drag is not implemented yet.')
18
18
  end
19
19
 
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)))
20
+ # Fills the specific `selector` input box with `text`.
21
+ def fill(selector, text)
22
+ raise NotImplementedError.new('fill is not implemented yet.')
23
23
  end
24
24
 
25
- # @nodoc
25
+ # Flings the widget defined by `selector` in the specified `direction`.
26
+ def fling(selector, direction, speed: nil)
27
+ raise NotImplementedError.new('fling is not implemented yet.')
28
+ end
29
+
30
+ # Returns information about a widget defined by `selector`.
31
+ def info(selector)
32
+ wrap_impl(@impl.info(unwrap_impl(selector)))
33
+ end
34
+
35
+ # Installs an apk on the device.
36
+ def install_apk(file, args: nil)
37
+ raise NotImplementedError.new('install_apk is not implemented yet.')
38
+ end
39
+
40
+ # Launches Chrome browser on the device, and returns its persistent context.
41
+ def launch_browser(
42
+ acceptDownloads: nil,
43
+ bypassCSP: nil,
44
+ colorScheme: nil,
45
+ command: nil,
46
+ deviceScaleFactor: nil,
47
+ extraHTTPHeaders: nil,
48
+ geolocation: nil,
49
+ hasTouch: nil,
50
+ httpCredentials: nil,
51
+ ignoreHTTPSErrors: nil,
52
+ isMobile: nil,
53
+ javaScriptEnabled: nil,
54
+ locale: nil,
55
+ noViewport: nil,
56
+ offline: nil,
57
+ permissions: nil,
58
+ record_har_omit_content: nil,
59
+ record_har_path: nil,
60
+ record_video_dir: nil,
61
+ record_video_size: nil,
62
+ screen: nil,
63
+ timezoneId: nil,
64
+ userAgent: nil,
65
+ viewport: nil,
66
+ &block)
67
+ wrap_impl(@impl.launch_browser(acceptDownloads: unwrap_impl(acceptDownloads), bypassCSP: unwrap_impl(bypassCSP), colorScheme: unwrap_impl(colorScheme), command: unwrap_impl(command), 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), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), screen: unwrap_impl(screen), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
68
+ end
69
+
70
+ # Performs a long tap on the widget defined by `selector`.
71
+ def long_tap(selector)
72
+ raise NotImplementedError.new('long_tap is not implemented yet.')
73
+ end
74
+
75
+ # Device model.
76
+ def model
77
+ wrap_impl(@impl.model)
78
+ end
79
+
80
+ # Launches a process in the shell on the device and returns a socket to communicate with the launched process.
81
+ def open(command)
82
+ raise NotImplementedError.new('open is not implemented yet.')
83
+ end
84
+
85
+ # Pinches the widget defined by `selector` in the closing direction.
86
+ def pinch_close(selector, percent, speed: nil)
87
+ raise NotImplementedError.new('pinch_close is not implemented yet.')
88
+ end
89
+
90
+ # Pinches the widget defined by `selector` in the open direction.
91
+ def pinch_open(selector, percent, speed: nil)
92
+ raise NotImplementedError.new('pinch_open is not implemented yet.')
93
+ end
94
+
95
+ # Presses the specific `key` in the widget defined by `selector`.
96
+ def press(selector, key)
97
+ raise NotImplementedError.new('press is not implemented yet.')
98
+ end
99
+
100
+ # Copies a file to the device.
101
+ def push(file, path, mode: nil)
102
+ raise NotImplementedError.new('push is not implemented yet.')
103
+ end
104
+
105
+ # Returns the buffer with the captured screenshot of the device.
26
106
  def screenshot(path: nil)
27
107
  wrap_impl(@impl.screenshot(path: unwrap_impl(path)))
28
108
  end
29
109
 
30
- # @nodoc
110
+ # Scrolls the widget defined by `selector` in the specified `direction`.
111
+ def scroll(selector, direction, percent, speed: nil)
112
+ raise NotImplementedError.new('scroll is not implemented yet.')
113
+ end
114
+
115
+ # Device serial number.
116
+ def serial
117
+ wrap_impl(@impl.serial)
118
+ end
119
+
120
+ # This setting will change the default maximum time for all the methods accepting `timeout` option.
121
+ def set_default_timeout(timeout)
122
+ raise NotImplementedError.new('set_default_timeout is not implemented yet.')
123
+ end
124
+ alias_method :default_timeout=, :set_default_timeout
125
+
126
+ # Executes a shell command on the device and returns its output.
31
127
  def shell(command)
32
128
  wrap_impl(@impl.shell(unwrap_impl(command)))
33
129
  end
34
130
 
35
- # @nodoc
36
- def input
37
- wrap_impl(@impl.input)
131
+ # Swipes the widget defined by `selector` in the specified `direction`.
132
+ def swipe(selector, direction, percent, speed: nil)
133
+ raise NotImplementedError.new('swipe is not implemented yet.')
38
134
  end
39
135
 
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)))
136
+ # Taps on the widget defined by `selector`.
137
+ def tap_point(selector, duration: nil)
138
+ raise NotImplementedError.new('tap_point is not implemented yet.')
43
139
  end
44
140
 
45
- # @nodoc
46
- def info(selector)
47
- wrap_impl(@impl.info(unwrap_impl(selector)))
141
+ # Waits for the specific `selector` to either appear or disappear, depending on the `state`.
142
+ def wait(selector, state: nil)
143
+ raise NotImplementedError.new('wait is not implemented yet.')
144
+ end
145
+
146
+ # Waits for event to fire and passes its value into the predicate function. Returns when the predicate returns truthy
147
+ # value.
148
+ def wait_for_event(event, optionsOrPredicate: nil)
149
+ raise NotImplementedError.new('wait_for_event is not implemented yet.')
150
+ end
151
+
152
+ # This method waits until `AndroidWebView` matching the `selector` is opened and returns it. If there is already an open
153
+ # `AndroidWebView` matching the `selector`, returns immediately.
154
+ def web_view(selector)
155
+ raise NotImplementedError.new('web_view is not implemented yet.')
156
+ end
157
+
158
+ # Currently open WebViews.
159
+ def web_views
160
+ raise NotImplementedError.new('web_views is not implemented yet.')
48
161
  end
49
162
 
50
163
  # @nodoc
51
- def serial
52
- wrap_impl(@impl.serial)
164
+ def tap_on(selector, duration: nil, timeout: nil)
165
+ wrap_impl(@impl.tap_on(unwrap_impl(selector), duration: unwrap_impl(duration), timeout: unwrap_impl(timeout)))
53
166
  end
54
167
 
55
168
  # @nodoc
56
- def model
57
- wrap_impl(@impl.model)
169
+ def tree
170
+ wrap_impl(@impl.tree)
58
171
  end
59
172
 
60
173
  # -- inherited from EventEmitter --
@@ -1,25 +1,29 @@
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)))
13
- end
14
-
15
- # @nodoc
4
+ # Performs a drag between `from` and `to` points.
16
5
  def drag(from, to, steps)
17
6
  wrap_impl(@impl.drag(unwrap_impl(from), unwrap_impl(to), unwrap_impl(steps)))
18
7
  end
19
8
 
20
- # @nodoc
9
+ # Presses the `key`.
21
10
  def press(key)
22
11
  wrap_impl(@impl.press(unwrap_impl(key)))
23
12
  end
13
+
14
+ # Swipes following the path defined by `segments`.
15
+ def swipe(from, segments, steps)
16
+ raise NotImplementedError.new('swipe is not implemented yet.')
17
+ end
18
+
19
+ # Taps at the specified `point`.
20
+ def tap_point(point)
21
+ wrap_impl(@impl.tap_point(unwrap_impl(point)))
22
+ end
23
+
24
+ # Types `text` into currently focused widget.
25
+ def type(text)
26
+ wrap_impl(@impl.type(unwrap_impl(text)))
27
+ end
24
28
  end
25
29
  end
@@ -0,0 +1,16 @@
1
+ module Playwright
2
+ # `AndroidSocket` is a way to communicate with a process launched on the `AndroidDevice`. Use
3
+ # [`method: AndroidDevice.open`] to open a socket.
4
+ class AndroidSocket < PlaywrightApi
5
+
6
+ # Closes the socket.
7
+ def close
8
+ raise NotImplementedError.new('close is not implemented yet.')
9
+ end
10
+
11
+ # Writes some `data` to the socket.
12
+ def write(data)
13
+ raise NotImplementedError.new('write is not implemented yet.')
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ module Playwright
2
+ # `AndroidWebView` represents a WebView open on the `AndroidDevice`. WebView is usually obtained using
3
+ # [`method: AndroidDevice.webView`].
4
+ class AndroidWebView < PlaywrightApi
5
+
6
+ # Connects to the WebView and returns a regular Playwright `Page` to interact with.
7
+ def page
8
+ raise NotImplementedError.new('page is not implemented yet.')
9
+ end
10
+
11
+ # WebView process PID.
12
+ def pid
13
+ raise NotImplementedError.new('pid is not implemented yet.')
14
+ end
15
+
16
+ # WebView package identifier.
17
+ def pkg
18
+ raise NotImplementedError.new('pkg is not implemented yet.')
19
+ end
20
+ end
21
+ end
@@ -15,6 +15,22 @@ module Playwright
15
15
  # })();
16
16
  # ```
17
17
  #
18
+ # ```java
19
+ # import com.microsoft.playwright.*;
20
+ #
21
+ # public class Example {
22
+ # public static void main(String[] args) {
23
+ # try (Playwright playwright = Playwright.create()) {
24
+ # BrowserType firefox = playwright.firefox()
25
+ # Browser browser = firefox.launch();
26
+ # Page page = browser.newPage();
27
+ # page.navigate('https://example.com');
28
+ # browser.close();
29
+ # }
30
+ # }
31
+ # }
32
+ # ```
33
+ #
18
34
  # ```python async
19
35
  # import asyncio
20
36
  # from playwright.async_api import async_playwright
@@ -69,6 +85,13 @@ module Playwright
69
85
  # console.log(browser.contexts().length); // prints `1`
70
86
  # ```
71
87
  #
88
+ # ```java
89
+ # Browser browser = pw.webkit().launch();
90
+ # System.out.println(browser.contexts().size()); // prints "0"
91
+ # BrowserContext context = browser.newContext();
92
+ # System.out.println(browser.contexts().size()); // prints "1"
93
+ # ```
94
+ #
72
95
  # ```python async
73
96
  # browser = await pw.webkit.launch()
74
97
  # print(len(browser.contexts())) # prints `0`
@@ -91,6 +114,13 @@ module Playwright
91
114
  wrap_impl(@impl.connected?)
92
115
  end
93
116
 
117
+ # > NOTE: CDP Sessions are only supported on Chromium-based browsers.
118
+ #
119
+ # Returns the newly created browser session.
120
+ def new_browser_cdp_session
121
+ raise NotImplementedError.new('new_browser_cdp_session is not implemented yet.')
122
+ end
123
+
94
124
  # Creates a new browser context. It won't share cookies/cache with other browser contexts.
95
125
  #
96
126
  #
@@ -105,6 +135,15 @@ module Playwright
105
135
  # })();
106
136
  # ```
107
137
  #
138
+ # ```java
139
+ # Browser browser = playwright.firefox().launch(); // Or 'chromium' or 'webkit'.
140
+ # // Create a new incognito browser context.
141
+ # BrowserContext context = browser.newContext();
142
+ # // Create a new page in a pristine context.
143
+ # Page page = context.newPage();
144
+ # page.navigate('https://example.com');
145
+ # ```
146
+ #
108
147
  # ```python async
109
148
  # browser = await playwright.firefox.launch() # or "chromium" or "webkit".
110
149
  # # create a new incognito browser context.
@@ -135,21 +174,21 @@ module Playwright
135
174
  isMobile: nil,
136
175
  javaScriptEnabled: nil,
137
176
  locale: nil,
138
- logger: nil,
177
+ noViewport: nil,
139
178
  offline: nil,
140
179
  permissions: nil,
141
180
  proxy: nil,
142
- recordHar: nil,
143
- recordVideo: nil,
181
+ record_har_omit_content: nil,
182
+ record_har_path: nil,
183
+ record_video_dir: nil,
184
+ record_video_size: nil,
185
+ screen: nil,
144
186
  storageState: nil,
145
- storageStatePath: nil,
146
187
  timezoneId: nil,
147
188
  userAgent: nil,
148
- videoSize: nil,
149
- videosPath: nil,
150
189
  viewport: nil,
151
190
  &block)
152
- wrap_impl(@impl.new_context(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), storageStatePath: unwrap_impl(storageStatePath), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), videoSize: unwrap_impl(videoSize), videosPath: unwrap_impl(videosPath), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
191
+ wrap_impl(@impl.new_context(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), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), screen: unwrap_impl(screen), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport), &wrap_block_call(block)))
153
192
  end
154
193
 
155
194
  # Creates a new page in a new browser context. Closing this page will close the context as well.
@@ -170,20 +209,54 @@ module Playwright
170
209
  isMobile: nil,
171
210
  javaScriptEnabled: nil,
172
211
  locale: nil,
173
- logger: nil,
212
+ noViewport: nil,
174
213
  offline: nil,
175
214
  permissions: nil,
176
215
  proxy: nil,
177
- recordHar: nil,
178
- recordVideo: nil,
216
+ record_har_omit_content: nil,
217
+ record_har_path: nil,
218
+ record_video_dir: nil,
219
+ record_video_size: nil,
220
+ screen: nil,
179
221
  storageState: nil,
180
- storageStatePath: nil,
181
222
  timezoneId: nil,
182
223
  userAgent: nil,
183
- videoSize: nil,
184
- videosPath: nil,
185
224
  viewport: nil)
186
- wrap_impl(@impl.new_page(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), storageStatePath: unwrap_impl(storageStatePath), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), videoSize: unwrap_impl(videoSize), videosPath: unwrap_impl(videosPath), viewport: unwrap_impl(viewport)))
225
+ wrap_impl(@impl.new_page(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), noViewport: unwrap_impl(noViewport), offline: unwrap_impl(offline), permissions: unwrap_impl(permissions), proxy: unwrap_impl(proxy), record_har_omit_content: unwrap_impl(record_har_omit_content), record_har_path: unwrap_impl(record_har_path), record_video_dir: unwrap_impl(record_video_dir), record_video_size: unwrap_impl(record_video_size), screen: unwrap_impl(screen), storageState: unwrap_impl(storageState), timezoneId: unwrap_impl(timezoneId), userAgent: unwrap_impl(userAgent), viewport: unwrap_impl(viewport)))
226
+ end
227
+
228
+ # > NOTE: Tracing is only supported on Chromium-based browsers.
229
+ #
230
+ # You can use [`method: Browser.startTracing`] and [`method: Browser.stopTracing`] to create a trace file that can be
231
+ # opened in Chrome DevTools performance panel.
232
+ #
233
+ #
234
+ # ```js
235
+ # await browser.startTracing(page, {path: 'trace.json'});
236
+ # await page.goto('https://www.google.com');
237
+ # await browser.stopTracing();
238
+ # ```
239
+ #
240
+ # ```python async
241
+ # await browser.start_tracing(page, path="trace.json")
242
+ # await page.goto("https://www.google.com")
243
+ # await browser.stop_tracing()
244
+ # ```
245
+ #
246
+ # ```python sync
247
+ # browser.start_tracing(page, path="trace.json")
248
+ # page.goto("https://www.google.com")
249
+ # browser.stop_tracing()
250
+ # ```
251
+ def start_tracing(page: nil, categories: nil, path: nil, screenshots: nil)
252
+ wrap_impl(@impl.start_tracing(page: unwrap_impl(page), categories: unwrap_impl(categories), path: unwrap_impl(path), screenshots: unwrap_impl(screenshots)))
253
+ end
254
+
255
+ # > NOTE: Tracing is only supported on Chromium-based browsers.
256
+ #
257
+ # Returns the buffer with trace data.
258
+ def stop_tracing
259
+ wrap_impl(@impl.stop_tracing)
187
260
  end
188
261
 
189
262
  # Returns the browser version.
@@ -191,11 +264,6 @@ module Playwright
191
264
  wrap_impl(@impl.version)
192
265
  end
193
266
 
194
- # @nodoc
195
- def after_initialize
196
- wrap_impl(@impl.after_initialize)
197
- end
198
-
199
267
  # -- inherited from EventEmitter --
200
268
  # @nodoc
201
269
  def once(event, callback)