Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
JENKINS-37523 - wrong message displayed for duplicate item name
- Loading branch information
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package core; | ||
|
||
import org.jenkinsci.test.acceptance.junit.AbstractJUnitTest; | ||
import org.jenkinsci.test.acceptance.po.FreeStyleJob; | ||
import org.junit.Test; | ||
import org.openqa.selenium.By; | ||
|
||
public class CreateItemTest extends AbstractJUnitTest { | ||
@Test | ||
public void duplicate_item_name_displays_error() { | ||
// create a job with a known name | ||
jenkins.jobs.create(FreeStyleJob.class, "asdf"); | ||
|
||
// go try to create one with the same name | ||
jenkins.jobs.visit("newJob"); | ||
|
||
fillIn("name", "asdf"); | ||
|
||
blur(find(By.name("name"))); | ||
|
||
// the 'name cannot be empty' message: | ||
assert(!findIfNotVisible(By.id("itemname-required")).isDisplayed()); | ||
// the 'real' message: | ||
assert(findIfNotVisible(By.id("itemname-invalid")).isDisplayed()); | ||
|
||
assert(!findIfNotVisible(By.id("ok-button")).isEnabled()); | ||
|
||
jenkins.jobs.findTypeCaption(FreeStyleJob.class).click(); | ||
|
||
// the 'name cannot be empty' message: | ||
assert(!findIfNotVisible(By.id("itemname-required")).isDisplayed()); | ||
// the 'real' message: | ||
assert(findIfNotVisible(By.id("itemname-invalid")).isDisplayed()); | ||
|
||
assert(!findIfNotVisible(By.id("ok-button")).isEnabled()); | ||
} | ||
} |