Sha256: b081d58d60219b4b4510d9ccba67b6a7d5c907825baab38d51272d5624dffbf3

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

# rake android['android/element/button']
describe 'android/element/button' do
  def before_first
    # nav to buttons activity
    wait { find('App').click }
    wait { find('Activity').click }
    wait { find('Animation').click }
  end

  def after_last
    # nav back to home activity
    3.times { back }
  end

  def fade_in
    'Fade in'
  end

  t { before_first }

  t 'button' do
    # by index
    wait { button(1).name.must_equal fade_in }

    # by name contains
    wait { button('ade').name.must_equal fade_in }
  end

  t 'buttons' do
    exp = ['Zoom in', 'Modern zoom in', 'Thumbnail zoom']
    wait { buttons('zoom').map { |e| e.text }.must_equal exp }
    wait { buttons.length.must_equal 6 }
  end

  t 'first_button' do
    wait { first_button.name.must_equal fade_in }
  end

  t 'last_button' do
    wait { last_button.name.must_equal 'Thumbnail zoom' }
  end

  t 'button_exact' do
    wait { button_exact(fade_in).name.must_equal fade_in }
  end

  t 'buttons_exact' do
    wait { buttons_exact(fade_in).first.name.must_equal fade_in }
  end

  t { after_last }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
appium_lib-2.1.0 android_tests/lib/android/specs/android/element/button.rb
appium_lib-2.0.0 android_tests/lib/android/specs/android/element/button.rb