capybara-playwright-driver 0.5.14 → 0.5.15
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/lib/capybara/playwright/node.rb +17 -1
- data/lib/capybara/playwright/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ba07441d548a46b1450b0a84c122f64ba5352636cf13c60464ab6b6f03bb676
|
|
4
|
+
data.tar.gz: 92d41ebb4e43e1e4fdebd7e05bb579dba096b50c52f8938308851afb7506d5bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba22dfe3eb6ebd9e1c63cda722684987f4f3130bdcb4e3898fa74cbf6941134cee56c602dfc1d9902a45d323777484edb1826d6d4c837c0316ca9d87e01be07c
|
|
7
|
+
data.tar.gz: fdeee2f2f050d41e7e0078f8903db28c922ed999598a7ee77ba46dbb9d39c20feab7f148cc0a22617b5f8c9103c24d1aa5bbb9a76b813c83046673261b35db02
|
|
@@ -915,7 +915,7 @@ module Capybara
|
|
|
915
915
|
def execute
|
|
916
916
|
input_started = false
|
|
917
917
|
mouse_down = false
|
|
918
|
-
|
|
918
|
+
wait_for_target_layout
|
|
919
919
|
@source.scroll_into_view_if_needed(timeout: @timeout)
|
|
920
920
|
|
|
921
921
|
position_from = center_of(@source)
|
|
@@ -945,6 +945,22 @@ module Capybara
|
|
|
945
945
|
@page.mouse.up if mouse_down
|
|
946
946
|
end
|
|
947
947
|
|
|
948
|
+
# Playwright's 'visible' state requires a non-empty bounding box, which an
|
|
949
|
+
# empty drop zone never has. Selenium drags onto such an element, so only
|
|
950
|
+
# wait for the target to be rendered.
|
|
951
|
+
TARGET_HAS_LAYOUT = <<~JAVASCRIPT
|
|
952
|
+
(element) => {
|
|
953
|
+
if (!element.isConnected) throw new Error('Element is not attached to the DOM');
|
|
954
|
+
|
|
955
|
+
return element.getClientRects().length > 0 &&
|
|
956
|
+
window.getComputedStyle(element).visibility === 'visible';
|
|
957
|
+
}
|
|
958
|
+
JAVASCRIPT
|
|
959
|
+
|
|
960
|
+
private def wait_for_target_layout
|
|
961
|
+
@target.owner_frame.wait_for_function(TARGET_HAS_LAYOUT, arg: @target, timeout: @timeout).dispose
|
|
962
|
+
end
|
|
963
|
+
|
|
948
964
|
# @param element [Playwright::ElementHandle]
|
|
949
965
|
private def center_of(element)
|
|
950
966
|
box = ElementGeometry.bounding_box(element)
|