TAS-1376 getTasks call for admin

This commit is contained in:
Cristina Axinte
2016-10-11 17:05:27 +03:00
parent d0653cc88a
commit a36e08daff
3 changed files with 59 additions and 0 deletions
@@ -0,0 +1,18 @@
package org.alfresco.rest;
import org.testng.annotations.BeforeClass;
import com.jayway.restassured.RestAssured;
public abstract class RestWorkflowTest extends RestTest
{
@BeforeClass(alwaysRun = true)
public void checkServerHealth() throws Exception
{
serverHealth.assertServerIsOnline();
RestAssured.baseURI = restProperties.envProperty().getTestServerUrl();
RestAssured.port = restProperties.envProperty().getPort();
RestAssured.basePath = restProperties.getRestWorkflowPath();
}
}
@@ -0,0 +1,40 @@
package org.alfresco.rest.workflow.tasks;
import org.alfresco.rest.RestWorkflowTest;
import org.alfresco.rest.requests.RestTasksApi;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = { "rest-api", "workflow", "tasks", "sanity" })
public class GetTasksSanityTests extends RestWorkflowTest
{
@Autowired
RestTasksApi tasksApi;
UserModel userModel;
SiteModel siteModel;
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
userModel = dataUser.createRandomTestUser();
siteModel = dataSite.usingUser(userModel).createPublicRandomSite();
tasksApi.useRestClient(restClient);
}
@TestRail(section = { "rest-api", "workflow", "tasks" }, executionType = ExecutionType.SANITY, description = "Verify manager user fails to get an user favorite sites with Rest API (403)")
public void managerUserFailsToGetAnUserFavoriteSites() throws Exception
{
UserModel adminUser=dataUser.getAdminUser();
restClient.authenticateUser(adminUser);
tasksApi.getTasks().assertEntriesListIsNotEmpty();
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
}
+1
View File
@@ -9,6 +9,7 @@ admin.password=admin
# rest related
rest.basePath=alfresco/api/-default-/public/alfresco/versions/1
rest.workflowPath=alfresco/api/-default-/public/workflow/versions/1
# TEST MANAGEMENT SECTION - Test Rail