rudra 1.0.1 → 1.0.2
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 +13 -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: 9a3e08fb86e29c7f72586cbe0a03cec519e68cebd5c8f986bdf6d38cc960b122
         | 
| 4 | 
            +
              data.tar.gz: 9f794663c91bb3a1c3899d2e41eb5381f8feabf52ffc7c0e015b8d02ea01d15b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 74e5bfba9f30dca8e29e774b597b0d43f598348cbebe57ce127ea1aadc357d00d7f9d1e285fe96b30a4534e0d3e5d37ce4156798deced3850a2010bbc1dd4429
         | 
| 7 | 
            +
              data.tar.gz: 6967c064241c3de2c3a780631f2c7e7ed30a1bf88e3dba60807da8cd11b53aef33e3e2450c7eb5f134921d75fcb1e46e2d96446c7c106380dc318e8302d42866
         | 
    
        data/lib/rudra.rb
    CHANGED
    
    | @@ -33,6 +33,7 @@ class Rudra | |
| 33 33 | 
             
              #   browsers: :chrome, :firefox, :safari
         | 
| 34 34 | 
             
              # @option options [String] :locale ('en') the browser locale
         | 
| 35 35 | 
             
              # @option options [Integer] :timeout (30) implicit_wait timeout
         | 
| 36 | 
            +
              # @option options [Boolean] :verbose (true) verbose mode
         | 
| 36 37 | 
             
              def initialize(options = {})
         | 
| 37 38 | 
             
                self.browser = options.fetch(:browser, :chrome)
         | 
| 38 39 | 
             
                self.locale = options.fetch(:locale, 'en')
         | 
| @@ -691,6 +692,7 @@ class Rudra | |
| 691 692 | 
             
              #   identify the element or Selenium::WebDriver::Element
         | 
| 692 693 | 
             
              # @param [String] event the event name
         | 
| 693 694 | 
             
              def trigger(locator, event)
         | 
| 695 | 
            +
                log("- trigger(#{locator})") if @verbose && locator.is_a?(String)
         | 
| 694 696 | 
             
                execute_script(%(
         | 
| 695 697 | 
             
                  var element = arguments[0];
         | 
| 696 698 | 
             
                  var eventName = arguments[1];
         | 
| @@ -705,6 +707,7 @@ class Rudra | |
| 705 707 |  | 
| 706 708 | 
             
              # Clear all drawing
         | 
| 707 709 | 
             
              def clear_drawings
         | 
| 710 | 
            +
                log('- clear_drawings') if @verbose
         | 
| 708 711 | 
             
                execute_script(%(
         | 
| 709 712 | 
             
                  var elements = window.document.body.querySelectorAll('[id*="rudra_"]');
         | 
| 710 713 | 
             
                  for (var i = 0; i < elements.length; i++) {
         | 
| @@ -789,6 +792,8 @@ class Rudra | |
| 789 792 | 
             
              # @param [String] color CSS style of backgroundColor
         | 
| 790 793 | 
             
              # @return [Selenium::WebDriver::Element] the color fill element
         | 
| 791 794 | 
             
              def draw_color_fill(locator, color = 'rgba(255,0,0,0.8)')
         | 
| 795 | 
            +
                log("- draw_color_fill(#{locator})") if @verbose && locator.is_a?(String)
         | 
| 796 | 
            +
             | 
| 792 797 | 
             
                rectangle = rect(locator)
         | 
| 793 798 | 
             
                id = random_id
         | 
| 794 799 |  | 
| @@ -826,6 +831,8 @@ class Rudra | |
| 826 831 | 
             
              # @option options [Boolean] :draw_symbol (false) if to draw symbol
         | 
| 827 832 | 
             
              # @return [Selenium::WebDriver::Element] the tooltip element
         | 
| 828 833 | 
             
              def draw_flyover(locator, options = {})
         | 
| 834 | 
            +
                log("- draw_flyover(#{locator})") if @verbose && locator.is_a?(String)
         | 
| 835 | 
            +
             | 
| 829 836 | 
             
                attribute_name = options.fetch(:attribute, 'title')
         | 
| 830 837 | 
             
                offset_x = options.fetch(:offset_x, 5)
         | 
| 831 838 | 
             
                offset_y = options.fetch(:offset_y, 15)
         | 
| @@ -903,6 +910,8 @@ class Rudra | |
| 903 910 | 
             
              # @option padding [Integer] :left (5) left padding
         | 
| 904 911 | 
             
              # @return [Selenium::WebDriver::Element] the redmark element
         | 
| 905 912 | 
             
              def draw_redmark(locator, padding = {})
         | 
| 913 | 
            +
                log("- draw_redmark(#{locator})") if @verbose && locator.is_a?(String)
         | 
| 914 | 
            +
             | 
| 906 915 | 
             
                top = padding.fetch(:top, 5)
         | 
| 907 916 | 
             
                right = padding.fetch(:right, 5)
         | 
| 908 917 | 
             
                bottom = padding.fetch(:bottom, 5)
         | 
| @@ -939,6 +948,8 @@ class Rudra | |
| 939 948 | 
             
              # @option options [Integer] :offset_y (0) offset on y coordinate
         | 
| 940 949 | 
             
              # @return [Selenium::WebDriver::Element] the dropdown menu element
         | 
| 941 950 | 
             
              def draw_select(locator, options = {})
         | 
| 951 | 
            +
                log("- draw_select(#{locator})") if @verbose && locator.is_a?(String)
         | 
| 952 | 
            +
             | 
| 942 953 | 
             
                offset_x = options.fetch(:offset_x, 0)
         | 
| 943 954 | 
             
                offset_y = options.fetch(:offset_y, 0)
         | 
| 944 955 |  | 
| @@ -999,6 +1010,8 @@ class Rudra | |
| 999 1010 | 
             
              # @option options [Integer] :right (20) CSS style of right
         | 
| 1000 1011 | 
             
              # @return [Selenium::WebDriver::Element] the text element
         | 
| 1001 1012 | 
             
              def draw_text(locator, text, options = {})
         | 
| 1013 | 
            +
                log("- draw_text(#{locator})") if @verbose && locator.is_a?(String)
         | 
| 1014 | 
            +
             | 
| 1002 1015 | 
             
                color = options.fetch(:color, '#f00')
         | 
| 1003 1016 | 
             
                font_size = options.fetch(:font_size, 13)
         | 
| 1004 1017 | 
             
                top = options.fetch(:top, 2)
         |