playwright-ruby-client 1.38.0 → 1.39.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/documentation/docs/api/browser.md +13 -9
- data/documentation/docs/api/browser_context.md +51 -32
- data/documentation/docs/api/browser_type.md +12 -7
- data/documentation/docs/api/dialog.md +18 -15
- data/documentation/docs/api/element_handle.md +6 -5
- data/documentation/docs/api/frame.md +54 -24
- data/documentation/docs/api/locator.md +26 -0
- data/documentation/docs/api/page.md +101 -48
- data/documentation/docs/api/playwright.md +23 -20
- data/documentation/docs/api/selectors.md +34 -29
- data/lib/playwright/channel.rb +8 -0
- data/lib/playwright/channel_owner.rb +7 -2
- data/lib/playwright/channel_owners/browser_context.rb +1 -1
- data/lib/playwright/channel_owners/local_utils.rb +27 -0
- data/lib/playwright/channel_owners/playwright.rb +1 -24
- data/lib/playwright/connection.rb +1 -1
- data/lib/playwright/console_message_impl.rb +29 -0
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/browser.rb +2 -2
- data/lib/playwright_api/browser_context.rb +4 -4
- data/lib/playwright_api/browser_type.rb +2 -2
- data/lib/playwright_api/console_message.rb +0 -22
- data/lib/playwright_api/dialog.rb +2 -2
- data/lib/playwright_api/element_handle.rb +1 -1
- data/lib/playwright_api/frame.rb +7 -7
- data/lib/playwright_api/locator.rb +26 -0
- data/lib/playwright_api/page.rb +23 -23
- data/lib/playwright_api/playwright.rb +4 -4
- data/lib/playwright_api/selectors.rb +2 -2
- metadata +4 -4
- data/lib/playwright/channel_owners/console_message.rb +0 -25
data/lib/playwright_api/page.rb
CHANGED
@@ -8,9 +8,9 @@ module Playwright
|
|
8
8
|
# This example creates a page, navigates it to a URL, and then saves a screenshot:
|
9
9
|
#
|
10
10
|
# ```python sync
|
11
|
-
# from playwright.sync_api import sync_playwright
|
11
|
+
# from playwright.sync_api import sync_playwright, Playwright
|
12
12
|
#
|
13
|
-
# def run(playwright):
|
13
|
+
# def run(playwright: Playwright):
|
14
14
|
# webkit = playwright.webkit
|
15
15
|
# browser = webkit.launch()
|
16
16
|
# context = browser.new_context()
|
@@ -438,9 +438,9 @@ module Playwright
|
|
438
438
|
# An example of exposing page URL to all frames in a page:
|
439
439
|
#
|
440
440
|
# ```python sync
|
441
|
-
# from playwright.sync_api import sync_playwright
|
441
|
+
# from playwright.sync_api import sync_playwright, Playwright
|
442
442
|
#
|
443
|
-
# def run(playwright):
|
443
|
+
# def run(playwright: Playwright):
|
444
444
|
# webkit = playwright.webkit
|
445
445
|
# browser = webkit.launch(headless=false)
|
446
446
|
# context = browser.new_context()
|
@@ -496,7 +496,7 @@ module Playwright
|
|
496
496
|
#
|
497
497
|
# ```python sync
|
498
498
|
# import hashlib
|
499
|
-
# from playwright.sync_api import sync_playwright
|
499
|
+
# from playwright.sync_api import sync_playwright, Playwright
|
500
500
|
#
|
501
501
|
# def sha256(text):
|
502
502
|
# m = hashlib.sha256()
|
@@ -504,7 +504,7 @@ module Playwright
|
|
504
504
|
# return m.hexdigest()
|
505
505
|
#
|
506
506
|
#
|
507
|
-
# def run(playwright):
|
507
|
+
# def run(playwright: Playwright):
|
508
508
|
# webkit = playwright.webkit
|
509
509
|
# browser = webkit.launch(headless=False)
|
510
510
|
# page = browser.new_page()
|
@@ -1176,7 +1176,7 @@ module Playwright
|
|
1176
1176
|
# **Usage**
|
1177
1177
|
#
|
1178
1178
|
# ```python sync
|
1179
|
-
# #
|
1179
|
+
# # Single selection matching the value or label
|
1180
1180
|
# page.select_option("select#colors", "blue")
|
1181
1181
|
# # single selection matching both the label
|
1182
1182
|
# page.select_option("select#colors", label="blue")
|
@@ -1441,9 +1441,9 @@ module Playwright
|
|
1441
1441
|
# The [`method: Page.waitForFunction`] can be used to observe viewport size change:
|
1442
1442
|
#
|
1443
1443
|
# ```python sync
|
1444
|
-
# from playwright.sync_api import sync_playwright
|
1444
|
+
# from playwright.sync_api import sync_playwright, Playwright
|
1445
1445
|
#
|
1446
|
-
# def run(playwright):
|
1446
|
+
# def run(playwright: Playwright):
|
1447
1447
|
# webkit = playwright.webkit
|
1448
1448
|
# browser = webkit.launch()
|
1449
1449
|
# page = browser.new_page()
|
@@ -1587,9 +1587,9 @@ module Playwright
|
|
1587
1587
|
# This method works across navigations:
|
1588
1588
|
#
|
1589
1589
|
# ```python sync
|
1590
|
-
# from playwright.sync_api import sync_playwright
|
1590
|
+
# from playwright.sync_api import sync_playwright, Playwright
|
1591
1591
|
#
|
1592
|
-
# def run(playwright):
|
1592
|
+
# def run(playwright: Playwright):
|
1593
1593
|
# chromium = playwright.chromium
|
1594
1594
|
# browser = chromium.launch()
|
1595
1595
|
# page = browser.new_page()
|
@@ -1671,33 +1671,33 @@ module Playwright
|
|
1671
1671
|
end
|
1672
1672
|
|
1673
1673
|
# @nodoc
|
1674
|
-
def
|
1675
|
-
wrap_impl(@impl.
|
1674
|
+
def stop_css_coverage
|
1675
|
+
wrap_impl(@impl.stop_css_coverage)
|
1676
1676
|
end
|
1677
1677
|
|
1678
1678
|
# @nodoc
|
1679
|
-
def
|
1680
|
-
wrap_impl(@impl.
|
1679
|
+
def stop_js_coverage
|
1680
|
+
wrap_impl(@impl.stop_js_coverage)
|
1681
1681
|
end
|
1682
1682
|
|
1683
1683
|
# @nodoc
|
1684
|
-
def
|
1685
|
-
wrap_impl(@impl.
|
1684
|
+
def start_css_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
|
1685
|
+
wrap_impl(@impl.start_css_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
1686
1686
|
end
|
1687
1687
|
|
1688
1688
|
# @nodoc
|
1689
|
-
def
|
1690
|
-
wrap_impl(@impl.
|
1689
|
+
def owned_context=(req)
|
1690
|
+
wrap_impl(@impl.owned_context=(unwrap_impl(req)))
|
1691
1691
|
end
|
1692
1692
|
|
1693
1693
|
# @nodoc
|
1694
|
-
def
|
1695
|
-
wrap_impl(@impl.
|
1694
|
+
def guid
|
1695
|
+
wrap_impl(@impl.guid)
|
1696
1696
|
end
|
1697
1697
|
|
1698
1698
|
# @nodoc
|
1699
|
-
def
|
1700
|
-
wrap_impl(@impl.
|
1699
|
+
def start_js_coverage(resetOnNavigation: nil, reportAnonymousScripts: nil)
|
1700
|
+
wrap_impl(@impl.start_js_coverage(resetOnNavigation: unwrap_impl(resetOnNavigation), reportAnonymousScripts: unwrap_impl(reportAnonymousScripts)))
|
1701
1701
|
end
|
1702
1702
|
|
1703
1703
|
# -- inherited from EventEmitter --
|
@@ -4,9 +4,9 @@ module Playwright
|
|
4
4
|
# to drive automation:
|
5
5
|
#
|
6
6
|
# ```python sync
|
7
|
-
# from playwright.sync_api import sync_playwright
|
7
|
+
# from playwright.sync_api import sync_playwright, Playwright
|
8
8
|
#
|
9
|
-
# def run(playwright):
|
9
|
+
# def run(playwright: Playwright):
|
10
10
|
# chromium = playwright.chromium # or "firefox" or "webkit".
|
11
11
|
# browser = chromium.launch()
|
12
12
|
# page = browser.new_page()
|
@@ -29,9 +29,9 @@ module Playwright
|
|
29
29
|
# Returns a dictionary of devices to be used with [`method: Browser.newContext`] or [`method: Browser.newPage`].
|
30
30
|
#
|
31
31
|
# ```python sync
|
32
|
-
# from playwright.sync_api import sync_playwright
|
32
|
+
# from playwright.sync_api import sync_playwright, Playwright
|
33
33
|
#
|
34
|
-
# def run(playwright):
|
34
|
+
# def run(playwright: Playwright):
|
35
35
|
# webkit = playwright.webkit
|
36
36
|
# iphone = playwright.devices["iPhone 6"]
|
37
37
|
# browser = webkit.launch()
|
@@ -12,9 +12,9 @@ module Playwright
|
|
12
12
|
# An example of registering selector engine that queries elements based on a tag name:
|
13
13
|
#
|
14
14
|
# ```python sync
|
15
|
-
# from playwright.sync_api import sync_playwright
|
15
|
+
# from playwright.sync_api import sync_playwright, Playwright
|
16
16
|
#
|
17
|
-
# def run(playwright):
|
17
|
+
# def run(playwright: Playwright):
|
18
18
|
# tag_selector = """
|
19
19
|
# {
|
20
20
|
# // Returns the first element matching given selector in the root's subtree.
|
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.39.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -289,7 +289,6 @@ files:
|
|
289
289
|
- lib/playwright/channel_owners/browser_context.rb
|
290
290
|
- lib/playwright/channel_owners/browser_type.rb
|
291
291
|
- lib/playwright/channel_owners/cdp_session.rb
|
292
|
-
- lib/playwright/channel_owners/console_message.rb
|
293
292
|
- lib/playwright/channel_owners/dialog.rb
|
294
293
|
- lib/playwright/channel_owners/electron.rb
|
295
294
|
- lib/playwright/channel_owners/element_handle.rb
|
@@ -309,6 +308,7 @@ files:
|
|
309
308
|
- lib/playwright/channel_owners/worker.rb
|
310
309
|
- lib/playwright/channel_owners/writable_stream.rb
|
311
310
|
- lib/playwright/connection.rb
|
311
|
+
- lib/playwright/console_message_impl.rb
|
312
312
|
- lib/playwright/download_impl.rb
|
313
313
|
- lib/playwright/errors.rb
|
314
314
|
- lib/playwright/event_emitter.rb
|
@@ -401,5 +401,5 @@ requirements: []
|
|
401
401
|
rubygems_version: 3.3.26
|
402
402
|
signing_key:
|
403
403
|
specification_version: 4
|
404
|
-
summary: The Ruby binding of playwright driver 1.
|
404
|
+
summary: The Ruby binding of playwright driver 1.39.0
|
405
405
|
test_files: []
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Playwright
|
2
|
-
define_channel_owner :ConsoleMessage do
|
3
|
-
def page
|
4
|
-
@page ||= ChannelOwners::Page.from_nullable(@initializer['page'])
|
5
|
-
end
|
6
|
-
|
7
|
-
def type
|
8
|
-
@initializer['type']
|
9
|
-
end
|
10
|
-
|
11
|
-
def text
|
12
|
-
@initializer['text']
|
13
|
-
end
|
14
|
-
|
15
|
-
def args
|
16
|
-
@initializer['args']&.map do |arg|
|
17
|
-
ChannelOwner.from(arg)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def location
|
22
|
-
@initialize['location']
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|