mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
test: Moved @Test from class level to method level
This commit is contained in:
@@ -23,12 +23,8 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public class AddFavoritesCoreTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
DataUser dataUser;
|
||||
|
||||
private UserModel adminUserModel;
|
||||
private SiteModel siteModel;
|
||||
private ListUserWithRoles usersWithRoles;
|
||||
@@ -38,7 +34,6 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
FolderModel folder;
|
||||
|
||||
private RestCommentModel comment;
|
||||
|
||||
private RestTagModel returnedModel;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
@@ -56,6 +51,7 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Check that if target guid does not describe a site, file, or folder status code is 400")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void addFavoriteUsingInvalidGuid() throws Exception
|
||||
{
|
||||
LinkModel link = dataLink.usingAdmin().usingSite(siteModel).createRandomLink();
|
||||
@@ -65,18 +61,20 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(site);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, site.getGuid().split("/")[3]));
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Check that if personId does not exist, status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void addFavoriteUsingInexistentUser() throws Exception
|
||||
{
|
||||
restClient.withCoreAPI().usingUser(new UserModel("random_user", "random_password")).addSiteToFavorites(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "random_user"));
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Check that if target guid does not exist, status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void addFavoriteUsingInexistentGuid() throws Exception
|
||||
{
|
||||
SiteModel site = dataSite.usingUser(adminUserModel).createPublicRandomSite();
|
||||
@@ -86,10 +84,11 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
|
||||
.containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "random_guid"));
|
||||
}
|
||||
|
||||
|
||||
@Bug(id = "MNT-17157")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Check that if a favorite already exists with the specified id status code is 404")
|
||||
@Bug(id = "MNT-17157")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void addFavoriteTwice() throws Exception
|
||||
{
|
||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
@@ -97,9 +96,10 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CONFLICT);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Check that if user provides file in target but guid is of a folder status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void addFileToFavoritesUsingFolderGuid() throws Exception
|
||||
{
|
||||
String nodeRef = document.getNodeRef();
|
||||
@@ -111,9 +111,10 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
|
||||
document.setNodeRef(nodeRef);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add to favorites a file for a Manager, check it was added")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void managerIsAbleToAddFileToFavorites() throws Exception
|
||||
{
|
||||
restPersonFavoritesModel = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
@@ -124,6 +125,7 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify add favorite, perform getFavorites call, check value is updated")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void verifyGetFavoritesAfterFavoritingSite() throws Exception
|
||||
{
|
||||
restPersonFavoritesModel = restClient.authenticateUser(adminUserModel)
|
||||
@@ -135,6 +137,7 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add to favorites a folder for a Manager, check it was added")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void managerIsAbleToAddFolderToFavorites() throws Exception
|
||||
{
|
||||
restPersonFavoritesModel = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
@@ -142,9 +145,10 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
restPersonFavoritesModel.assertThat().field("targetGuid").is(folder.getNodeRefWithoutVersion());
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Add to favorites a site for a Manager, check it was added")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void managerIsAbleToAddSiteToFavorites() throws Exception
|
||||
{
|
||||
restPersonFavoritesModel = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
@@ -152,9 +156,10 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
restPersonFavoritesModel.assertThat().field("targetGuid").is(siteModel.getGuid());
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify add favorite specifying -me- string in place of <personid> for request")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void userIsAbleToAddFavoriteWhenUsingMeAsUsername() throws Exception
|
||||
{
|
||||
restPersonFavoritesModel = restClient.authenticateUser(adminUserModel)
|
||||
@@ -164,10 +169,11 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
|
||||
restClient.withCoreAPI().usingAuthUser().getFavoriteSites().assertThat().entriesListContains("guid", siteModel.getGuid());
|
||||
}
|
||||
|
||||
|
||||
@Bug(id = "MNT-17158")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify add file favorite with comment id returns status code 404")
|
||||
@Bug(id = "MNT-17158")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void addFileFavoriteUsingCommentId() throws Exception
|
||||
{
|
||||
FileModel file = dataContent.usingSite(siteModel).usingUser(adminUserModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
@@ -177,9 +183,10 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().addFileToFavorites(file);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify add file favorite with tag id returns status code 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void addFileFavoriteUsingTagId() throws Exception
|
||||
{
|
||||
FileModel file = dataContent.usingSite(siteModel).usingUser(adminUserModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
@@ -190,9 +197,10 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND,
|
||||
adminUserModel.getUsername(), returnedModel.getId()));
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Check that if user provides site in target but id is of a file status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void addSiteToFavoritesUsingFileId() throws Exception
|
||||
{
|
||||
String guid = siteModel.getGuid();
|
||||
@@ -203,9 +211,10 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
|
||||
siteModel.setGuid(guid);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Check that if user provides folder in target but guid is of a file status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void addFolderToFavoritesUsingFileGuid() throws Exception
|
||||
{
|
||||
String nodeRef = folder.getNodeRef();
|
||||
@@ -216,4 +225,4 @@ public class AddFavoritesCoreTests extends RestTest
|
||||
|
||||
folder.setNodeRef(nodeRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,8 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public class AddFavoritesSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
DataUser dataUser;
|
||||
|
||||
private UserModel adminUserModel;
|
||||
private SiteModel siteModel;
|
||||
private ListUserWithRoles usersWithRoles;
|
||||
@@ -40,9 +36,9 @@ public class AddFavoritesSanityTests extends RestTest
|
||||
UserRole.SiteContributor);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES },
|
||||
executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Admin user add site to favorites with Rest API and status code is 201")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsAbleToAddToFavorites() throws Exception
|
||||
{
|
||||
restPersonFavoritesModel = restClient.withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
@@ -53,6 +49,7 @@ public class AddFavoritesSanityTests extends RestTest
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify Manager user add site to favorites with Rest API and status code is 201")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void managerIsAbleToAddToFavorites() throws Exception
|
||||
{
|
||||
restPersonFavoritesModel = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)).withCoreAPI()
|
||||
@@ -61,9 +58,9 @@ public class AddFavoritesSanityTests extends RestTest
|
||||
restPersonFavoritesModel.assertThat().field("targetGuid").is(siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES },
|
||||
executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Collaborator user add site to favorites with Rest API and status code is 201")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void collaboratorIsAbleToAddToFavorites() throws Exception
|
||||
{
|
||||
restPersonFavoritesModel = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
@@ -72,9 +69,9 @@ public class AddFavoritesSanityTests extends RestTest
|
||||
restPersonFavoritesModel.and().field("targetGuid").is(siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES },
|
||||
executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Contributor user add site to favorites with Rest API and status code is 201")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void contributorIsAbleToAddToFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restPersonFavoritesModel= restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor))
|
||||
@@ -83,9 +80,9 @@ public class AddFavoritesSanityTests extends RestTest
|
||||
restPersonFavoritesModel.and().field("targetGuid").is(siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES },
|
||||
executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Consumer user add site to favorites with Rest API and status code is 201")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void consumerIsAbleToAddToFavorites() throws Exception
|
||||
{
|
||||
restPersonFavoritesModel = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer))
|
||||
@@ -94,10 +91,10 @@ public class AddFavoritesSanityTests extends RestTest
|
||||
restPersonFavoritesModel.and().field("targetGuid").is(siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify Manager user gets status code 401 if authentication call fails")
|
||||
@Bug(id="MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Manager user gets status code 401 if authentication call fails")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void managerIsNotAbleToAddToFavoritesIfAuthenticationFails() throws Exception
|
||||
{
|
||||
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public class DeleteFavoritesSanityTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel;
|
||||
@@ -34,8 +33,9 @@ public class DeleteFavoritesSanityTests extends RestTest
|
||||
UserRole.SiteContributor);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user deletes site from favorites with Rest API and status code is 204")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Admin user deletes site from favorites with Rest API and status code is 204")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsAbleToDeleteFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(siteModel);
|
||||
@@ -44,8 +44,9 @@ public class DeleteFavoritesSanityTests extends RestTest
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites().assertThat().entriesListDoesNotContain("targetGuid", siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Manager user deletes site from favorites with Rest API and status code is 204")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Manager user deletes site from favorites with Rest API and status code is 204")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void managerIsAbleToDeleteFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
|
||||
@@ -55,8 +56,9 @@ public class DeleteFavoritesSanityTests extends RestTest
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites().assertThat().entriesListDoesNotContain("targetGuid", siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user deletes site from favorites with Rest API and status code is 204")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Collaborator user deletes site from favorites with Rest API and status code is 204")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void collaboratorIsAbleToDeleteFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel siteCollaborator = usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator);
|
||||
@@ -66,8 +68,9 @@ public class DeleteFavoritesSanityTests extends RestTest
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites().assertThat().entriesListDoesNotContain("targetGuid", siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Contributor user deletes site from favorites with Rest API and status code is 204")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Contributor user deletes site from favorites with Rest API and status code is 204")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void contributorIsAbleToDeleteFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel siteContributor = usersWithRoles.getOneUserWithRole(UserRole.SiteContributor);
|
||||
@@ -77,8 +80,9 @@ public class DeleteFavoritesSanityTests extends RestTest
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites().assertThat().entriesListDoesNotContain("targetGuid", siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Consumer user delets site from favorites with Rest API and status code is 204")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Consumer user delets site from favorites with Rest API and status code is 204")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void consumerIsAbleToDeleteFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel siteConsumer = usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer);
|
||||
@@ -88,9 +92,10 @@ public class DeleteFavoritesSanityTests extends RestTest
|
||||
restClient.withCoreAPI().usingAuthUser().getFavorites().assertThat().entriesListDoesNotContain("targetGuid", siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user doesn't have permission to delete favorites of another user with Rest API and status code is 404")
|
||||
@Bug(id="MNT-16557")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user doesn't have permission to delete favorites of another user with Rest API and status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void userIsNotAbleToDeleteFavoritesOfAnotherUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel siteCollaborator = usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator);
|
||||
@@ -100,8 +105,10 @@ public class DeleteFavoritesSanityTests extends RestTest
|
||||
.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user doesn't have permission to delete favorites of admin user with Rest API and status code is 404")
|
||||
@Bug(id="MNT-16557")
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user doesn't have permission to delete favorites of admin user with Rest API and status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void userIsNotAbleToDeleteFavoritesOfAdminUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingAuthUser().addSiteToFavorites(siteModel);
|
||||
@@ -111,8 +118,10 @@ public class DeleteFavoritesSanityTests extends RestTest
|
||||
.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify admin user doesn't have permission to delete favorites of another user with Rest API and status code is 404")
|
||||
@Bug(id="MNT-16557")
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify admin user doesn't have permission to delete favorites of another user with Rest API and status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsNotAbleToDeleteFavoritesOfAnotherUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
@@ -123,8 +132,10 @@ public class DeleteFavoritesSanityTests extends RestTest
|
||||
.assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary(RestErrorModel.PERMISSION_WAS_DENIED);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
|
||||
@Bug(id = "MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user gets status code 401 if authentication call fails")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void userIsNotAbleToDeleteFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public class GetFavoriteSanityTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel;
|
||||
@@ -43,8 +42,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
UserRole.SiteContributor);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorite site with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Admin user gets favorite site with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsAbleToRetrieveFavoritesSite() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(siteModel);
|
||||
@@ -54,8 +54,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
restSiteModelsCollection.and().entriesListContains("guid",siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorite folder with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Admin user gets favorite folder with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsAbleToRetrieveFavoritesFolder() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(folderModel);
|
||||
@@ -66,8 +67,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorite file with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Admin user gets favorite file with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsAbleToRetrieveFavoritesFile() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.withCoreAPI().usingUser(adminUserModel).addFileToFavorites(fileModel);
|
||||
@@ -77,8 +79,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
restPersonFavoritesModelsCollection.and().entriesListContains("targetGuid", fileModel.getNodeRefWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets favorite site with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Manager user gets favorite site with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void managerIsAbleToRetrieveFavorite() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
@@ -89,8 +92,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
restSiteModelsCollection.and().entriesListContains("guid",siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user gets favorite site with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Collaborator user gets favorite site with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void collaboratorIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
@@ -101,8 +105,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
restSiteModelsCollection.and().entriesListContains("guid",siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Contributor user gets favorite site with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Contributor user gets favorite site with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void contributorIsAbleToRetrieveFavorite() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
@@ -113,8 +118,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
restSiteModelsCollection.and().entriesListContains("guid",siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Consumer user gets favorite site with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Consumer user gets favorite site with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void consumerIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
@@ -125,8 +131,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
restSiteModelsCollection.and().entriesListContains("guid",siteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user doesn't get favorite site of another user with Rest API and status code is 404")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user doesn't get favorite site of another user with Rest API and status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void userIsNotAbleToRetrieveFavoriteSiteOfAnotherUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
@@ -137,8 +144,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUsername()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user doesn't get favorite site of admin user with Rest API and status code is 404")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user doesn't get favorite site of admin user with Rest API and status code is 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void userIsNotAbleToRetrieveFavoritesOfAdminUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer))
|
||||
@@ -148,8 +156,9 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, adminUserModel.getUsername()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
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")
|
||||
@TestRail(section = { TestGroup.REST_API, 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")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsNotAbleToRetrieveFavoritesOfAnotherUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel).withCoreAPI()
|
||||
@@ -159,9 +168,10 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUsername()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
|
||||
@Bug(id="MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user gets status code 401 if authentication call fails")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
|
||||
@@ -170,5 +180,4 @@ public class GetFavoriteSanityTests extends RestTest
|
||||
.usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)).getFavorite(siteModel.getGuid());
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED).assertLastException().hasName(StatusModel.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import org.testng.annotations.Test;
|
||||
/**
|
||||
* Created by Claudia Agache on 11/21/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public class GetFavoritesCoreTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel;
|
||||
@@ -46,8 +45,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
UserRole.SiteContributor);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify User gets only favorites sites with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify User gets only favorites sites with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void userIsAbleToRetrieveOnlyFavoritesSites() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
@@ -63,8 +63,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
.and().entriesListDoesNotContain("targetGuid", firstFolderModel.getNodeRef());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify User gets only favorites files with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify User gets only favorites files with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void userIsAbleToRetrieveOnlyFavoritesFiles() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
@@ -80,8 +81,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
.and().entriesListDoesNotContain("targetGuid", firstFolderModel.getNodeRef());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify User gets only favorites folders with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify User gets only favorites folders with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void userIsAbleToRetrieveOnlyFavoritesFolders() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
@@ -97,8 +99,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
.and().entriesListDoesNotContain("targetGuid", firstFileModel.getNodeRefWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify User gets only favorites files or folders with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify User gets only favorites files or folders with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void userIsAbleToRetrieveFavoritesFilesOrFolders() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
@@ -117,8 +120,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
.and().entriesListDoesNotContain("targetGuid", firstSiteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify User gets only favorites files or sites with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify User gets only favorites files or sites with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void userIsAbleToRetrieveFavoritesFilesOrSites() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
@@ -137,8 +141,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
.and().entriesListDoesNotContain("targetGuid", firstFolderModel.getNodeRef());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify User gets only favorites folders or sites with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify User gets only favorites folders or sites with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void userIsAbleToRetrieveFavoritesFoldersOrSites() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
@@ -157,8 +162,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
.and().entriesListDoesNotContain("targetGuid", firstFileModel.getNodeRefWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify User gets all favorites with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify User gets all favorites with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void userIsAbleToRetrieveAllFavorites() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
@@ -187,8 +193,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
.and().entriesListDoesNotContain("targetGuid", secondFileModel.getNodeRefWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify request using invalid where parameter returns status 400")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify request using invalid where parameter returns status 400")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void getFavoritesUsingInvalidWhereParameter() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
@@ -202,8 +209,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.INVALID_ARGUMENT, "WHERE query"));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify request for a user with no favorites returns status 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify request for a user with no favorites returns status 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void userHasNoFavorites() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
@@ -213,8 +221,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
userFavorites.assertThat().entriesListIsEmpty().and().paginationField("totalItems").is("0");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify User gets correct favorites after deleting a favorite")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify User gets correct favorites after deleting a favorite")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void checkFavoriteFolderIsRemoved() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
@@ -231,8 +240,9 @@ public class GetFavoritesCoreTests extends RestTest
|
||||
}
|
||||
|
||||
@Bug(id="REPO-1642", description = "reproduced on 5.2.1 only, it works on 5.2.0")
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION, description = "Verify request using personId that does not exist returns status 404")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Verify request using personId that does not exist returns status 404")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.CORE })
|
||||
public void checkFavoritesWhenPersonIdDoesNotExist() throws Exception
|
||||
{
|
||||
UserModel someUser = new UserModel("someUser", DataUser.PASSWORD);
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public class GetFavoritesSanityTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel;
|
||||
@@ -47,8 +46,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
UserRole.SiteContributor);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorites sites with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Admin user gets favorites sites with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsAbleToRetrieveFavoritesSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.withCoreAPI().usingUser(adminUserModel).addSiteToFavorites(firstSiteModel);
|
||||
@@ -60,8 +60,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.and().entriesListContains("targetGuid", secondSiteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorites folders with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Admin user gets favorites folders with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsAbleToRetrieveFavoritesFolders() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.withCoreAPI().usingUser(adminUserModel).addFolderToFavorites(firstFolderModel);
|
||||
@@ -73,8 +74,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.and().entriesListContains("targetGuid", secondFolderModel.getNodeRef());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Admin user gets favorites files with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Admin user gets favorites files with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsAbleToRetrieveFavoritesFiles() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.withCoreAPI().usingUser(adminUserModel).addFileToFavorites(firstFileModel);
|
||||
@@ -86,8 +88,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.and().entriesListContains("targetGuid", secondFileModel.getNodeRefWithoutVersion());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Manager user gets favorites with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Manager user gets favorites with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void managerIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||
@@ -100,8 +103,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.assertThat().entriesListContains("targetGuid", secondSiteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Collaborator user gets favorites with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Collaborator user gets favorites with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void collaboratorIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
@@ -114,8 +118,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.and().entriesListContains("targetGuid", secondSiteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Contributor user gets favorites with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Contributor user gets favorites with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void contributorIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor))
|
||||
@@ -128,8 +133,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.entriesListContains("targetGuid", secondSiteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify Consumer user gets favorites with Rest API and status code is 200")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify Consumer user gets favorites with Rest API and status code is 200")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void consumerIsAbleToRetrieveFavorites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer))
|
||||
@@ -142,8 +148,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.assertThat().entriesListContains("targetGuid", secondSiteModel.getGuid());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
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")
|
||||
@TestRail(section = { TestGroup.REST_API, 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")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void userIsNotAbleToRetrieveFavoritesOfAnotherUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer))
|
||||
@@ -152,8 +159,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUsername()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
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")
|
||||
@TestRail(section = { TestGroup.REST_API, 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")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void userIsNotAbleToRetrieveFavoritesOfAdminUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer)).withCoreAPI()
|
||||
@@ -162,8 +170,9 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, adminUserModel.getUsername()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
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")
|
||||
@TestRail(section = { TestGroup.REST_API, 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")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void adminIsNotAbleToRetrieveFavoritesOfAnotherUser() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
@@ -172,9 +181,10 @@ public class GetFavoritesSanityTests extends RestTest
|
||||
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator).getUsername()));
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.FAVORITES }, executionType = ExecutionType.SANITY, description = "Verify user gets status code 401 if authentication call fails")
|
||||
@Bug(id="MNT-16904")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.FAVORITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify user gets status code 401 if authentication call fails")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public void userIsNotAbleToRetrieveFavoritesIfAuthenticationFails() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel siteManager = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS })
|
||||
public class RestGetNetworkForPersonSanityTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel;
|
||||
@@ -28,10 +27,9 @@ public class RestGetNetworkForPersonSanityTests extends RestTest
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify non existing user gets another exisiting network with Rest API and checks the forbidden status")
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify non existing user gets another exisiting network with Rest API and checks the forbidden status")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void nonExistingTenantUserIsNotAuthorizedToRequest() throws Exception
|
||||
{
|
||||
UserModel tenantUser = new UserModel("nonexisting", "password");
|
||||
@@ -41,32 +39,29 @@ public class RestGetNetworkForPersonSanityTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify tenant admin user gets specific network with Rest API and response is not empty")
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify tenant admin user gets specific network with Rest API and response is not empty")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void adminTenantChecksIfNetworkIsPresent() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
restClient.withCoreAPI().usingUser(adminTenantUser).getNetwork();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify tenant user is not authorized to check network of admin user with Rest API and checks the forbidden status")
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify tenant user is not authorized to check network of admin user with Rest API and checks the forbidden status")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void tenantUserIsNotAuthorizedToCheckNetworkOfAdminUser() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser);
|
||||
restClient.withCoreAPI().usingAuthUser().getNetwork(adminTenantUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify admin tenant user is not authorized to check network of another user with Rest API and checks the forbidden status")
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify admin tenant user is not authorized to check network of another user with Rest API and checks the forbidden status")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void adminTenantUserIsNotAuthorizedToCheckNetworkOfAnotherUser() throws Exception
|
||||
{
|
||||
UserModel secondAdminTenantUser = UserModel.getAdminTenantUser();
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.testng.annotations.Test;
|
||||
/**
|
||||
* Created by Cristina Axinte on 9/26/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS })
|
||||
public class RestGetNetworkTest extends RestTest
|
||||
{
|
||||
UserModel adminTenantUser;
|
||||
@@ -38,9 +37,9 @@ public class RestGetNetworkTest extends RestTest
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, executionType = ExecutionType.SANITY, description = "Verify non existing user gets another exisiting network with Rest API and checks the forbidden status")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify non existing user gets another exisiting network with Rest API and checks the forbidden status")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS})
|
||||
public void nonExistingTenantUserIsNotAuthorizedToRequest() throws Exception
|
||||
{
|
||||
UserModel tenantUser = new UserModel("nonexisting", "password");
|
||||
@@ -50,9 +49,9 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, executionType = ExecutionType.SANITY, description = "Verify tenant admin user gets specific network with Rest API and response is not empty")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify tenant admin user gets specific network with Rest API and response is not empty")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void adminTenantChecksIfNetworkIsPresent() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
@@ -60,16 +59,18 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, description = "Verify tenant admin user gets specific network with Rest API and checks response parameters are correct")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS },
|
||||
description = "Verify tenant admin user gets specific network with Rest API and checks response parameters are correct")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS })
|
||||
public void adminTenantChecksNetworkParamsAreCorrect() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
restClient.withCoreAPI().usingNetworks().getNetwork().assertNetworkHasName(adminTenantUser).assertNetworkIsEnabled();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, description = "Verify tenant admin user gets non exisiting network with Rest API and checks the not found status")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS },
|
||||
description = "Verify tenant admin user gets non existing network with Rest API and checks the not found status")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS })
|
||||
public void adminTenantChecksIfNonExistingNetworkIsNotFound() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
@@ -77,8 +78,9 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, description = "Verify tenant admin user gets another exisiting network with Rest API and checks the forbidden status")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS },
|
||||
description = "Verify tenant admin user gets another existing network with Rest API and checks the forbidden status")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS })
|
||||
public void adminTenantChecksIfAnotherExistingNetworkIsForbidden() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
@@ -86,7 +88,9 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS }, description = "Verify any tenant user gets its network with Rest API and response is not empty")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS },
|
||||
description = "Verify any tenant user gets its network with Rest API and response is not empty")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS })
|
||||
public void userTenantChecksIfNetworkIsPresent() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser);
|
||||
@@ -94,16 +98,18 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, description = "Verify any tenant user gets specific network with Rest API and checks response parameters are correct")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS },
|
||||
description = "Verify any tenant user gets specific network with Rest API and checks response parameters are correct")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS })
|
||||
public void userTenantChecksNetworkParamsAreCorrect() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser);
|
||||
restClient.withCoreAPI().usingNetworks().getNetwork(adminTenantUser).assertNetworkHasName(adminTenantUser).assertNetworkIsEnabled();
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, description = "Verify any tenant user gets non exisiting network with Rest API and checks the not found status")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS },
|
||||
description = "Verify any tenant user gets non existing network with Rest API and checks the not found status")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS })
|
||||
public void userTenantChecksIfNonExistingNetworkIsNotFound() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser);
|
||||
@@ -111,9 +117,9 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, description = "Verify any tenant user gets another exisiting network with Rest API and checks the forbidden status")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS },
|
||||
description = "Verify any tenant user gets another existing network with Rest API and checks the forbidden status")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void userTenantChecksIfAnotherExistingNetworkIsForbidden() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser);
|
||||
@@ -121,9 +127,9 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, executionType = ExecutionType.SANITY, description = "Verify manager tenant user gets its network with Rest API and response is not empty")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify manager tenant user gets its network with Rest API and response is not empty")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void tenantManagerUserChecksIfNetworkIsPresent() throws Exception
|
||||
{
|
||||
UserModel managerTenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("manTenant");
|
||||
@@ -134,9 +140,9 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, executionType = ExecutionType.SANITY, description = "Verify collaborator tenant user gets its network with Rest API and response is not empty")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify collaborator tenant user gets its network with Rest API and response is not empty")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void tenantCollaboratorUserChecksIfNetworkIsPresent() throws Exception
|
||||
{
|
||||
UserModel collaboratorTenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("colTenant");
|
||||
@@ -147,9 +153,9 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, executionType = ExecutionType.SANITY, description = "Verify consumer tenant user gets its network with Rest API and response is not empty")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify consumer tenant user gets its network with Rest API and response is not empty")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void tenantConsumerUserChecksIfNetworkIsPresent() throws Exception
|
||||
{
|
||||
UserModel consumerTenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("consTenant");
|
||||
@@ -160,9 +166,9 @@ public class RestGetNetworkTest extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = TestGroup.COMMENTS)
|
||||
@TestRail(section = { TestGroup.REST_API,
|
||||
TestGroup.NETWORKS }, executionType = ExecutionType.SANITY, description = "Verify contributor tenant user gets its network with Rest API and response is not empty")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify contributor tenant user gets its network with Rest API and response is not empty")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.NETWORKS, TestGroup.COMMENTS })
|
||||
public void tenantContributorUserChecksIfItsNetworkIsPresent() throws Exception
|
||||
{
|
||||
UserModel contributorTenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("contTenant");
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY })
|
||||
public class RestGetNetworksForPersonSanityTests extends RestTest
|
||||
{
|
||||
private UserModel adminUserModel;
|
||||
@@ -28,10 +27,9 @@ public class RestGetNetworksForPersonSanityTests extends RestTest
|
||||
}
|
||||
|
||||
@Bug(id = "MNT-16904")
|
||||
@Test(groups = {TestGroup.COMMENTS, TestGroup.NETWORKS})
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify non existing user gets another exisiting network with Rest API and checks the forbidden status")
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify non existing user gets another exisiting network with Rest API and checks the forbidden status")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY, TestGroup.COMMENTS, TestGroup.NETWORKS })
|
||||
public void nonExistingTenantUserIsNotAuthorizedToRequest() throws Exception
|
||||
{
|
||||
UserModel tenantUser = new UserModel("nonexisting", "password");
|
||||
@@ -41,32 +39,29 @@ public class RestGetNetworksForPersonSanityTests extends RestTest
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@Test(groups = {TestGroup.COMMENTS, TestGroup.NETWORKS})
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify tenant admin user gets specific network with Rest API and response is not empty")
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify tenant admin user gets specific network with Rest API and response is not empty")
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY, TestGroup.COMMENTS, TestGroup.NETWORKS })
|
||||
public void adminTenantChecksIfNetworkIsPresent() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminTenantUser);
|
||||
restClient.withCoreAPI().usingAuthUser().getNetworks();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Test(groups = {TestGroup.COMMENTS, TestGroup.NETWORKS})
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify tenant user is not authorized to check network of admin user with Rest API and checks the forbidden status")
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API,TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify tenant user is not authorized to check network of admin user with Rest API and checks the forbidden status")
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY, TestGroup.COMMENTS, TestGroup.NETWORKS })
|
||||
public void tenantUserIsNotAuthorizedToCheckNetworkOfAdminUser() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(tenantUser);
|
||||
restClient.withCoreAPI().usingAuthUser().getNetworks(adminTenantUser);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
@Test(groups = {TestGroup.COMMENTS, TestGroup.NETWORKS})
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS },
|
||||
executionType = ExecutionType.SANITY,
|
||||
description = "Verify admin tenant user is not authorized to check network of another user with Rest API and checks the forbidden status")
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.NETWORKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify admin tenant user is not authorized to check network of another user with Rest API and checks the forbidden status")
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.SANITY, TestGroup.COMMENTS, TestGroup.NETWORKS })
|
||||
public void adminTenantUserIsNotAuthorizedToCheckNetworkOfAnotherUser() throws Exception
|
||||
{
|
||||
UserModel secondAdminTenantUser = UserModel.getAdminTenantUser();
|
||||
|
||||
Reference in New Issue
Block a user