Skip to content

Automated Tests

helkv edited this page Nov 13, 2019 · 1 revision

This Page gives an overview over the existing automated tests for imeji and how to run them.

The automated tests for imeji are separated in:

  • UI Tests
  • Integration Tests

UI Tests

Imeji workflows are tested on UI level using the Selenium testing framework.

The Selenium tests are managed in an separate project: https://github.com/MPDL/imeji-gui-testing

Integration Tests

Methods on the Service level and the connection to the Jena DB and to Elasticsearch are tested by the Integration Tests.

The Integration Tests are located in the src/test directory of this project.

Requirements and Configuration to run the Integration Tests

  • Requirements

    • Requirements of the current imeji release are fulfilled: https://github.com/MPDL/imeji/wiki/Installation
    • Docker must be installed and running:
      • Docker is used to start an Elasticsearch instance within a Docker Container for the tests
      • Instructions to set up Docker for the tests on Windows 7 :
        • Download the latest version of Docker Toolbox: https://github.com/docker/toolbox/releases
        • Install Docker Toolbox: https://docs.docker.com/toolbox/toolbox_install_windows (skip step 1. and 3.)
        • Create and Start a VirtualBox as Docker host:
          1. Open Windows Command Prompt: cmd.exe
          2. List all Docker hosts: docker-machine ls
          3. Create a VirtualBox if none exists: docker-machine create default
          4. Start the VirtualBox: docker-machine start default
        • The VirtualBox should be stopped before system shut down:
          • Stop the VirtualBox: docker-machine stop default
      • As soon as the VirtualBox is created and started (steps a.-d.) the tests can be executed!
  • Configuration

    • Imeji properties for the tests can be configured in the src/test/resources/imeji.properties file. The following properties should be checked and set correctly before running the tests:
      • imeji.tdb.path Set to a writeable directory where the test database (Apache Jena) can be stored
      • imeji.storage.path Set to a writeable directory where the test binary files can be stored
      • imeji.imagemagick.installpath If ImageMagick 6 is installed (recommended), set to the directory where the ImageMagick binaries (convert etc.) are installed – Set this path to avoid Exceptions referring to ImageMagick during the tests