capybara-playwright-driver 0.5.2 → 0.5.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a279b6e3fb53216312d0acfb25cab1b393a122f777c65729df720b77f6bd0a17
|
4
|
+
data.tar.gz: 21f8543b574eeebe80fe02261020aa6430a4aa4a280718d1deb2fcd7cde24f1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0107a7bc12828a7022a4dbe12d371c8a38a58a98a136bb819cbff329b9c949ea785fdafdd8ed45ff2eb9aa176df7c962737aa1139cebe921e1458c3d56817da
|
7
|
+
data.tar.gz: cbe1c778c7996168db5e0d67e9869afc267ffff30c7c686f9ccc03c87ff1afa98eb21d4b77e5fcc3098c762b1fad255f9cd066b9b9e59b7e456838c4be97ef76
|
@@ -46,7 +46,7 @@ module Capybara
|
|
46
46
|
def with_playwright_page(&block)
|
47
47
|
raise ArgumentError.new('block must be given') unless block
|
48
48
|
|
49
|
-
|
49
|
+
browser.with_playwright_page(&block)
|
50
50
|
end
|
51
51
|
|
52
52
|
# Start Playwright tracing (doc: https://playwright.dev/docs/api/class-tracing#tracing-start)
|
@@ -8,7 +8,10 @@ module Capybara
|
|
8
8
|
|
9
9
|
# Playwright has own auto-waiting feature.
|
10
10
|
# So disable Capybara's retry logic.
|
11
|
-
|
11
|
+
if driver.is_a?(Capybara::Playwright::Driver)
|
12
|
+
options[:wait] = 0
|
13
|
+
end
|
14
|
+
|
12
15
|
super
|
13
16
|
end
|
14
17
|
end
|
@@ -21,7 +24,7 @@ module Capybara
|
|
21
24
|
if native.is_a?(::Playwright::ElementHandle)
|
22
25
|
block.call(native)
|
23
26
|
else
|
24
|
-
raise "#{native.inspect} is not a
|
27
|
+
raise "#{native.inspect} is not a Playwright::ElementHandle"
|
25
28
|
end
|
26
29
|
end
|
27
30
|
end
|
@@ -131,7 +134,7 @@ module Capybara
|
|
131
134
|
}
|
132
135
|
}
|
133
136
|
JAVASCRIPT
|
134
|
-
text.to_s.gsub(/\A[[:space:]&&[^\u00a0]]+/, '')
|
137
|
+
text.to_s.scrub.gsub(/\A[[:space:]&&[^\u00a0]]+/, '')
|
135
138
|
.gsub(/[[:space:]&&[^\u00a0]]+\z/, '')
|
136
139
|
.gsub(/\n+/, "\n")
|
137
140
|
.tr("\u00a0", ' ')
|
@@ -548,7 +551,7 @@ module Capybara
|
|
548
551
|
_key = key.last
|
549
552
|
code =
|
550
553
|
if _key.is_a?(String) && _key.length == 1
|
551
|
-
_key
|
554
|
+
_key
|
552
555
|
elsif _key.is_a?(Symbol)
|
553
556
|
key_for(_key)
|
554
557
|
else
|
@@ -567,7 +570,7 @@ module Capybara
|
|
567
570
|
when String
|
568
571
|
key.each_char do |char|
|
569
572
|
executables << PressKey.new(
|
570
|
-
key: char
|
573
|
+
key: char,
|
571
574
|
modifiers: modifiers,
|
572
575
|
)
|
573
576
|
end
|
@@ -600,6 +603,10 @@ module Capybara
|
|
600
603
|
|
601
604
|
class PressKey
|
602
605
|
def initialize(key:, modifiers:)
|
606
|
+
# Shift requires an explicitly uppercase a-z key to produce the correct output
|
607
|
+
# See https://playwright.dev/docs/input#keys-and-shortcuts
|
608
|
+
key = key.upcase if modifiers == [MODIFIERS[:shift]] && key.match?(/^[a-z]$/)
|
609
|
+
|
603
610
|
# puts "PressKey: key=#{key} modifiers: #{modifiers}"
|
604
611
|
if modifiers.empty?
|
605
612
|
@key = key
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-playwright-driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -241,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
241
|
- !ruby/object:Gem::Version
|
242
242
|
version: '0'
|
243
243
|
requirements: []
|
244
|
-
rubygems_version: 3.5.
|
244
|
+
rubygems_version: 3.5.22
|
245
245
|
signing_key:
|
246
246
|
specification_version: 4
|
247
247
|
summary: Playwright driver for Capybara
|