tests/ide_tests/run_python_exemple.sikuli/run_python_exemple.py
branchwxPython4
changeset 3446 de8cc85b688a
parent 3424 7db96e011fe7
child 3447 65c5f66e9298
equal deleted inserted replaced
3445:83545348403e 3446:de8cc85b688a
    10 
    10 
    11 # common test definitions module
    11 # common test definitions module
    12 from sikuliberemiz import *
    12 from sikuliberemiz import *
    13 
    13 
    14 # Start the app
    14 # Start the app
    15 proc,app = StartBeremizApp(exemple="python")
    15 app = BeremizApp(exemple="python")
    16 
    16 
    17 # To detect when actions did finish because IDE content isn't changing
    17 app.k.Clean()
    18 # idle = IDEIdleObserver(app)
       
    19 # screencap based idle detection was making many false positive. Test is more stable with stdout based idle detection
       
    20 
    18 
    21 stdoutIdle = stdoutIdleObserver(proc)
    19 app.waitForChangeAndIdleStdout()
    22 
    20 
    23 # To send keyboard shortuts
    21 app.k.Build()
    24 k = KBDShortcut(app)
       
    25 
    22 
    26 k.Clean()
    23 app.waitForChangeAndIdleStdout()
    27 
    24 
    28 stdoutIdle.Wait(2,15)
    25 app.k.Connect()
    29 
    26 
    30 k.Build()
    27 app.waitForChangeAndIdleStdout()
    31 
    28 
    32 stdoutIdle.Wait(2,15)
    29 app.k.Transfer()
    33 
    30 
    34 k.Connect()
    31 app.waitForChangeAndIdleStdout()
    35 
    32 
    36 stdoutIdle.Wait(2,15)
    33 app.k.Run()
    37 
       
    38 k.Transfer()
       
    39 
       
    40 stdoutIdle.Wait(2,15)
       
    41 
       
    42 #del idle
       
    43 
       
    44 del stdoutIdle
       
    45 
       
    46 k.Run()
       
    47 
    34 
    48 # wait 10 seconds for 10 Grumpfs
    35 # wait 10 seconds for 10 Grumpfs
    49 found = waitPatternInStdout(proc, "Grumpf", 10, 10)
    36 found = app.waitPatternInStdout("Grumpf", 10, 10)
    50 
    37 
    51 app.close()
    38 app.close()
    52 
    39 
    53 if found:
    40 if found:
    54     exit(0)
    41     exit(0)