playwright-ruby-client 1.61.0 → 1.62.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.
- checksums.yaml +4 -4
- data/README.md +12 -17
- data/documentation/docs/api/api_response.md +12 -0
- data/documentation/docs/api/browser_context.md +5 -3
- data/documentation/docs/api/browser_type.md +2 -0
- data/documentation/docs/api/credentials.md +6 -2
- data/documentation/docs/api/element_handle.md +7 -0
- data/documentation/docs/api/frame.md +8 -0
- data/documentation/docs/api/locator.md +29 -0
- data/documentation/docs/api/locator_assertions.md +4 -2
- data/documentation/docs/api/page.md +14 -0
- data/documentation/docs/api/playwright.md +2 -2
- data/documentation/docs/article/getting_started.md +12 -11
- data/documentation/docs/article/guides/download_playwright_driver.md +11 -32
- data/documentation/docs/article/guides/launch_browser.md +5 -4
- data/documentation/docs/article/guides/playwright_on_alpine_linux.md +6 -5
- data/documentation/docs/article/guides/rails_integration.md +72 -4
- data/documentation/docs/article/guides/rails_integration_with_null_driver.md +4 -3
- data/documentation/docs/article/guides/semi_automation.md +1 -1
- data/documentation/docs/article/guides/use_storage_state.md +1 -1
- data/documentation/docs/include/api_coverage.md +2 -0
- data/documentation/docusaurus.config.js +31 -0
- data/documentation/package.json +3 -0
- data/documentation/yarn.lock +159 -174
- data/lib/playwright/api_response_impl.rb +16 -0
- data/lib/playwright/channel_owners/browser_context.rb +6 -2
- data/lib/playwright/channel_owners/element_handle.rb +14 -4
- data/lib/playwright/channel_owners/frame.rb +14 -0
- data/lib/playwright/channel_owners/page.rb +19 -8
- data/lib/playwright/connection.rb +9 -1
- data/lib/playwright/locator_assertions_impl.rb +14 -1
- data/lib/playwright/locator_impl.rb +28 -5
- data/lib/playwright/screencast.rb +20 -6
- data/lib/playwright/screenshot_utils.rb +24 -0
- data/lib/playwright/test.rb +12 -2
- data/lib/playwright/url_matcher.rb +120 -4
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright.rb +2 -2
- data/lib/playwright_api/api_request_context.rb +6 -6
- data/lib/playwright_api/api_response.rb +9 -0
- data/lib/playwright_api/browser.rb +6 -6
- data/lib/playwright_api/browser_context.rb +14 -12
- data/lib/playwright_api/browser_type.rb +8 -6
- data/lib/playwright_api/cdp_session.rb +6 -6
- data/lib/playwright_api/credentials.rb +6 -2
- data/lib/playwright_api/dialog.rb +6 -6
- data/lib/playwright_api/element_handle.rb +20 -13
- data/lib/playwright_api/frame.rb +29 -21
- data/lib/playwright_api/js_handle.rb +6 -6
- data/lib/playwright_api/locator.rb +39 -13
- data/lib/playwright_api/locator_assertions.rb +6 -4
- data/lib/playwright_api/page.rb +37 -23
- data/lib/playwright_api/playwright.rb +6 -6
- data/lib/playwright_api/request.rb +8 -8
- data/lib/playwright_api/response.rb +6 -6
- data/lib/playwright_api/route.rb +6 -6
- data/lib/playwright_api/tracing.rb +6 -6
- data/lib/playwright_api/web_socket.rb +6 -6
- data/lib/playwright_api/worker.rb +8 -8
- data/playwright.gemspec +5 -0
- data/sig/playwright.rbs +41 -39
- metadata +7 -3
|
@@ -98,12 +98,6 @@ module Playwright
|
|
|
98
98
|
wrap_impl(@impl.to_s)
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
-
# -- inherited from EventEmitter --
|
|
102
|
-
# @nodoc
|
|
103
|
-
def off(event, callback)
|
|
104
|
-
event_emitter_proxy.off(event, callback)
|
|
105
|
-
end
|
|
106
|
-
|
|
107
101
|
# -- inherited from EventEmitter --
|
|
108
102
|
# @nodoc
|
|
109
103
|
def once(event, callback)
|
|
@@ -116,6 +110,12 @@ module Playwright
|
|
|
116
110
|
event_emitter_proxy.on(event, callback)
|
|
117
111
|
end
|
|
118
112
|
|
|
113
|
+
# -- inherited from EventEmitter --
|
|
114
|
+
# @nodoc
|
|
115
|
+
def off(event, callback)
|
|
116
|
+
event_emitter_proxy.off(event, callback)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
119
|
private def event_emitter_proxy
|
|
120
120
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
121
121
|
end
|
|
@@ -168,9 +168,10 @@ module Playwright
|
|
|
168
168
|
force: nil,
|
|
169
169
|
noWaitAfter: nil,
|
|
170
170
|
position: nil,
|
|
171
|
+
scroll: nil,
|
|
171
172
|
timeout: nil,
|
|
172
173
|
trial: nil)
|
|
173
|
-
wrap_impl(@impl.check(force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
174
|
+
wrap_impl(@impl.check(force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
174
175
|
end
|
|
175
176
|
|
|
176
177
|
#
|
|
@@ -230,10 +231,11 @@ module Playwright
|
|
|
230
231
|
modifiers: nil,
|
|
231
232
|
noWaitAfter: nil,
|
|
232
233
|
position: nil,
|
|
234
|
+
scroll: nil,
|
|
233
235
|
steps: nil,
|
|
234
236
|
timeout: nil,
|
|
235
237
|
trial: nil)
|
|
236
|
-
wrap_impl(@impl.click(button: unwrap_impl(button), clickCount: unwrap_impl(clickCount), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), steps: unwrap_impl(steps), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
238
|
+
wrap_impl(@impl.click(button: unwrap_impl(button), clickCount: unwrap_impl(clickCount), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), steps: unwrap_impl(steps), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
237
239
|
end
|
|
238
240
|
|
|
239
241
|
#
|
|
@@ -273,10 +275,11 @@ module Playwright
|
|
|
273
275
|
modifiers: nil,
|
|
274
276
|
noWaitAfter: nil,
|
|
275
277
|
position: nil,
|
|
278
|
+
scroll: nil,
|
|
276
279
|
steps: nil,
|
|
277
280
|
timeout: nil,
|
|
278
281
|
trial: nil)
|
|
279
|
-
wrap_impl(@impl.dblclick(button: unwrap_impl(button), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), steps: unwrap_impl(steps), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
282
|
+
wrap_impl(@impl.dblclick(button: unwrap_impl(button), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), steps: unwrap_impl(steps), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
280
283
|
end
|
|
281
284
|
|
|
282
285
|
#
|
|
@@ -378,12 +381,13 @@ module Playwright
|
|
|
378
381
|
target,
|
|
379
382
|
force: nil,
|
|
380
383
|
noWaitAfter: nil,
|
|
384
|
+
scroll: nil,
|
|
381
385
|
sourcePosition: nil,
|
|
382
386
|
steps: nil,
|
|
383
387
|
targetPosition: nil,
|
|
384
388
|
timeout: nil,
|
|
385
389
|
trial: nil)
|
|
386
|
-
wrap_impl(@impl.drag_to(unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), sourcePosition: unwrap_impl(sourcePosition), steps: unwrap_impl(steps), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
390
|
+
wrap_impl(@impl.drag_to(unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), scroll: unwrap_impl(scroll), sourcePosition: unwrap_impl(sourcePosition), steps: unwrap_impl(steps), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
387
391
|
end
|
|
388
392
|
|
|
389
393
|
#
|
|
@@ -807,9 +811,10 @@ module Playwright
|
|
|
807
811
|
modifiers: nil,
|
|
808
812
|
noWaitAfter: nil,
|
|
809
813
|
position: nil,
|
|
814
|
+
scroll: nil,
|
|
810
815
|
timeout: nil,
|
|
811
816
|
trial: nil)
|
|
812
|
-
wrap_impl(@impl.hover(force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
817
|
+
wrap_impl(@impl.hover(force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
813
818
|
end
|
|
814
819
|
|
|
815
820
|
#
|
|
@@ -1187,9 +1192,10 @@ module Playwright
|
|
|
1187
1192
|
force: nil,
|
|
1188
1193
|
noWaitAfter: nil,
|
|
1189
1194
|
position: nil,
|
|
1195
|
+
scroll: nil,
|
|
1190
1196
|
timeout: nil,
|
|
1191
1197
|
trial: nil)
|
|
1192
|
-
wrap_impl(@impl.set_checked(unwrap_impl(checked), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1198
|
+
wrap_impl(@impl.set_checked(unwrap_impl(checked), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1193
1199
|
end
|
|
1194
1200
|
alias_method :checked=, :set_checked
|
|
1195
1201
|
|
|
@@ -1253,9 +1259,10 @@ module Playwright
|
|
|
1253
1259
|
modifiers: nil,
|
|
1254
1260
|
noWaitAfter: nil,
|
|
1255
1261
|
position: nil,
|
|
1262
|
+
scroll: nil,
|
|
1256
1263
|
timeout: nil,
|
|
1257
1264
|
trial: nil)
|
|
1258
|
-
wrap_impl(@impl.tap_point(force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1265
|
+
wrap_impl(@impl.tap_point(force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1259
1266
|
end
|
|
1260
1267
|
|
|
1261
1268
|
#
|
|
@@ -1304,9 +1311,10 @@ module Playwright
|
|
|
1304
1311
|
force: nil,
|
|
1305
1312
|
noWaitAfter: nil,
|
|
1306
1313
|
position: nil,
|
|
1314
|
+
scroll: nil,
|
|
1307
1315
|
timeout: nil,
|
|
1308
1316
|
trial: nil)
|
|
1309
|
-
wrap_impl(@impl.uncheck(force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1317
|
+
wrap_impl(@impl.uncheck(force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1310
1318
|
end
|
|
1311
1319
|
|
|
1312
1320
|
#
|
|
@@ -1325,6 +1333,29 @@ module Playwright
|
|
|
1325
1333
|
wrap_impl(@impl.wait_for(state: unwrap_impl(state), timeout: unwrap_impl(timeout)))
|
|
1326
1334
|
end
|
|
1327
1335
|
|
|
1336
|
+
#
|
|
1337
|
+
# Returns when `expression` returns a truthy value, called with the matching element as a first argument, and `arg` as a second argument.
|
|
1338
|
+
#
|
|
1339
|
+
# This is a generic way to wait for an element to reach a custom condition without asserting it. The locator is re-resolved on each retry, so it tolerates the element being re-rendered while waiting.
|
|
1340
|
+
#
|
|
1341
|
+
# If `expression` returns a [Promise], this method will wait for the promise to resolve before checking its value.
|
|
1342
|
+
#
|
|
1343
|
+
# If `expression` throws or rejects, this method throws.
|
|
1344
|
+
#
|
|
1345
|
+
# **Usage**
|
|
1346
|
+
#
|
|
1347
|
+
# Wait for an attribute to appear:
|
|
1348
|
+
#
|
|
1349
|
+
# Passing argument to `expression`:
|
|
1350
|
+
def wait_for_function(expression, arg: nil, timeout: nil)
|
|
1351
|
+
wrap_impl(@impl.wait_for_function(unwrap_impl(expression), arg: unwrap_impl(arg), timeout: unwrap_impl(timeout)))
|
|
1352
|
+
end
|
|
1353
|
+
|
|
1354
|
+
# @nodoc
|
|
1355
|
+
def expect(expression, options, title)
|
|
1356
|
+
wrap_impl(@impl.expect(unwrap_impl(expression), unwrap_impl(options), unwrap_impl(title)))
|
|
1357
|
+
end
|
|
1358
|
+
|
|
1328
1359
|
# @nodoc
|
|
1329
1360
|
def _assertions(timeout, is_not, message)
|
|
1330
1361
|
wrap_impl(@impl._assertions(unwrap_impl(timeout), unwrap_impl(is_not), unwrap_impl(message)))
|
|
@@ -1335,11 +1366,6 @@ module Playwright
|
|
|
1335
1366
|
wrap_impl(@impl.resolve_selector)
|
|
1336
1367
|
end
|
|
1337
1368
|
|
|
1338
|
-
# @nodoc
|
|
1339
|
-
def expect(expression, options, title)
|
|
1340
|
-
wrap_impl(@impl.expect(unwrap_impl(expression), unwrap_impl(options), unwrap_impl(title)))
|
|
1341
|
-
end
|
|
1342
|
-
|
|
1343
1369
|
# @nodoc
|
|
1344
1370
|
def to_s
|
|
1345
1371
|
wrap_impl(@impl.to_s)
|
|
@@ -104,8 +104,8 @@ module Playwright
|
|
|
104
104
|
|
|
105
105
|
#
|
|
106
106
|
# The opposite of [`method: LocatorAssertions.toHaveAttribute`].
|
|
107
|
-
def not_to_have_attribute(name, value, ignoreCase: nil, timeout: nil)
|
|
108
|
-
wrap_impl(@impl.not_to_have_attribute(unwrap_impl(name), unwrap_impl(value), ignoreCase: unwrap_impl(ignoreCase), timeout: unwrap_impl(timeout)))
|
|
107
|
+
def not_to_have_attribute(name, value: nil, ignoreCase: nil, timeout: nil)
|
|
108
|
+
wrap_impl(@impl.not_to_have_attribute(unwrap_impl(name), value: unwrap_impl(value), ignoreCase: unwrap_impl(ignoreCase), timeout: unwrap_impl(timeout)))
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
#
|
|
@@ -477,9 +477,11 @@ module Playwright
|
|
|
477
477
|
#
|
|
478
478
|
# locator = page.locator("input")
|
|
479
479
|
# expect(locator).to_have_attribute("type", "text")
|
|
480
|
+
# expect(locator).to_have_attribute("disabled")
|
|
481
|
+
# expect(locator).not_to_have_attribute("readonly")
|
|
480
482
|
# ```
|
|
481
|
-
def to_have_attribute(name, value, ignoreCase: nil, timeout: nil)
|
|
482
|
-
wrap_impl(@impl.to_have_attribute(unwrap_impl(name), unwrap_impl(value), ignoreCase: unwrap_impl(ignoreCase), timeout: unwrap_impl(timeout)))
|
|
483
|
+
def to_have_attribute(name, value: nil, ignoreCase: nil, timeout: nil)
|
|
484
|
+
wrap_impl(@impl.to_have_attribute(unwrap_impl(name), value: unwrap_impl(value), ignoreCase: unwrap_impl(ignoreCase), timeout: unwrap_impl(timeout)))
|
|
483
485
|
end
|
|
484
486
|
|
|
485
487
|
#
|
data/lib/playwright_api/page.rb
CHANGED
|
@@ -154,10 +154,11 @@ module Playwright
|
|
|
154
154
|
force: nil,
|
|
155
155
|
noWaitAfter: nil,
|
|
156
156
|
position: nil,
|
|
157
|
+
scroll: nil,
|
|
157
158
|
strict: nil,
|
|
158
159
|
timeout: nil,
|
|
159
160
|
trial: nil)
|
|
160
|
-
wrap_impl(@impl.check(unwrap_impl(selector), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
161
|
+
wrap_impl(@impl.check(unwrap_impl(selector), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
161
162
|
end
|
|
162
163
|
|
|
163
164
|
#
|
|
@@ -179,10 +180,11 @@ module Playwright
|
|
|
179
180
|
modifiers: nil,
|
|
180
181
|
noWaitAfter: nil,
|
|
181
182
|
position: nil,
|
|
183
|
+
scroll: nil,
|
|
182
184
|
strict: nil,
|
|
183
185
|
timeout: nil,
|
|
184
186
|
trial: nil)
|
|
185
|
-
wrap_impl(@impl.click(unwrap_impl(selector), button: unwrap_impl(button), clickCount: unwrap_impl(clickCount), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
187
|
+
wrap_impl(@impl.click(unwrap_impl(selector), button: unwrap_impl(button), clickCount: unwrap_impl(clickCount), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
186
188
|
end
|
|
187
189
|
|
|
188
190
|
#
|
|
@@ -228,10 +230,11 @@ module Playwright
|
|
|
228
230
|
modifiers: nil,
|
|
229
231
|
noWaitAfter: nil,
|
|
230
232
|
position: nil,
|
|
233
|
+
scroll: nil,
|
|
231
234
|
strict: nil,
|
|
232
235
|
timeout: nil,
|
|
233
236
|
trial: nil)
|
|
234
|
-
wrap_impl(@impl.dblclick(unwrap_impl(selector), button: unwrap_impl(button), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
237
|
+
wrap_impl(@impl.dblclick(unwrap_impl(selector), button: unwrap_impl(button), delay: unwrap_impl(delay), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
235
238
|
end
|
|
236
239
|
|
|
237
240
|
#
|
|
@@ -300,13 +303,14 @@ module Playwright
|
|
|
300
303
|
target,
|
|
301
304
|
force: nil,
|
|
302
305
|
noWaitAfter: nil,
|
|
306
|
+
scroll: nil,
|
|
303
307
|
sourcePosition: nil,
|
|
304
308
|
steps: nil,
|
|
305
309
|
strict: nil,
|
|
306
310
|
targetPosition: nil,
|
|
307
311
|
timeout: nil,
|
|
308
312
|
trial: nil)
|
|
309
|
-
wrap_impl(@impl.drag_and_drop(unwrap_impl(source), unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), sourcePosition: unwrap_impl(sourcePosition), steps: unwrap_impl(steps), strict: unwrap_impl(strict), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
313
|
+
wrap_impl(@impl.drag_and_drop(unwrap_impl(source), unwrap_impl(target), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), scroll: unwrap_impl(scroll), sourcePosition: unwrap_impl(sourcePosition), steps: unwrap_impl(steps), strict: unwrap_impl(strict), targetPosition: unwrap_impl(targetPosition), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
310
314
|
end
|
|
311
315
|
|
|
312
316
|
#
|
|
@@ -810,6 +814,9 @@ module Playwright
|
|
|
810
814
|
# last redirect. If cannot go back, returns `null`.
|
|
811
815
|
#
|
|
812
816
|
# Navigate to the previous page in history.
|
|
817
|
+
#
|
|
818
|
+
# **NOTE**: **Testing Back/Forward Cache (BFCache) is not supported.**
|
|
819
|
+
# By default, Playwright disables the Back/Forward Cache across all browsers. Even if explicitly enabled, Playwright's internal state relies on network-level navigation events. Because BFCache restores unfreeze the DOM without firing these events, using `page.goBack()` or `page.goForward()` to trigger a BFCache restore will result in timeouts and a desynchronized `Page` state.
|
|
813
820
|
def go_back(timeout: nil, waitUntil: nil)
|
|
814
821
|
wrap_impl(@impl.go_back(timeout: unwrap_impl(timeout), waitUntil: unwrap_impl(waitUntil)))
|
|
815
822
|
end
|
|
@@ -819,6 +826,9 @@ module Playwright
|
|
|
819
826
|
# last redirect. If cannot go forward, returns `null`.
|
|
820
827
|
#
|
|
821
828
|
# Navigate to the next page in history.
|
|
829
|
+
#
|
|
830
|
+
# **NOTE**: **Testing Back/Forward Cache (BFCache) is not supported.**
|
|
831
|
+
# By default, Playwright disables the Back/Forward Cache across all browsers. Even if explicitly enabled, Playwright's internal state relies on network-level navigation events. Because BFCache restores unfreeze the DOM without firing these events, using `page.goBack()` or `page.goForward()` to trigger a BFCache restore will result in timeouts and a desynchronized `Page` state.
|
|
822
832
|
def go_forward(timeout: nil, waitUntil: nil)
|
|
823
833
|
wrap_impl(@impl.go_forward(timeout: unwrap_impl(timeout), waitUntil: unwrap_impl(waitUntil)))
|
|
824
834
|
end
|
|
@@ -885,10 +895,11 @@ module Playwright
|
|
|
885
895
|
modifiers: nil,
|
|
886
896
|
noWaitAfter: nil,
|
|
887
897
|
position: nil,
|
|
898
|
+
scroll: nil,
|
|
888
899
|
strict: nil,
|
|
889
900
|
timeout: nil,
|
|
890
901
|
trial: nil)
|
|
891
|
-
wrap_impl(@impl.hover(unwrap_impl(selector), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
902
|
+
wrap_impl(@impl.hover(unwrap_impl(selector), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
892
903
|
end
|
|
893
904
|
|
|
894
905
|
#
|
|
@@ -1408,10 +1419,11 @@ module Playwright
|
|
|
1408
1419
|
force: nil,
|
|
1409
1420
|
noWaitAfter: nil,
|
|
1410
1421
|
position: nil,
|
|
1422
|
+
scroll: nil,
|
|
1411
1423
|
strict: nil,
|
|
1412
1424
|
timeout: nil,
|
|
1413
1425
|
trial: nil)
|
|
1414
|
-
wrap_impl(@impl.set_checked(unwrap_impl(selector), unwrap_impl(checked), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1426
|
+
wrap_impl(@impl.set_checked(unwrap_impl(selector), unwrap_impl(checked), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1415
1427
|
end
|
|
1416
1428
|
|
|
1417
1429
|
#
|
|
@@ -1514,10 +1526,11 @@ module Playwright
|
|
|
1514
1526
|
modifiers: nil,
|
|
1515
1527
|
noWaitAfter: nil,
|
|
1516
1528
|
position: nil,
|
|
1529
|
+
scroll: nil,
|
|
1517
1530
|
strict: nil,
|
|
1518
1531
|
timeout: nil,
|
|
1519
1532
|
trial: nil)
|
|
1520
|
-
wrap_impl(@impl.tap_point(unwrap_impl(selector), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1533
|
+
wrap_impl(@impl.tap_point(unwrap_impl(selector), force: unwrap_impl(force), modifiers: unwrap_impl(modifiers), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1521
1534
|
end
|
|
1522
1535
|
|
|
1523
1536
|
#
|
|
@@ -1567,10 +1580,11 @@ module Playwright
|
|
|
1567
1580
|
force: nil,
|
|
1568
1581
|
noWaitAfter: nil,
|
|
1569
1582
|
position: nil,
|
|
1583
|
+
scroll: nil,
|
|
1570
1584
|
strict: nil,
|
|
1571
1585
|
timeout: nil,
|
|
1572
1586
|
trial: nil)
|
|
1573
|
-
wrap_impl(@impl.uncheck(unwrap_impl(selector), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1587
|
+
wrap_impl(@impl.uncheck(unwrap_impl(selector), force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), scroll: unwrap_impl(scroll), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
|
1574
1588
|
end
|
|
1575
1589
|
|
|
1576
1590
|
#
|
|
@@ -1880,6 +1894,11 @@ module Playwright
|
|
|
1880
1894
|
raise NotImplementedError.new('wait_for_event is not implemented yet.')
|
|
1881
1895
|
end
|
|
1882
1896
|
|
|
1897
|
+
# @nodoc
|
|
1898
|
+
def snapshot_for_ai(timeout: nil, depth: nil, boxes: nil)
|
|
1899
|
+
wrap_impl(@impl.snapshot_for_ai(timeout: unwrap_impl(timeout), depth: unwrap_impl(depth), boxes: unwrap_impl(boxes)))
|
|
1900
|
+
end
|
|
1901
|
+
|
|
1883
1902
|
# @nodoc
|
|
1884
1903
|
def _assertions(timeout, is_not, message)
|
|
1885
1904
|
wrap_impl(@impl._assertions(unwrap_impl(timeout), unwrap_impl(is_not), unwrap_impl(message)))
|
|
@@ -1891,13 +1910,8 @@ module Playwright
|
|
|
1891
1910
|
end
|
|
1892
1911
|
|
|
1893
1912
|
# @nodoc
|
|
1894
|
-
def
|
|
1895
|
-
wrap_impl(@impl.
|
|
1896
|
-
end
|
|
1897
|
-
|
|
1898
|
-
# @nodoc
|
|
1899
|
-
def stop_js_coverage
|
|
1900
|
-
wrap_impl(@impl.stop_js_coverage)
|
|
1913
|
+
def stop_css_coverage
|
|
1914
|
+
wrap_impl(@impl.stop_css_coverage)
|
|
1901
1915
|
end
|
|
1902
1916
|
|
|
1903
1917
|
# @nodoc
|
|
@@ -1906,8 +1920,8 @@ module Playwright
|
|
|
1906
1920
|
end
|
|
1907
1921
|
|
|
1908
1922
|
# @nodoc
|
|
1909
|
-
def
|
|
1910
|
-
wrap_impl(@impl.
|
|
1923
|
+
def stop_js_coverage
|
|
1924
|
+
wrap_impl(@impl.stop_js_coverage)
|
|
1911
1925
|
end
|
|
1912
1926
|
|
|
1913
1927
|
# @nodoc
|
|
@@ -1920,12 +1934,6 @@ module Playwright
|
|
|
1920
1934
|
wrap_impl(@impl.owned_context=(unwrap_impl(req)))
|
|
1921
1935
|
end
|
|
1922
1936
|
|
|
1923
|
-
# -- inherited from EventEmitter --
|
|
1924
|
-
# @nodoc
|
|
1925
|
-
def off(event, callback)
|
|
1926
|
-
event_emitter_proxy.off(event, callback)
|
|
1927
|
-
end
|
|
1928
|
-
|
|
1929
1937
|
# -- inherited from EventEmitter --
|
|
1930
1938
|
# @nodoc
|
|
1931
1939
|
def once(event, callback)
|
|
@@ -1938,6 +1946,12 @@ module Playwright
|
|
|
1938
1946
|
event_emitter_proxy.on(event, callback)
|
|
1939
1947
|
end
|
|
1940
1948
|
|
|
1949
|
+
# -- inherited from EventEmitter --
|
|
1950
|
+
# @nodoc
|
|
1951
|
+
def off(event, callback)
|
|
1952
|
+
event_emitter_proxy.off(event, callback)
|
|
1953
|
+
end
|
|
1954
|
+
|
|
1941
1955
|
private def event_emitter_proxy
|
|
1942
1956
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
1943
1957
|
end
|
|
@@ -103,12 +103,6 @@ module Playwright
|
|
|
103
103
|
wrap_impl(@impl.electron)
|
|
104
104
|
end
|
|
105
105
|
|
|
106
|
-
# -- inherited from EventEmitter --
|
|
107
|
-
# @nodoc
|
|
108
|
-
def off(event, callback)
|
|
109
|
-
event_emitter_proxy.off(event, callback)
|
|
110
|
-
end
|
|
111
|
-
|
|
112
106
|
# -- inherited from EventEmitter --
|
|
113
107
|
# @nodoc
|
|
114
108
|
def once(event, callback)
|
|
@@ -121,6 +115,12 @@ module Playwright
|
|
|
121
115
|
event_emitter_proxy.on(event, callback)
|
|
122
116
|
end
|
|
123
117
|
|
|
118
|
+
# -- inherited from EventEmitter --
|
|
119
|
+
# @nodoc
|
|
120
|
+
def off(event, callback)
|
|
121
|
+
event_emitter_proxy.off(event, callback)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
124
|
private def event_emitter_proxy
|
|
125
125
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
126
126
|
end
|
|
@@ -217,20 +217,14 @@ module Playwright
|
|
|
217
217
|
wrap_impl(@impl.url)
|
|
218
218
|
end
|
|
219
219
|
|
|
220
|
-
# @nodoc
|
|
221
|
-
def header_values(name)
|
|
222
|
-
wrap_impl(@impl.header_values(unwrap_impl(name)))
|
|
223
|
-
end
|
|
224
|
-
|
|
225
220
|
# @nodoc
|
|
226
221
|
def apply_fallback_overrides(overrides)
|
|
227
222
|
wrap_impl(@impl.apply_fallback_overrides(unwrap_impl(overrides)))
|
|
228
223
|
end
|
|
229
224
|
|
|
230
|
-
# -- inherited from EventEmitter --
|
|
231
225
|
# @nodoc
|
|
232
|
-
def
|
|
233
|
-
|
|
226
|
+
def header_values(name)
|
|
227
|
+
wrap_impl(@impl.header_values(unwrap_impl(name)))
|
|
234
228
|
end
|
|
235
229
|
|
|
236
230
|
# -- inherited from EventEmitter --
|
|
@@ -245,6 +239,12 @@ module Playwright
|
|
|
245
239
|
event_emitter_proxy.on(event, callback)
|
|
246
240
|
end
|
|
247
241
|
|
|
242
|
+
# -- inherited from EventEmitter --
|
|
243
|
+
# @nodoc
|
|
244
|
+
def off(event, callback)
|
|
245
|
+
event_emitter_proxy.off(event, callback)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
248
|
private def event_emitter_proxy
|
|
249
249
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
250
250
|
end
|
|
@@ -133,12 +133,6 @@ module Playwright
|
|
|
133
133
|
wrap_impl(@impl.from_service_worker?)
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
-
# -- inherited from EventEmitter --
|
|
137
|
-
# @nodoc
|
|
138
|
-
def off(event, callback)
|
|
139
|
-
event_emitter_proxy.off(event, callback)
|
|
140
|
-
end
|
|
141
|
-
|
|
142
136
|
# -- inherited from EventEmitter --
|
|
143
137
|
# @nodoc
|
|
144
138
|
def once(event, callback)
|
|
@@ -151,6 +145,12 @@ module Playwright
|
|
|
151
145
|
event_emitter_proxy.on(event, callback)
|
|
152
146
|
end
|
|
153
147
|
|
|
148
|
+
# -- inherited from EventEmitter --
|
|
149
|
+
# @nodoc
|
|
150
|
+
def off(event, callback)
|
|
151
|
+
event_emitter_proxy.off(event, callback)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
154
|
private def event_emitter_proxy
|
|
155
155
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
156
156
|
end
|
data/lib/playwright_api/route.rb
CHANGED
|
@@ -177,12 +177,6 @@ module Playwright
|
|
|
177
177
|
wrap_impl(@impl.redirect_navigation_request(unwrap_impl(url)))
|
|
178
178
|
end
|
|
179
179
|
|
|
180
|
-
# -- inherited from EventEmitter --
|
|
181
|
-
# @nodoc
|
|
182
|
-
def off(event, callback)
|
|
183
|
-
event_emitter_proxy.off(event, callback)
|
|
184
|
-
end
|
|
185
|
-
|
|
186
180
|
# -- inherited from EventEmitter --
|
|
187
181
|
# @nodoc
|
|
188
182
|
def once(event, callback)
|
|
@@ -195,6 +189,12 @@ module Playwright
|
|
|
195
189
|
event_emitter_proxy.on(event, callback)
|
|
196
190
|
end
|
|
197
191
|
|
|
192
|
+
# -- inherited from EventEmitter --
|
|
193
|
+
# @nodoc
|
|
194
|
+
def off(event, callback)
|
|
195
|
+
event_emitter_proxy.off(event, callback)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
198
|
private def event_emitter_proxy
|
|
199
199
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
200
200
|
end
|
|
@@ -127,12 +127,6 @@ module Playwright
|
|
|
127
127
|
wrap_impl(@impl.stop_har)
|
|
128
128
|
end
|
|
129
129
|
|
|
130
|
-
# -- inherited from EventEmitter --
|
|
131
|
-
# @nodoc
|
|
132
|
-
def off(event, callback)
|
|
133
|
-
event_emitter_proxy.off(event, callback)
|
|
134
|
-
end
|
|
135
|
-
|
|
136
130
|
# -- inherited from EventEmitter --
|
|
137
131
|
# @nodoc
|
|
138
132
|
def once(event, callback)
|
|
@@ -145,6 +139,12 @@ module Playwright
|
|
|
145
139
|
event_emitter_proxy.on(event, callback)
|
|
146
140
|
end
|
|
147
141
|
|
|
142
|
+
# -- inherited from EventEmitter --
|
|
143
|
+
# @nodoc
|
|
144
|
+
def off(event, callback)
|
|
145
|
+
event_emitter_proxy.off(event, callback)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
148
|
private def event_emitter_proxy
|
|
149
149
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
150
150
|
end
|
|
@@ -34,12 +34,6 @@ module Playwright
|
|
|
34
34
|
wrap_impl(@impl.wait_for_event(unwrap_impl(event), predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
# -- inherited from EventEmitter --
|
|
38
|
-
# @nodoc
|
|
39
|
-
def off(event, callback)
|
|
40
|
-
event_emitter_proxy.off(event, callback)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
37
|
# -- inherited from EventEmitter --
|
|
44
38
|
# @nodoc
|
|
45
39
|
def once(event, callback)
|
|
@@ -52,6 +46,12 @@ module Playwright
|
|
|
52
46
|
event_emitter_proxy.on(event, callback)
|
|
53
47
|
end
|
|
54
48
|
|
|
49
|
+
# -- inherited from EventEmitter --
|
|
50
|
+
# @nodoc
|
|
51
|
+
def off(event, callback)
|
|
52
|
+
event_emitter_proxy.off(event, callback)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
55
|
private def event_emitter_proxy
|
|
56
56
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
57
57
|
end
|
|
@@ -63,20 +63,14 @@ module Playwright
|
|
|
63
63
|
wrap_impl(@impl.expect_event(unwrap_impl(event), predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
# @nodoc
|
|
67
|
-
def page=(req)
|
|
68
|
-
wrap_impl(@impl.page=(unwrap_impl(req)))
|
|
69
|
-
end
|
|
70
|
-
|
|
71
66
|
# @nodoc
|
|
72
67
|
def context=(req)
|
|
73
68
|
wrap_impl(@impl.context=(unwrap_impl(req)))
|
|
74
69
|
end
|
|
75
70
|
|
|
76
|
-
# -- inherited from EventEmitter --
|
|
77
71
|
# @nodoc
|
|
78
|
-
def
|
|
79
|
-
|
|
72
|
+
def page=(req)
|
|
73
|
+
wrap_impl(@impl.page=(unwrap_impl(req)))
|
|
80
74
|
end
|
|
81
75
|
|
|
82
76
|
# -- inherited from EventEmitter --
|
|
@@ -91,6 +85,12 @@ module Playwright
|
|
|
91
85
|
event_emitter_proxy.on(event, callback)
|
|
92
86
|
end
|
|
93
87
|
|
|
88
|
+
# -- inherited from EventEmitter --
|
|
89
|
+
# @nodoc
|
|
90
|
+
def off(event, callback)
|
|
91
|
+
event_emitter_proxy.off(event, callback)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
94
|
private def event_emitter_proxy
|
|
95
95
|
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
|
96
96
|
end
|
data/playwright.gemspec
CHANGED
|
@@ -14,6 +14,11 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.summary = "The Ruby binding of playwright driver #{Playwright::COMPATIBLE_PLAYWRIGHT_VERSION}"
|
|
15
15
|
spec.homepage = 'https://github.com/YusukeIwaki/playwright-ruby-client'
|
|
16
16
|
spec.license = 'MIT'
|
|
17
|
+
spec.metadata = {
|
|
18
|
+
'documentation_uri' => 'https://playwright-ruby-client.vercel.app/docs/article/getting_started',
|
|
19
|
+
'source_code_uri' => spec.homepage,
|
|
20
|
+
'bug_tracker_uri' => "#{spec.homepage}/issues",
|
|
21
|
+
}
|
|
17
22
|
|
|
18
23
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
19
24
|
`git ls-files -z`.split("\x0").reject do |f|
|