Running few tests from a suite cmd

Asked by Asheru

Hello,

I know this is somehow not related to sikuli but maybe someone already achieved this.
Let's say I have like 200 tests written with sikuli and py. Now I want to runt only test 35,and 80 from command line. Is it possible to organize them in a way to achieve this?

Thank you.

Question information

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

Have a look at the unittest feature (which would be eqivalent to organize your tests into classes and functions, but why invent the world again ;-)

Another option is to have each test in a separate script and use the runscript feature of SikuliX.

... and finally you can wrap each test sequence in
if test in testsToRun:
    # the test snippet

where testsToRun is a list of test-numbers, which in turn could be created based on the numbers given as commandline parameters.

Revision history for this message
Asheru (asheru93) said :
#2

But let's say I have them grouped with the help of unittest llike test
def test1()
def test2()
.
.
.
def test100()

Now I use HTMLTestRunner+unittest to run them and generate a report.

Would it be possbile to run from cmd with skiluli no the file that I want to execute but the methods directly?
Lets say java -jar <path to sikuli> -r test35() test38() shomeshow?

So at any given time depending on what I want to run to execute like that?

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

ok, then you already have unittest.

You have to use the config options for the suite, that collects the testcases and is given to HTMLTestRunner.

Consult the docs of Python unittest (version 2.7!)

Revision history for this message
Asheru (asheru93) said :
#4

Alright then. Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Asheru for more information if necessary.

To post a message you must log in.