This commit is contained in:
Cristina Jalba
2016-09-28 13:43:46 +03:00
parent 4e133b2a92
commit d5ca004407

View File

@@ -46,7 +46,8 @@ public class UpdateCommentsSanityTest extends RestTest
document = dataContent.usingSite(siteModel).usingUser(adminUserModel).createContent(DocumentType.TEXT_PLAIN);
commentModel = commentsAPI.addComment(document.getNodeRef(), "This is a new comment");
usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel, Arrays.asList(UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor));
usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel,
Arrays.asList(UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor));
}
@TestRail(section = { "rest-api",
@@ -57,8 +58,8 @@ public class UpdateCommentsSanityTest extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString());
}
@TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY,
description= "Verify Manager user updates comments created by admin user with Rest API and status code is 200")
@TestRail(section = { "rest-api",
"comments" }, executionType = ExecutionType.SANITY, description = "Verify Manager user updates comments created by admin user with Rest API and status code is 200")
public void managerIsAbleToUpdateComment() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.get(UserRole.SiteManager));
@@ -66,4 +67,13 @@ public class UpdateCommentsSanityTest extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK.toString());
}
@TestRail(section = { "rest-api",
"comments" }, executionType = ExecutionType.SANITY, description = "Verify Contributor user updates comments created by admin user with Rest API and status code is 200")
public void contributorIsAbleToUpdateComment() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.get(UserRole.SiteContributor));
commentsAPI.updateComment(document.getNodeRef(), commentModel.getId(), "This is the updated comment with Contributor user");
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN.toString());
}
}