Skip to content

Supernova test framework in Groovy flavor, UI and Restful services couldn't be any easier than this

License

Notifications You must be signed in to change notification settings

amado-saladino/supernova-groovy

Repository files navigation

Overview

Groovy Flavor of Supernova framework.

Components

  • RestUtils
  • TestCase (UI)
  • JSON server
  • Scripts
  • Data files
  • YAML configuration

JSON server

Json server could run in a container, container components reside in json-server folder.

docker run -d -p 81:80 -v $PWD:/data -e "DB=users.json" ghcr.io/amado-saladino/json-server:v1

port

container port is defined in json-server.json config file

Scripts

Scripts can be injected in a web page, there is jquery.js to inject jQuery in a web page

Data placeholders

Placeholders could be easily replaced by values e.g. user-placeholders.json has some placeholders, these placeholders could be replaced using RestUtils.resolveVarsInString method.

Groovy

Enjoy the high flexibility of Dynamic Programming of Groovy lang.

Run

gradle clean test

Run Custom Tests

gradle clean test --tests TestDataSource  # class
gradle clean test --tests TestDataSource.*json*  # pattern of method
gradle clean test --tests TestDataSource."use excel sheet as data source"  # a specific method

Run in Docker

Build the image

docker build -t gradle-test .

Run test

docker run -v `pwd`:/app -v gradle-repo:/root/.gradle/caches/modules-2/files-2.1 amadosaladino/selenium-gradle

Run a specific test method

docker run -v gradle-repo:/root/.gradle/caches/modules-2/files-2.1 -v `pwd`:/app amadosaladino/selenium-gradle clean test --tests TestHome."show page elements"

View Test Report

docker run --rm --name=report -d -v $PWD/build/reports/tests/test:/usr/share/nginx/html -p 80:80 nginx:1.14

Screenshot Viewer

Screenshots taken during test run could be displayed this way:

docker run -d -v $PWD/screenshots:/Pictures:ro -p 81:80 --name gallery ghcr.io/linuxserver/photoshow

docker compose

docker-compose up -d

Regression Test

docker-compose start test

Note When running docker-compose, edit src/resources/config.yml and set RESTJSON property to json-server:80

About

Supernova test framework in Groovy flavor, UI and Restful services couldn't be any easier than this

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published