An open API service indexing awesome lists of open source software.

https://github.com/npo-poms/functional-tests

Integration/ui tests for the NPO POMS universe
https://github.com/npo-poms/functional-tests

npo npo-backend-api npo-frontend-api poms testing

Last synced: 6 months ago
JSON representation

Integration/ui tests for the NPO POMS universe

Awesome Lists containing this project

README

          

= POMS Fitnesse tests
:toc:
:toclevels: 5

== Introduction

This project also used to contain the functional api tests. These are moved to https://gitlab.com/npo-identity/poms/api-tests[gitlab.com/npo-identity] . What remains are the https://fitnesse.org/[fitnesse] tests, originally developed by Specialisterren.

=== Covered by the tests

There are 3 sets

=== E2E, API
These talks to api's. I think these tests are redundant.

=== GUI

Tests for the POMS GUI.

=== Firefox, Chrome

== Prerequisites

* Java 11. It doesn't work with java >= 17
* Maven 3.9

== Properties files

In order to run the tests these properties files should be present:

* `poms-fitnesse-accounts.properties`
* `poms-fitnesse-apikeys.properties` (not for 'gui').

Both properties files should be in either of these folders:

* `~/conf` (Linux/macOS) of `%userprofile%\conf` (Windows)
* [wiki/FitNesseRoot/files/fileFixture](wiki/FitNesseRoot/files/fileFixture)

The properties files are provided separately by Specialisterren.

== Running locally

In order to get access to the automated scripts in FitNesse, `start.bat` (or `start.sh`) should be executed, located in [/poms-functional-tests-fitnesse](/poms-functional-tests-fitnesse).A command prompt will appear.Wait until it says: `Starting FitNesse on port: 9090`.

