1414import java .util .logging .Level ;
1515import java .util .logging .Logger ;
1616
17+ import com .gargoylesoftware .htmlunit .ElementNotFoundException ;
1718import com .gargoylesoftware .htmlunit .html .DomElement ;
1819import com .gargoylesoftware .htmlunit .html .DomNodeList ;
1920import com .gargoylesoftware .htmlunit .html .HtmlButton ;
@@ -257,11 +258,11 @@ public void defaultWorkspaceVolume() throws Exception {
257258 JenkinsRule .WebClient wc = j .createWebClient ();
258259 HtmlPage p = wc .goTo ("configureClouds/" );
259260 HtmlForm f = p .getFormByName ("config" );
260- HtmlButton buttonExtends = HtmlFormUtil . getButtonByCaption (f , "Pod Templates... " );
261+ HtmlButton buttonExtends = getButton (f , "Pod Templates" );
261262 buttonExtends .click ();
262- HtmlButton buttonAdd = HtmlFormUtil . getButtonByCaption (f , "Add Pod Template" );
263+ HtmlButton buttonAdd = getButton (f , "Add Pod Template" );
263264 buttonAdd .click ();
264- HtmlButton buttonDetails = HtmlFormUtil . getButtonByCaption (f , "Pod Template details... " );
265+ HtmlButton buttonDetails = getButton (f , "Pod Template details" );
265266 buttonDetails .click ();
266267 DomElement templates = p .getElementByName ("templates" );
267268 HtmlInput templateName = getInputByName (templates , "_.name" );
@@ -273,6 +274,18 @@ public void defaultWorkspaceVolume() throws Exception {
273274 assertEquals (WorkspaceVolume .getDefault (), podTemplate .getWorkspaceVolume ());
274275 }
275276
277+ // TODO 2.385+ delete
278+ private HtmlButton getButton (HtmlForm f , String buttonText ) {
279+ HtmlButton button ;
280+ try {
281+ button = HtmlFormUtil .getButtonByCaption (f , buttonText );
282+ } catch (ElementNotFoundException e ) {
283+ // before https://github.com/jenkinsci/jenkins/pull/7173 the 3 dots where added by core
284+ button = HtmlFormUtil .getButtonByCaption (f , buttonText + "..." );
285+ }
286+ return button ;
287+ }
288+
276289 @ Test
277290 public void minRetentionTimeout () {
278291 KubernetesCloud cloud = new KubernetesCloud ("kubernetes" );
0 commit comments