Class: AlertsPage

Inherits:
UnderOs::Page
  • Object
show all
Defined in:
app/pages/alerts_page.rb

Instance Method Summary collapse

Constructor Details

#initializeAlertsPage

Returns a new instance of AlertsPage.



2
3
4
5
6
7
8
9
10
11
12
13
# File 'app/pages/alerts_page.rb', line 2

def initialize
  find('#buttons button').each_with_index do |button, index|
    button.on :tap do
      case index
      when 1 then Alert.new(title: "Error", message: button.text)
      when 2 then Alert.new(message: button.text, button: "Doh...")
      when 3 then Alert.new(message: button.text, buttons: ["Option 1", "Option 2"])
      else        Alert.new(button.text)
      end
    end
  end
end