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");
|
||||
}
|
||||
|
||||
|
@@ -3,12 +3,15 @@ package org.alfresco.rest;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.exception.DataPreparationException;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
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", "people", "sanity" })
|
||||
public class SamplePeopleTest extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
@@ -29,21 +32,21 @@ public class SamplePeopleTest extends RestTest
|
||||
peopleAPI.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToRetrievePerson() throws Exception
|
||||
@TestRail(section={"rest-api", "people"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldRetrievePerson() throws Exception
|
||||
{
|
||||
peopleAPI.getPerson(userModel.getUsername())
|
||||
.assertResponseIsNotEmpty();
|
||||
|
||||
.assertResponseIsNotEmpty();
|
||||
|
||||
peopleAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
.assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToRetrieveItself() throws Exception
|
||||
@TestRail(section={"rest-api", "people"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldRetrieveItself() throws Exception
|
||||
{
|
||||
peopleAPI.getPerson(adminUser.getUsername())
|
||||
.assertPersonHasName(adminUser.getUsername());
|
||||
.assertPersonHasName(adminUser.getUsername());
|
||||
}
|
||||
|
||||
}
|
@@ -7,12 +7,15 @@ import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.exception.DataPreparationException;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
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.springframework.social.alfresco.api.entities.Role;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { "rest-api", "people", "sanity" })
|
||||
public class SampleSitesTest extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
@@ -36,68 +39,69 @@ public class SampleSitesTest extends RestTest
|
||||
siteAPI.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminCanGetSiteDetails() throws JsonToModelConversionException, Exception
|
||||
@TestRail(section={"rest-api", "sites"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldGetSiteDetails() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSite(siteModel.getId()).assertResponseIsNotEmpty();
|
||||
siteAPI.getSite(siteModel.getId())
|
||||
.assertResponseIsNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminCanAccessSiteDetails() throws JsonToModelConversionException, Exception
|
||||
@TestRail(section={"rest-api", "sites"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldGetSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSite(siteModel.getId());
|
||||
siteAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
.assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminCanAccessSites() throws JsonToModelConversionException, Exception
|
||||
@TestRail(section={"rest-api", "sites"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldAccessSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSites()
|
||||
.assertThatResponseIsNotEmpty();
|
||||
.assertThatResponseIsNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToRetrieveSites() throws JsonToModelConversionException, Exception
|
||||
@TestRail(section={"rest-api", "sites"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldRetrieveSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSites();
|
||||
siteAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
.assertStatusCodeIs(HttpStatus.OK.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToAccessResponsePagination() throws JsonToModelConversionException, Exception
|
||||
@TestRail(section={"rest-api", "sites"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldAccessResponsePagination() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSites().assertResponseHasPagination();
|
||||
siteAPI.getSites()
|
||||
.assertResponseHasPagination();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToAddNewSiteMember() throws JsonToModelConversionException, DataPreparationException, Exception
|
||||
@TestRail(section={"rest-api", "sites"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldAddNewSiteMember() throws JsonToModelConversionException, DataPreparationException, Exception
|
||||
{
|
||||
UserModel newMember = dataUser.createRandomTestUser();
|
||||
SiteMember siteMember = new SiteMember(Role.SiteCollaborator.toString(),
|
||||
newMember.getUsername());
|
||||
|
||||
SiteMember siteMember = new SiteMember(Role.SiteCollaborator.toString(), newMember.getUsername());
|
||||
|
||||
siteAPI.addPerson(siteModel.getId(), siteMember);
|
||||
siteAPI.usingRestWrapper()
|
||||
.assertStatusCodeIs(HttpStatus.CREATED.toString());
|
||||
.assertStatusCodeIs(HttpStatus.CREATED.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToGetSiteFromSitesList() throws JsonToModelConversionException, Exception
|
||||
@TestRail(section={"rest-api", "sites"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldGetSiteFromSitesList() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getAllSites()
|
||||
.assertThatResponseHasSite(siteModel.getId());
|
||||
.assertThatResponseHasSite(siteModel.getId());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void adminIsAbleToAccessSiteDetails() throws JsonToModelConversionException, Exception
|
||||
@TestRail(section={"rest-api", "sites"}, executionType= ExecutionType.SANITY)
|
||||
public void adminShouldAccessSiteDetails1() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
siteAPI.getSite(siteModel.getId())
|
||||
.assertResponseIsNotEmpty()
|
||||
.assertSiteHasDescription(siteModel.getDescription())
|
||||
.assertSiteHasTitle(siteModel.getTitle())
|
||||
.assertSiteHasVisibility(siteModel.getVisibility());
|
||||
.assertResponseIsNotEmpty()
|
||||
.assertSiteHasDescription(siteModel.getDescription())
|
||||
.assertSiteHasTitle(siteModel.getTitle())
|
||||
.assertSiteHasVisibility(siteModel.getVisibility());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user