""" This test opens, builds and runs exemple project named "python".
Test succeeds if runtime's stdout behaves as expected
# allow module import from current test directory's parent
addImportPath(os.path.dirname(getBundlePath()))
# common test definitions module
from sikuliberemiz import *
# Start the app without any project given
proc,app = StartBeremizApp()
new_project_path = os.path.join(os.path.abspath(os.path.curdir), "new_test_project")
# New project path must exist (usually created in directory selection dialog)
os.mkdir(new_project_path)
# To detect when actions did finish because IDE content isn't changing
idle = IDEIdleObserver(app)
# To send keyboard shortuts
# Create new project (opens new project directory selection dialog)
# Move to "Home" section of file selecor, otherwise address is
# "file ignored" at first run
# Enter directory by name
type(new_project_path + Key.ENTER)
# When prompted for creating first program select type ST
type(Key.TAB*4) # go to lang dropdown
type(Key.DOWN*2) # change selected language
type(Key.ENTER) # validate
{printf("Test OK\\n");fflush(stdout);}
# Focus project tree and select root item
# FIXME: Select other field to ensure URI is validated
# Close project config editor
# Focus seems undefined at that time (FIXME)
# Force focussing on "something" so that next shortcut is taken
stdoutIdle = stdoutIdleObserver(proc)
found = waitPatternInStdout(proc, "Test OK", 10)