← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #292717]: python unittest discover in SikuliX

 

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

RaiMan posted a new comment:
@tranquillo
... yes, to do it this way, is not possible currently with Sikuli(X) IDE, since it is not possible, to edit plain Python files.

The reason behind:
A Sikuli(X) script normally is a package with a .py file and associated images, that are used in the script.

Solution in your case:
- using the SikuliX IDE capture ALL needed images in ALL tests in one images.sikuli script
- have a naming convention for your images and preferably in the images.sikuli use something like
imageFooBar =  "imageFooBar.png" (special capture support for that in latest SikuliX)
- in boilerplate take care, that the folder containing the images.sikuli is in sys.path
- in every test have:
from sikuli import *
from images import *
- then use in your test:
click(imageFooBar)

Of course you have to use some Python aware editor, to manage all your
test....py (e.g. IntelliJ's PyCharm).

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.