tests/ide_tests/opcua_browse.sikuli/opcua_browse.py
branchwxPython4
changeset 3672 230c8b90f3dc
parent 3545 67e1707f24c8
child 3679 b6bca75bf3fa
equal deleted inserted replaced
3671:973a7681f206 3672:230c8b90f3dc
       
     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, AuxiliaryProcess
       
    13 
       
    14 def test(app):
       
    15 
       
    16     server = AuxiliaryProcess(app, ["/bin/bash",os.path.join(getBundlePath(),"opcua_service.bash")])
       
    17     #server = AuxiliaryProcess(app, ["/bin/bash","-c","echo $PWD"])
       
    18 
       
    19     app.doubleClick("opcua_node.png")
       
    20 
       
    21     app.WaitIdleUI()
       
    22 
       
    23     # app.click("Browse Server") # OCR didn't work because of gradient in button...
       
    24     app.click("opcua_browse_server.png")
       
    25 
       
    26     app.WaitIdleUI()
       
    27 
       
    28     app.doubleClick("Objects")
       
    29 
       
    30     app.WaitIdleUI()
       
    31 
       
    32     app.doubleClick("TestObject")
       
    33 
       
    34     app.dragNdrop("TestIn", "output variables")
       
    35 
       
    36     app.wait(1)
       
    37 
       
    38     app.dragNdrop("TestOut", "input variables")
       
    39 
       
    40     app.wait(3)
       
    41 
       
    42     app.k.Clean()
       
    43 
       
    44     app.waitForChangeAndIdleStdout()
       
    45 
       
    46     app.k.Build()
       
    47 
       
    48     app.waitForChangeAndIdleStdout()
       
    49 
       
    50     app.k.Connect()
       
    51 
       
    52     app.waitForChangeAndIdleStdout()
       
    53 
       
    54     app.k.Transfer()
       
    55 
       
    56     app.waitForChangeAndIdleStdout()
       
    57 
       
    58     app.k.Run()
       
    59 
       
    60     # wait 10 seconds for 10 patterns
       
    61     res = app.waitPatternInStdout("6.8", 10)
       
    62 
       
    63     server.close()
       
    64 
       
    65     return res
       
    66 
       
    67 run_test(test, testproject="opcua_browse")