playwright-ruby-client 1.53.0 → 1.54.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_context.md +1 -1
- data/documentation/docs/api/console_message.md +0 -3
- data/documentation/docs/api/frame.md +1 -0
- data/documentation/docs/api/frame_locator.md +1 -0
- data/documentation/docs/api/locator.md +1 -0
- data/documentation/docs/api/mouse.md +2 -0
- data/documentation/docs/api/page.md +1 -0
- data/lib/playwright/channel_owners/frame.rb +25 -1
- data/lib/playwright/locator_impl.rb +2 -24
- data/lib/playwright/page_assertions_impl.rb +2 -2
- data/lib/playwright/transport.rb +1 -1
- data/lib/playwright/version.rb +2 -2
- data/lib/playwright_api/browser_context.rb +1 -1
- data/lib/playwright_api/console_message.rb +0 -4
- data/lib/playwright_api/frame.rb +8 -2
- data/lib/playwright_api/frame_locator.rb +1 -0
- data/lib/playwright_api/locator.rb +1 -0
- data/lib/playwright_api/mouse.rb +2 -0
- data/lib/playwright_api/page.rb +1 -0
- data/lib/playwright_api/playwright.rb +4 -4
- data/lib/playwright_api/response.rb +4 -4
- data/sig/playwright.rbs +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d26f10b0192fbc1b4fd2e1724fca389df99b9857388d57b35f30913f15bb3767
|
4
|
+
data.tar.gz: 6d13481a4553b0a91dc138179254973afdcaf27e06071a703aec338894f13266
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4ec72f8748fc736afa98fdfb0f01022170714422fc1be92b024cb88f87a40aa7539850c3b0127c935ab0cb848c0c6a9a4f7841021dca6c4669a2ac9c8600bd0
|
7
|
+
data.tar.gz: 530c3ac3a4dd1343ccac9af49d7f1fa85c45e296f496f398bb1d6d05532e66d7d6ecab0f27a5810801f41d3d04bfea29de8bc3709462a5d94598b3fa1e3bfe47
|
@@ -85,7 +85,7 @@ def browser
|
|
85
85
|
```
|
86
86
|
|
87
87
|
|
88
|
-
|
88
|
+
Gets the browser instance that owns the context. Returns `null` if the context is created outside of normal browser, e.g. Android or Electron.
|
89
89
|
|
90
90
|
## clear_cookies
|
91
91
|
|
@@ -74,6 +74,3 @@ def type
|
|
74
74
|
```
|
75
75
|
|
76
76
|
|
77
|
-
One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`,
|
78
|
-
`'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`,
|
79
|
-
`'count'`, `'timeEnd'`.
|
@@ -7,6 +7,8 @@ sidebar_position: 10
|
|
7
7
|
|
8
8
|
The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
|
9
9
|
|
10
|
+
**NOTE**: If you want to debug where the mouse moved, you can use the [Trace viewer](https://playwright.dev/python/docs/trace-viewer-intro) or [Playwright Inspector](https://playwright.dev/python/docs/running-tests). A red dot showing the location of the mouse will be shown for every mouse action.
|
11
|
+
|
10
12
|
Every `page` object has its own Mouse, accessible with [Page#mouse](./page#mouse).
|
11
13
|
|
12
14
|
```ruby
|
@@ -666,7 +666,7 @@ module Playwright
|
|
666
666
|
end
|
667
667
|
|
668
668
|
def wait_for_timeout(timeout)
|
669
|
-
@channel.send_message_to_server('waitForTimeout',
|
669
|
+
@channel.send_message_to_server('waitForTimeout', waitTimeout: timeout)
|
670
670
|
|
671
671
|
nil
|
672
672
|
end
|
@@ -688,6 +688,30 @@ module Playwright
|
|
688
688
|
@channel.send_message_to_server('highlight', selector: selector)
|
689
689
|
end
|
690
690
|
|
691
|
+
def expect(selector, expression, options, title)
|
692
|
+
if options.key?(:expectedValue)
|
693
|
+
options[:expectedValue] = JavaScript::ValueSerializer
|
694
|
+
.new(options[:expectedValue])
|
695
|
+
.serialize
|
696
|
+
end
|
697
|
+
|
698
|
+
result = @channel.send_message_to_server_result(
|
699
|
+
title, # title
|
700
|
+
"expect", # method
|
701
|
+
{ # params
|
702
|
+
selector: selector,
|
703
|
+
expression: expression,
|
704
|
+
**options,
|
705
|
+
}.compact
|
706
|
+
)
|
707
|
+
|
708
|
+
if result.key?('received')
|
709
|
+
result['received'] = JavaScript::ValueParser.new(result['received']).parse
|
710
|
+
end
|
711
|
+
|
712
|
+
result
|
713
|
+
end
|
714
|
+
|
691
715
|
# @param page [Page]
|
692
716
|
# @note This method should be used internally. Accessed via .send method, so keep private!
|
693
717
|
private def update_page_from_page(page)
|
@@ -335,9 +335,7 @@ module Playwright
|
|
335
335
|
end
|
336
336
|
|
337
337
|
def generate_locator_string
|
338
|
-
|
339
|
-
handle.channel.send_message_to_server('generateLocatorString')
|
340
|
-
end
|
338
|
+
@frame.channel.send_message_to_server('generateLocatorString', { selector: @selector })
|
341
339
|
end
|
342
340
|
|
343
341
|
def hover(
|
@@ -520,27 +518,7 @@ module Playwright
|
|
520
518
|
end
|
521
519
|
|
522
520
|
def expect(expression, options, title)
|
523
|
-
|
524
|
-
options[:expectedValue] = JavaScript::ValueSerializer
|
525
|
-
.new(options[:expectedValue])
|
526
|
-
.serialize
|
527
|
-
end
|
528
|
-
|
529
|
-
result = @frame.channel.send_message_to_server_result(
|
530
|
-
title, # title
|
531
|
-
"expect", # method
|
532
|
-
{ # params
|
533
|
-
selector: @selector,
|
534
|
-
expression: expression,
|
535
|
-
**options,
|
536
|
-
}
|
537
|
-
)
|
538
|
-
|
539
|
-
if result.key?('received')
|
540
|
-
result['received'] = JavaScript::ValueParser.new(result['received']).parse
|
541
|
-
end
|
542
|
-
|
543
|
-
result
|
521
|
+
@frame.expect(@selector, expression, options, title)
|
544
522
|
end
|
545
523
|
end
|
546
524
|
end
|
@@ -13,7 +13,7 @@ module Playwright
|
|
13
13
|
|
14
14
|
def initialize(page, default_expect_timeout, is_not, message)
|
15
15
|
@page = PlaywrightApi.unwrap(page)
|
16
|
-
@
|
16
|
+
@frame = @page.main_frame
|
17
17
|
@default_expect_timeout = default_expect_timeout
|
18
18
|
@is_not = is_not
|
19
19
|
@custom_message = message
|
@@ -25,7 +25,7 @@ module Playwright
|
|
25
25
|
message.gsub!("expected to", "not expected to") if @is_not
|
26
26
|
expect_options.delete(:useInnerText) if expect_options.key?(:useInnerText) && expect_options[:useInnerText].nil?
|
27
27
|
|
28
|
-
result = @
|
28
|
+
result = @frame.expect(nil, expression, expect_options, title)
|
29
29
|
|
30
30
|
if result["matches"] == @is_not
|
31
31
|
actual = result["received"]
|
data/lib/playwright/transport.rb
CHANGED
data/lib/playwright/version.rb
CHANGED
@@ -80,7 +80,7 @@ module Playwright
|
|
80
80
|
end
|
81
81
|
|
82
82
|
#
|
83
|
-
#
|
83
|
+
# Gets the browser instance that owns the context. Returns `null` if the context is created outside of normal browser, e.g. Android or Electron.
|
84
84
|
def browser
|
85
85
|
wrap_impl(@impl.browser)
|
86
86
|
end
|
@@ -45,10 +45,6 @@ module Playwright
|
|
45
45
|
wrap_impl(@impl.text)
|
46
46
|
end
|
47
47
|
|
48
|
-
#
|
49
|
-
# One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`,
|
50
|
-
# `'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`,
|
51
|
-
# `'count'`, `'timeEnd'`.
|
52
48
|
def type
|
53
49
|
wrap_impl(@impl.type)
|
54
50
|
end
|
data/lib/playwright_api/frame.rb
CHANGED
@@ -487,6 +487,7 @@ module Playwright
|
|
487
487
|
def get_by_test_id(testId)
|
488
488
|
wrap_impl(@impl.get_by_test_id(unwrap_impl(testId)))
|
489
489
|
end
|
490
|
+
alias_method :get_by_testid, :get_by_test_id
|
490
491
|
|
491
492
|
#
|
492
493
|
# Allows locating elements that contain given text.
|
@@ -1038,14 +1039,19 @@ module Playwright
|
|
1038
1039
|
wrap_impl(@impl.wait_for_url(unwrap_impl(url), timeout: unwrap_impl(timeout), waitUntil: unwrap_impl(waitUntil)))
|
1039
1040
|
end
|
1040
1041
|
|
1042
|
+
# @nodoc
|
1043
|
+
def detached=(req)
|
1044
|
+
wrap_impl(@impl.detached=(unwrap_impl(req)))
|
1045
|
+
end
|
1046
|
+
|
1041
1047
|
# @nodoc
|
1042
1048
|
def highlight(selector)
|
1043
1049
|
wrap_impl(@impl.highlight(unwrap_impl(selector)))
|
1044
1050
|
end
|
1045
1051
|
|
1046
1052
|
# @nodoc
|
1047
|
-
def
|
1048
|
-
wrap_impl(@impl.
|
1053
|
+
def expect(selector, expression, options, title)
|
1054
|
+
wrap_impl(@impl.expect(unwrap_impl(selector), unwrap_impl(expression), unwrap_impl(options), unwrap_impl(title)))
|
1049
1055
|
end
|
1050
1056
|
|
1051
1057
|
# -- inherited from EventEmitter --
|
data/lib/playwright_api/mouse.rb
CHANGED
@@ -2,6 +2,8 @@ module Playwright
|
|
2
2
|
#
|
3
3
|
# The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
|
4
4
|
#
|
5
|
+
# **NOTE**: If you want to debug where the mouse moved, you can use the [Trace viewer](../trace-viewer-intro.md) or [Playwright Inspector](../running-tests.md). A red dot showing the location of the mouse will be shown for every mouse action.
|
6
|
+
#
|
5
7
|
# Every `page` object has its own Mouse, accessible with [`property: Page.mouse`].
|
6
8
|
#
|
7
9
|
# ```python sync
|
data/lib/playwright_api/page.rb
CHANGED
@@ -94,13 +94,13 @@ module Playwright
|
|
94
94
|
end
|
95
95
|
|
96
96
|
# @nodoc
|
97
|
-
def
|
98
|
-
wrap_impl(@impl.
|
97
|
+
def electron
|
98
|
+
wrap_impl(@impl.electron)
|
99
99
|
end
|
100
100
|
|
101
101
|
# @nodoc
|
102
|
-
def
|
103
|
-
wrap_impl(@impl.
|
102
|
+
def android
|
103
|
+
wrap_impl(@impl.android)
|
104
104
|
end
|
105
105
|
|
106
106
|
# -- inherited from EventEmitter --
|
@@ -118,13 +118,13 @@ module Playwright
|
|
118
118
|
end
|
119
119
|
|
120
120
|
# @nodoc
|
121
|
-
def
|
122
|
-
wrap_impl(@impl.
|
121
|
+
def from_service_worker?
|
122
|
+
wrap_impl(@impl.from_service_worker?)
|
123
123
|
end
|
124
124
|
|
125
125
|
# @nodoc
|
126
|
-
def
|
127
|
-
wrap_impl(@impl.
|
126
|
+
def ok?
|
127
|
+
wrap_impl(@impl.ok?)
|
128
128
|
end
|
129
129
|
|
130
130
|
# -- inherited from EventEmitter --
|
data/sig/playwright.rbs
CHANGED
@@ -170,6 +170,7 @@ module Playwright
|
|
170
170
|
def get_by_placeholder: ((String | Regexp) text, ?exact: bool) -> Locator
|
171
171
|
def get_by_role: (("alert" | "alertdialog" | "application" | "article" | "banner" | "blockquote" | "button" | "caption" | "cell" | "checkbox" | "code" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "deletion" | "dialog" | "directory" | "document" | "emphasis" | "feed" | "figure" | "form" | "generic" | "grid" | "gridcell" | "group" | "heading" | "img" | "insertion" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "meter" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "navigation" | "none" | "note" | "option" | "paragraph" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "strong" | "subscript" | "superscript" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "time" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem") role, ?checked: bool, ?disabled: bool, ?exact: bool, ?expanded: bool, ?includeHidden: bool, ?level: Integer, ?name: (String | Regexp), ?pressed: bool, ?selected: bool) -> Locator
|
172
172
|
def get_by_test_id: ((String | Regexp) testId) -> Locator
|
173
|
+
def get_by_testid: ((String | Regexp) testId) -> Locator
|
173
174
|
def get_by_text: ((String | Regexp) text, ?exact: bool) -> Locator
|
174
175
|
def get_by_title: ((String | Regexp) text, ?exact: bool) -> Locator
|
175
176
|
def goto: (String url, ?referer: String, ?timeout: Float, ?waitUntil: ("load" | "domcontentloaded" | "networkidle" | "commit")) -> (nil | Response)
|
@@ -239,7 +240,7 @@ module Playwright
|
|
239
240
|
def location: -> Hash[untyped, untyped]
|
240
241
|
def page: -> (nil | Page)
|
241
242
|
def text: -> String
|
242
|
-
def type: ->
|
243
|
+
def type: -> ("log" | "debug" | "info" | "error" | "warning" | "dir" | "dirxml" | "table" | "trace" | "clear" | "startGroup" | "startGroupCollapsed" | "endGroup" | "assert" | "profile" | "profileEnd" | "count" | "timeEnd")
|
243
244
|
end
|
244
245
|
|
245
246
|
class Dialog
|
@@ -293,6 +294,7 @@ module Playwright
|
|
293
294
|
def get_by_placeholder: ((String | Regexp) text, ?exact: bool) -> Locator
|
294
295
|
def get_by_role: (("alert" | "alertdialog" | "application" | "article" | "banner" | "blockquote" | "button" | "caption" | "cell" | "checkbox" | "code" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "deletion" | "dialog" | "directory" | "document" | "emphasis" | "feed" | "figure" | "form" | "generic" | "grid" | "gridcell" | "group" | "heading" | "img" | "insertion" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "meter" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "navigation" | "none" | "note" | "option" | "paragraph" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "strong" | "subscript" | "superscript" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "time" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem") role, ?checked: bool, ?disabled: bool, ?exact: bool, ?expanded: bool, ?includeHidden: bool, ?level: Integer, ?name: (String | Regexp), ?pressed: bool, ?selected: bool) -> Locator
|
295
296
|
def get_by_test_id: ((String | Regexp) testId) -> Locator
|
297
|
+
def get_by_testid: ((String | Regexp) testId) -> Locator
|
296
298
|
def get_by_text: ((String | Regexp) text, ?exact: bool) -> Locator
|
297
299
|
def get_by_title: ((String | Regexp) text, ?exact: bool) -> Locator
|
298
300
|
def go_back: (?timeout: Float, ?waitUntil: ("load" | "domcontentloaded" | "networkidle" | "commit")) -> (nil | Response)
|
@@ -487,6 +489,7 @@ module Playwright
|
|
487
489
|
def get_by_placeholder: ((String | Regexp) text, ?exact: bool) -> Locator
|
488
490
|
def get_by_role: (("alert" | "alertdialog" | "application" | "article" | "banner" | "blockquote" | "button" | "caption" | "cell" | "checkbox" | "code" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "deletion" | "dialog" | "directory" | "document" | "emphasis" | "feed" | "figure" | "form" | "generic" | "grid" | "gridcell" | "group" | "heading" | "img" | "insertion" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "meter" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "navigation" | "none" | "note" | "option" | "paragraph" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "strong" | "subscript" | "superscript" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "time" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem") role, ?checked: bool, ?disabled: bool, ?exact: bool, ?expanded: bool, ?includeHidden: bool, ?level: Integer, ?name: (String | Regexp), ?pressed: bool, ?selected: bool) -> Locator
|
489
491
|
def get_by_test_id: ((String | Regexp) testId) -> Locator
|
492
|
+
def get_by_testid: ((String | Regexp) testId) -> Locator
|
490
493
|
def get_by_text: ((String | Regexp) text, ?exact: bool) -> Locator
|
491
494
|
def get_by_title: ((String | Regexp) text, ?exact: bool) -> Locator
|
492
495
|
def highlight: -> void
|
@@ -530,6 +533,7 @@ module Playwright
|
|
530
533
|
def get_by_placeholder: ((String | Regexp) text, ?exact: bool) -> Locator
|
531
534
|
def get_by_role: (("alert" | "alertdialog" | "application" | "article" | "banner" | "blockquote" | "button" | "caption" | "cell" | "checkbox" | "code" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "deletion" | "dialog" | "directory" | "document" | "emphasis" | "feed" | "figure" | "form" | "generic" | "grid" | "gridcell" | "group" | "heading" | "img" | "insertion" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "meter" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "navigation" | "none" | "note" | "option" | "paragraph" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "strong" | "subscript" | "superscript" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "time" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem") role, ?checked: bool, ?disabled: bool, ?exact: bool, ?expanded: bool, ?includeHidden: bool, ?level: Integer, ?name: (String | Regexp), ?pressed: bool, ?selected: bool) -> Locator
|
532
535
|
def get_by_test_id: ((String | Regexp) testId) -> Locator
|
536
|
+
def get_by_testid: ((String | Regexp) testId) -> Locator
|
533
537
|
def get_by_text: ((String | Regexp) text, ?exact: bool) -> Locator
|
534
538
|
def get_by_title: ((String | Regexp) text, ?exact: bool) -> Locator
|
535
539
|
def last: -> FrameLocator
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.54.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
@@ -409,5 +409,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
409
409
|
requirements: []
|
410
410
|
rubygems_version: 3.6.9
|
411
411
|
specification_version: 4
|
412
|
-
summary: The Ruby binding of playwright driver 1.
|
412
|
+
summary: The Ruby binding of playwright driver 1.54.1
|
413
413
|
test_files: []
|