mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-10-01 14:41:19 +00:00
TAS-437 added TestRail annotation
This commit is contained in:
@@ -6,11 +6,14 @@ import org.alfresco.rest.model.RestCommentModel;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { "rest-api", "comments", "sanity" })
|
||||
public class SampleCommentsTest extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
@@ -29,37 +32,33 @@ public class SampleCommentsTest extends RestTest
|
||||
restClient.authenticateUser(userModel);
|
||||
commentsAPI.useRestClient(restClient);
|
||||
|
||||
document = dataContent.usingResource("Shared")
|
||||
.usingUser(userModel)
|
||||
.createContent(DocumentType.TEXT_PLAIN);
|
||||
document = dataContent.usingResource("Shared").usingUser(userModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToAddComment() throws JsonToModelConversionException, Exception
|
||||
@TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY)
|
||||
public void admiShouldAddComment() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
commentsAPI.addComment(document.getNodeRef(), "This is a new comment");
|
||||
commentsAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.CREATED.toString());
|
||||
.assertStatusCodeIs(HttpStatus.CREATED.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToRetrieveComments() throws JsonToModelConversionException
|
||||
@TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY)
|
||||
public void admiShouldRetrieveComments() throws JsonToModelConversionException
|
||||
{
|
||||
commentsAPI.getNodeComments(document.getNodeRef());
|
||||
commentsAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
.assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToUpdateComment() throws JsonToModelConversionException, Exception
|
||||
@TestRail(section={"rest-api", "comments"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldUpdateComment() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
// add initial comment
|
||||
String commentId = commentsAPI.addComment(document.getNodeRef(), "This is a new comment").getId();
|
||||
|
||||
// update comment
|
||||
RestCommentModel commentEntry = commentsAPI.updateComment(document.getNodeRef(),
|
||||
commentId,
|
||||
"This is the updated comment");
|
||||
RestCommentModel commentEntry = commentsAPI.updateComment(document.getNodeRef(), commentId, "This is the updated comment");
|
||||
commentEntry.assertCommentContentIs("This is the updated comment");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user