playwright-ruby-client 1.15.1 → 1.17.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/documentation/docs/api/{fetch_request.md → api_request_context.md} +2 -2
- data/documentation/docs/api/browser_context.md +1 -1
- data/documentation/docs/api/element_handle.md +2 -3
- data/documentation/docs/api/frame.md +30 -0
- data/documentation/docs/api/frame_locator.md +70 -0
- data/documentation/docs/api/locator.md +35 -2
- data/documentation/docs/api/page.md +35 -4
- data/documentation/docs/api/request.md +3 -3
- data/documentation/docs/api/selectors.md +1 -1
- data/documentation/docs/api/tracing.md +2 -2
- data/documentation/docs/include/api_coverage.md +26 -7
- data/documentation/package.json +2 -2
- data/documentation/yarn.lock +1430 -1486
- data/lib/playwright/channel_owners/api_request_context.rb +4 -0
- data/lib/playwright/channel_owners/artifact.rb +1 -6
- data/lib/playwright/channel_owners/browser.rb +6 -8
- data/lib/playwright/channel_owners/browser_context.rb +5 -3
- data/lib/playwright/channel_owners/browser_type.rb +0 -1
- data/lib/playwright/channel_owners/fetch_request.rb +5 -1
- data/lib/playwright/channel_owners/frame.rb +13 -7
- data/lib/playwright/channel_owners/page.rb +18 -10
- data/lib/playwright/channel_owners/request.rb +9 -21
- data/lib/playwright/channel_owners/response.rb +0 -4
- data/lib/playwright/connection.rb +9 -0
- data/lib/playwright/frame_locator_impl.rb +49 -0
- data/lib/playwright/locator_impl.rb +17 -5
- data/lib/playwright/route_handler.rb +13 -1
- data/lib/playwright/tracing_impl.rb +6 -9
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright/video.rb +3 -0
- data/lib/playwright.rb +2 -1
- data/lib/playwright_api/api_request_context.rb +149 -0
- data/lib/playwright_api/browser_context.rb +6 -1
- data/lib/playwright_api/element_handle.rb +2 -3
- data/lib/playwright_api/frame.rb +26 -1
- data/lib/playwright_api/frame_locator.rb +51 -0
- data/lib/playwright_api/locator.rb +25 -2
- data/lib/playwright_api/page.rb +35 -9
- data/lib/playwright_api/playwright.rb +5 -0
- data/lib/playwright_api/selectors.rb +2 -2
- data/lib/playwright_api/tracing.rb +4 -4
- data/lib/playwright_api/worker.rb +4 -4
- metadata +11 -7
- data/lib/playwright_api/fetch_request.rb +0 -74
@@ -6,7 +6,7 @@ module Playwright
|
|
6
6
|
# If a page opens another page, e.g. with a `window.open` call, the popup will belong to the parent page's browser
|
7
7
|
# context.
|
8
8
|
#
|
9
|
-
# Playwright allows
|
9
|
+
# Playwright allows creating "incognito" browser contexts with [`method: Browser.newContext`] method. "Incognito" browser
|
10
10
|
# contexts don't write any browsing data to disk.
|
11
11
|
#
|
12
12
|
# ```python sync
|
@@ -20,6 +20,11 @@ module Playwright
|
|
20
20
|
# ```
|
21
21
|
class BrowserContext < PlaywrightApi
|
22
22
|
|
23
|
+
# API testing helper associated with this context. Requests made with this API will use context cookies.
|
24
|
+
def request # property
|
25
|
+
raise NotImplementedError.new('request is not implemented yet.')
|
26
|
+
end
|
27
|
+
|
23
28
|
def tracing # property
|
24
29
|
wrap_impl(@impl.tracing)
|
25
30
|
end
|
@@ -6,6 +6,8 @@ module Playwright
|
|
6
6
|
# ElementHandle represents an in-page DOM element. ElementHandles can be created with the [`method: Page.querySelector`]
|
7
7
|
# method.
|
8
8
|
#
|
9
|
+
# > NOTE: The use of ElementHandle is discouraged, use `Locator` objects and web-first assertions instead.
|
10
|
+
#
|
9
11
|
# ```python sync
|
10
12
|
# href_element = page.query_selector("a")
|
11
13
|
# href_element.click()
|
@@ -17,9 +19,6 @@ module Playwright
|
|
17
19
|
# ElementHandle instances can be used as an argument in [`method: Page.evalOnSelector`] and [`method: Page.evaluate`]
|
18
20
|
# methods.
|
19
21
|
#
|
20
|
-
# > NOTE: In most cases, you would want to use the `Locator` object instead. You should only use `ElementHandle` if you
|
21
|
-
# want to retain a handle to a particular DOM Node that you intend to pass into [`method: Page.evaluate`] as an argument.
|
22
|
-
#
|
23
22
|
# The difference between the `Locator` and ElementHandle is that the ElementHandle points to a particular element, while
|
24
23
|
# `Locator` captures the logic of how to retrieve an element.
|
25
24
|
#
|
data/lib/playwright_api/frame.rb
CHANGED
@@ -183,6 +183,9 @@ module Playwright
|
|
183
183
|
|
184
184
|
# Returns the return value of `expression`.
|
185
185
|
#
|
186
|
+
# > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
|
187
|
+
# tests. Use [`method: Locator.evaluate`], other `Locator` helper methods or web-first assertions instead.
|
188
|
+
#
|
186
189
|
# The method finds an element matching the specified selector within the frame and passes it as a first argument to
|
187
190
|
# `expression`. See [Working with selectors](./selectors.md) for more details. If no elements match the selector, the
|
188
191
|
# method throws an error.
|
@@ -203,6 +206,9 @@ module Playwright
|
|
203
206
|
|
204
207
|
# Returns the return value of `expression`.
|
205
208
|
#
|
209
|
+
# > NOTE: In most cases, [`method: Locator.evaluateAll`], other `Locator` helper methods and web-first assertions do a
|
210
|
+
# better job.
|
211
|
+
#
|
206
212
|
# The method finds all elements matching the specified selector within the frame and passes an array of matched elements
|
207
213
|
# as a first argument to `expression`. See [Working with selectors](./selectors.md) for more details.
|
208
214
|
#
|
@@ -243,7 +249,7 @@ module Playwright
|
|
243
249
|
# `ElementHandle` instances can be passed as an argument to the [`method: Frame.evaluate`]:
|
244
250
|
#
|
245
251
|
# ```python sync
|
246
|
-
# body_handle = frame.
|
252
|
+
# body_handle = frame.evaluate("document.body")
|
247
253
|
# html = frame.evaluate("([body, suffix]) => body.innerHTML + suffix", [body_handle, "hello"])
|
248
254
|
# body_handle.dispose()
|
249
255
|
# ```
|
@@ -324,6 +330,18 @@ module Playwright
|
|
324
330
|
wrap_impl(@impl.frame_element)
|
325
331
|
end
|
326
332
|
|
333
|
+
# When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in
|
334
|
+
# that iframe. Following snippet locates element with text "Submit" in the iframe with id `my-frame`, like `<iframe
|
335
|
+
# id="my-frame">`:
|
336
|
+
#
|
337
|
+
# ```python sync
|
338
|
+
# locator = frame.frame_locator("#my-iframe").locator("text=Submit")
|
339
|
+
# locator.click()
|
340
|
+
# ```
|
341
|
+
def frame_locator(selector)
|
342
|
+
wrap_impl(@impl.frame_locator(unwrap_impl(selector)))
|
343
|
+
end
|
344
|
+
|
327
345
|
# Returns element attribute value.
|
328
346
|
def get_attribute(selector, name, strict: nil, timeout: nil)
|
329
347
|
wrap_impl(@impl.get_attribute(unwrap_impl(selector), unwrap_impl(name), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
@@ -478,6 +496,8 @@ module Playwright
|
|
478
496
|
|
479
497
|
# Returns the ElementHandle pointing to the frame element.
|
480
498
|
#
|
499
|
+
# > NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.
|
500
|
+
#
|
481
501
|
# The method finds an element matching the specified selector within the frame. See
|
482
502
|
# [Working with selectors](./selectors.md) for more details. If no elements match the selector, returns `null`.
|
483
503
|
def query_selector(selector, strict: nil)
|
@@ -486,6 +506,8 @@ module Playwright
|
|
486
506
|
|
487
507
|
# Returns the ElementHandles pointing to the frame elements.
|
488
508
|
#
|
509
|
+
# > NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects instead.
|
510
|
+
#
|
489
511
|
# The method finds all elements matching the specified selector within the frame. See
|
490
512
|
# [Working with selectors](./selectors.md) for more details. If no elements match the selector, returns empty array.
|
491
513
|
def query_selector_all(selector)
|
@@ -714,6 +736,9 @@ module Playwright
|
|
714
736
|
# Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
|
715
737
|
# `detached`.
|
716
738
|
#
|
739
|
+
# > NOTE: Playwright automatically waits for element to be ready before performing an action. Using `Locator` objects and
|
740
|
+
# web-first assertions make the code wait-for-selector-free.
|
741
|
+
#
|
717
742
|
# Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
|
718
743
|
# the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
|
719
744
|
# selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Playwright
|
2
|
+
# FrameLocator represents a view to the `iframe` on the page. It captures the logic sufficient to retrieve the `iframe`
|
3
|
+
# and locate elements in that iframe. FrameLocator can be created with either [`method: Page.frameLocator`] or
|
4
|
+
# [`method: Locator.frameLocator`] method.
|
5
|
+
#
|
6
|
+
# ```python sync
|
7
|
+
# locator = page.frame_locator("my-frame").locator("text=Submit")
|
8
|
+
# locator.click()
|
9
|
+
# ```
|
10
|
+
#
|
11
|
+
# **Strictness**
|
12
|
+
#
|
13
|
+
# Frame locators are strict. This means that all operations on frame locators will throw if more than one element matches
|
14
|
+
# given selector.
|
15
|
+
#
|
16
|
+
# ```python sync
|
17
|
+
# # Throws if there are several frames in DOM:
|
18
|
+
# page.frame_locator('.result-frame').locator('button').click()
|
19
|
+
#
|
20
|
+
# # Works because we explicitly tell locator to pick the first frame:
|
21
|
+
# page.frame_locator('.result-frame').first.locator('button').click()
|
22
|
+
# ```
|
23
|
+
class FrameLocator < PlaywrightApi
|
24
|
+
|
25
|
+
# Returns locator to the first matching frame.
|
26
|
+
def first
|
27
|
+
wrap_impl(@impl.first)
|
28
|
+
end
|
29
|
+
|
30
|
+
# When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in
|
31
|
+
# that iframe.
|
32
|
+
def frame_locator(selector)
|
33
|
+
wrap_impl(@impl.frame_locator(unwrap_impl(selector)))
|
34
|
+
end
|
35
|
+
|
36
|
+
# Returns locator to the last matching frame.
|
37
|
+
def last
|
38
|
+
wrap_impl(@impl.last)
|
39
|
+
end
|
40
|
+
|
41
|
+
# The method finds an element matching the specified selector in the FrameLocator's subtree.
|
42
|
+
def locator(selector)
|
43
|
+
wrap_impl(@impl.locator(unwrap_impl(selector)))
|
44
|
+
end
|
45
|
+
|
46
|
+
# Returns locator to the n-th matching frame.
|
47
|
+
def nth(index)
|
48
|
+
wrap_impl(@impl.nth(unwrap_impl(index)))
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -264,6 +264,17 @@ module Playwright
|
|
264
264
|
wrap_impl(@impl.focus(timeout: unwrap_impl(timeout)))
|
265
265
|
end
|
266
266
|
|
267
|
+
# When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in
|
268
|
+
# that iframe:
|
269
|
+
#
|
270
|
+
# ```python sync
|
271
|
+
# locator = page.frame_locator("text=Submit").locator("text=Submit")
|
272
|
+
# locator.click()
|
273
|
+
# ```
|
274
|
+
def frame_locator(selector)
|
275
|
+
wrap_impl(@impl.frame_locator(unwrap_impl(selector)))
|
276
|
+
end
|
277
|
+
|
267
278
|
# Returns element attribute value.
|
268
279
|
def get_attribute(name, timeout: nil)
|
269
280
|
wrap_impl(@impl.get_attribute(unwrap_impl(name), timeout: unwrap_impl(timeout)))
|
@@ -338,8 +349,7 @@ module Playwright
|
|
338
349
|
wrap_impl(@impl.last)
|
339
350
|
end
|
340
351
|
|
341
|
-
# The method finds an element matching the specified selector in the `Locator`'s subtree.
|
342
|
-
# [Working with selectors](./selectors.md) for more details.
|
352
|
+
# The method finds an element matching the specified selector in the `Locator`'s subtree.
|
343
353
|
def locator(selector)
|
344
354
|
wrap_impl(@impl.locator(unwrap_impl(selector)))
|
345
355
|
end
|
@@ -540,6 +550,19 @@ module Playwright
|
|
540
550
|
wrap_impl(@impl.uncheck(force: unwrap_impl(force), noWaitAfter: unwrap_impl(noWaitAfter), position: unwrap_impl(position), timeout: unwrap_impl(timeout), trial: unwrap_impl(trial)))
|
541
551
|
end
|
542
552
|
|
553
|
+
# Returns when element specified by locator satisfies the `state` option.
|
554
|
+
#
|
555
|
+
# If target element already satisfies the condition, the method returns immediately. Otherwise, waits for up to `timeout`
|
556
|
+
# milliseconds until the condition is met.
|
557
|
+
#
|
558
|
+
# ```python sync
|
559
|
+
# order_sent = page.locator("#order-sent")
|
560
|
+
# order_sent.wait_for()
|
561
|
+
# ```
|
562
|
+
def wait_for(state: nil, timeout: nil)
|
563
|
+
wrap_impl(@impl.wait_for(state: unwrap_impl(state), timeout: unwrap_impl(timeout)))
|
564
|
+
end
|
565
|
+
|
543
566
|
# @nodoc
|
544
567
|
def to_s
|
545
568
|
wrap_impl(@impl.to_s)
|
data/lib/playwright_api/page.rb
CHANGED
@@ -288,6 +288,9 @@ module Playwright
|
|
288
288
|
wrap_impl(@impl.emulate_media(colorScheme: unwrap_impl(colorScheme), forcedColors: unwrap_impl(forcedColors), media: unwrap_impl(media), reducedMotion: unwrap_impl(reducedMotion)))
|
289
289
|
end
|
290
290
|
|
291
|
+
# > NOTE: This method does not wait for the element to pass actionability checks and therefore can lead to the flaky
|
292
|
+
# tests. Use [`method: Locator.evaluate`], other `Locator` helper methods or web-first assertions instead.
|
293
|
+
#
|
291
294
|
# The method finds an element matching the specified selector within the page and passes it as a first argument to
|
292
295
|
# `expression`. If no elements match the selector, the method throws an error. Returns the value of `expression`.
|
293
296
|
#
|
@@ -307,6 +310,9 @@ module Playwright
|
|
307
310
|
wrap_impl(@impl.eval_on_selector(unwrap_impl(selector), unwrap_impl(expression), arg: unwrap_impl(arg), strict: unwrap_impl(strict)))
|
308
311
|
end
|
309
312
|
|
313
|
+
# > NOTE: In most cases, [`method: Locator.evaluateAll`], other `Locator` helper methods and web-first assertions do a
|
314
|
+
# better job.
|
315
|
+
#
|
310
316
|
# The method finds all elements matching the specified selector within the page and passes an array of matched elements as
|
311
317
|
# a first argument to `expression`. Returns the result of `expression` invocation.
|
312
318
|
#
|
@@ -349,7 +355,7 @@ module Playwright
|
|
349
355
|
# `ElementHandle` instances can be passed as an argument to the [`method: Page.evaluate`]:
|
350
356
|
#
|
351
357
|
# ```python sync
|
352
|
-
# body_handle = page.
|
358
|
+
# body_handle = page.evaluate("document.body")
|
353
359
|
# html = page.evaluate("([body, suffix]) => body.innerHTML + suffix", [body_handle, "hello"])
|
354
360
|
# body_handle.dispose()
|
355
361
|
# ```
|
@@ -533,6 +539,18 @@ module Playwright
|
|
533
539
|
wrap_impl(@impl.frame(name: unwrap_impl(name), url: unwrap_impl(url)))
|
534
540
|
end
|
535
541
|
|
542
|
+
# When working with iframes, you can create a frame locator that will enter the iframe and allow selecting elements in
|
543
|
+
# that iframe. Following snippet locates element with text "Submit" in the iframe with id `my-frame`, like `<iframe
|
544
|
+
# id="my-frame">`:
|
545
|
+
#
|
546
|
+
# ```python sync
|
547
|
+
# locator = page.frame_locator("#my-iframe").locator("text=Submit")
|
548
|
+
# locator.click()
|
549
|
+
# ```
|
550
|
+
def frame_locator(selector)
|
551
|
+
wrap_impl(@impl.frame_locator(unwrap_impl(selector)))
|
552
|
+
end
|
553
|
+
|
536
554
|
# An array of all frames attached to the page.
|
537
555
|
def frames
|
538
556
|
wrap_impl(@impl.frames)
|
@@ -791,14 +809,18 @@ module Playwright
|
|
791
809
|
wrap_impl(@impl.press(unwrap_impl(selector), unwrap_impl(key), delay: unwrap_impl(delay), noWaitAfter: unwrap_impl(noWaitAfter), strict: unwrap_impl(strict), timeout: unwrap_impl(timeout)))
|
792
810
|
end
|
793
811
|
|
812
|
+
# > NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.
|
813
|
+
#
|
794
814
|
# The method finds an element matching the specified selector within the page. If no elements match the selector, the
|
795
|
-
# return value resolves to `null`. To wait for an element on the page, use [`method:
|
815
|
+
# return value resolves to `null`. To wait for an element on the page, use [`method: Locator.waitFor`].
|
796
816
|
#
|
797
817
|
# Shortcut for main frame's [`method: Frame.querySelector`].
|
798
818
|
def query_selector(selector, strict: nil)
|
799
819
|
wrap_impl(@impl.query_selector(unwrap_impl(selector), strict: unwrap_impl(strict)))
|
800
820
|
end
|
801
821
|
|
822
|
+
# > NOTE: The use of `ElementHandle` is discouraged, use `Locator` objects and web-first assertions instead.
|
823
|
+
#
|
802
824
|
# The method finds all elements matching the specified selector within the page. If no elements match the selector, the
|
803
825
|
# return value resolves to `[]`.
|
804
826
|
#
|
@@ -807,8 +829,8 @@ module Playwright
|
|
807
829
|
wrap_impl(@impl.query_selector_all(unwrap_impl(selector)))
|
808
830
|
end
|
809
831
|
|
810
|
-
#
|
811
|
-
# last redirect.
|
832
|
+
# This method reloads the current page, in the same way as if the user had triggered a browser refresh. Returns the main
|
833
|
+
# resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.
|
812
834
|
def reload(timeout: nil, waitUntil: nil)
|
813
835
|
wrap_impl(@impl.reload(timeout: unwrap_impl(timeout), waitUntil: unwrap_impl(waitUntil)))
|
814
836
|
end
|
@@ -990,7 +1012,8 @@ module Playwright
|
|
990
1012
|
# [`method: Browser.newContext`] allows to set viewport size (and more) for all pages in the context at once.
|
991
1013
|
#
|
992
1014
|
# `page.setViewportSize` will resize the page. A lot of websites don't expect phones to change size, so you should set the
|
993
|
-
# viewport size before navigating to the page.
|
1015
|
+
# viewport size before navigating to the page. [`method: Page.setViewportSize`] will also reset `screen` size, use
|
1016
|
+
# [`method: Browser.newContext`] with `screen` and `viewport` parameters if you need better control of these properties.
|
994
1017
|
#
|
995
1018
|
# ```python sync
|
996
1019
|
# page = browser.new_page()
|
@@ -1266,6 +1289,9 @@ module Playwright
|
|
1266
1289
|
# Returns when element specified by selector satisfies `state` option. Returns `null` if waiting for `hidden` or
|
1267
1290
|
# `detached`.
|
1268
1291
|
#
|
1292
|
+
# > NOTE: Playwright automatically waits for element to be ready before performing an action. Using `Locator` objects and
|
1293
|
+
# web-first assertions make the code wait-for-selector-free.
|
1294
|
+
#
|
1269
1295
|
# Wait for the `selector` to satisfy `state` option (either appear/disappear from dom, or become visible/hidden). If at
|
1270
1296
|
# the moment of calling the method `selector` already satisfies the condition, the method will return immediately. If the
|
1271
1297
|
# selector doesn't satisfy the condition for the `timeout` milliseconds, the function will throw.
|
@@ -1366,13 +1392,13 @@ module Playwright
|
|
1366
1392
|
end
|
1367
1393
|
|
1368
1394
|
# @nodoc
|
1369
|
-
def
|
1370
|
-
wrap_impl(@impl.
|
1395
|
+
def stop_css_coverage
|
1396
|
+
wrap_impl(@impl.stop_css_coverage)
|
1371
1397
|
end
|
1372
1398
|
|
1373
1399
|
# @nodoc
|
1374
|
-
def
|
1375
|
-
wrap_impl(@impl.
|
1400
|
+
def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
|
1401
|
+
wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
1376
1402
|
end
|
1377
1403
|
|
1378
1404
|
# @nodoc
|
@@ -50,6 +50,11 @@ module Playwright
|
|
50
50
|
wrap_impl(@impl.firefox)
|
51
51
|
end
|
52
52
|
|
53
|
+
# Exposes API that can be used for the Web API testing.
|
54
|
+
def request # property
|
55
|
+
raise NotImplementedError.new('request is not implemented yet.')
|
56
|
+
end
|
57
|
+
|
53
58
|
# Selectors can be used to install custom selector engines. See [Working with selectors](./selectors.md) for more
|
54
59
|
# information.
|
55
60
|
def selectors # property
|
@@ -28,11 +28,11 @@ module Playwright
|
|
28
28
|
# page.set_content('<div><button>Click me</button></div>')
|
29
29
|
#
|
30
30
|
# # Use the selector prefixed with its name.
|
31
|
-
# button = page.
|
31
|
+
# button = page.locator('tag=button')
|
32
32
|
# # Combine it with other selector engines.
|
33
33
|
# page.click('tag=div >> text="Click me"')
|
34
34
|
# # Can use it in any methods supporting selectors.
|
35
|
-
# button_count = page.
|
35
|
+
# button_count = page.locator('tag=button').count()
|
36
36
|
# print(button_count)
|
37
37
|
# browser.close()
|
38
38
|
#
|
@@ -22,8 +22,8 @@ module Playwright
|
|
22
22
|
# page.goto("https://playwright.dev")
|
23
23
|
# context.tracing.stop(path = "trace.zip")
|
24
24
|
# ```
|
25
|
-
def start(name: nil, screenshots: nil, snapshots: nil)
|
26
|
-
wrap_impl(@impl.start(name: unwrap_impl(name), screenshots: unwrap_impl(screenshots), snapshots: unwrap_impl(snapshots)))
|
25
|
+
def start(name: nil, screenshots: nil, snapshots: nil, title: nil)
|
26
|
+
wrap_impl(@impl.start(name: unwrap_impl(name), screenshots: unwrap_impl(screenshots), snapshots: unwrap_impl(snapshots), title: unwrap_impl(title)))
|
27
27
|
end
|
28
28
|
|
29
29
|
# Start a new trace chunk. If you'd like to record multiple traces on the same `BrowserContext`, use
|
@@ -45,8 +45,8 @@ module Playwright
|
|
45
45
|
# # Save a second trace file with different actions.
|
46
46
|
# context.tracing.stop_chunk(path = "trace2.zip")
|
47
47
|
# ```
|
48
|
-
def start_chunk
|
49
|
-
wrap_impl(@impl.start_chunk)
|
48
|
+
def start_chunk(title: nil)
|
49
|
+
wrap_impl(@impl.start_chunk(title: unwrap_impl(title)))
|
50
50
|
end
|
51
51
|
|
52
52
|
# Stop tracing.
|
@@ -44,13 +44,13 @@ module Playwright
|
|
44
44
|
end
|
45
45
|
|
46
46
|
# @nodoc
|
47
|
-
def
|
48
|
-
wrap_impl(@impl.
|
47
|
+
def page=(req)
|
48
|
+
wrap_impl(@impl.page=(unwrap_impl(req)))
|
49
49
|
end
|
50
50
|
|
51
51
|
# @nodoc
|
52
|
-
def
|
53
|
-
wrap_impl(@impl.
|
52
|
+
def context=(req)
|
53
|
+
wrap_impl(@impl.context=(unwrap_impl(req)))
|
54
54
|
end
|
55
55
|
|
56
56
|
# -- inherited from EventEmitter --
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playwright-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -210,6 +210,7 @@ files:
|
|
210
210
|
- documentation/README.md
|
211
211
|
- documentation/babel.config.js
|
212
212
|
- documentation/docs/api/accessibility.md
|
213
|
+
- documentation/docs/api/api_request_context.md
|
213
214
|
- documentation/docs/api/browser.md
|
214
215
|
- documentation/docs/api/browser_context.md
|
215
216
|
- documentation/docs/api/browser_type.md
|
@@ -224,9 +225,9 @@ files:
|
|
224
225
|
- documentation/docs/api/experimental/android_input.md
|
225
226
|
- documentation/docs/api/experimental/android_socket.md
|
226
227
|
- documentation/docs/api/experimental/android_web_view.md
|
227
|
-
- documentation/docs/api/fetch_request.md
|
228
228
|
- documentation/docs/api/file_chooser.md
|
229
229
|
- documentation/docs/api/frame.md
|
230
|
+
- documentation/docs/api/frame_locator.md
|
230
231
|
- documentation/docs/api/js_handle.md
|
231
232
|
- documentation/docs/api/keyboard.md
|
232
233
|
- documentation/docs/api/locator.md
|
@@ -278,6 +279,7 @@ files:
|
|
278
279
|
- lib/playwright/channel_owner.rb
|
279
280
|
- lib/playwright/channel_owners/android.rb
|
280
281
|
- lib/playwright/channel_owners/android_device.rb
|
282
|
+
- lib/playwright/channel_owners/api_request_context.rb
|
281
283
|
- lib/playwright/channel_owners/artifact.rb
|
282
284
|
- lib/playwright/channel_owners/binding_call.rb
|
283
285
|
- lib/playwright/channel_owners/browser.rb
|
@@ -307,6 +309,7 @@ files:
|
|
307
309
|
- lib/playwright/event_emitter_proxy.rb
|
308
310
|
- lib/playwright/events.rb
|
309
311
|
- lib/playwright/file_chooser_impl.rb
|
312
|
+
- lib/playwright/frame_locator_impl.rb
|
310
313
|
- lib/playwright/http_headers.rb
|
311
314
|
- lib/playwright/input_files.rb
|
312
315
|
- lib/playwright/javascript.rb
|
@@ -337,6 +340,7 @@ files:
|
|
337
340
|
- lib/playwright_api/android_input.rb
|
338
341
|
- lib/playwright_api/android_socket.rb
|
339
342
|
- lib/playwright_api/android_web_view.rb
|
343
|
+
- lib/playwright_api/api_request_context.rb
|
340
344
|
- lib/playwright_api/browser.rb
|
341
345
|
- lib/playwright_api/browser_context.rb
|
342
346
|
- lib/playwright_api/browser_type.rb
|
@@ -345,9 +349,9 @@ files:
|
|
345
349
|
- lib/playwright_api/dialog.rb
|
346
350
|
- lib/playwright_api/download.rb
|
347
351
|
- lib/playwright_api/element_handle.rb
|
348
|
-
- lib/playwright_api/fetch_request.rb
|
349
352
|
- lib/playwright_api/file_chooser.rb
|
350
353
|
- lib/playwright_api/frame.rb
|
354
|
+
- lib/playwright_api/frame_locator.rb
|
351
355
|
- lib/playwright_api/js_handle.rb
|
352
356
|
- lib/playwright_api/keyboard.rb
|
353
357
|
- lib/playwright_api/locator.rb
|
@@ -378,12 +382,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
378
382
|
version: '2.4'
|
379
383
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
380
384
|
requirements:
|
381
|
-
- - "
|
385
|
+
- - ">"
|
382
386
|
- !ruby/object:Gem::Version
|
383
|
-
version:
|
387
|
+
version: 1.3.1
|
384
388
|
requirements: []
|
385
389
|
rubygems_version: 3.2.22
|
386
390
|
signing_key:
|
387
391
|
specification_version: 4
|
388
|
-
summary: The Ruby binding of playwright driver 1.
|
392
|
+
summary: The Ruby binding of playwright driver 1.17.0
|
389
393
|
test_files: []
|
@@ -1,74 +0,0 @@
|
|
1
|
-
module Playwright
|
2
|
-
# This API is used for Web API testing. You can use it to trigger API endpoints, configure micro-services, prepare
|
3
|
-
# environment or the service to your e2e test. When used on `Page` or a `BrowserContext`, this API will automatically use
|
4
|
-
# the cookies from the corresponding `BrowserContext`. This means that if you log in using this API, your e2e test will be
|
5
|
-
# logged in and vice versa.
|
6
|
-
class FetchRequest < PlaywrightApi
|
7
|
-
|
8
|
-
# All responses received through [`method: FetchRequest.fetch`], [`method: FetchRequest.get`],
|
9
|
-
# [`method: FetchRequest.post`] and other methods are stored in the memory, so that you can later call
|
10
|
-
# [`method: FetchResponse.body`]. This method discards all stored responses, and makes [`method: FetchResponse.body`]
|
11
|
-
# throw "Response disposed" error.
|
12
|
-
def dispose
|
13
|
-
raise NotImplementedError.new('dispose is not implemented yet.')
|
14
|
-
end
|
15
|
-
|
16
|
-
# Sends HTTP(S) fetch and returns its response. The method will populate fetch cookies from the context and update context
|
17
|
-
# cookies from the response. The method will automatically follow redirects.
|
18
|
-
def fetch(
|
19
|
-
urlOrRequest,
|
20
|
-
data: nil,
|
21
|
-
failOnStatusCode: nil,
|
22
|
-
headers: nil,
|
23
|
-
method: nil,
|
24
|
-
params: nil,
|
25
|
-
timeout: nil)
|
26
|
-
raise NotImplementedError.new('fetch is not implemented yet.')
|
27
|
-
end
|
28
|
-
|
29
|
-
# Sends HTTP(S) GET request and returns its response. The method will populate fetch cookies from the context and update
|
30
|
-
# context cookies from the response. The method will automatically follow redirects.
|
31
|
-
def get(
|
32
|
-
urlOrRequest,
|
33
|
-
failOnStatusCode: nil,
|
34
|
-
headers: nil,
|
35
|
-
params: nil,
|
36
|
-
timeout: nil)
|
37
|
-
raise NotImplementedError.new('get is not implemented yet.')
|
38
|
-
end
|
39
|
-
|
40
|
-
# Sends HTTP(S) fetch and returns its response. The method will populate fetch cookies from the context and update context
|
41
|
-
# cookies from the response. The method will automatically follow redirects.
|
42
|
-
def post(
|
43
|
-
urlOrRequest,
|
44
|
-
data: nil,
|
45
|
-
failOnStatusCode: nil,
|
46
|
-
headers: nil,
|
47
|
-
params: nil,
|
48
|
-
timeout: nil)
|
49
|
-
raise NotImplementedError.new('post is not implemented yet.')
|
50
|
-
end
|
51
|
-
|
52
|
-
# -- inherited from EventEmitter --
|
53
|
-
# @nodoc
|
54
|
-
def off(event, callback)
|
55
|
-
event_emitter_proxy.off(event, callback)
|
56
|
-
end
|
57
|
-
|
58
|
-
# -- inherited from EventEmitter --
|
59
|
-
# @nodoc
|
60
|
-
def once(event, callback)
|
61
|
-
event_emitter_proxy.once(event, callback)
|
62
|
-
end
|
63
|
-
|
64
|
-
# -- inherited from EventEmitter --
|
65
|
-
# @nodoc
|
66
|
-
def on(event, callback)
|
67
|
-
event_emitter_proxy.on(event, callback)
|
68
|
-
end
|
69
|
-
|
70
|
-
private def event_emitter_proxy
|
71
|
-
@event_emitter_proxy ||= EventEmitterProxy.new(self, @impl)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|