← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #218747]: Problem when using unittest : i can't get any tests ran

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
class setUp() and class tearDown() are not supported in this version of
Jython unit test.

You either have to leave out/empty setUp() and tearDown() or use class
variables:

Something like that:

class Log(unittest.TestCase):
    setUpDone = False
    tearDown = False

    def setUp(self):
        if not Log.setUpDone:
            Log.setUpDone = True
            openApp("test")

    def tearDown(self):
        if not Log.tearDownDone:
            Log.tearDownDone = True
            closeApp("test")

    def testLogIn(self):
        type(Pattern("Num-1.png").targetOffset(40,2), "10001", KeyModifier.SHIFT)
        type(Pattern("Pass.png").targetOffset(38,1), "1111")
        click("Valider.png")

    def testLogOut(self):
        popup("KO")

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