@@ -1104,7 +1104,7 @@ class WrapperContextSpec extends Specification {
11041104 1 * mockJobManagement. requirePlugin(' nodejs' )
11051105 }
11061106
1107- def ' call sauce on demand with defaults' () {
1107+ def ' call sauce on demand with defaults for older plugin version ' () {
11081108 when :
11091109 context. sauceOnDemand {
11101110 }
@@ -1131,7 +1131,41 @@ class WrapperContextSpec extends Specification {
11311131 }
11321132 }
11331133
1134+ def ' call sauce on demand with defaults' () {
1135+ given :
1136+ mockJobManagement. isMinimumPluginVersionInstalled(' sauce-ondemand' , ' 1.148' ) >> true
1137+
1138+ when :
1139+ context. sauceOnDemand {
1140+ }
1141+
1142+ then :
1143+ with(context. wrapperNodes[0 ]) {
1144+ name() == ' hudson.plugins.sauce__ondemand.SauceOnDemandBuildWrapper'
1145+ children(). size() == 16
1146+ useGeneratedTunnelIdentifier[0 ]. value() == false
1147+ sendUsageData[0 ]. value() == false
1148+ nativeAppPackage[0 ]. value() == ' '
1149+ useChromeForAndroid[0 ]. value() == false
1150+ sauceConnectPath[0 ]. value() == ' '
1151+ enableSauceConnect[0 ]. value() == false
1152+ seleniumHost[0 ]. value() == ' '
1153+ seleniumPort[0 ]. value() == ' '
1154+ webDriverBrowsers[0 ]. value(). empty
1155+ appiumBrowsers[0 ]. value(). empty
1156+ useLatestVersion[0 ]. value() == false
1157+ launchSauceConnectOnSlave[0 ]. value() == false
1158+ options[0 ]. value() == ' '
1159+ credentialId[0 ]. value() == ' '
1160+ verboseLogging[0 ]. value() == false
1161+ condition[0 ]. attribute(' class' ) == ' org.jenkins_ci.plugins.run_condition.core.AlwaysRun'
1162+ }
1163+ }
1164+
11341165 def ' call sauce on demand with all options' () {
1166+ given :
1167+ mockJobManagement. isMinimumPluginVersionInstalled(' sauce-ondemand' , ' 1.148' ) >> true
1168+
11351169 when :
11361170 context. sauceOnDemand {
11371171 useGeneratedTunnelIdentifier()
@@ -1148,13 +1182,14 @@ class WrapperContextSpec extends Specification {
11481182 useLatestVersion()
11491183 launchSauceConnectOnSlave()
11501184 options(' options' )
1185+ credentials(' credentialId' )
11511186 verboseLogging()
11521187 }
11531188
11541189 then :
11551190 with(context. wrapperNodes[0 ]) {
11561191 name() == ' hudson.plugins.sauce__ondemand.SauceOnDemandBuildWrapper'
1157- children(). size() == 15
1192+ children(). size() == 16
11581193 useGeneratedTunnelIdentifier[0 ]. value() == true
11591194 sendUsageData[0 ]. value() == true
11601195 nativeAppPackage[0 ]. value() == ' nativeAppPackage'
@@ -1174,6 +1209,7 @@ class WrapperContextSpec extends Specification {
11741209 useLatestVersion[0 ]. value() == true
11751210 launchSauceConnectOnSlave[0 ]. value() == true
11761211 options[0 ]. value() == ' options'
1212+ credentialId[0 ]. value() == ' credentialId'
11771213 verboseLogging[0 ]. value() == true
11781214 condition[0 ]. attribute(' class' ) == ' org.jenkins_ci.plugins.run_condition.core.AlwaysRun'
11791215 }
0 commit comments