meglish 1.0.4 → 1.0.5
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/meglish-log.rb +1 -1
- data/lib/meglish.rb +8 -8
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 4c8aeacb593d1ceba95ab1aa4e6334c89c7d1979
         | 
| 4 | 
            +
              data.tar.gz: 5f77a9b2d816408787f902977c1324abd132cf5f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 76f4df60f9c73f9de252547c2cfabd7cab7a26d1df94701043118afefebb5e4b6069df0174988c90cb510bb5b772d7a2d6d2928e12575424a6ab2ab754fc7cfc
         | 
| 7 | 
            +
              data.tar.gz: 0e63edd98d86388873c09ae70b6edf727c4cdbb403d4b1b228f4452039319076fec7caf713da19dce9ed18c72e8735855e7dc81335f8b63abc7d670453ea5024
         | 
    
        data/lib/meglish-log.rb
    CHANGED
    
    
    
        data/lib/meglish.rb
    CHANGED
    
    | @@ -5,7 +5,7 @@ module Meglish | |
| 5 5 | 
             
                    include_all: true,
         | 
| 6 6 | 
             
                    timeout: 30,
         | 
| 7 7 | 
             
                    confirm_alert: true
         | 
| 8 | 
            -
                }
         | 
| 8 | 
            +
                }.freeze
         | 
| 9 9 |  | 
| 10 10 | 
             
                def clear_text_element(_query, _options = {})
         | 
| 11 11 | 
             
                    touch_element(_query.strip, _options)
         | 
| @@ -93,11 +93,11 @@ module Meglish | |
| 93 93 | 
             
                def set_date_element(_query_input, _date, _options = {})
         | 
| 94 94 | 
             
                    new_date = _date.match(/(^[\d]{4})\/([\d]{1,2})\/([\d]{1,2})/)
         | 
| 95 95 | 
             
                    year = new_date[1].to_i
         | 
| 96 | 
            -
                    month =  | 
| 96 | 
            +
                    month = new_date[2].to_i - 1
         | 
| 97 97 | 
             
                    day = new_date[3].to_i
         | 
| 98 98 |  | 
| 99 99 | 
             
                    touch_element(_query_input, _options)
         | 
| 100 | 
            -
                    query( | 
| 100 | 
            +
                    query('DatePicker', method_name: :updateDate, arguments: [year, month, day])
         | 
| 101 101 | 
             
                    touch("MDButton id:'md_buttonDefaultPositive'") unless get_option(:confirm_alert, _options)
         | 
| 102 102 | 
             
                end
         | 
| 103 103 |  | 
| @@ -147,7 +147,7 @@ module Meglish | |
| 147 147 | 
             
                end
         | 
| 148 148 |  | 
| 149 149 | 
             
                def touch_element(_query, _options = {})
         | 
| 150 | 
            -
             | 
| 150 | 
            +
                    find_element_on_screen(_query, _options)
         | 
| 151 151 | 
             
                    touch(_query.strip)
         | 
| 152 152 | 
             
                end
         | 
| 153 153 |  | 
| @@ -183,7 +183,7 @@ module Meglish | |
| 183 183 | 
             
                def wait_for_text_element(_query, _timeout = 10, _options = {})
         | 
| 184 184 | 
             
                    count = 0
         | 
| 185 185 | 
             
                    filled = ''
         | 
| 186 | 
            -
                    while  | 
| 186 | 
            +
                    while filled.nil? || filled.empty?
         | 
| 187 187 | 
             
                        return if count >= _timeout
         | 
| 188 188 | 
             
                        filled = text_element(_query, _options)
         | 
| 189 189 | 
             
                        sleep 1
         | 
| @@ -236,14 +236,14 @@ module Meglish | |
| 236 236 | 
             
                end
         | 
| 237 237 |  | 
| 238 238 | 
             
                def get_option(_option, _options)
         | 
| 239 | 
            -
                    default_value = ENV[_option]
         | 
| 239 | 
            +
                    default_value = ENV[_option[0, _option.length].upcase]
         | 
| 240 240 | 
             
                    default_value = MELGISH_CONDITIONS[_option] if default_value.nil? || default_value.empty?
         | 
| 241 241 | 
             
                    return default_value unless has_option?(_option, _options)
         | 
| 242 | 
            -
                    _options[ | 
| 242 | 
            +
                    _options[_option]
         | 
| 243 243 | 
             
                end
         | 
| 244 244 |  | 
| 245 245 | 
             
                def has_option?(_option, _options)
         | 
| 246 246 | 
             
                    return (_options[_option].nil? ? false : true) unless _options.nil? || _options.empty?
         | 
| 247 | 
            -
                     | 
| 247 | 
            +
                    false
         | 
| 248 248 | 
             
                end
         | 
| 249 249 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: meglish
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.5
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Eduardo Gomes Heinen
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016-11- | 
| 11 | 
            +
            date: 2016-11-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: calabash-android
         |