# 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