Sha256: 8864c30fc665d07c33e2ccd72104a6eac25dd7d337a8d2695d0066ab5cf7b246

Contents?: true

Size: 1.1 KB

Versions: 21

Compression:

Stored size: 1.1 KB

Contents

# rake ios[ios/element/alert]
describe 'ios/element/alert' do
  def nav_once
    screen.must_equal catalog
    wait_true do
      UI::Inventory.xcuitest? ? find_element(:name, 'Alerts').click : text('alerts').click
      tag(UI::Inventory.navbar).name == 'Alerts' # wait for true
    end

    # redefine method as no-op after it's invoked once
    self.class.send :define_method, :nav_once, proc {}
  end

  def after_last
    alert_accept if exists do
      UI::Inventory.xcuitest? ? find_elements(:name, 'UIActionSheet <title>') : text('UIActionSheet <title>')
    end
    back_click
    screen.must_equal catalog
    sleep 1
  end

  before do
    nav_once
    open_alert
  end

  def open_alert
    wait_true do
      if  UI::Inventory.xcuitest?
        find_element(:name, 'Show OK-Cancel').click
        find_element(:name, 'UIActionSheet <title>').displayed?
      else
        text('Show OK-Cancel').click
        text('UIActionSheet <title>').displayed?
      end
    end
  end

  t 'alert_accept' do
    alert_accept
  end

  t 'alert_dismiss' do
    alert_dismiss
  end

  t 'after_last' do
    after_last
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
appium_lib-9.4.5 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.4.4 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.4.3 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.4.2 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.4.1 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.4.0 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.3.8 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.3.7 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.3.6 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.3.5 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.3.4 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.3.3 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.3.2 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.3.1 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.3.0 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.2.0 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.1.3 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.1.2 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.1.1 ios_tests/lib/ios/specs/ios/element/alert.rb
appium_lib-9.1.0 ios_tests/lib/ios/specs/ios/element/alert.rb