Why does Sikuli not return to the IDE after running all unit tests?

Asked by Michael Roepke

After Running unit test Sikuli doesnt appear anymore. Is there a way to get back to the IDE UI?

Thanks
Michael

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

--- You might try to use your system specific abort key combination.

--- How do you know, that all tests have been executed? (the small transparent window in upper left corner?)

--- Are you sure, that your test script does not have any syntax errors? (test with a normal run, which should do nothing but check syntax)

--- Have you saved your script before running the test?

--- If anything odd happens during the test run, stop the IDE, restart it and open your saved script again for the test run.

--- Run the test on commandline (see doc ) and see what happens.

--- There was a strange situation that someone set setAutoWaitTimeout(5000), which was ok for 5 seconds with release 0.9.x, but now it means that it waits about 1.5 hours if something cannot be found.

--- This is a base test skeleton, that should run:
def setUp(self):
    wait(2)
    print "***** setUp"

def tearDown(self):
    wait(2)
    print "***** tearDown"

def test1(self):
    wait(2)
    print "***** test1"
    assert( True )

def test2(self):
    wait(2)
    print "***** test2"
    assert( False )

test1 should be reported as failed, test2 as ok.

Revision history for this message
Michael Roepke (michael-roepke) said :
#2

thanks, solved.... my app crashed.... and so did sikuli...

Revision history for this message
Yuren Ju (yurenju) said :
#3

not work for me.

my unit test script is simple:

def testA(self):
  print "Test"
  assert (True)

and I use below script to run normal:
testA(None)

and this script is work.

but when I use command line to execute:
./sikuli-ide.sh -t ~/test-sikuli.sikuli/

it only print
[error] null

Revision history for this message
Yuren Ju (yurenju) said :
#4

I test on Debian squeeze and Ubuntu 11.04, neither can't work.

Revision history for this message
RaiMan (raimund-hocke) said :
#5

@ Yuren Ju:
that's why it is called "Running scripts from command line" ;-)

When using the command line execution of scripts, the IDE never shows up.

Your script configuration does not conform to the unit test framework in the IDE.

A unit test script can only contain def()'s and has to be run in the IDE in the unit test window (ctrl-u). a correctly configured unittest script will never do anything when run normally in the IDE window.

So take care that your test-sikuli.sikuli only contains:
def testA(self):
  print "Test"
  assert (True)

and the
./sikuli-ide.sh -t ~/test-sikuli.sikuli/

should run, if all path/filenames are correct.

Revision history for this message
Yuren Ju (yurenju) said :
#6

let me explain my situation:

1. I write a unit test:

def testA(self):
 print "Test"
 assert True

2. press ctrl + U, and press "run"
3. sikuli show a small dialog, which contain:

(run button)
Runs: 0/0, Errors: 0, Failures: 0

4. so I guess my script incorrect, so I add:
testA(None)
to normal run the script, but it work.

5. I try to run unit test script from command line (remove testA(None), but sikuli only print
[error] null

Revision history for this message
RaiMan (raimund-hocke) said :
#7

correct:

2. only press ctrl + U ( and NOT press "run )

3. 3. sikuli show a small dialog, which contain:

(run button)
Runs: 0/0, Errors: 0, Failures: 0

now you have to press this small run button. If not already done, Sikuli will ask you to save the script.

the massage area should report something like:
Test
Running...
Finished: 0,01 seconds

--- on 5.
It seems, that the script cannot be found. try to use full absolute path names for the shell script and the Sikuli script. This works for me and prints something like that:
[info] Sikuli vision engine loaded.
...
[info] VDictProxy loaded.
.Test

Time: 0,001

OK (1 test)

Revision history for this message
Yuren Ju (yurenju) said :
#8

Do you try on Mac OS?
I try debian, ubuntu and Widnows 7, neither can't work.

Revision history for this message
RaiMan (raimund-hocke) said :
#9

You are right, I am mainly on Mac ;-)

But just tested on my Win 7 32 Bit: works exactly the same.

And I am sure, if I start up my Ubuntu, it will also do it the same way.

I guess you have to really use absolute path names for everything.