tests/ide_tests/sikuliberemiz.py
branchwxPython4
changeset 3669 ca25c686cd97
parent 3668 142c268124ab
child 3670 cfb2b05b68c4
equal deleted inserted replaced
3668:142c268124ab 3669:ca25c686cd97
   187         self.pattern = None
   187         self.pattern = None
   188         self.ReportScreenShot("found pattern" if res else "pattern not found")
   188         self.ReportScreenShot("found pattern" if res else "pattern not found")
   189         return res
   189         return res
   190 
   190 
   191 class BeremizApp(IDEIdleObserver, stdoutIdleObserver):
   191 class BeremizApp(IDEIdleObserver, stdoutIdleObserver):
   192     def __init__(self, projectpath=None, exemple=None):
   192     def __init__(self, projectpath=None, exemple=None, testproject=None):
   193         """
   193         """
   194         Starts Beremiz IDE, waits for main window to appear, maximize it.
   194         Starts Beremiz IDE, waits for main window to appear, maximize it.
   195 
   195 
   196             Parameters: 
   196             Parameters: 
   197                 projectpath (str): path to project to open
   197                 projectpath (str): path to project to open
   222 
   222 
   223         if exemple is not None:
   223         if exemple is not None:
   224             command.append(opj(beremiz_path,"exemples",exemple))
   224             command.append(opj(beremiz_path,"exemples",exemple))
   225         elif projectpath is not None:
   225         elif projectpath is not None:
   226             command.append(projectpath)
   226             command.append(projectpath)
       
   227         elif testproject is not None:
       
   228             command.append(opj(beremiz_path,"tests","projects",testproject))
       
   229 
   227 
   230 
   228         # App class is broken in Sikuli 2.0.5: can't start process with arguments.
   231         # App class is broken in Sikuli 2.0.5: can't start process with arguments.
   229         # 
   232         # 
   230         # Workaround : - use subprocess module to spawn IDE process,
   233         # Workaround : - use subprocess module to spawn IDE process,
   231         #              - use wmctrl to find IDE window details and maximize it
   234         #              - use wmctrl to find IDE window details and maximize it