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.
- checksums.yaml +4 -4
 - data/lib/rudra.rb +20 -0
 - 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: 2d32f8fed6918c55fac1f6de03e6bfb80bac6510a26a74303bd7274a30c1f8fe
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: fcc2148f6701587fb009d09ba1f740250870c013f76853d2b68c7c0027a69192
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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
         
     |