rudra 1.0.2 → 1.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rudra.rb +20 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a3e08fb86e29c7f72586cbe0a03cec519e68cebd5c8f986bdf6d38cc960b122
4
- data.tar.gz: 9f794663c91bb3a1c3899d2e41eb5381f8feabf52ffc7c0e015b8d02ea01d15b
3
+ metadata.gz: 2d32f8fed6918c55fac1f6de03e6bfb80bac6510a26a74303bd7274a30c1f8fe
4
+ data.tar.gz: fcc2148f6701587fb009d09ba1f740250870c013f76853d2b68c7c0027a69192
5
5
  SHA512:
6
- metadata.gz: 74e5bfba9f30dca8e29e774b597b0d43f598348cbebe57ce127ea1aadc357d00d7f9d1e285fe96b30a4534e0d3e5d37ce4156798deced3850a2010bbc1dd4429
7
- data.tar.gz: 6967c064241c3de2c3a780631f2c7e7ed30a1bf88e3dba60807da8cd11b53aef33e3e2450c7eb5f134921d75fcb1e46e2d96446c7c106380dc318e8302d42866
6
+ metadata.gz: 6726fe6808e3f643bc4b42470f89bfdf28927650e8fa86fb6524ddd25a18fed6f0e5727d63b62dd21390001986a6496056dc01896b4a9e27913b63648df99759
7
+ data.tar.gz: 34a1130c1eca89552e32f49fcd335c874d675b0f4e473b15a2b62d996bca0f0d825f2c0fa111bd8ab20788d9643352193f32a00a229d7bcd4700cf07cfaae846
data/lib/rudra.rb CHANGED
@@ -472,6 +472,19 @@ class Rudra
472
472
  action.drag_and_drop(el1, el2).perform
473
473
  end
474
474
 
475
+ # Drag and drop to an offset
476
+ # @param [String] source the locator to emulate button down at
477
+ # @param [Hash] offset the offset coordinates
478
+ # @option offset [Integer] :x (0) offset on x coordinate
479
+ # @option offset [Integer] :y (0) offset on y coordinate
480
+ def drag_and_drop_by(source, offset = {})
481
+ element = find_element(source)
482
+ x = offset.fetch(:x, 0)
483
+ y = offset.fetch(:y, 0)
484
+
485
+ action.drag_and_drop_by(element, x, y).perform
486
+ end
487
+
475
488
  # If the given element, identified by locator, is enabled
476
489
  # @param [String, Selenium::WebDriver::Element] locator the locator to
477
490
  # identify the element or Selenium::WebDriver::Element
@@ -530,6 +543,13 @@ class Rudra
530
543
  find_element(locator).location
531
544
  end
532
545
 
546
+ # Moves the mouse from its current position (or 0,0) by the given offset
547
+ # @param [Integer] right_by horizontal offset
548
+ # @param [Integer] down_by vertical offset
549
+ def move_by(right_by = 0, down_by = 0)
550
+ action.move_by(right_by, down_by).perform
551
+ end
552
+
533
553
  # Move to the given element, identified by locator, with an offset
534
554
  # @param [String, Selenium::WebDriver::Element] locator the locator to
535
555
  # identify the element or Selenium::WebDriver::Element
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rudra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Chen