""" This test opens, builds and runs a new project.
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 *
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)
# 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
app.type(new_project_path + Key.ENTER)
# When prompted for creating first program select type ST
app.type(Key.TAB*4) # go to lang dropdown
app.type(Key.DOWN*2) # change selected language
app.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
app.waitPatternInStdout("Successfully built.", 10)
return app.waitPatternInStdout("Test OK", 10)