Module: WindowsUIHelpers

Defined in:
lib/SimpliTest/helpers/windows_ui.rb

Constant Summary collapse

BUTTONS_OK =

:nocov: button constants

0
BUTTONS_OKCANCEL =
1
BUTTONS_ABORTRETRYIGNORE =
2
BUTTONS_YESNO =
4
CLICKED_OK =

return code constants

1
CLICKED_CANCEL =
2
CLICKED_ABORT =
3
CLICKED_RETRY =
4
CLICKED_IGNORE =
5
CLICKED_YES =
6
CLICKED_NO =
7
APP_TITLE =
'SimpliTest'

Instance Method Summary collapse

Instance Method Details

#message_box(txt, title, buttons) ⇒ Object



19
20
21
# File 'lib/SimpliTest/helpers/windows_ui.rb', line 19

def message_box(txt, title, buttons)   
  MessageBox::MessageBoxA nil, txt, title, buttons
end

#user_consents_via_prompt?(question) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/SimpliTest/helpers/windows_ui.rb', line 23

def user_consents_via_prompt?(question)
  message_box(question, APP_TITLE, BUTTONS_YESNO) == CLICKED_YES
end

#user_informed_via_prompt?(message) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/SimpliTest/helpers/windows_ui.rb', line 27

def user_informed_via_prompt?(message)
  message_box(message, APP_TITLE, BUTTONS_OK) == CLICKED_OK
end