Skip to content

npmExecuteEndToEndTests

Description

Executes end to end tests by running the npm script configured via the runScript property.

Parameters

name mandatory default possible values
appUrls no
baseUrl no
buildDescriptorExcludeList no
credentialsId no
dockerImage no
onlyRunInProductiveBranch no true, false
parallelExecution no
productiveBranch no master
runScript no ci-e2e
script yes
wdi5 no true, false
  • appUrls - The URLs under which the app is available after deployment. Each element of appUrls must be a map containing a property url, an optional property credentialId, and an optional property parameters. The optional property parameters can be used to pass additional parameters to the end-to-end test deployment reachable via the given application URL. These parameters must be a list of strings, where each string corresponds to one element of the parameters. For example, if the parameter --tag scenario1 should be passed to the test, specify parameters: ["--tag", "scenario1"]. These parameters are appended to the npm command during execution.
  • baseUrl - Base URL of the application to be tested
  • buildDescriptorExcludeList - List of build descriptors and therefore modules to exclude from execution of the npm scripts. The elements of the list can either be a path to the build descriptor or a pattern.
  • credentialsId - Credentials to access the application to be tested
  • dockerImage - Docker image on which end to end tests should be executed
  • onlyRunInProductiveBranch - Boolean to indicate whether the step should only be executed in the productive branch or not.
  • parallelExecution - Executes the deployments in parallel.
  • productiveBranch - The branch used as productive branch, defaults to master.
  • runScript - Script to be executed from package.json. Defaults to ci-e2e.
  • script - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the this parameter, as in script: this. This allows the function to access the commonPipelineEnvironment for retrieving, e.g. configuration parameters.
  • wdi5 - Distinguish if these are wdi5 tests. If set to true wdi5_username and wdi5_password environment variables are used to enable autologin.

Step configuration

We recommend to define values of step parameters via config.yml file.

In following sections of the config.yml the configuration is possible:

parameter general step/stage
appUrls X
baseUrl X
buildDescriptorExcludeList X
credentialsId X
dockerImage X
onlyRunInProductiveBranch X
parallelExecution X X
productiveBranch X X
runScript X
script
wdi5 X

Examples

Passing credentials

When running acceptance tests in a real environment, authentication will be enabled in most cases. WDI5 includes features to automatically perform the login. For this, if the step parameter wdi5 is set to true, the provided basic auth credential (credentialsId) are mapped to the environment variables wdi5_username and wdi5_password.