Sha256: eaaf5edcfa40b69425b808a40f671c55faf50ac8c23da19e3370040054968adf

Contents?: true

Size: 1.29 KB

Versions: 7

Compression:

Stored size: 1.29 KB

Contents

# rubocop:disable Lint/RescueException
# rubocop:disable Metrics/LineLength

#
#  Skip:
#    status # status patches are already tested in driver.rb
#    raw_execute # debug output for Pry
#

# rake ios[common/patch]
describe 'common/patch.rb' do
  def before_first
    screen.must_equal catalog
  end

  t 'before_first' do
    before_first
  end

  # Attributes are busted in Android.
  # Blocked on https://github.com/appium/appium/issues/628
  describe 'Selenium::WebDriver::Element methods' do
    # TODO: t 'value' do; end

    t 'name' do
      first_text.name.must_equal 'UICatalog'
    end

    # t 'tag_name' do; end # Doesn't work on Android

    t 'location_rel' do
      loc = first_text.location_rel
      loc.x.class.must_equal String
      loc.y.class.must_equal String
    end
  end

  describe 'common patch' do
    # By default, the webdriver gem will return message instead of origValue
    # {"message":"An unknown server-side error occurred while processing the command.","origValue":"Strategy id is not valid."}
    t 'error_message' do
      value = ''
      begin
        set_wait 0
        find_element(:css, 'ok')
      rescue Exception => e
        value = e.message
      ensure
        set_wait
      end
      value.must_equal 'Invalid locator strategy: css selector'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
appium_lib-8.2.1 ios_tests/lib/ios/specs/common/patch.rb
appium_lib-8.2.0 ios_tests/lib/ios/specs/common/patch.rb
appium_lib-8.1.0 ios_tests/lib/ios/specs/common/patch.rb
appium_lib-8.0.2 ios_tests/lib/ios/specs/common/patch.rb
appium_lib-8.0.1 ios_tests/lib/ios/specs/common/patch.rb
appium_lib-8.0.0 ios_tests/lib/ios/specs/common/patch.rb
appium_lib-7.0.0 ios_tests/lib/ios/specs/common/patch.rb