Merge branch 'master' of gitlab.alfresco.com:tas/alfresco-tas-restapi-test into add-test-grops

# Conflicts:
#	src/test/java/org/alfresco/rest/workflow/tasks/GetTasksSanityTests.java
This commit is contained in:
Paul Brodner
2016-10-17 22:33:25 +03:00
63 changed files with 410 additions and 102 deletions
@@ -19,7 +19,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
@Test(groups = { TestGroup.REST_API, TestGroup.SANITY, TestGroup.SANITY })
public class AddCommentSanityTests extends RestTest
{
@Autowired
@@ -23,7 +23,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/10/2016.
*/
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
@Test(groups = { TestGroup.REST_API, TestGroup.SANITY, TestGroup.SANITY })
public class AddCommentsSanityTests extends RestTest
{
@Autowired RestCommentsApi commentsAPI;
@@ -20,7 +20,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
@Test(groups = { TestGroup.REST_API, TestGroup.SANITY, TestGroup.SANITY })
public class DeleteCommentsSanityTests extends RestTest
{
@@ -19,7 +19,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
@Test(groups = { TestGroup.REST_API, TestGroup.SANITY, TestGroup.SANITY })
public class GetCommentsSanityTests extends RestTest
{
@Autowired
@@ -48,7 +48,7 @@ public class GetCommentsSanityTests extends RestTest
usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel, UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
}
@TestRail(section={TestGroup.REST_API, TestGroup.COMMENTS}, executionType= ExecutionType.SANITY,
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
description= "Verify Admin user gets comments with Rest API and status code is 200")
public void adminIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception
{
@@ -56,7 +56,7 @@ public class GetCommentsSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section={TestGroup.REST_API, TestGroup.COMMENTS}, executionType= ExecutionType.SANITY,
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
description= "Verify Manager user gets comments created by admin user with Rest API and status code is 200")
public void managerIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception
{
@@ -65,7 +65,7 @@ public class GetCommentsSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section={TestGroup.REST_API, TestGroup.COMMENTS}, executionType= ExecutionType.SANITY,
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
description= "Verify Contributor user gets comments created by admin user with Rest API and status code is 200")
public void contributorIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception
{
@@ -74,7 +74,7 @@ public class GetCommentsSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section={TestGroup.REST_API, TestGroup.COMMENTS}, executionType= ExecutionType.SANITY,
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
description= "Verify Collaborator user gets comments created by admin user with Rest API and status code is 200")
public void collaboratorIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception
{
@@ -83,7 +83,7 @@ public class GetCommentsSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section={TestGroup.REST_API, TestGroup.COMMENTS}, executionType= ExecutionType.SANITY,
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
description= "Verify Consumer user gets comments created by admin user with Rest API and status code is 200")
public void consumerIsAbleToRetrieveComments() throws JsonToModelConversionException, Exception
{
@@ -92,7 +92,7 @@ public class GetCommentsSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section={TestGroup.REST_API, TestGroup.COMMENTS}, executionType= ExecutionType.SANITY,
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
description= "Verify Manager user gets status code 401 if authentication call fails")
@Bug(id="MNT-16904")
public void managerIsNotAbleToRetrieveCommentIfAuthenticationFails() throws JsonToModelConversionException, Exception
@@ -103,7 +103,7 @@ public class GetCommentsSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
}
@TestRail(section={TestGroup.REST_API, TestGroup.COMMENTS}, executionType= ExecutionType.SANITY,
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
description= "Verify Manager user gets comments created by another user and status code is 200")
public void managerIsAbleToRetrieveCommentsCreatedByAnotherUser() throws JsonToModelConversionException, Exception
{
@@ -116,7 +116,7 @@ public class GetCommentsSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section={TestGroup.REST_API, TestGroup.COMMENTS}, executionType= ExecutionType.SANITY,
@TestRail(section={TestGroup.REST_API, TestGroup.SANITY}, executionType= ExecutionType.SANITY,
description= "Verify admin user gets comments created by another user and status code is 200")
public void adminIsAbleToRetrieveCommentsCreatedByAnotherUser() throws JsonToModelConversionException, Exception
{
@@ -21,7 +21,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.SANITY })
@Test(groups = { TestGroup.REST_API, TestGroup.SANITY, TestGroup.SANITY })
public class UpdateCommentsSanityTests extends RestTest
{
@Autowired
@@ -106,26 +106,26 @@ public class UpdateCommentsSanityTests extends RestTest
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
}
@TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify update comment with inexistent nodeId returns status code 404")
@TestRail(section = { TestGroup.REST_API, TestGroup.SANITY }, executionType = ExecutionType.SANITY, description = "Verify update comment with inexistent nodeId returns status code 404")
public void canNotUpdateCommentIfNodeIdIsNotSet() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUserModel);
FolderModel content = FolderModel.getRandomFolderModel();
content.setNodeRef("node ref that does not exist");
commentsAPI.updateComment(content, commentModel, "This is the updated comment.");
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.NOT_FOUND);
}
@TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS }, executionType = ExecutionType.SANITY, description = "Verify if commentId is not set the status code is 404")
@TestRail(section = { TestGroup.REST_API, TestGroup.SANITY }, executionType = ExecutionType.SANITY, description = "Verify if commentId is not set the status code is 404")
public void canNotUpdateCommentIfCommentIdIsNotSet() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUserModel);
RestCommentModel comment = new RestCommentModel();
comment.setId("comment id that does not exist");
commentsAPI.updateComment(document, comment, "This is the updated comment.");
commentsAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.NOT_FOUND);
}
}
}
@@ -17,7 +17,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
public class DeleteFavoritesSanityTests extends RestTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, "favorites", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
public class GetFavoriteSanityTests extends RestTest
{
@Autowired
@@ -53,7 +53,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorite site with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorite site with Rest API and status code is 200")
public void adminIsAbleToRetrieveFavoritesSite() throws JsonToModelConversionException, Exception
{
favoritesAPI.addSiteToFavorites(adminUserModel, siteModel);
@@ -62,7 +62,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorite folder with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorite folder with Rest API and status code is 200")
public void adminIsAbleToRetrieveFavoritesFolder() throws JsonToModelConversionException, Exception
{
favoritesAPI.addFolderToFavorites(adminUserModel, folderModel);
@@ -71,7 +71,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorite file with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorite file with Rest API and status code is 200")
public void adminIsAbleToRetrieveFavoritesFile() throws JsonToModelConversionException, Exception
{
favoritesAPI.addFileToFavorites(adminUserModel, fileModel);
@@ -80,7 +80,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets favorite site with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets favorite site with Rest API and status code is 200")
public void managerIsAbleToRetrieveFavorite() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
@@ -90,7 +90,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user gets favorite site with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user gets favorite site with Rest API and status code is 200")
public void collaboratorIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
@@ -100,7 +100,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Contributor user gets favorite site with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Contributor user gets favorite site with Rest API and status code is 200")
public void contributorIsAbleToRetrieveFavorite() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
@@ -110,7 +110,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Consumer user gets favorite site with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Consumer user gets favorite site with Rest API and status code is 200")
public void consumerIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
@@ -120,7 +120,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify user doesn't get favorite site of another user with Rest API and status code is 404")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user doesn't get favorite site of another user with Rest API and status code is 404")
public void userIsNotAbleToRetrieveFavoriteSiteOfAnotherUser() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
@@ -129,7 +129,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify user doesn't get favorite site of admin user with Rest API and status code is 404")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user doesn't get favorite site of admin user with Rest API and status code is 404")
public void userIsNotAbleToRetrieveFavoritesOfAdminUser() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
@@ -138,7 +138,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify admin user doesn't get favorite site of another user with Rest API and status code is 404")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify admin user doesn't get favorite site of another user with Rest API and status code is 404")
public void adminIsNotAbleToRetrieveFavoritesOfAnotherUser() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUserModel);
@@ -147,7 +147,7 @@ public class GetFavoriteSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
@Bug(id="MNT-16904")
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception
{
@@ -20,7 +20,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, "favorites", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
public class GetFavoritesSanityTests extends RestTest
{
@@ -61,7 +61,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorites sites with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorites sites with Rest API and status code is 200")
public void adminIsAbleToRetrieveFavoritesSites() throws JsonToModelConversionException, Exception
{
favoritesAPI.addSiteToFavorites(adminUserModel, firstSiteModel);
@@ -71,7 +71,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorites folders with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorites folders with Rest API and status code is 200")
public void adminIsAbleToRetrieveFavoritesFolders() throws JsonToModelConversionException, Exception
{
favoritesAPI.addFolderToFavorites(adminUserModel, firstFolderModel);
@@ -81,7 +81,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorites files with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorites files with Rest API and status code is 200")
public void adminIsAbleToRetrieveFavoritesFiles() throws JsonToModelConversionException, Exception
{
favoritesAPI.addFileToFavorites(adminUserModel, firstFileModel);
@@ -91,7 +91,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets favorites with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets favorites with Rest API and status code is 200")
public void managerIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
@@ -102,7 +102,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user gets favorites with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user gets favorites with Rest API and status code is 200")
public void collaboratorIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
@@ -113,7 +113,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Contributor user gets favorites with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Contributor user gets favorites with Rest API and status code is 200")
public void contributorIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
@@ -124,7 +124,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Consumer user gets favorites with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Consumer user gets favorites with Rest API and status code is 200")
public void consumerIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
@@ -135,7 +135,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify user doesn't have permission to get favorites of another user with Rest API and status code is 404")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user doesn't have permission to get favorites of another user with Rest API and status code is 404")
public void userIsNotAbleToRetrieveFavoritesOfAnotherUser() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
@@ -144,7 +144,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify user doesn't have permission to get favorites of admin user with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user doesn't have permission to get favorites of admin user with Rest API and status code is 200")
public void userIsNotAbleToRetrieveFavoritesOfAdminUser() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
@@ -153,7 +153,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify admin user doesn't have permission to get favorites of another user with Rest API and status code is 200")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify admin user doesn't have permission to get favorites of another user with Rest API and status code is 200")
public void adminIsNotAbleToRetrieveFavoritesOfAnotherUser() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUserModel);
@@ -162,7 +162,7 @@ public class GetFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
@Bug(id="MNT-16904")
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception
{
@@ -18,7 +18,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, "favorites", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
public class PostFavoritesSanityTests extends RestTest
{
@Autowired
@@ -49,7 +49,7 @@ public class PostFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Admin user add site to favorites with Rest API and status code is 201")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user add site to favorites with Rest API and status code is 201")
public void adminIsAbleToAddToFavorites() throws Exception
{
favoritesAPI.addSiteToFavorites(adminUserModel, siteModel);
@@ -57,7 +57,7 @@ public class PostFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Manager user add site to favorites with Rest API and status code is 201")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Manager user add site to favorites with Rest API and status code is 201")
public void managerIsAbleToAddToFavorites() throws Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
@@ -66,7 +66,7 @@ public class PostFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user add site to favorites with Rest API and status code is 201")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user add site to favorites with Rest API and status code is 201")
public void collaboratorIsAbleToAddToFavorites() throws Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
@@ -75,7 +75,7 @@ public class PostFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Contributor user add site to favorites with Rest API and status code is 201")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Contributor user add site to favorites with Rest API and status code is 201")
public void contributorIsAbleToAddToFavorites() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
@@ -84,7 +84,7 @@ public class PostFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Consumer user add site to favorites with Rest API and status code is 201")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Consumer user add site to favorites with Rest API and status code is 201")
public void consumerIsAbleToAddToFavorites() throws Exception
{
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
@@ -93,7 +93,7 @@ public class PostFavoritesSanityTests extends RestTest
}
@TestRail(section = { TestGroup.REST_API,
"favorites" }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets status code 401 if authentication call fails")
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets status code 401 if authentication call fails")
@Bug(id="MNT-16904")
public void managerIsNotAbleToAddCommentIfAuthenticationFails() throws Exception
{
@@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.SANITY })
public class RestGetNetworkForPersonSanityTests extends RestTest
{
@@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.SANITY })
public class RestGetNetworksForPersonSanityTests extends RestTest
{
@Autowired
@@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class AddFavoriteSiteSanityTests extends RestTest
{
@Autowired
@@ -19,7 +19,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class AddSiteMembershipRequestSanityTests extends RestTest
{
@Autowired
@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
/**
* @author Cristina Axinte
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class DeleteFavoriteSiteSanityTests extends RestTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class DeleteSiteMemberSanityTests extends RestTest
{
@Autowired
@@ -22,7 +22,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = {TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = {TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class DeleteSiteMembershipRequestSanityTests extends RestTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.testng.annotations.Test;
* @author Cristina Axinte
*
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class GetFavoriteSiteSanityTests extends RestTest
{
@Autowired
@@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class GetFavoriteSitesSanityTests extends RestTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
* Tests for getActivities (/people/{personId}/activities) RestAPI call
*
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, "activities", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, "activities", TestGroup.SANITY })
public class GetPeopleActivitiesSanityTests extends RestTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
* @author Cristina Axinte
*
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, "preferences", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, "preferences", TestGroup.SANITY })
public class GetPeoplePreferenceSanityTests extends RestTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.testng.annotations.Test;
* @author Cristina Axinte
*
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, "preferences", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, "preferences", TestGroup.SANITY })
public class GetPeoplePreferencesSanityTests extends RestTest
{
@Autowired
@@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class GetPeopleSanityTests extends RestTest
{
@Autowired
@@ -19,7 +19,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class GetSiteMembershipRequestSanityTests extends RestTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
*
* @author Cristina Axinte
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class GetSiteMembershipRequestsSanityTests extends RestTest
{
@Autowired
@@ -19,7 +19,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class GetSiteMembershipSanityTests extends RestTest
{
@Autowired
@@ -17,7 +17,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class GetSitesMembershipInformationSanityTests extends RestTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.springframework.social.alfresco.api.entities.Site.Visibility;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.SANITY })
public class UpdateSiteMembershipRequestSanityTests extends RestTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY })
public class AddRatingSanityTests extends RestTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY })
public class DeleteRatingSanityTests extends RestTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.RATINGS, TestGroup.SANITY })
public class GetRatingSanityTests extends RestTest
{
@Autowired
@@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
public class AddSiteMemberSanityTests extends RestTest
{
@Autowired
@@ -19,7 +19,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
public class GetSiteContainerSanityTests extends RestTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
public class GetSiteContainersSanityTests extends RestTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
public class GetSiteMemberSanityTests extends RestTest
{
@@ -22,7 +22,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
public class GetSiteMembersSanityTests extends RestTest
{
@Autowired
@@ -23,7 +23,7 @@ import org.testng.annotations.Test;
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
public class GetSiteSanityTests extends RestTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
public class GetSitesSanityTests extends RestTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = {TestGroup.REST_API, TestGroup.SITES, TestGroup.COMMENTS})
@Test(groups = {TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY})
public class RemoveSiteMemberSanityTests extends RestTest
{
@@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
public class UpdateSiteMemberSanityTests extends RestTest
{
@Autowired
@@ -23,7 +23,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/3/2016.
*/
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
public class AddTagSanityTests extends RestTest
{
@Autowired
@@ -23,7 +23,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/7/2016.
*/
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
public class AddTagsSanityTests extends RestTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/4/2016.
*/
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
public class DeleteTagSanityTests extends RestTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
public class GetNodeTagsSanityTests extends RestTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
public class GetTagSanityTests extends RestTest
{
@@ -17,7 +17,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
public class GetTagsSanityTests extends RestTest
{
@Autowired
@@ -24,7 +24,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/4/2016.
*/
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
public class UpdateTagSanityTests extends RestTest
{
@Autowired RestTagsApi tagsAPI;
@@ -0,0 +1,64 @@
package org.alfresco.rest.workflow.deployments;
import org.alfresco.rest.RestWorkflowTest;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.rest.model.RestDeploymentModel;
import org.alfresco.rest.requests.RestDeploymentsApi;
import org.alfresco.utility.model.TestGroup;
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;
/**
* Tests for REST API call DELETE "/deployments/{deploymentId}"
* Class has priority 100 in order to be executed last in the list of tests classes
*
* @author Cristina Axinte
*
*/
@Test(groups = { TestGroup.REST_API, TestGroup.DEPLOYMENTS, TestGroup.SANITY, TestGroup.WORKFLOW }, priority = 100)
public class DeleteDeploymentSanityTests extends RestWorkflowTest
{
@Autowired
private RestDeploymentsApi deploymentsApi;
private UserModel adminUser;
private RestDeploymentModel deployment;
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws Exception
{
adminUser = dataUser.getAdminUser();
deploymentsApi.useRestClient(restClient);
}
@Test(groups ={"extension-points"})
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
executionType = ExecutionType.SANITY, description = "Verify admin user deletes a specific deployment using REST API and status code is successful (204)")
public void adminDeletesDeploymentWithSuccess() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUser);
// The deployment with name "customWorkflowExtentionForRest.bpmn" is created by Workflow Extention Point
deployment = deploymentsApi.getDeployments().getDeploymentWithName("customWorkflowExtentionForRest.bpmn");
deploymentsApi.deleteDeployment(deployment);
deploymentsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NO_CONTENT);
}
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
executionType = ExecutionType.SANITY, description = "Verify admin user cannot delete an inexistent deployment using REST API and status code is successful (204)")
public void adminCannotDeleteInexistentDeployment() throws JsonToModelConversionException, Exception
{
deployment = new RestDeploymentModel();
deployment.setId(String.valueOf(1000));
restClient.authenticateUser(adminUser);
deploymentsApi.deleteDeployment(deployment);
deploymentsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NOT_FOUND);
}
}
@@ -0,0 +1,60 @@
package org.alfresco.rest.workflow.deployments;
import org.alfresco.rest.RestWorkflowTest;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.rest.model.RestDeploymentModel;
import org.alfresco.rest.requests.RestDeploymentsApi;
import org.alfresco.utility.model.TestGroup;
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;
/**
* Tests for REST API call GET "/deployments/{deploymentId}"
*
* @author Cristina Axinte
*
*/
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.SANITY })
public class GetDeploymentSanityTests extends RestWorkflowTest
{
@Autowired
private RestDeploymentsApi deploymentsApi;
private UserModel adminUser;
private UserModel anotherUser;
private RestDeploymentModel deployment;
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws Exception
{
adminUser = dataUser.getAdminUser();
anotherUser = dataUser.createRandomTestUser();
deploymentsApi.useRestClient(restClient);
restClient.authenticateUser(adminUser);
deployment = deploymentsApi.getDeployments().getOneRandomEntry();
}
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
executionType = ExecutionType.SANITY, description = "Verify admin user gets a non-network deployment using REST API and status code is OK (200)")
public void adminGetsNonNetworkDeploymentWithSuccess() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUser);
deploymentsApi.getDeployment(deployment);
deploymentsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS },
executionType = ExecutionType.SANITY, description = "Verify non admin user is forbidden to get a non-network deployment using REST API (403)")
public void nonAdminIsForbiddenToGetNonNetworkDeployment() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(anotherUser);
deploymentsApi.getDeployment(deployment);
deploymentsApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN);
}
}
@@ -17,7 +17,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/4/2016.
*/
@Test(groups = { TestGroup.REST_API, "deployments", TestGroup.COMMENTS, TestGroup.NETWORKS })
@Test(groups = { TestGroup.REST_API, TestGroup.DEPLOYMENTS, TestGroup.SANITY, TestGroup.NETWORKS })
public class GetDeploymentsSanityTests extends RestWorkflowTest
{
@Autowired
@@ -39,7 +39,7 @@ public class GetDeploymentsSanityTests extends RestWorkflowTest
}
@TestRail(section = { TestGroup.REST_API,
"deployments" }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets non-network deployments using REST API and status code is OK (200)")
TestGroup.DEPLOYMENTS }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets non-network deployments using REST API and status code is OK (200)")
public void getNonNetworkDeploymentsWithAdmin() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUserModel);
@@ -48,7 +48,7 @@ public class GetDeploymentsSanityTests extends RestWorkflowTest
}
@TestRail(section = { TestGroup.REST_API,
"deployments" }, executionType = ExecutionType.SANITY, description = "Verify Tenant Admin user gets network deployments using REST API and status code is OK (200)")
TestGroup.DEPLOYMENTS }, executionType = ExecutionType.SANITY, description = "Verify Tenant Admin user gets network deployments using REST API and status code is OK (200)")
public void getNetworkDeploymentsWithAdmin() throws JsonToModelConversionException, Exception
{
tenantApi.useRestClient(restClient);
@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/13/2016.
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PROCESS_DEFINITION, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY })
public class GetProcessDefinitionImageSanityTests extends RestWorkflowTest {
@Autowired
private DataUser dataUser;
@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/13/2016.
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PROCESS_DEFINITION, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY })
public class GetProcessDefinitionSanityTests extends RestWorkflowTest
{
@Autowired
@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/13/2016.
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PROCESS_DEFINITION, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY })
public class GetProcessDefinitionsSanityTests extends RestWorkflowTest
{
@Autowired
@@ -0,0 +1,80 @@
package org.alfresco.rest.workflow.processes;
import org.alfresco.dataprep.CMISUtil.DocumentType;
import org.alfresco.rest.RestWorkflowTest;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.rest.model.RestProcessItemModel;
import org.alfresco.rest.model.RestProcessModel;
import org.alfresco.rest.requests.RestProcessesApi;
import org.alfresco.utility.data.DataUser;
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;
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;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PROCESSES, TestGroup.SANITY})
public class AddProcessItemSanityTests extends RestWorkflowTest
{
@Autowired
private DataUser dataUser;
@Autowired
private RestProcessesApi processesApi;
private FileModel document, document2, document3;
private SiteModel siteModel;
private UserModel userWhoStartsTask, assignee;
private RestProcessModel processModel;
private UserModel adminUser;
private RestProcessItemModel processItem;
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws Exception
{
adminUser = dataUser.getAdminUser();
userWhoStartsTask = dataUser.createRandomTestUser();
assignee = dataUser.createRandomTestUser();
siteModel = dataSite.usingUser(adminUser).createPublicRandomSite();
document = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
dataWorkflow.usingUser(userWhoStartsTask).usingSite(siteModel).usingResource(document).createNewTaskAndAssignTo(assignee);
processesApi.useRestClient(restClient);
}
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
description = "Create non-existing process item")
public void addProcessItem() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUser);
document2 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
processModel = processesApi.getProcesses().getOneRandomEntry();
processItem = processesApi.addProcessItem(processModel, document2);
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
processesApi.getProcessesItems(processModel).assertProcessItemExists(processItem);
}
@Bug(id= "MNT-16966")
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
description = "Add process item that already exists")
public void addProcessItemThatAlreadyExists() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUser);
document3 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
processModel = processesApi.getProcesses().getOneRandomEntry();
processItem = processesApi.addProcessItem(processModel, document3);
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
processesApi.getProcessesItems(processModel).assertProcessItemExists(processItem);
processItem = processesApi.addProcessItem(processModel, document3);
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.BAD_REQUEST);
}
}
@@ -23,7 +23,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.SANITY })
public class AddProcessVariableSanityTests extends RestWorkflowTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/12/2016.
*/
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.SANITY })
public class DeleteProcessSanityTests extends RestWorkflowTest
{
@Autowired
@@ -22,7 +22,7 @@ import org.testng.annotations.Test;
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.SANITY })
public class GetProcessItemsSanityTests extends RestWorkflowTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
*
* @author Cristina Axinte
*/
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, "processes", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
public class GetProcessTasksSanityTests extends RestWorkflowTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.testng.annotations.Test;
/**
* Created by Claudia Agache on 10/11/2016.
*/
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.SANITY })
public class GetProcessesSanityTests extends RestWorkflowTest
{
@Autowired
@@ -20,7 +20,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.SANITY })
public class GetProcessesVariablesSanityTests extends RestWorkflowTest
{
@Autowired
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, "processes", TestGroup.SANITY })
public class RemoveProcessVariableSanityTests extends RestWorkflowTest
{
@Autowired
@@ -0,0 +1,87 @@
package org.alfresco.rest.workflow.processes;
import org.alfresco.dataprep.CMISUtil.DocumentType;
import org.alfresco.rest.RestWorkflowTest;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.rest.model.RestProcessModel;
import org.alfresco.rest.model.RestProcessVariableModel;
import org.alfresco.rest.requests.RestProcessesApi;
import org.alfresco.utility.data.DataUser;
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.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;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PROCESSES, TestGroup.SANITY })
public class UpdateProcessVariableSanityTests extends RestWorkflowTest
{
@Autowired
private DataUser dataUser;
@Autowired
private RestProcessesApi processesApi;
private FileModel document;
private SiteModel siteModel;
private UserModel userWhoStartsTask, assignee;
private RestProcessModel processModel;
private UserModel adminUser;
@BeforeClass(alwaysRun = true)
public void dataPreparation() throws Exception
{
adminUser = dataUser.getAdminUser();
userWhoStartsTask = dataUser.createRandomTestUser();
assignee = dataUser.createRandomTestUser();
siteModel = dataSite.usingUser(userWhoStartsTask).createPublicRandomSite();
document = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
dataWorkflow.usingUser(userWhoStartsTask).usingSite(siteModel).usingResource(document).createNewTaskAndAssignTo(assignee);
processesApi.useRestClient(restClient);
}
@TestRail(section = {"rest-api", "processes" }, executionType = ExecutionType.SANITY,
description = "Create non-existing variable using put call")
public void addProcessVariable() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUser);
RestProcessVariableModel variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
processModel = processesApi.getProcesses().getOneEntry();
processesApi.updateProcessVariable(processModel, variableModel);
processesApi.getProcessesVariables(processModel).assertProcessVariableExists(variableModel);
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section = {"rest-api", "processes" }, executionType = ExecutionType.SANITY,
description = "Update existing variable using put call")
public void updateProcessVariable() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUser);
RestProcessVariableModel variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
processModel = processesApi.getProcesses().getOneEntry();
processesApi.addProcessVariable(processModel, variableModel);
variableModel.setValue("newValue");
processesApi.updateProcessVariable(processModel, variableModel).assertProcessVariableHasValue("newValue");
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section = {"rest-api", "processes" }, executionType = ExecutionType.SANITY,
description = "Try to add process variable using an invalid processId")
public void addProcessVariableUsingInvalidProcessId() throws JsonToModelConversionException, Exception
{
restClient.authenticateUser(adminUser);
RestProcessVariableModel variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
processModel = processesApi.getProcesses().getOneEntry();
processModel.onModel().setId("abc");
processesApi.updateProcessVariable(processModel, variableModel);
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NOT_FOUND);
}
}
@@ -17,7 +17,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
public class GetTaskSanityTests extends RestWorkflowTest
{
@Autowired
@@ -9,6 +9,7 @@ import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TaskModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,7 +17,7 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.COMMENTS })
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
public class GetTasksSanityTests extends RestWorkflowTest
{
@Autowired
@@ -57,6 +58,22 @@ public class GetTasksSanityTests extends RestWorkflowTest
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify candidate user that claims the task gets its existing tasks with Rest API and response is successfull (200)")
@Bug(id = "MNT-16967")
public void candidateUserGetsItsTasks() throws Exception
{
UserModel userModel1 = dataUser.createRandomTestUser();
UserModel userModel2 = dataUser.createRandomTestUser();
GroupModel group = dataGroup.createRandomGroup();
dataGroup.addListOfUsersToGroup(group, userModel1, userModel2);
dataWorkflow.usingUser(userModel).usingSite(siteModel).usingResource(fileModel).createPooledReviewTaskAndAssignTo(group);
restClient.authenticateUser(userModel1);
tasksApi.getTasks().assertEntriesListIsNotEmpty();
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify candidate user that claims the task gets its existing tasks with Rest API and response is successfull (200)")
public void candidateUserThatClaimsTaskGetsItsTasks() throws Exception
{