Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/bergPublic

HAL test suite based on Cypress

License

NotificationsYou must be signed in to change notification settings

hal/berg

Berg is a test-suite forHAL Management Console based onCypress 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 aspostgres) 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
    • recommended version is 16, in other versions you can get errors likeUnable to detect compiler type
    • Node Version Manager (nvm) is recommended optional tool to install & manage multiple Node environments
  • npx CLI tool used to exeute binaries from project'snode_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 and start podman socket:
    • export TESTCONTAINERS_RYUK_DISABLED=true
    • export DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock
      • the path can be found by commandpodman info --debug and look forpath inremoteSocket section.
    • systemctl --user start podman.socket
  • 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 bynode-maven JS wrapper to execute Maven & Java related tasks into the build automation.

How to build & run

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

in the root directory to download all of the NPM dependencies specified inpackage.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 topackages/testsuite and from within that directory executenpm 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 thepackages/testsuite directory and supports glob patterns, e.g to execute onlyejb 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 useHAL_IMAGE andWILDFLY_IMAGE environment variables to specify custom images, e.g
    HAL_IMAGE=quay.io/myorg/hal WILDFLY_IMAGE=quay.io/myorg/wildfly npm test ...

Available environment properties

Following is a table of supported environment properties that can be used when running the testsuite.

Property nameDefault valueDescription
HAL_IMAGEquay.io/halconsole/hal-development:latestHAL standalone image to be used
WILDFLY_IMAGEquay.io/halconsole/wildfly-development:latestWildFly/JBoss EAP image to be used
KEYCLOAK_IMAGEquay.io/keycloak/keycloak:latestKeycloak/RH-SSO image to be used for OIDC tests
POSTGRES_IMAGEdocker.io/library/postgres:latestPostgreSQL image to be used for datasource tests
MYSQL_IMAGEdocker.io/library/mysql:latestMySQL image to be used for datasource tests
MARIADB_IMAGEdocker.io/library/mariadb:latestMariaDB image to be used for datasource tests
MSSQL_IMAGEmcr.microsoft.com/mssql/server:2022-latestMicrosoft SQL Server image to be used for datasource tests

Custom method documentation

Documentation can be generated by following command in root of this repository

npm run docs

Contributing

See contributing guide:CONTRIBUTING.md

About

HAL test suite based on Cypress

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp