Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #310 from zanata/fix-groupid-length-test
Browse files Browse the repository at this point in the history
Fix version group ID test
  • Loading branch information
carlosmunoz committed Dec 2, 2013
2 parents df256fe + bc758c7 commit 0689fe9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
Expand Up @@ -51,8 +51,8 @@ public WebElement getInputGroupName() {
return groupNameField;
}

public WebElement getInputGroupId() {
return groupSlugField;
public String getGroupIdValue() {
return groupSlugField.getAttribute("value");
}

public WebElement getInputGroupDescription() {
Expand Down
Expand Up @@ -25,7 +25,6 @@
import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.zanata.feature.BasicAcceptanceTest;
Expand Down Expand Up @@ -100,28 +99,20 @@ public void requiredFields() {
}

@Test
@Ignore("rhbz1034551")
public void groupIDFieldSize() {
String errorMsg = "value must be shorter than or equal to 40 characters";
String groupID = "abcdefghijklmnopqrstuvwxyzabcdefghijklmno";
String groupID = "abcdefghijklmnopqrstuvwxyzabcdefghijklmn";
String groupIDExtra = "xyz";
String groupName = "verifyIDFieldSizeName";

CreateVersionGroupPage groupPage =
dashboardPage.goToGroups().createNewGroup();
groupPage.inputGroupId(groupID).inputGroupName(groupName)
.saveGroupFailure();
assertThat("Invalid length error is shown",
groupPage.getFieldValidationErrors(),
Matchers.contains(errorMsg));
CreateVersionGroupPage groupPage = dashboardPage
.goToGroups()
.createNewGroup()
.inputGroupId(groupID + groupIDExtra)
.inputGroupName(groupName);

groupPage.clearFields();
groupID = groupID.substring(0, 40);
assertThat("GroupID is now 40 characters long", groupID.length(),
Matchers.equalTo(40));
groupPage.inputGroupId(groupID).inputGroupName(groupName);
VersionGroupsPage versionGroupsPage = groupPage.saveGroup();
assertThat("A group ID of 40 chars is valid",
versionGroupsPage.getGroupNames(), Matchers.hasItem(groupName));
assertThat("User cannot enter more than 40 characters",
groupPage.getGroupIdValue(),
Matchers.equalTo(groupID));
}

@Test
Expand Down

0 comments on commit 0689fe9

Please sign in to comment.