Prerequisites
-
Docker installed
-
Python 3.11.x & Pip installed:
-
Robot Framework & dependencies installed:
- Run the following command inside your
.\integration-tests\testsfolder path:pip install -r requirements.txt
- Run the following command inside your
-
An EHRbase instance running on port
8080:Click to expand: Configure & run EHRbase instance
-
Create the Docker network:
docker network create ehrbase-net
-
Spin up the Postgres database:
docker run --name ehrdb --network ehrbase-net -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 ehrbase/ehrbase-v2-postgres:16.2
-
Get EHRBase repository locally from https://github.com/ehrbase/ehrbase
-
Change the following properties in
ehrbase/configuration/src/main/resources/application.yml:ehrscape.enabled: true tags.enabled: true aql.debugging-enabled: true aql.response.generator-details-enabled: true
Note: If you need to modify other settings, feel free to do so. However, please note that existing Robot tests are tightly coupled to the default configuration and may fail if other values are changed.
-
Build the project (run from the root
/ehrbasefolder):mvn clean install -Dmaven.test.skip=true
-
Start the application (run from the root
/ehrbasefolder):java -jar application/target/ehrbase.jar --server.nodename=local.ehrbase.org
-
Wait for the confirmation message in your console:
Started EhrBase in X seconds
-
From .\integration-tests root project directory, run:
cd tests
.\run_local_tests.shResults will be stored in .\integration-tests\results\test-suites
Prerequisites
- Get EHRBase repository locally from https://github.com/ehrbase/ehrbase (if not present)
- Change the following properties in
.\ehrbase\configuration\src\main\resources\application.yml:ehrscape.enabled: true tags.enabled: true aql.debugging-enabled: true aql.response.generator-details-enabled: true
Note: If you need to modify other settings, feel free to do so. However, please note that existing Robot tests are tightly coupled to the default configuration and may fail if other values are changed.
- Build the project (run from the root
.\ehrbasefolder):mvn clean install -Dmaven.test.skip=true
- Build Docker image (run from the root
.\ehrbasefolder):docker build -t ehrbase/ehrbase:next . - Set environment variable
EHRBASE_IMAGE:SET EHRBASE_IMAGE=ehrbase/ehrbase:next
Execute a single test suite (run from the root .\ehrbase folder).
- Results will be stored in
.\ehrbase\tests\results\(folder_with_test_suite_path_name). - Example:
- .\ehrbase\tests\results\SANITY
- .\ehrbase\tests\results\STORED_QUERY
Expand commands to run tests in Docker
docker compose -f docker-compose.yml -f tests/docker-compose-int-test.yml run \
--remove-orphans --rm ehrbase-integration-tests runRobotTest \
--serverBase http://ehrbase:8080 \
--name SANITY \
--path SANITY_TESTS \
--tags Sanity \
--env NONEFor the other suites, just replace below lines (for example) in the above full command:
...
--name STORED_QUERY \
--path STORED_QUERY_TESTS \
--tags stored_query \
......
--name COMPOSITION \
--path COMPOSITION_TESTS \
--tags COMPOSITION \
......
--name CONTRIBUTION \
--path CONTRIBUTION_TESTS \
--tags CONTRIBUTION \
......
--name DIRECTORY \
--path DIRECTORY_TESTS \
--tags DIRECTORY \
......
--name AQL \
--path AQL_TESTS \
--tags AQL_TESTS_PACKAGE \
......
--name EHR_SERVICE \
--path EHR_SERVICE_TESTS \
--tags EHR_SERVICE \
......
--name EHR_STATUS \
--path EHR_STATUS_TESTS \
--tags EHR_STATUS \
......
--name EHRSCAPE \
--path EHRSCAPE_TESTS \
--tags EhrScapeTag \
......
--name TAGS \
--path TAGS_TESTS \
--tags TAGS_SUITES \
......
--name TEMPLATE \
--path TEMPLATE_TESTS \
--tags template \
......
--name SWAGGER \
--path SWAGGER_TESTS \
--tags SWAGGER_EHRBASE \
...For both options, log.html and output.xml files will be created where:
- output.xml - generated during test execution. After test execution is completed, it will be automatically post-processed by Rebot tool, which is an integral part of Robot Framework, generating the user-friendly log.html file.
- log.html - contains details about the executed test cases in HTML format. Test suite, test case and keyword details have a hierarchical structure for better readability.
References: