← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #242302]: Start button not working with unit testing

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
ok, that is standard unit testing.

So you have to get familiar with that (again faq 1804).
Is rather easy and flexible with Python.

On top we have the HTMLTestrunner, that produces nice test reports in
HTML in a modified version even with screenshots in case of failed
tests.

Everything else, I already mentioned is still true.

I would recommend, to first start with the Sikuli IDE with some basic snippets, that e.g. 
-- start your app and bring it in a state to start a test (setup)
-- find buttons, click them and get a feeling how to check the outcome (test case)
-- shut down your application or reset it into a state like just being started (teardown)

Then you should make a top-down design of your test cases and suites and implement the required classes and decide about packaging into modules.
Now build your final setup and teardown methods and make them work with one empty test case.
This should be setup in Eclipse with Python plugin.
Now you know, that your testing framework works together with the automation framework.

About the images:
In your Eclipse project have an images.sikuli, that you use with the Sikuli IDE, to capture the images. Name the images using a naming scheme, that fits your testing structure and naming.
In Eclipse, the script needs at the beginning:
from sikuli import *
import os
sys.path.add(os.path.join(java.lang.System.getProperty("user.dir"))
import images

the latter tells Sikuli, where to find the used images.

with this setup, you even might test snippets in images.sikuli in Sikuli IDE and just copy and paste them to your Eclipse script.
Take care, that images.sikuli does not contain any executable code, when running your stuff in Eclipse.

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