You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Besides the Docker network name there are also a number of parameters that you may or may not pass to the step.
113
+
114
+
| Parameter | optional? | Default | Description |
115
+
|-----------|-----------|---------|-------------|
116
+
|seleniumHubImage | optional | 'selenium/hub' | the Selenium Docker container images to be used from hub.docker.com.|
117
+
|seleniumVersion | optional | "3.141.59-zinc" | the Selenium Docker container image tag |
118
+
|workerImageFF | optional | "selenium/node-firefox" | the Selenium Firefox worker node Docker container image. This matches automatically with the given Selenium hub version. |
119
+
|workerImageChrome | optional | "selenium/node-chrome" | the Selenium Chrome worker node Docker container image. This matches automatically with the given Selenium hub version.|
120
+
|firefoxWorkerCount| mandatory if no Chrome worker is used | 0 | the number of Firefox containers that should be started for the test |
121
+
|chromeWorkerCount | mandatory if no Firefox worker is used | 0 | the number of Chrome containers that should be started for the test |
122
+
|hubPortMapping | optional | 4444 | the port under which the Selenium Hub should be available |
123
+
|debugSelenium | optional | false | set to `true` if you want your Jenkins run log to be filled with debug output |
124
+
125
+
Please note that `firefoxWorkerCount` AND `chromeWorkerCount` must not contain a value of zero. That would render the
126
+
test unusable because there would no one to execute the tests. In this case the body will not be executed and a
127
+
`ConfigurationException` will be thrown.
128
+
129
+
```groovy
130
+
// example for starting Selenium with a certain parameter with a groovy map.
131
+
// The rest of the parameters fallback to their defaults.
It is possible (although not necessary) to explicitly work with docker networks. This library supports the automatic creation and removal of a bridge network with a unique name.
51
149
52
-
### How
150
+
### Usage
53
151
54
152
`withZalenium` accepts now an optional network name the Zalenium container can attach to the given network. Conveniently a docker network can be created with this pipeline step which provides the dynamically created network name.
@@ -67,7 +166,7 @@ It is possible (although not necessary) to explicitly work with docker networks.
67
166
68
167
Often comes a Truststore into play while working with Jenkins and Java. Jenkins can accommodate necessary certificates in its truststore so Java applications like Maven (and others too!) can successfully interact with other parties, like download artifacts from artifact repositories or transport data over the network. Even so, it may be necessary to provide these Java applications with the right certificates when otherwise encrypted communication would fail without doing so.
69
168
70
-
## Simple Truststore pipeline
169
+
###Simple Truststore pipeline
71
170
72
171
For such circumstances this library provides a small snippet. The global `truststore` variable ensures that any truststore files which are copied in the process are also removed at the end of both `copy` and `use` actions.
73
172
@@ -106,23 +205,6 @@ node('anotherNode') {
106
205
}
107
206
```
108
207
109
-
## Locking
110
-
111
-
Right now, only one Job can run Zalenium Tests at a time.
112
-
This could be improved in the future.
113
-
114
-
### Why?
115
-
116
-
When multiple jobs executed we faced non-deterministic issues that the zalenium container was gone all of a sudden,
117
-
connections were aborted or timed out.
118
-
119
-
So we implemented a lock before starting zalenium that can only be passed by one job at a time.
120
-
It feels like this issue is gone now, but we're not sure if the lock was the proper fix.
121
-
122
-
### How?
123
-
124
-
We use the `lock` step of the [Lockable Resources Plugin](https://wiki.jenkins.io/display/JENKINS/Lockable+Resources+Plugin).
125
-
126
208
# Troubleshooting
127
209
128
210
The logs of the zalenium container are stored in `$WORKSPACE/zalenium-docker.log`.
* @param nexusCredentials Jenkins credentials which provide USERNAME and PASSWORD to an account which enables Nexus interaction
16
-
* @param cesFQDN the full qualified domain name of the current CES instance, f. i. <code>cesinstance.stage.host.tld</code>
20
+
* @param cesFQDN the full qualified domain name of the current CES instance, f. i. <code>cesinstance.stage.host.tld</code>. The prefix <code>https://</code> will be added automatically.
17
21
* @param pathToLocalMavenRepository without the .m2 directory part, f. i. <code>/usr/share/maven</code>. The suffix <code>/.m2/repository</code> will be added automatically.
22
+
* @param mirrorNexusPath relative path to a maven central mirror hosted inside a nexus instance. The prefix <code>/nexus/repository</code> will be added automatically. Defaults to "maven-central"
23
+
* @param closure This closure will be executed when the Maven <code>settings.xml</code> file was successfully created.
* Provides a simple custom maven settings.xml file to current working directory with Maven Central mirror in the
61
+
* current CES instance.
62
+
* @param nexusCredentials Jenkins credentials which provide USERNAME and PASSWORD to an account which enables Nexus interaction
63
+
* @param cesFQDN the full qualified domain name of the current CES instance, f. i. <code>cesinstance.stage.host.tld</code>. The prefix <code>https://</code> will be added automatically.
64
+
* @param mirrorNexusPath relative path to a maven central mirror hosted inside a nexus instance. The prefix <code>/nexus/repository</code> will be added automatically. Defaults to "maven-central"
65
+
* @param closure This closure will be executed when the Maven <code>settings.xml</code> file was successfully created.
* Creates a Maven <code>settings.xml</code> and executes Maven with the given arguments.
74
+
* @param nexusCredentials Jenkins credentials which provide USERNAME and PASSWORD to an account which enables Nexus interaction
75
+
* @param cesFQDN the full qualified domain name of the current CES instance, f. i. <code>cesinstance.stage.host.tld</code>. The prefix <code>https://</code> will be added automatically.
76
+
* @param mirrorNexusPath relative path to a maven central mirror hosted inside a nexus instance. The prefix <code>/nexus/repository</code> will be added automatically. Defaults to "maven-central"
77
+
* @param mvnCallArgs these arguments contain the Maven arguments
* @param settingsXml the path to a Maven <code>settings.xml</code> file. (mandatory)
101
+
* @param mvnCallArgs these arguments contain the Maven arguments. Whether these arguments are optional or not depends on your <code>pom.xml</code>.
60
102
*/
61
103
defmvn(StringsettingsXml, StringmvnCallArgs) {
62
104
def mvnHome = tool 'M3'
63
-
105
+
64
106
mvnWithHome(mvnHome, settingsXml, mvnCallArgs)
65
107
}
66
108
109
+
/**
110
+
* Creates a Maven <code>settings.xml</code> and executes Maven with the given arguments.
111
+
* @param nexusCredentials Jenkins credentials which provide USERNAME and PASSWORD to an account which enables Nexus interaction
112
+
* @param cesFQDN the full qualified domain name of the current CES instance, f. i. <code>cesinstance.stage.host.tld</code>. The prefix <code>https://</code> will be added automatically.
113
+
* @param mvnHome the Maven home path
114
+
* @param pathToLocalMavenRepository the path to the local Maven repository
115
+
* @param mvnCallArgs these arguments contain the Maven arguments. Whether these arguments are optional or not depends on your <code>pom.xml</code>.
* Creates a Maven <code>settings.xml</code> and executes Maven with the given arguments.
125
+
* @param nexusCredentials Jenkins credentials which provide USERNAME and PASSWORD to an account which enables Nexus interaction
126
+
* @param cesFQDN the full qualified domain name of the current CES instance, f. i. <code>cesinstance.stage.host.tld</code>. The prefix <code>https://</code> will be added automatically.
127
+
* @param mirrorNexusPath relative path to a maven central mirror hosted inside a nexus instance. The prefix <code>/nexus/repository</code> will be added automatically. Defaults to "maven-central"
128
+
* @param mvnCallArgs these arguments contain the Maven arguments
0 commit comments