Running few tests from a suite cmd

Asked by Asheru on 2018-12-13


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

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
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.

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?

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!)

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.