Skip to content

Commit

Permalink
[JENKINS-50023] Fix TopLevelItem#renameTo after JENKINS-22936
Browse files Browse the repository at this point in the history
  • Loading branch information
raul-arabaolaza committed Mar 9, 2018
1 parent 2a6b4ce commit f18d77a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/org/jenkinsci/test/acceptance/po/TopLevelItem.java
Expand Up @@ -43,12 +43,12 @@ public TopLevelItem(PageObject context, URL url, String name) {
*/
@CheckReturnValue
public <T extends TopLevelItem> T renameTo(final String newName) {
configure();
open();
String oldName = name;
control("/name").set(newName);
save();
waitFor(by.button("Yes")).click();

control(by.href("/job/" + oldName + "/confirm-rename")).click();
WebElement renameButton = waitFor(by.button("Rename"));
control(by.name("newName")).set(newName);
renameButton.click();
try {
return (T) newInstance(getClass(),
injector, new URL(url.toExternalForm().replace(oldName, newName)), newName);
Expand Down

0 comments on commit f18d77a

Please sign in to comment.