add constant group name

This commit is contained in:
Paul Brodner
2016-10-17 22:14:07 +03:00
parent 871b8299f1
commit 105d737959
60 changed files with 617 additions and 566 deletions
@@ -9,6 +9,7 @@ import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType;
@@ -18,7 +19,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { "rest-api", "comments", "sanity" })
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
public class AddCommentSanityTests extends RestTest
{
@Autowired
@@ -43,16 +44,16 @@ public class AddCommentSanityTests extends RestTest
usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel, UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
}
@TestRail(section = { "rest-api",
"comments" }, executionType = ExecutionType.SANITY, description = "Verify admin user adds comments with Rest API and status code is 201")
@TestRail(section = { TestGroup.REST_API,
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify admin user adds comments with Rest API and status code is 201")
public void adminIsAbleToAddComment() throws JsonToModelConversionException, Exception
{
commentsAPI.addComment(document, "This is a new comment added by " + adminUserModel.getUsername());
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
}
@TestRail(section = { "rest-api",
"comments" }, executionType = ExecutionType.SANITY, description = "Verify Manager user adds comments with Rest API and status code is 201")
@TestRail(section = { TestGroup.REST_API,
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify Manager user adds comments with Rest API and status code is 201")
public void managerIsAbleToAddComment() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
@@ -60,8 +61,8 @@ public class AddCommentSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
}
@TestRail(section = { "rest-api",
"comments" }, executionType = ExecutionType.SANITY, description = "Verify Contributor user adds comments with Rest API and status code is 201")
@TestRail(section = { TestGroup.REST_API,
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify Contributor user adds comments with Rest API and status code is 201")
public void contributorIsAbleToAddComment() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
@@ -69,8 +70,8 @@ public class AddCommentSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
}
@TestRail(section = { "rest-api",
"comments" }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user adds comments with Rest API and status code is 201")
@TestRail(section = { TestGroup.REST_API,
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user adds comments with Rest API and status code is 201")
public void collaboratorIsAbleToAddComment() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
@@ -78,8 +79,8 @@ public class AddCommentSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
}
@TestRail(section = { "rest-api",
"comments" }, executionType = ExecutionType.SANITY, description = "Verify Consumer user adds comments with Rest API and status code is 201")
@TestRail(section = { TestGroup.REST_API,
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify Consumer user adds comments with Rest API and status code is 201")
public void consumerIsAbleToAddComment() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
@@ -87,8 +88,8 @@ public class AddCommentSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN);
}
@TestRail(section = { "rest-api",
"comments" }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user gets status code 401 on post comments call")
@TestRail(section = { TestGroup.REST_API,
TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify unauthenticated user gets status code 401 on post comments call")
@Bug(id="MNT-16904")
public void unauthenticatedUserIsNotAbleToAddComment() throws JsonToModelConversionException, Exception
{