sikuli-behave is a dockerized testing framework containing a step library intended to allow users to easily write Selenium and SikuliX tests with the Behave testing framework.
docker run -it --rm \
--env DISPLAY \
--volume $HOME/.Xauthority:/root/.Xauthority \
--volume /tmp/.X11-unix:/tmp/.X11-unix \
--volume $PWD:$PWD \
--workdir $PWD \
ixilon/sikuli-behave behave
The running Docker container must have permissions to connect to the XServer.
Behave uses tests written in a natural language style (Gherkin language), backed up by Python code (step implementations).
sikuli-behave step implementations must be written for Python language level 2.7.
For details about how to write Behave tests read this tutorial.
Selenium is for automating web applications for testing purposes.
sikuli-behave contains the behave-webdriver step library.
Add this import statement to your environment.py to initialize behave-webdriver and integrate it with the sikuli-behave Docker image.
# features/environment.py
from sikuli_behave.environment import *
To use step definitions of the behave-webdriver step library add this import statement to your step implementation:
# features/steps/my_step.py
from behave_webdriver.steps import *
SikuliX automates anything you see on the screen. It uses image detection and text recognition (OCR) powered by OpenCV to identify and control GUI components. This allows users to write end-to-end tests for desktop as well as web applications, even if there is no easy access to internals or the source code of the application or web page.
sikuli-behave defines some useful steps for running SikuliX tests with Behave.
To use them, the sikuli-behave step library must be imported into your own step implementation file:
# features/steps/my_step.py
from sikuli_behave.steps import *
Save images referenced by steps in the folder features/steps/image as PNG files.
The following step
Then I expect to see the image "foo"
is true if the image features/steps/image/foo.png is visible on the screen.
If a test step fails a screenshot of the current web page is saved in the file screenshot.png.
If a step can't be implemented, then the user can confirm whether the step has been failed or not.
@then(u'I expect to hear a beep')
def step_impl(context):
context.ask()
Use headless mode if there is no XServer, for instance if sikuli-behave is to be started in a continuous integration pipeline.
docker run --rm -v ${PWD}:/data -w /data ixilon/sikuli-behave xvfb-wrapper behave --stop -c
Content type
Image
Digest
Size
708.4 MB
Last updated
about 5 years ago
docker pull ixilon/sikuli-behave