def click_button_with_caption(caption, opts={})
        if opts && opts[:index]
          wait_before_and_after { button(:caption => caption, :index => opts[:index]).click }
        else
          wait_before_and_after { button(:caption, caption).click }
        end
    end
def click_button_with_caption(caption, opts={})
        if opts && opts[:index]
          wait_before_and_after { button(:caption => caption, :index => opts[:index]).click }
        else
          wait_before_and_after { button(:caption, caption).click }
        end
    end
Click a button with caption
 Usage:
   click_button_with_caption("Confirm payment")