예제 #1
0
 def setUp (self):
     dp.run(GOURMET_APP_PATH,'--gourmet-directory=%s'%self.gdir,APPNAME)
     print('setUp -- first run?',self.firstRun)
     if TestsWithBaseSet.firstRun:
         print('first run, sleep a bit extra...')
         time.sleep(3)
     time.sleep(2)
     print('focus frame')
     dp.focus.application(APPNAME)
     print('setUp done!')
     if TestsWithBaseSet.firstRun:
         self.do_testFileImport("/home/tom/Projects/grecipe-manager/src/tests/recipe_files/test_set.grmt")
         TestsWithBaseSet.firstRun = False
예제 #2
0
 def setUp (self):
     dp.run(GOURMET_APP_PATH,'--gourmet-directory=%s'%self.gdir,APPNAME)
     print 'setUp -- first run?',self.firstRun
     if TestsWithBaseSet.firstRun:
         print 'first run, sleep a bit extra...'
         time.sleep(3)
     time.sleep(2)
     print 'focus frame'
     dp.focus.application(APPNAME)
     print 'setUp done!'
     if TestsWithBaseSet.firstRun:
         self.do_testFileImport("/home/tom/Projects/grecipe-manager/src/tests/recipe_files/test_set.grmt")
         TestsWithBaseSet.firstRun = False
예제 #3
0
 def setUp (self):
     # Start application
     print(self,'set up!')
     print('running',GOURMET_APP_PATH,self.gdir)
     dp.run(GOURMET_APP_PATH,'--gourmet-directory=%s'%self.gdir,APPNAME)
     print('Done with run!')
     if BasicTests.firstRun:
         print('first run, sleep a bit extra...')
         time.sleep(3)
         BasicTests.firstRun = False
     time.sleep(2)
     print('focus frame')
     dp.focus.application(APPNAME)
     print('setUp done!')
예제 #4
0
 def setUp (self):
     # Start application
     print self,'set up!'
     print 'running',GOURMET_APP_PATH,self.gdir
     dp.run(GOURMET_APP_PATH,'--gourmet-directory=%s'%self.gdir,APPNAME)
     print 'Done with run!'
     if BasicTests.firstRun:
         print 'first run, sleep a bit extra...'
         time.sleep(3)
         BasicTests.firstRun = False
     time.sleep(2)
     print 'focus frame'
     dp.focus.application(APPNAME)
     print 'setUp done!'
예제 #5
0
def run_ui_typing_helper(cache, text):
    if os.path.isfile(cache):
        os.remove(cache)

    pid = run('gedit {}'.format(cache))
    gedit = tree.root.application('gedit')

    focus.application('gedit')
    focus.text()
    typeText(text)

    keyCombo('<Control>s')

    try:
        # @NOTE: maybe we can't access the menu and click the
        # item `Quit` at menu `File`

        click.menu('File')
        click.menuItem('Quit')
    except Exception as error:
        keyCombo('<Control>q')

    try:
        with open(cache) as fd:
            return fd.read()
    except Exception as error:
        os.kill(pid, signal.SIGKILL)
        return None
예제 #6
0
def run_app(file=None):
    global pid

    if file is not None:
        arguments = os.path.join(os.path.dirname(__file__), file)
    else:
        arguments = ''
    pid = dt.run(sys.argv[1], arguments=arguments, appName='xreader')
예제 #7
0
 def setUp(self):
     self.pid = run('gtk3-demo')
     self.app = focus.application.node
예제 #8
0
 def setUp(self):
     self.pid = run('gtk3-demo')
     self.app = focus.application.node