2

In a Jenkins 2.0 pipeline, I'm using code similar to

wrap([$class: 'Xvfb']) {
  // execute selenium tests
}

As expected, this xvfb session uses the default screen resolution (1024x768x8?). I would like to override it.

According to the documentation at https://github.com/jenkinsci/xvfb-plugin, the Xvfb plugin has a Screen member that controls the resolution. What is the syntax for doing so? I've tried

wrap([$class: 'Xvfb'](Screen:'1440x900x24')) {
  // execute selenium tests
}

wrap([$class: 'Xvfb'][Screen:'1440x900x24']) {
  // execute selenium tests
}

and

wrap([$class: 'Xvfb']) {
  Screen = '1440x900x24'
  // execute selenium tests
}
4

1 回答 1

3

i believe config goes into the same map, so

wrap([$class: 'Xvfb', screen: '1440x900x24']) {
  // execute selenium tests
}

Should work. And you shouldn't need the square brackets either

于 2017-04-19T05:55:06.713 回答