← Back to team overview

sikuli-driver team mailing list archive

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

 

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

I'm trying to run tests with a "scenario approach". After a view research and tries, i can't manage to get my tests ran : either with the built-in unit test feature, or with an external runner, the number of test cases to be run is 0. I'm using 2 Sikuli files : one containing a class, and the main one.
Here is my class :
-------
#testClass.sikuli module
from sikuli import *
import unittest

class Log(unittest.TestCase):
    def setUp(self):
        openApp("test")
    def tearDown(self):
        closeApp("test")
        
    def logIn(self):
        type(Pattern("Num-1.png").targetOffset(40,2), "10001", KeyModifier.SHIFT)
        type(Pattern("Pass.png").targetOffset(38,1), "1111")
        click("Valider.png")

    def logOut(self):
        popup("KO")
-------------------

Here is my main file :
----------
import unittest
import HTMLTestRunner

from testClass import *

suite = unittest.TestLoader().loadTestsFromTestCase(Log)
outfile = open("C:\Report.html", "w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outfile, title='Test Report', description='This is demo' )
runner.run(suite)
--------------------

I then run the tests with the following command : Sikuli-IDE.exe -r main.sikuli
(main.sikuli contains my testClass folder and is in the same place as the exe file)
The file report.html is generated, with 0 test run (and i don't see anything happening).

Can someone explain where i'm wrong please?
Thanks!


       

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