← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #233001]: startup problem in sikuli

 

Question #233001 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/233001

    Status: Open => Answered

RaiMan proposed the following answer:
--- You say you use HTMLTestRunner
So you must have organized your stuff using the features from Python unit test principally like this:

# a testA.sikuli
class UnitTestA(unittest.TestCase):
    def setUp(self):
        popup("setting things up")
    def test1(self):
        popup("running test1")
    def test2(self):
        popup("running test2")
    def test3(self):
        popup("running test3")
    def tearDown(self):
        popup("tearing things down")

Wether this is a test step or a test document in your sense is not
clear.

so you might have more of these testX.sikuli

To run the stuff you must somehow have a maintest.sikuli and import the
testX.sikuli and build a suite by selecting test classes and/or test
def()s using the features of unit test and then finally run the suite
using HTMLTestRunner.

If you are using the latest Sikuli (version 1.0.0), then you could insert 
Debug.user()
calls in the setUp()and tearDown() functions and selectively in main test functions and a user log file even with timestamps, so you see what happens.

So it is still not clear, why your problems in the first run have something to do with Sikuli features. If you are using the unit test framework, then using exit() in a test function does not lead to a general stop of running, since the magic of unit test is to catch all exceptions and report them. 
At the current language level 2.5, that is used by Sikuli a graceful termination of a unittest run is not supported.

The easiest way, to implement a graceful termination is to look at every
start of a new test step, wether a global termination switch is on and
then simply return immediately with an exception "skipped by
termination".

Another option might be to use unittest2 which is a backport of the unit test of level 2.7 to language level <2.7
But you would have to modify HTMLTestRunner, so it uses unittest2.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.