Skip to content

xjusko/berg

 
 

Repository files navigation

Berg

Berg is a test-suite for HAL Management Console based on Cypress UI test automation. Berg as a name is heavily inspired by Gutenberg, inventor of printing press :) (printing press -> press -> Cypress).

Technological Stack

NodeJS

Node (https://nodejs.org/en/) is the JavaScript runtime engine used to run Berg, since Cypress is built only for JavaScript.

Cypress

Cypress (https://www.cypress.io) is the main automation framework used for developing, running & reporting tests. Main benefit of Cypress is, that it is bundling the testing code directly into the system (browser) under testing. Since JavaScript is the main language used by modern browsers, the test execution is swift, stable and less environment error-prone as in standard (Selenium + WebDriver) UI automation tools.

TestContainers

TestContainers (https://github.com/testcontainers/testcontainers-node) serves to launch & manage test scoped containers. Currently following containers are being used for testing:

  • Standalone HAL image used for most of the UI testing. It is a standalone HAL binary delivered by a container image that will be connected to a running WildFly server (that exposes management interface)
  • WildFly Server Image used for resource management. Exposes management interfaces onto which the Standalone HAL Image connects.
  • DB Images (such as postgres) serving (mostly) to run DB instances, that are being used in the datasource related tests.

Requirements

Following tools are required to run the test suite

  • NodeJS as a runtime environment.
    • nvm is optional tool to install & manage multiple Node environments
  • npx CLI tool used to exeute binaries from project's node_modules directly (instead of providing absolute/relative path to the commannds). It is used in multiple build steps.
  • Podman | Docker as a container runtime used by TestContainers. Note that when using Podman as container runtime you may need to export following environment variables:
    • TESTCONTAINERS_RYUK_DISABLED=true
    • DOCKER_HOST environment variable pointing to podman.sock
  • Java. Yes we'll need Java to write deployments/applications that will be deployed onto the running WildFly container.
  • Maven. Yes, we'll need Maven to ease up the development of the deployed applications & downloading needed JDBC drivers for datasource & drivers UI tests. Maven is mostly used embedded by node-maven JS wrapper to execute Maven & Java related tasks into the build automation.

How to build & run

  • Make sure you have all the tools from Requirements installed
  • Run
npm install

in the root directory to download all of the NPM dependencies specified in package.json

  • If you want to run Cypress developer console with the loaded spec files, run
npm run develop
  • If you want to execute whole testsuite, navigate to packages/testsuite and from within that directory execute npm test
    • It is also possible to run on specific browser by supplying --browser argument, e.g
    npm test -- --browser=chrome
    
    • It is also possible to reduce the amount of specs executed by passing --specs flag. This flag must be relative to the packages/testsuite directory and supports glob patterns, e.g to execute only ejb related tests, run
    npm test -- --specs="cypress/e2e/*ejb*.cy.ts"
    
    • If you wish to run the test suite against custom HAL or WildFly images, you can use HAL_IMAGE and WILDFLY_IMAGE environment variables to specify custom images, e.g
    HAL_IMAGE=quay.io/myorg/hal WILDFLY_IMAGE=quay.io/myorg/wildfly npm test ...
    

About

HAL test suite based on Cypress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.4%
  • Other 0.6%