2017-04-18 159 views
1

在詹金斯2.0管道中的xfvb包裹裏面的屏幕分辨率,我使用類似的代碼坐落在詹金斯管道

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

正如預期的那樣,這xvfb的會話使用默認的屏幕分辨率(1024x768x8?) 。我想重寫它。

根據https://github.com/jenkinsci/xvfb-plugin的文檔,Xvfb插件有一個控制分辨率的屏幕成員。這樣做的語法是什麼?我試過

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

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

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

嘗試:'wrap([$ class:'Xvfb',screen:'1440x900x24']){..}' –

+1

@tim_yates:就這樣做了。寫下來,我會upvote你的答案! – mcating

+0

完成:-)很高興它的工作! –

回答

3

我相信配置進入同一個地圖,所以

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

應該工作。你不應該需要方括號