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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22ec489327d6ba1f70552c2ff0d73b41e4a4ba6c02a898aa608dfe86cfdb3b14
4
- data.tar.gz: e41e3084aae362754ad8980bde6ef20e178edc87db72d4e845844802af02d77d
3
+ metadata.gz: d26f10b0192fbc1b4fd2e1724fca389df99b9857388d57b35f30913f15bb3767
4
+ data.tar.gz: 6d13481a4553b0a91dc138179254973afdcaf27e06071a703aec338894f13266
5
5
  SHA512:
6
- metadata.gz: 3232bcc3f42fc1ab80c1027f1b2af825d21903c9024c8253015d5892dc1f5022a2ef31a9689350e33a4a9e6ce9425a31e55dc38ed75e0142e674c66135ca82f8
7
- data.tar.gz: 29497adfd1e1bbcbef55eda2cdbc496e9a270d4500a082a071024afd519f01a9976bae5cc06c63a9c2f1825ca5afe86ed618017356add5015a5e0f15128bc72d
6
+ metadata.gz: d4ec72f8748fc736afa98fdfb0f01022170714422fc1be92b024cb88f87a40aa7539850c3b0127c935ab0cb848c0c6a9a4f7841021dca6c4669a2ac9c8600bd0
7
+ data.tar.gz: 530c3ac3a4dd1343ccac9af49d7f1fa85c45e296f496f398bb1d6d05532e66d7d6ecab0f27a5810801f41d3d04bfea29de8bc3709462a5d94598b3fa1e3bfe47
@@ -85,7 +85,7 @@ def browser
85
85
  ```
86
86
 
87
87
 
88
- Returns the browser instance of the context. If it was launched as a persistent context null gets returned.
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'`.
@@ -530,6 +530,7 @@ Many html elements have an implicitly [defined role](https://w3c.github.io/html-
530
530
  ```
531
531
  def get_by_test_id(testId)
532
532
  ```
533
+ alias: `get_by_testid`
533
534
 
534
535
 
535
536
  Locate element by the test id.
@@ -176,6 +176,7 @@ Many html elements have an implicitly [defined role](https://w3c.github.io/html-
176
176
  ```
177
177
  def get_by_test_id(testId)
178
178
  ```
179
+ alias: `get_by_testid`
179
180
 
180
181
 
181
182
  Locate element by the test id.
@@ -741,6 +741,7 @@ Many html elements have an implicitly [defined role](https://w3c.github.io/html-
741
741
  ```
742
742
  def get_by_test_id(testId)
743
743
  ```
744
+ alias: `get_by_testid`
744
745
 
745
746
 
746
747
  Locate element by the test id.
@@ -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
@@ -724,6 +724,7 @@ Many html elements have an implicitly [defined role](https://w3c.github.io/html-
724
724
  ```
725
725
  def get_by_test_id(testId)
726
726
  ```
727
+ alias: `get_by_testid`
727
728
 
728
729
 
729
730
  Locate element by the test id.
@@ -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', timeout: timeout)
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
- with_element(timeout: nil) do |handle, _|
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
- if options.key?(:expectedValue)
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
- @locator = @page.locator(":root")
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 = @locator.expect(expression, expect_options, title)
28
+ result = @frame.expect(nil, expression, expect_options, title)
29
29
 
30
30
  if result["matches"] == @is_not
31
31
  actual = result["received"]
@@ -43,7 +43,7 @@ module Playwright
43
43
  # Terminate playwright-cli driver.
44
44
  def stop
45
45
  [@stdin, @stdout, @stderr].each { |io| io.close unless io.closed? }
46
- @thread&.terminate
46
+ @thread&.join
47
47
  end
48
48
 
49
49
  # Start `playwright-cli run-driver`
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playwright
4
- VERSION = '1.53.0'
5
- COMPATIBLE_PLAYWRIGHT_VERSION = '1.53.0'
4
+ VERSION = '1.54.0'
5
+ COMPATIBLE_PLAYWRIGHT_VERSION = '1.54.1'
6
6
  end
@@ -80,7 +80,7 @@ module Playwright
80
80
  end
81
81
 
82
82
  #
83
- # Returns the browser instance of the context. If it was launched as a persistent context null gets returned.
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
@@ -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 detached=(req)
1048
- wrap_impl(@impl.detached=(unwrap_impl(req)))
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 --
@@ -170,6 +170,7 @@ module Playwright
170
170
  def get_by_test_id(testId)
171
171
  wrap_impl(@impl.get_by_test_id(unwrap_impl(testId)))
172
172
  end
173
+ alias_method :get_by_testid, :get_by_test_id
173
174
 
174
175
  #
175
176
  # Allows locating elements that contain given text.
@@ -661,6 +661,7 @@ module Playwright
661
661
  def get_by_test_id(testId)
662
662
  wrap_impl(@impl.get_by_test_id(unwrap_impl(testId)))
663
663
  end
664
+ alias_method :get_by_testid, :get_by_test_id
664
665
 
665
666
  #
666
667
  # Allows locating elements that contain given text.
@@ -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
@@ -716,6 +716,7 @@ module Playwright
716
716
  def get_by_test_id(testId)
717
717
  wrap_impl(@impl.get_by_test_id(unwrap_impl(testId)))
718
718
  end
719
+ alias_method :get_by_testid, :get_by_test_id
719
720
 
720
721
  #
721
722
  # Allows locating elements that contain given text.
@@ -94,13 +94,13 @@ module Playwright
94
94
  end
95
95
 
96
96
  # @nodoc
97
- def android
98
- wrap_impl(@impl.android)
97
+ def electron
98
+ wrap_impl(@impl.electron)
99
99
  end
100
100
 
101
101
  # @nodoc
102
- def electron
103
- wrap_impl(@impl.electron)
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 ok?
122
- wrap_impl(@impl.ok?)
121
+ def from_service_worker?
122
+ wrap_impl(@impl.from_service_worker?)
123
123
  end
124
124
 
125
125
  # @nodoc
126
- def from_service_worker?
127
- wrap_impl(@impl.from_service_worker?)
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: -> String
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.53.0
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.53.0
412
+ summary: The Ruby binding of playwright driver 1.54.1
413
413
  test_files: []