Skip to content

Commit

Permalink
chore(testing):[#742] update test strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
mkanal committed Mar 13, 2024
1 parent 12f6ba4 commit 958b40b
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 3 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
- [Getting started](https://github.com/eclipse-tractusx/traceability-foss/#getting-started)
- [Application authentication](https://github.com/eclipse-tractusx/traceability-foss/#application-authentication)
- [Application architecture & patterns](https://github.com/eclipse-tractusx/traceability-foss/#application-architecture--patterns)
- [User guide](https://github.com/eclipse-tractusx/traceability-foss/#user-guide)
- [User guide](#user-guide)
- [Frontend Testing strategy](#frontend-testing-strategy)
- [The backend application](https://github.com/eclipse-tractusx/traceability-foss/#the-backend-application)
- [Prerequisites](https://github.com/eclipse-tractusx/traceability-foss/#backend-prerequisites)
- [Installation](https://github.com/eclipse-tractusx/traceability-foss/#backend-installation)
Expand Down Expand Up @@ -104,6 +105,10 @@ so that you end up with a well-structured app.

A detailed [explanation](https://github.com/eclipse-tractusx/traceability-foss/blob/main/docs/src/docs/user/user-manual.adoc) of how to use the application.

### Frontend Testing Strategy

See [TESTING](TESTING.md).

## The backend application

### Backend Prerequisites
Expand Down
9 changes: 9 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Testing Strategy

## Frontend Testing Strategy

See [TESTING](frontend/TESTING.md).

## Backend Testing Strategy
See [TESTING](tx-backend/TESTING.md).

14 changes: 12 additions & 2 deletions frontend/E2E.md → frontend/TESTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
## E2E tests
# Frontend Testing Strategy

We use Cypress as e2e testing framework (https://www.cypress.io/) + https://www.npmjs.com/package/@cypress/schematic.
## Unit Tests
Unit tests are executed automatically during the GitHub workflow
[Unit Tests Frontend](.github/workflows/unit-test_frontend.yml)

#### Test Reports
https://sonarcloud.io/project/overview?id=eclipse-tractusx_traceability-foss-frontend
[sonar-scan-frontenc.yml](./workflows/sonar-scan-frontenc.yml)

## E2E tests with Cypress

We use Cypress as e2e testing framework [Cypress](https://www.cypress.io/) and [npmjs](https://www.npmjs.com/package/@cypress/schematic).

To be able to use Behavior-driven development (BDD) approach we have configured additional lib: https://github.com/badeball/cypress-cucumber-preprocessor

Expand Down
59 changes: 59 additions & 0 deletions tx-backend/TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Backend Testing Strategy

### Unit Tests

Unit tests are executed automatically during the GitHub workflow
[pull-request_backend.yml](./github/workflows/pull-request_backend.yml)
[sonar-scan-backend.yml](./workflows/sonar-scan-backend.yml)

#### Test Reports

https://sonarcloud.io/project/issues?resolved=false&id=eclipse-tractusx_traceability-foss-backend
[sonar-scan-backend.yml](./workflows/sonar-scan-backend.yml)

#### Test Coverage

- The current test coverage is [![Coverage](https://sonarcloud.io/project/overview?id=eclipse-tractusx_traceability-foss-backend&metric=coverage)](https://sonarcloud.io/project/overview?id=eclipse-tractusx_traceability-foss-backend).

- For more information on coverage see [Architecture Documentation - Development concepts](https://eclipse-tractusx.github.io/traceability-foss/docs/arc42/full.html#_development_concepts).

#### Testing Frameworks and Libaries

- The Trace-X project uses [JUnit5](https://junit.org/junit5/) with [AssertJ](https://github.com/assertj/assertj)
and [Mockito](https://site.mockito.org/) and the testing capabilities of the
[Spring Boot Framework](https://spring.io/projects/spring-boot) for unit testing.


### Integration Tests

Besides the Spring Boot features testing features the following frameworks and tools are used for integation testing:
- [Testcontainers](https://java.testcontainers.org/) for bootstrapping integration tests with real services wrapped in Docker containers
- [Wiremock](https://wiremock.org/) for building mock APIs in order to simulate dependencies

The Wiremock tests are intended to cover the IRS flow and communication
without the need of a running environment that includes all dependencies.
Wiremock Tests and their corresponding utilities are marked by the suffix `WiremockTest` respectively `WiremockSupport`.

- Furthermore, the following libraries are utilized:
- [Awaitility](http://www.awaitility.org/) for expressing expectations of asynchronous code
in a concise and easy to read manner.
- [DataFaker](https://www.datafaker.net/) for creating fake data.

### Smoke Tests

N.A


### Regression Tests

[Cucumber](https://cucumber.io/) for regression testing.


#### Cucumber Tests

- There are [Cucumber](https://cucumber.io/) that verify the response bodies in more detail.
- See the module `tx-cucumber-tests` and the [Cucumber Tests README](irs-cucumber-tests/README.md) for more information.

### Load Tests

N.A

0 comments on commit 958b40b

Please sign in to comment.