tests/ide_tests/debug_project.sikuli/debug_project.py
branchwxPython4
changeset 3528 c269f256a7c4
parent 3447 65c5f66e9298
child 3540 75a83cc07f27
equal deleted inserted replaced
3527:fbe924df437b 3528:c269f256a7c4
       
     1 """ This test opens, modifies, builds and runs exemple project named "python".
       
     2 Test succeeds if runtime's stdout behaves as expected
       
     3 """
       
     4 
       
     5 import os
       
     6 import time
       
     7 
       
     8 # allow module import from current test directory's parent
       
     9 addImportPath(os.path.dirname(getBundlePath()))
       
    10 
       
    11 # common test definitions module
       
    12 from sikuliberemiz import run_test
       
    13 
       
    14 def test(app):
       
    15 
       
    16     app.k.Clean()
       
    17     
       
    18     app.waitForChangeAndIdleStdout()
       
    19     
       
    20     app.k.Build()
       
    21     
       
    22     app.waitForChangeAndIdleStdout()
       
    23     
       
    24     app.k.Connect()
       
    25     
       
    26     app.waitForChangeAndIdleStdout()
       
    27     
       
    28     app.k.Transfer()
       
    29     
       
    30     app.waitForChangeAndIdleStdout()
       
    31     
       
    32     app.click("1646062660770.png")
       
    33 
       
    34     app.WaitIdleUI()
       
    35     
       
    36     app.click("1646066996789.png")
       
    37 
       
    38     app.WaitIdleUI()
       
    39 
       
    40     app.click("example")
       
    41 
       
    42     app.WaitIdleUI()
       
    43 
       
    44     app.type(Key.DOWN * 10, Key.CTRL)
       
    45 
       
    46     app.WaitIdleUI()
       
    47 
       
    48     app.k.Run()
       
    49 
       
    50     # wait up to 10 seconds for 10 Grumpfs
       
    51     app.waitPatternInStdout("Grumpf", 10, 10)
       
    52 
       
    53     app.rightClick("1646066996790.png")
       
    54 
       
    55     app.wait("Force",10)
       
    56     
       
    57     app.click("Force")
       
    58 
       
    59     app.k.SelectAll()
       
    60 
       
    61     app.type("'sys.stdout.write(\"DEBUG TEST OK\\n\")'")
       
    62 
       
    63     app.type(Key.ENTER)
       
    64     
       
    65     # wait 10 seconds for 10 patterns
       
    66     return app.waitPatternInStdout("DEBUG TEST OK", 10)
       
    67 
       
    68 run_test(test, exemple="python")