Then the FitNesse environment can be displayed by browsing to: [http://localhost:9090/NpoPoms](http://localhost:9090/NpoPoms).

From this page, the test scripts can be displayed after selecting the environment (`test` and `dev`), the test purpose (`gui`, `api` and `e2e`) and in case of `gui` and `e2e`, the browser (`Firefox` and `Chrome`): [http://localhost:9090/NpoPoms.Omgevingen](http://localhost:9090/NpoPoms.Omgevingen).

The test scripts make use of scenarios in the scenario library, located in [http://localhost:9090/NpoPoms.ScenarioLibrary](http://localhost:9090/NpoPoms.ScenarioLibrary).

== Running in Jenkins

In Jenkins, there should be separate jobs for every possible combination of environment, test purpose and in case of `gui` en `e2e`, the browser.

=== Gui

The configuration of the test environment of `gui` with `Firefox` should be set as follows:

![Npo-poms-api-jenkins-configuration](wiki/FitNesseRoot/files/images/Npo-poms-gui-jenkins-configuration.png)

If the properties files are in `~/conf` (Linux/macOS) of `%userprofile%\conf` (Windows), then `Commando` should be set as follows:

[source, bash]
----
MOZ_HEADLESS=1
mvn clean test-compile failsafe:integration-test -DfitnesseSuiteToRun=NpoPoms.Omgevingen.Test.Firefox.Gui
----

If the properties files are not in either of these folders, the properties file `poms-fitnesse-accounts.properties` should be generated through `Commando`.This file should contain the following:

[source, properties]
----
standaardGebruikersnaam=gebruikersnaam
standaardWachtwoord=wachtwoord
npoGebruikersnaam=gebruikersnaam
npoWachtwoord=wachtwoord
adminGebruikersnaam=gebruikersnaam
adminWachtwoord=wachtwoord
omroepUploaderGebruikersnaam=gebruikersnaam
omroepUploaderWachtwoord=wachtwoord
----

`Commando` should be set as follows:

[source, bash]
----
mvn clean test-compile
mkdir -p target/fitnesse-results/files/fileFixture

(echo standaardGebruikersnaam='gebruikersnaam' & echo standaardWachtwoord='wachtwoord' & echo npoGebruikersnaam='gebruikersnaam' & echo npoWachtwoord='wachtwoord' & echo adminGebruikersnaam='gebruikersnaam' & echo adminWachtwoord='wachtwoord' & echo omroepUploaderGebruikersnaam='gebruikersnaam' & echo omroepUploaderWachtwoord='wachtwoord') > target/fitnesse-results/files/fileFixture/poms-fitnesse-accounts.properties

mvn failsafe:integration-test -DfitnesseSuiteToRun=NpoPoms.Omgevingen.Test.Firefox.Gui "-DseleniumJsonProfile={'args':['headless','disable-gpu']}"
----

where the values after `=` should be replaced by the actual values.

The configurations of other combinations of environment (`test` and `dev`) and browser (`Firefox` and `Chrome`) have a similar configuration.

=== Api

The configuration of the test environment of `api` should be set like `gui`, except for the `Commando` field.

If the properties files are in `~/conf` (Linux/macOS) of `%userprofile%\conf` (Windows), then `Commando` should be set as follows:

[source, bash]
----
MOZ_HEADLESS=1
mvn clean test-compile failsafe:integration-test -DfitnesseSuiteToRun=NpoPoms.Omgevingen.Test.Api
----

If the properties files are not in either of these folders, the properties file `poms-fitnesse-accounts.properties` should be generated through `Commando`.This file should contain the following:

[source, properties]
----
frontEndApiKey=apiKey
frontEndApiSecret=secret
frontEndApiOrigin=https://poms.testomgeving.example.com/
backEndApiKey=apiKey
backEndApiSecret=secret
backEndApiOrigin=https://poms.testomgeving.example.com/
----

`Commando` should be set as follows:

[source, bash]
----
mvn clean test-compile
mkdir -p target/fitnesse-results/files/fileFixture

(echo frontEndApiKey='apiKey' & echo frontEndApiSecret='secret' & echo frontEndApiOrigin='https://poms.testomgeving.example.com/' & echo backEndApiKey='apiKey' & echo backEndApiSecret='secret' & echo backEndApiOrigin='https://poms.testomgeving.example.com/') > target/fitnesse-results/files/fileFixture/poms-fitnesse-apikeys.properties

mvn failsafe:integration-test -DfitnesseSuiteToRun=NpoPoms.Omgevingen.Test.Api "-DseleniumJsonProfile={'args':['headless','disable-gpu']}"
----

where the values after `=` should be replaced by the actual values.

The configuration of the `dev` environment has a similar configuration.

=== E2E

The configuration of the test environment of `e2e` with `Firefox` should be set like `gui`, except for the `Commando` field.

If the properties files are in `~/conf` (Linux/macOS) of `%userprofile%\conf` (Windows), then `Commando` should be set as follows:

[source, bash]
----
MOZ_HEADLESS=1
mvn clean test-compile failsafe:integration-test -DfitnesseSuiteToRun=NpoPoms.Omgevingen.Test.Firefox.E2E
----

If the properties files are not in either of these folders, the properties file `poms-fitnesse-accounts.properties` and `poms-fitnesse-apikeys.properties` should be generated through `Commando`.The contents of these files are mentioned in the earlier sections.

`Commando` should be set as follows:

[source, bash]
----
mvn clean test-compile
mkdir -p target/fitnesse-results/files/fileFixture

(echo standaardGebruikersnaam='gebruikersnaam' & echo standaardWachtwoord='wachtwoord' & echo npoGebruikersnaam='gebruikersnaam' & echo npoWachtwoord='wachtwoord' & echo adminGebruikersnaam='gebruikersnaam' & echo adminWachtwoord='wachtwoord' & echo omroepUploaderGebruikersnaam='gebruikersnaam' & echo omroepUploaderWachtwoord='wachtwoord') > target/fitnesse-results/files/fileFixture/poms-fitnesse-accounts.properties
(echo frontEndApiKey='apiKey' & echo frontEndApiSecret='secret' & echo frontEndApiOrigin='https://poms.testomgeving.example.com/' & echo backEndApiKey='apiKey' & echo backEndApiSecret='secret' & echo backEndApiOrigin='https://poms.testomgeving.example.com/') > target/fitnesse-results/files/fileFixture/poms-fitnesse-apikeys.properties

mvn failsafe:integration-test -DfitnesseSuiteToRun=NpoPoms.Omgevingen.Test.Firefox.E2E "-DseleniumJsonProfile={'args':['headless','disable-gpu']}"
----
where the values after `=` should be replaced by the actual values.

The configurations of other combinations of environment (`test` and `dev`) and browser (`Firefox` and `Chrome`) have a similar configuration.

== Docker, gitlab

The vpro https://git.vpro.nl/npo/test/fitnesse-runner[runs the GUI tests in gitlab too]. For this the link:Dockerfile[docker image] (at https://hub.docker.com/u/npopoms[hub.docker.io]) is used.