How to link up a series of Test Cases

Asked by Brian

If I got 5 test cases, named
testcase_1 , testcase_2 , ... , testcase_5
each of them has a single test script,
and my test cycle is

testcase_2 > testcase_4 > testcase_1 > testcase_5 > testcase_3

how can i link up these scripts together?

Thanks for your help:)

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Brian
Solved:
Last query:
Last reply:
Revision history for this message
obiwan-92 (obiwan-92) said :
#1

Hello,

You can call them from one sikuli script or use put them in some functions.
Look at the function import of python : http://docs.python.org/2/tutorial/modules.html

Hope it's help.

Regards.

Revision history for this message
Brian (brianiptszleung) said :
#2

i found

http://doc.sikuli.org/globals.html#importingsikuliscripts

is more useful for me.

i have create testcase1.py
===============
from sikuli import *
def t_c_1():
    click("1.png")
    click("2.png")
===============

and create testcycle1.py
===============
import testcase1
tc1.t_c_1()
===============

it works

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

Yes, good finding ;-)

This is the preferred way to implement these kinds of workflows.

The next step would be to use Python's unittest module (see faq 1804), that has more options to configure and log the test workflow.