diff --git a/.travis.yml b/.travis.yml
index 363d96a042..d370cd26d9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -32,14 +32,30 @@ matrix:
- curl -LJO https://github.com/whitesource/unified-agent-distribution/raw/master/standAlone/wss-unified-agent.jar
# Run WhiteSource Unified Agent
- java -jar wss-unified-agent.jar -apiKey ${WHITESOURCE_API_KEY} -c .wss-unified-agent.config -d ./war
- - name: "REST API TAS tests"
+ - name: "REST API TAS tests part1"
jdk: openjdk11
install:
- travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
- ./tests/scripts/start-compose.sh ./tests/environment/docker-compose-minimal+transforms.yml
- ./tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
script:
- - travis_wait 60 mvn install -q -f tests/tas-restapi/pom.xml -Pall-tas-tests -Denvironment=default -DrunBugs=false
+ - travis_wait 60 mvn install -f tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part1 -Denvironment=default -DrunBugs=false
+ - name: "REST API TAS tests part2"
+ jdk: openjdk11
+ install:
+ - travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
+ - ./tests/scripts/start-compose.sh ./tests/environment/docker-compose-minimal+transforms.yml
+ - ./tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
+ script:
+ - travis_wait 60 mvn install -f tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part2 -Denvironment=default -DrunBugs=false
+ - name: "REST API TAS tests part3"
+ jdk: openjdk11
+ install:
+ - travis_retry travis_wait 40 mvn install -q "-Dversion.edition=${VERSION_EDITION}" -Dmaven.javadoc.skip=true -PcommunityDocker
+ - ./tests/scripts/start-compose.sh ./tests/environment/docker-compose-minimal+transforms.yml
+ - ./tests/scripts/wait-for-alfresco-start.sh "http://localhost:8082/alfresco"
+ script:
+ - travis_wait 60 mvn install -f tests/tas-restapi/pom.xml -Pall-tas-tests,run-restapi-part3 -Denvironment=default -DrunBugs=false
- name: "CMIS TAS tests"
jdk: openjdk11
install:
diff --git a/pom.xml b/pom.xml
index 49f99a5f09..ba71b7167f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,7 +110,7 @@
3.0.16
3.3.0
1.1.4
- 1.15
+ 1.16
1.6
1.1
1.3
diff --git a/tests/environment/alfresco/Dockerfile b/tests/environment/alfresco/Dockerfile
new file mode 100644
index 0000000000..8a49a3266b
--- /dev/null
+++ b/tests/environment/alfresco/Dockerfile
@@ -0,0 +1,17 @@
+FROM alfresco/alfresco-content-repository-community:latest
+
+ARG TOMCAT_DIR=/usr/local/tomcat
+ARG GROUPNAME=Alfresco
+ARG GROUPID=1000
+ARG USERNAME=alfresco
+ARG USERID=33000
+
+USER root
+
+RUN echo -e '\n\
+# every second \n\
+activities.feed.generator.cronExpression=* * * ? * * \n\
+activities.post.lookup.cronExpression=* * * ? * * \n\
+' >> ${TOMCAT_DIR}/shared/classes/alfresco-global.properties
+
+USER ${USERID}
\ No newline at end of file
diff --git a/tests/environment/docker-compose-minimal+transforms.yml b/tests/environment/docker-compose-minimal+transforms.yml
index 2de93ab468..66543944c9 100644
--- a/tests/environment/docker-compose-minimal+transforms.yml
+++ b/tests/environment/docker-compose-minimal+transforms.yml
@@ -7,9 +7,11 @@ version: "3"
services:
alfresco:
- image: alfresco/alfresco-content-repository-community:latest
+ build:
+ context: ./alfresco
environment:
CATALINA_OPTS : "-agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=n"
+ # Some properties are built in Dockerfile because of cron expressions
JAVA_OPTS :
"
-Ddb.driver=org.postgresql.Driver
@@ -64,7 +66,10 @@ services:
- POSTGRES_DB=alfresco
solr6:
- image: alfresco/alfresco-search-services:${SOLR6_TAG}
+ build:
+ context: ./search
+ args:
+ - TAG=${SOLR6_TAG}
environment:
#Solr needs to know how to register itself with Alfresco
- SOLR_ALFRESCO_HOST=alfresco
diff --git a/tests/environment/search/Dockerfile b/tests/environment/search/Dockerfile
new file mode 100644
index 0000000000..7363a42114
--- /dev/null
+++ b/tests/environment/search/Dockerfile
@@ -0,0 +1,10 @@
+ARG TAG
+FROM alfresco/alfresco-search-services:${TAG}
+
+ENV DIST_DIR /opt/alfresco-search-services
+
+COPY extra-config.sh .
+
+# add config script in 3rd line
+RUN sed -i "3isource $PWD/extra-config.sh" \
+ /opt/alfresco-search-services/solr/bin/search_config_setup.sh
\ No newline at end of file
diff --git a/tests/environment/search/extra-config.sh b/tests/environment/search/extra-config.sh
new file mode 100755
index 0000000000..b5bec4494f
--- /dev/null
+++ b/tests/environment/search/extra-config.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+set -e
+
+# Runs trackers once a second by modifying the template config of cores
+sed -i 's|alfresco.cron=0/10 \* \* \* \* ? \*|alfresco.cron=\* \* \* ? \* \*|' \
+ /opt/alfresco-search-services/solrhome/templates/rerank/conf/solrcore.properties
+sed -i 's/alfresco.commitInterval=2000/alfresco.commitInterval=200/' \
+ /opt/alfresco-search-services/solrhome/templates/rerank/conf/solrcore.properties
+sed -i 's/alfresco.newSearcherInterval=3000/alfresco.newSearcherInterval=300/' \
+ /opt/alfresco-search-services/solrhome/templates/rerank/conf/solrcore.properties
\ No newline at end of file
diff --git a/tests/tas-cmis/src/test/java/org/alfresco/cmis/CheckInTests.java b/tests/tas-cmis/src/test/java/org/alfresco/cmis/CheckInTests.java
index 4caa9fddef..f28b3e1233 100644
--- a/tests/tas-cmis/src/test/java/org/alfresco/cmis/CheckInTests.java
+++ b/tests/tas-cmis/src/test/java/org/alfresco/cmis/CheckInTests.java
@@ -111,8 +111,8 @@ public class CheckInTests extends CmisTest
.checkIn().refreshResource()
.and().assertThat().documentIsNotCheckedOut()
.then().assertThat().documentHasVersion(2.0);
- Utility.waitToLoopTime(5);
- cmisApi.assertThat().contentIs(newContent);
+ Utility.sleep(100, 5000, () ->
+ cmisApi.assertThat().contentIs(newContent));
}
@TestRail(section = {"cmis-api"}, executionType= ExecutionType.REGRESSION,
diff --git a/tests/tas-cmis/src/test/java/org/alfresco/cmis/CreateDocumentFromSourceTests.java b/tests/tas-cmis/src/test/java/org/alfresco/cmis/CreateDocumentFromSourceTests.java
index b04eb10425..76c214646d 100644
--- a/tests/tas-cmis/src/test/java/org/alfresco/cmis/CreateDocumentFromSourceTests.java
+++ b/tests/tas-cmis/src/test/java/org/alfresco/cmis/CreateDocumentFromSourceTests.java
@@ -146,7 +146,7 @@ public class CreateDocumentFromSourceTests extends CmisTest
newFile = new FileModel("");
cmisApi.authenticateUser(siteManager).usingSite(publicSite).createFileFromSource(newFile, sourceFile).then()
.usingSite(publicSite).assertThat().doesNotHaveFile(newFile);
- Utility.sleep(500, 10000, () ->
+ Utility.sleep(100, 10000, () ->
{
cmisApi.usingSite(publicSite).assertThat().doesNotHaveFile(newFile);
});
@@ -160,7 +160,7 @@ public class CreateDocumentFromSourceTests extends CmisTest
newFile = FileModel.getRandomFileModel(FileType.TEXT_PLAIN);
cmisApi.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)).usingSite(publicSite)
.createFileFromSource(newFile, sourceFile);
- Utility.sleep(500, 10000, () ->
+ Utility.sleep(100, 10000, () ->
{
cmisApi.refreshResource().then().assertThat().existsInRepo().and().assertThat().contentIs(sourceContent);
});
@@ -175,7 +175,7 @@ public class CreateDocumentFromSourceTests extends CmisTest
newFile = FileModel.getRandomFileModel(FileType.TEXT_PLAIN);
cmisApi.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor)).usingSite(publicSite)
.createFileFromSource(newFile, sourceFile);
- Utility.sleep(500, 10000, () ->
+ Utility.sleep(100, 10000, () ->
{
cmisApi.refreshResource().then().assertThat().existsInRepo().and().assertThat().contentIs(sourceContent);
});
@@ -189,7 +189,7 @@ public class CreateDocumentFromSourceTests extends CmisTest
newFile = FileModel.getRandomFileModel(FileType.TEXT_PLAIN);
cmisApi.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator)).usingSite(publicSite)
.createFileFromSource(newFile, sourceFile);
- Utility.sleep(500, 10000, () ->
+ Utility.sleep(100, 10000, () ->
{
cmisApi.refreshResource().then().assertThat().existsInRepo().and()
.assertThat().contentIs(sourceContent);
@@ -215,7 +215,7 @@ public class CreateDocumentFromSourceTests extends CmisTest
newFile = FileModel.getRandomFileModel(FileType.TEXT_PLAIN);
cmisApi.authenticateUser(siteManager).usingSite(publicSite)
.createFileFromSource(newFile, sourceFile, VersioningState.MINOR);
- Utility.sleep(500, 10000, () ->
+ Utility.sleep(100, 10000, () ->
{
cmisApi.refreshResource().then().assertThat().existsInRepo().and()
.assertThat().contentIs(sourceContent).and()
@@ -232,7 +232,7 @@ public class CreateDocumentFromSourceTests extends CmisTest
newFile = FileModel.getRandomFileModel(FileType.TEXT_PLAIN);
cmisApi.authenticateUser(siteManager).usingSite(publicSite)
.createFileFromSource(newFile, sourceFile, VersioningState.NONE);
- Utility.sleep(1000, 35000, () ->
+ Utility.sleep(100, 35000, () ->
{
cmisApi.refreshResource().then().assertThat().existsInRepo().and()
.assertThat().contentIs(sourceContent).and()
@@ -248,7 +248,7 @@ public class CreateDocumentFromSourceTests extends CmisTest
newFile = FileModel.getRandomFileModel(FileType.TEXT_PLAIN);
cmisApi.authenticateUser(siteManager).usingSite(publicSite)
.createFileFromSource(newFile, sourceFile, VersioningState.CHECKEDOUT);
- Utility.sleep(1000, 35000, () ->
+ Utility.sleep(100, 35000, () ->
{
cmisApi.refreshResource().then().assertThat().existsInRepo().and()
.assertThat().contentIs(sourceContent).and()
diff --git a/tests/tas-integration/src/test/java/org/alfresco/tas/integration/IntegrationSanityTests.java b/tests/tas-integration/src/test/java/org/alfresco/tas/integration/IntegrationSanityTests.java
index c0d8d330a0..50b74af19d 100644
--- a/tests/tas-integration/src/test/java/org/alfresco/tas/integration/IntegrationSanityTests.java
+++ b/tests/tas-integration/src/test/java/org/alfresco/tas/integration/IntegrationSanityTests.java
@@ -439,12 +439,11 @@ public class IntegrationSanityTests extends IntegrationTest
.assertThat().field("tag").is("integration_tag3");
STEP("* 8. U1 gets tags and verify all tags are listed");
- Utility.waitToLoopTime(30);
- restAPI.withParams("maxItems=10000").withCoreAPI().getTags()
- .assertThat().entriesListContains("tag", "integration_tag1")
- .and().entriesListContains("tag", "integration_tag2")
- .and().entriesListContains("tag", "integration_tag3");
-
+ Utility.sleep(500, 30000, () ->
+ restAPI.withParams("maxItems=10000").withCoreAPI().getTags()
+ .assertThat().entriesListContains("tag", "integration_tag1")
+ .and().entriesListContains("tag", "integration_tag2")
+ .and().entriesListContains("tag", "integration_tag3"));
STEP("* 9. U1 gets file1 tags and verify only tag1 and tag2 are listed");
restAPI.withCoreAPI()
.usingResource(testFile1).getNodeTags()
diff --git a/tests/tas-restapi/pom.xml b/tests/tas-restapi/pom.xml
index afa94b2c2a..14337f62a3 100644
--- a/tests/tas-restapi/pom.xml
+++ b/tests/tas-restapi/pom.xml
@@ -27,6 +27,27 @@
${project.basedir}/src/test/resources/restapi-suite.xml
+
+
+ run-restapi-part1
+
+ ${project.basedir}/src/test/resources/test-suites/part1-suite.xml
+
+
+
+ run-restapi-part2
+
+ ${project.basedir}/src/test/resources/test-suites/part2-suite.xml
+
+
+
+ run-restapi-part3
+
+ ${project.basedir}/src/test/resources/test-suites/part3-suite.xml
+
+
+
+
org.alfresco.tas
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/groups/GroupsTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/groups/GroupsTests.java
index 5eb3fa562e..1ea3b53166 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/groups/GroupsTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/groups/GroupsTests.java
@@ -153,6 +153,6 @@ public class GroupsTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.OK);
}
};
- Utility.sleep(1000, 35000, op);// Allow indexing to complete.
+ Utility.sleep(500, 35000, op);// Allow indexing to complete.
}
}
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/cors/CORSTest.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/misc/CORSTest.java
similarity index 99%
rename from tests/tas-restapi/src/test/java/org/alfresco/rest/cors/CORSTest.java
rename to tests/tas-restapi/src/test/java/org/alfresco/rest/misc/CORSTest.java
index 790e75aab3..d813801028 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/cors/CORSTest.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/misc/CORSTest.java
@@ -1,4 +1,4 @@
-package org.alfresco.rest.cors;
+package org.alfresco.rest.misc;
import io.restassured.RestAssured;
import org.alfresco.rest.RestTest;
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/FunctionalCasesTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/misc/FunctionalCasesTests.java
similarity index 82%
rename from tests/tas-restapi/src/test/java/org/alfresco/rest/FunctionalCasesTests.java
rename to tests/tas-restapi/src/test/java/org/alfresco/rest/misc/FunctionalCasesTests.java
index 7676dac8b6..ea7e8ecf76 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/FunctionalCasesTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/misc/FunctionalCasesTests.java
@@ -1,8 +1,9 @@
-package org.alfresco.rest;
+package org.alfresco.rest.misc;
import org.alfresco.dataprep.CMISUtil;
import org.alfresco.dataprep.CMISUtil.DocumentType;
import org.alfresco.dataprep.SiteService.Visibility;
+import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestActivityModelsCollection;
import org.alfresco.rest.model.RestCommentModel;
import org.alfresco.rest.model.RestCommentModelsCollection;
@@ -14,6 +15,7 @@ import org.alfresco.rest.model.RestSiteMemberModel;
import org.alfresco.rest.model.RestSiteMembershipRequestModelsCollection;
import org.alfresco.rest.model.RestTagModel;
import org.alfresco.rest.model.RestTaskModel;
+import org.alfresco.utility.Utility;
import org.alfresco.utility.constants.ActivityType;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.model.FileModel;
@@ -24,33 +26,15 @@ import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class FunctionalCasesTests extends RestTest
{
- private UserModel adminUser, manager;
- private SiteModel publicSite, moderatedSite, privateSite;
private RestSiteMemberModel updatedMember;
private RestSiteMembershipRequestModelsCollection returnedCollection;
private RestFavoriteSiteModel restFavoriteSiteModel;
private RestActivityModelsCollection activities;
private FileModel file;
- private RestActivityModelsCollection restActivityModelsCollection;
-
- private FileModel fileInSite;
- private RestCommentModel commentModel;
-
- @BeforeClass(alwaysRun=true)
- public void dataPreparation() throws Exception
- {
- adminUser = dataUser.getAdminUser();
- manager = dataUser.createRandomTestUser();
- publicSite = dataSite.usingUser(adminUser).createPublicRandomSite();
- dataUser.addUserToSite(manager, publicSite, UserRole.SiteManager);
- moderatedSite = dataSite.usingUser(adminUser).createModeratedRandomSite();
- privateSite = dataSite.usingUser(adminUser).createPrivateRandomSite();
- }
/**
* Scenario:
@@ -62,11 +46,12 @@ public class FunctionalCasesTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that manager is able to update manager with different roles and gets status code CREATED (201)")
- public void managerIsAbleToUpdateManagerWithDifferentRoles() throws Exception
+ public void managerIsAbleToUpdateManagerWithDifferentRoles()
{
UserModel testUser = dataUser.createRandomTestUser("testUser");
testUser.setUserRole(UserRole.SiteManager);
- restClient.authenticateUser(adminUser).withCoreAPI().usingSite(publicSite).addPerson(testUser)
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(publicSite).addPerson(testUser)
.assertThat().field("id").is(testUser.getUsername())
.and().field("role").is(testUser.getUserRole());
restClient.assertStatusCodeIs(HttpStatus.CREATED);
@@ -100,11 +85,12 @@ public class FunctionalCasesTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
description = "Verify that manager is able to update consumer with different roles and gets status code CREATED (201)")
- public void managerIsAbleToUpdateConsumerWithDifferentRoles() throws Exception
+ public void managerIsAbleToUpdateConsumerWithDifferentRoles()
{
UserModel testUser = dataUser.createRandomTestUser("testUser");
testUser.setUserRole(UserRole.SiteConsumer);
- restClient.authenticateUser(adminUser).withCoreAPI().usingSite(publicSite).addPerson(testUser)
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(publicSite).addPerson(testUser)
.assertThat().field("id").is(testUser.getUsername())
.and().field("role").is(testUser.getUserRole());
restClient.assertStatusCodeIs(HttpStatus.CREATED);
@@ -141,12 +127,12 @@ public class FunctionalCasesTests extends RestTest
public void approveRequestAddAndDeleteSiteFromFavorites() throws Exception
{
UserModel newMember = dataUser.createRandomTestUser();
-
+ SiteModel moderatedSite = dataSite.usingUser(dataUser.getAdminUser()).createModeratedRandomSite();
restClient.authenticateUser(newMember).withCoreAPI().usingMe().addSiteMembershipRequest(moderatedSite);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
RestTaskModel taskModel = restClient.authenticateUser(newMember).withWorkflowAPI().getTasks().getTaskModelByDescription(moderatedSite);
- workflow.approveSiteMembershipRequest(adminUser.getUsername(), adminUser.getPassword(), taskModel.getId(), true, "Approve");
+ workflow.approveSiteMembershipRequest(dataUser.getAdminUser().getUsername(), dataUser.getAdminUser().getPassword(), taskModel.getId(), true, "Approve");
returnedCollection = restClient.authenticateUser(newMember).withCoreAPI().usingMe().getSiteMembershipRequests();
restClient.assertStatusCodeIs(HttpStatus.OK);
returnedCollection.assertThat().entriesListDoesNotContain("id", moderatedSite.getId());
@@ -174,12 +160,12 @@ public class FunctionalCasesTests extends RestTest
public void rejectRequestAddModeratedSiteToFavorites() throws Exception
{
UserModel newMember = dataUser.createRandomTestUser();
-
+ SiteModel moderatedSite = dataSite.usingUser(dataUser.getAdminUser()).createModeratedRandomSite();
restClient.authenticateUser(newMember).withCoreAPI().usingMe().addSiteMembershipRequest(moderatedSite);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
RestTaskModel taskModel = restClient.authenticateUser(newMember).withWorkflowAPI().getTasks().getTaskModelByDescription(moderatedSite);
- workflow.approveSiteMembershipRequest(adminUser.getUsername(), adminUser.getPassword(), taskModel.getId(), false, "Rejected");
+ workflow.approveSiteMembershipRequest(dataUser.getAdminUser().getUsername(), dataUser.getAdminUser().getPassword(), taskModel.getId(), false, "Rejected");
returnedCollection = restClient.authenticateUser(newMember).withCoreAPI().usingMe().getSiteMembershipRequests();
restClient.assertStatusCodeIs(HttpStatus.OK);
returnedCollection.assertThat().entriesListDoesNotContain("id", moderatedSite.getId());
@@ -192,9 +178,9 @@ public class FunctionalCasesTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.CREATED);
taskModel = restClient.authenticateUser(newMember).withWorkflowAPI().getTasks().getTaskModelByDescription(moderatedSite);
- workflow.approveSiteMembershipRequest(adminUser.getUsername(), adminUser.getPassword(), taskModel.getId(), true, "Accept");
+ workflow.approveSiteMembershipRequest(dataUser.getAdminUser().getUsername(), dataUser.getAdminUser().getPassword(), taskModel.getId(), true, "Accept");
- restClient.authenticateUser(adminUser).withCoreAPI().usingUser(newMember).deleteSiteMember(moderatedSite);
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingUser(newMember).deleteSiteMember(moderatedSite);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
restClient.withCoreAPI().usingSite(moderatedSite).getSiteMembers().assertThat().entriesListDoesNotContain("id", newMember.getUsername());
@@ -210,8 +196,11 @@ public class FunctionalCasesTests extends RestTest
description = "Add a file and check that activity is included in person activities")
public void addFileThenGetPersonActivities() throws Exception
{
+ UserModel manager = dataUser.createRandomTestUser();
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ dataUser.addUserToSite(manager, publicSite, UserRole.SiteManager);
file = dataContent.usingUser(manager).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
- activities = restClient.authenticateUser(manager).withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(2);
+ activities = restClient.authenticateUser(manager).withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(3);
activities.assertThat().entriesListIsNotEmpty()
.and().entriesListContains("siteId", publicSite.getId())
.and().entriesListContains("activityType", "org.alfresco.documentlibrary.file-added")
@@ -228,9 +217,12 @@ public class FunctionalCasesTests extends RestTest
description = "Add a comment to a file and check that activity is included in person activities")
public void addCommentThenGetPersonActivities() throws Exception
{
+ UserModel manager = dataUser.createRandomTestUser();
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ dataUser.addUserToSite(manager, publicSite, UserRole.SiteManager);
file = dataContent.usingUser(manager).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
restClient.authenticateUser(manager).withCoreAPI().usingResource(file).addComment("new comment");
- activities = restClient.authenticateUser(manager).withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(3);
+ activities = restClient.authenticateUser(manager).withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(4);
activities.assertThat().entriesListIsNotEmpty()
.and().entriesListContains("siteId", publicSite.getId())
.and().entriesListContains("activityType", "org.alfresco.comments.comment-created")
@@ -247,9 +239,12 @@ public class FunctionalCasesTests extends RestTest
description = "Add a file, delete it and check that activity is included in person activities")
public void addFileDeleteItThenGetPersonActivities() throws Exception
{
+ UserModel manager = dataUser.createRandomTestUser();
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ dataUser.addUserToSite(manager, publicSite, UserRole.SiteManager);
file = dataContent.usingUser(manager).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
dataContent.usingUser(manager).usingResource(file).deleteContent();
- activities = restClient.authenticateUser(manager).withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(2);
+ activities = restClient.authenticateUser(manager).withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(4);
activities.assertThat().entriesListIsNotEmpty()
.and().entriesListContains("siteId", publicSite.getId())
.and().entriesListContains("activityType", "org.alfresco.documentlibrary.file-deleted")
@@ -269,6 +264,9 @@ public class FunctionalCasesTests extends RestTest
description = "Add comment to a file, then get comment details. Update it and check that get comment returns updated details. Delete comment then check that file has no comments.")
public void addUpdateDeleteCommentThenGetCommentDetails() throws Exception
{
+ UserModel manager = dataUser.createRandomTestUser();
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ dataUser.addUserToSite(manager, publicSite, UserRole.SiteManager);
file = dataContent.usingUser(manager).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
RestCommentModel newComment = restClient.authenticateUser(manager).withCoreAPI().usingResource(file).addComment("new comment");
restClient.assertStatusCodeIs(HttpStatus.CREATED);
@@ -303,6 +301,9 @@ public class FunctionalCasesTests extends RestTest
description = "Add a comment to a file, delete it, then added the same comment again.")
public void checkThatADeletedCommentCanBePostedAgain() throws Exception
{
+ UserModel manager = dataUser.createRandomTestUser();
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ dataUser.addUserToSite(manager, publicSite, UserRole.SiteManager);
file = dataContent.usingUser(manager).usingSite(publicSite).createContent(DocumentType.TEXT_PLAIN);
RestCommentModel newComment = restClient.authenticateUser(manager).withCoreAPI().usingResource(file).addComment("new comment");
restClient.assertStatusCodeIs(HttpStatus.CREATED);
@@ -330,8 +331,6 @@ public class FunctionalCasesTests extends RestTest
* Scenario:
* 1. join an user to a site
* 2. Check action is included in person activities list
- *
- * @throws Exception
*/
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
@@ -340,9 +339,9 @@ public class FunctionalCasesTests extends RestTest
public void joinUserToSiteThenGetPersonActivities() throws Exception
{
UserModel userJoinSite = dataUser.createRandomTestUser();
-
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
restClient.authenticateUser(userJoinSite).withCoreAPI().usingMe().addSiteMembershipRequest(publicSite);
- activities = restClient.withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(2);
+ activities = restClient.withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(1);
activities.assertThat().entriesListIsNotEmpty().and()
.entriesListContains("siteId", publicSite.getId()).and()
.entriesListContains("activityType", "org.alfresco.site.user-joined").and()
@@ -362,12 +361,12 @@ public class FunctionalCasesTests extends RestTest
{
UserModel newMember = dataUser.createRandomTestUser();
newMember.setUserRole(UserRole.SiteCollaborator);
-
- restClient.authenticateUser(adminUser).withCoreAPI().usingSite(privateSite).addPerson(newMember)
+ SiteModel privateSite = dataSite.usingUser(dataUser.getAdminUser()).createPrivateRandomSite();
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(privateSite).addPerson(newMember)
.assertThat().field("id").is(newMember.getUsername());
restClient.assertStatusCodeIs(HttpStatus.CREATED);
- restClient.authenticateUser(adminUser).withCoreAPI().usingUser(newMember).deleteSiteMember(privateSite);
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingUser(newMember).deleteSiteMember(privateSite);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
restClient.authenticateUser(newMember).withCoreAPI().usingMe().addSiteMembershipRequest(privateSite);
@@ -389,18 +388,18 @@ public class FunctionalCasesTests extends RestTest
{
UserModel newMember = dataUser.createRandomTestUser();
newMember.setUserRole(UserRole.SiteCollaborator);
-
+ SiteModel moderatedSite = dataSite.usingUser(dataUser.getAdminUser()).createModeratedRandomSite();
restClient.authenticateUser(newMember).withCoreAPI().usingMe().addSiteMembershipRequest(moderatedSite);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
RestTaskModel taskModel = restClient.authenticateUser(newMember).withWorkflowAPI().getTasks().getTaskModelByDescription(moderatedSite);
- workflow.approveSiteMembershipRequest(adminUser.getUsername(), adminUser.getPassword(), taskModel.getId(), true, "Accept");
+ workflow.approveSiteMembershipRequest(dataUser.getAdminUser().getUsername(), dataUser.getAdminUser().getPassword(), taskModel.getId(), true, "Accept");
- restClient.authenticateUser(adminUser).withCoreAPI().usingUser(newMember).deleteSiteMember(moderatedSite);
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingUser(newMember).deleteSiteMember(moderatedSite);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
restClient.withCoreAPI().usingSite(moderatedSite).getSiteMembers().assertThat().entriesListDoesNotContain("id", newMember.getUsername());
- restClient.authenticateUser(adminUser).withCoreAPI().usingSite(moderatedSite).addPerson(newMember)
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(moderatedSite).addPerson(newMember)
.assertThat().field("id").is(newMember.getUsername());
restClient.assertStatusCodeIs(HttpStatus.CREATED);
restClient.withCoreAPI().usingSite(moderatedSite).getSiteMembers().assertThat().entriesListContains("id", newMember.getUsername());
@@ -418,17 +417,18 @@ public class FunctionalCasesTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.REGRESSION })
public void checkTheCommentOfADocumentThatWasDeletedDoesNotExist() throws Exception
{
- file = dataContent.usingSite(publicSite).usingUser(adminUser).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
- String newContent = "This is a new comment added by " + adminUser.getUsername();
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ file = dataContent.usingSite(publicSite).usingUser(dataUser.getAdminUser()).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
+ String newContent = "This is a new comment added by " + dataUser.getAdminUser().getUsername();
- restClient.authenticateUser(adminUser).withCoreAPI().usingResource(file).addComment(newContent)
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingResource(file).addComment(newContent)
.assertThat().field("content").isNotEmpty()
.and().field("content").is(newContent);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
- dataContent.usingUser(adminUser).usingResource(file).deleteContent();
+ dataContent.usingUser(dataUser.getAdminUser()).usingResource(file).deleteContent();
- restClient.authenticateUser(adminUser).withCoreAPI().usingResource(file).getNodeComments();
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingResource(file).getNodeComments();
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
.assertLastError().containsSummary((String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, file.getNodeRefWithoutVersion())));
}
@@ -440,6 +440,7 @@ public class FunctionalCasesTests extends RestTest
* 3. Remove user from site
* 4. Get comments and check if the above comment was deleted
*/
+ @Bug(id="REPO-4854")
@TestRail(section = { TestGroup.REST_API, TestGroup.COMMENTS },
executionType = ExecutionType.REGRESSION, description = "Check that a comment of a document from a private site is not deleted after user is removed")
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.REGRESSION })
@@ -447,9 +448,10 @@ public class FunctionalCasesTests extends RestTest
{
UserModel newUser = dataUser.createRandomTestUser();
newUser.setUserRole(UserRole.SiteManager);
- restClient.authenticateUser(adminUser).withCoreAPI().usingSite(privateSite).addPerson(newUser);
+ SiteModel privateSite = dataSite.usingUser(dataUser.getAdminUser()).createPrivateRandomSite();
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(privateSite).addPerson(newUser);
- file = dataContent.usingSite(privateSite).usingUser(adminUser).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
+ file = dataContent.usingSite(privateSite).usingUser(dataUser.getAdminUser()).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
String newContent = "This is a new comment added by " + newUser.getUsername();
restClient.authenticateUser(newUser).withCoreAPI().usingResource(file).addComment(newContent)
@@ -457,11 +459,13 @@ public class FunctionalCasesTests extends RestTest
.and().field("content").is(newContent);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
- restClient.authenticateUser(adminUser).withCoreAPI().usingSite(privateSite).deleteSiteMember(newUser);
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(privateSite).deleteSiteMember(newUser);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
- restClient.withCoreAPI().usingSite(privateSite).getSiteMembers().assertThat().entriesListDoesNotContain("id", newUser.getUsername());
+ Utility.sleep(200, 10000, () ->
+ restClient.withCoreAPI().usingSite(privateSite).getSiteMembers()
+ .assertThat().entriesListDoesNotContain("id", newUser.getUsername()));
- RestCommentModelsCollection comments = restClient.authenticateUser(adminUser).withCoreAPI().usingResource(file).getNodeComments();
+ RestCommentModelsCollection comments = restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingResource(file).getNodeComments();
restClient.assertStatusCodeIs(HttpStatus.OK);
comments.assertThat().entriesListContains("content", newContent)
.and().entriesListContains("createdBy.id", newUser.getUsername());
@@ -477,7 +481,10 @@ public class FunctionalCasesTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.REGRESSION })
public void commentAFavoriteFile() throws Exception
{
- file = dataContent.usingSite(publicSite).usingUser(adminUser).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
+ UserModel manager = dataUser.createRandomTestUser();
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ dataUser.addUserToSite(manager, publicSite, UserRole.SiteManager);
+ file = dataContent.usingSite(publicSite).usingUser(dataUser.getAdminUser()).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
restClient.authenticateUser(manager).withCoreAPI().usingMe().addFileToFavorites(file);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
@@ -499,7 +506,10 @@ public class FunctionalCasesTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.COMMENTS, TestGroup.REGRESSION })
public void commentFileRemovedFromFavorites() throws Exception
{
- file = dataContent.usingSite(publicSite).usingUser(adminUser).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
+ UserModel manager = dataUser.createRandomTestUser();
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ dataUser.addUserToSite(manager, publicSite, UserRole.SiteManager);
+ file = dataContent.usingSite(publicSite).usingUser(dataUser.getAdminUser()).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
restClient.authenticateUser(manager).withCoreAPI().usingMe().addFileToFavorites(file);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
@@ -528,6 +538,9 @@ public class FunctionalCasesTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.FAVORITES, TestGroup.REGRESSION })
public void changeFavoriteSiteVisibilityThenCheckFavorites() throws Exception
{
+ UserModel manager = dataUser.createRandomTestUser();
+ SiteModel publicSite = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
+ dataUser.addUserToSite(manager, publicSite, UserRole.SiteManager);
SiteModel favoriteSite = dataSite.usingUser(manager).createPublicRandomSite();
UserModel regularUser = dataUser.createRandomTestUser();
@@ -581,19 +594,20 @@ public class FunctionalCasesTests extends RestTest
public void checkNewManagerActions() throws Exception
{
UserModel newMember = dataUser.createRandomTestUser();
- file = dataContent.usingSite(moderatedSite).usingUser(adminUser).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
+ SiteModel moderatedSite = dataSite.usingUser(dataUser.getAdminUser()).createModeratedRandomSite();
+ file = dataContent.usingSite(moderatedSite).usingUser(dataUser.getAdminUser()).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
restClient.authenticateUser(newMember).withCoreAPI().usingMe().addSiteMembershipRequest(moderatedSite);
restClient.assertStatusCodeIs(HttpStatus.CREATED);
RestTaskModel taskModel = restClient.withWorkflowAPI().getTasks().getTaskModelByDescription(moderatedSite);
- workflow.approveSiteMembershipRequest(adminUser.getUsername(), adminUser.getPassword(), taskModel.getId(), true, "Approve");
+ workflow.approveSiteMembershipRequest(dataUser.getAdminUser().getUsername(), dataUser.getAdminUser().getPassword(), taskModel.getId(), true, "Approve");
returnedCollection = restClient.withCoreAPI().usingMe().getSiteMembershipRequests();
restClient.assertStatusCodeIs(HttpStatus.OK);
returnedCollection.assertThat().entriesListDoesNotContain("id", moderatedSite.getId());
newMember.setUserRole(UserRole.SiteManager);
- restClient.authenticateUser(adminUser).withCoreAPI().usingSite(moderatedSite).updateSiteMember(newMember)
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(moderatedSite).updateSiteMember(newMember)
.assertThat().field("id").is(newMember.getUsername())
.and().field("role").is(newMember.getUserRole());
restClient.assertStatusCodeIs(HttpStatus.OK);
@@ -651,8 +665,7 @@ public class FunctionalCasesTests extends RestTest
* 9. Delete site member
* 10. Delete comment
* 11. Get Activities
- *
- * @throws Exception
+ *
*/
@Bug(id="REPO-1830")
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES, TestGroup.REGRESSION })
@@ -660,26 +673,26 @@ public class FunctionalCasesTests extends RestTest
public void userGetsItsPeopleActivities() throws Exception
{
UserModel newUser = dataUser.createRandomTestUser();
- SiteModel userSiteModel = dataSite.usingUser(adminUser).createPublicRandomSite();
+ SiteModel userSiteModel = dataSite.usingUser(dataUser.getAdminUser()).createPublicRandomSite();
dataUser.addUserToSite(newUser, userSiteModel, UserRole.SiteCollaborator);
dataContent.usingUser(newUser).usingSite(userSiteModel).createFolder();
-
- fileInSite = dataContent.usingUser(newUser).usingSite(userSiteModel).createContent(DocumentType.TEXT_PLAIN);
+
+ FileModel fileInSite = dataContent.usingUser(newUser).usingSite(userSiteModel).createContent(DocumentType.TEXT_PLAIN);
String newContent = "This is a new comment added by " + newUser.getUsername();
- commentModel = restClient.authenticateUser(newUser).withCoreAPI().usingResource(fileInSite).addComment(newContent);
+ RestCommentModel commentModel = restClient.authenticateUser(newUser).withCoreAPI().usingResource(fileInSite).addComment(newContent);
restClient.authenticateUser(newUser).withCoreAPI().usingResource(fileInSite).likeDocument();
restClient.withCoreAPI().usingResource(fileInSite).updateComment(commentModel, "new Content");
newUser.setUserRole(UserRole.SiteManager);
- restClient.authenticateUser(adminUser).withCoreAPI().usingSite(userSiteModel).updateSiteMember(newUser);
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(userSiteModel).updateSiteMember(newUser);
restClient.authenticateUser(newUser).withCoreAPI().usingResource(fileInSite).deleteLikeRating();
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
restClient.withCoreAPI().usingResource(fileInSite).deleteComment(commentModel);
- restClient.authenticateUser(adminUser).withCoreAPI().usingSite(userSiteModel).deleteSiteMember(newUser);
-
- restActivityModelsCollection = restClient.authenticateUser(newUser).withCoreAPI().usingMe().getPersonActivitiesUntilEntriesCountIs(10);
+ restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingSite(userSiteModel).deleteSiteMember(newUser);
+
+ RestActivityModelsCollection restActivityModelsCollection = restClient.authenticateUser(newUser).withCoreAPI().usingMe().getPersonActivitiesUntilEntriesCountIs(10);
restClient.assertStatusCodeIs(HttpStatus.OK);
restActivityModelsCollection.assertThat().paginationField("count").is("10");
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/nodes/NodesContentAndVersioningTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/nodes/NodesContentAndVersioningTests.java
index 9e2d0702bc..bbd354a499 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/nodes/NodesContentAndVersioningTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/nodes/NodesContentAndVersioningTests.java
@@ -262,7 +262,7 @@ public class NodesContentAndVersioningTests extends RestTest
// verify the content is the same as the uploaded file and check in headers for
// Content-Disposition to validate the download as attachment and fileName.
// wait for content to be picked up on AWS QS stacks
- Utility.sleep(1000, 60000, () -> {
+ Utility.sleep(500, 60000, () -> {
RestResponse versionContent = restClient.withCoreAPI().usingNode(file2).getVersionContent("2.0");
restClient.assertStatusCodeIs(HttpStatus.OK);
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/nodes/NodesLockTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/nodes/NodesLockTests.java
index da373a4b4c..37eb8c955a 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/nodes/NodesLockTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/nodes/NodesLockTests.java
@@ -730,7 +730,7 @@ public class NodesLockTests extends RestTest
query.setIncludeRequest(false);
// Allow indexing to complete.
- Utility.sleep(1000, 60000, () ->
+ Utility.sleep(500, 60000, () ->
{
SearchResponse response = query(query);
restClient.assertStatusCodeIs(HttpStatus.OK);
@@ -747,7 +747,7 @@ public class NodesLockTests extends RestTest
STEP("7. Verify that childNode1 and childNode2 are not found in the query results.");
// Allow indexing to complete.
- Utility.sleep(1000, 60000, () ->
+ Utility.sleep(500, 60000, () ->
{
SearchResponse response = query(query);
restClient.assertStatusCodeIs(HttpStatus.OK);
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/people/DeleteSiteMemberFullTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/people/DeleteSiteMemberFullTests.java
index d8b5e73286..917223f9b2 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/people/DeleteSiteMemberFullTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/people/DeleteSiteMemberFullTests.java
@@ -2,6 +2,7 @@ package org.alfresco.rest.people;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestErrorModel;
+import org.alfresco.utility.Utility;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.model.SiteModel;
@@ -159,9 +160,12 @@ public class DeleteSiteMemberFullTests extends RestTest
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteCollaborator)).deleteSiteMember(publicSiteModel);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(RestErrorModel.ENTITY_NOT_FOUND);
restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(publicSiteModel).addPerson(usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteCollaborator));
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers().assertThat().entriesListContains("id", usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
- .when().getSiteMember(usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
- .assertSiteMemberHasRole(UserRole.SiteCollaborator);
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat()
+ .entriesListContains("id",
+ usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
+ .when().getSiteMember(usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteCollaborator).getUsername())
+ .assertSiteMemberHasRole(UserRole.SiteCollaborator));
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
@@ -178,8 +182,9 @@ public class DeleteSiteMemberFullTests extends RestTest
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER).stackTraceIs(RestErrorModel.STACKTRACE);
restClient.withCoreAPI().usingSite(publicSiteModel).addPerson(usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteManager));
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers()
- .assertThat().entriesListContains("id", usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteManager).getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat()
+ .entriesListContains("id", usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteManager).getUsername()));
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
@@ -189,7 +194,8 @@ public class DeleteSiteMemberFullTests extends RestTest
restClient.authenticateUser(adminUserModel).withCoreAPI().usingUser(adminUserModel).deleteSiteMember(publicSiteModel);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
restClient.authenticateUser(usersWithRolesPublicSite.getOneUserWithRole(UserRole.SiteManager)).withCoreAPI().usingSite(publicSiteModel).addPerson(adminUserModel);
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers().assertThat().entriesListContains("id", adminUserModel.getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat().entriesListContains("id", adminUserModel.getUsername()));
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/people/activities/GetPeopleActivitiesSanityTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/people/activities/GetPeopleActivitiesSanityTests.java
index 8183430764..3ee3f3ccca 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/people/activities/GetPeopleActivitiesSanityTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/people/activities/GetPeopleActivitiesSanityTests.java
@@ -38,7 +38,7 @@ public class GetPeopleActivitiesSanityTests extends RestTest
unauthenticatedUser.setPassword("newpassword");
// only once the activity list is checked with retry in order not to wait the entire list in each test
- restActivityModelsCollection = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(5);
+ restActivityModelsCollection = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(6);
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@@ -49,9 +49,11 @@ public class GetPeopleActivitiesSanityTests extends RestTest
UserModel managerUser = usersWithRoles.getOneUserWithRole(UserRole.SiteManager);
dataContent.usingUser(managerUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
- restActivityModelsCollection = restClient.authenticateUser(managerUser).withCoreAPI().usingAuthUser().getPersonActivities();
+ restActivityModelsCollection = restClient.authenticateUser(managerUser).withCoreAPI()
+ .usingAuthUser().getPersonActivitiesUntilEntriesCountIs(6);
restClient.assertStatusCodeIs(HttpStatus.OK);
- restActivityModelsCollection.assertThat().entriesListIsNotEmpty().and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
+ restActivityModelsCollection.assertThat().entriesListIsNotEmpty()
+ .and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES, TestGroup.SANITY })
@@ -61,9 +63,11 @@ public class GetPeopleActivitiesSanityTests extends RestTest
UserModel collaboratorUser = usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator);
dataContent.usingUser(collaboratorUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
- restActivityModelsCollection = restClient.authenticateUser(collaboratorUser).withCoreAPI().usingAuthUser().getPersonActivities();
+ restActivityModelsCollection = restClient.authenticateUser(collaboratorUser).withCoreAPI()
+ .usingAuthUser().getPersonActivitiesUntilEntriesCountIs(6);
restClient.assertStatusCodeIs(HttpStatus.OK);
- restActivityModelsCollection.assertThat().entriesListIsNotEmpty().and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
+ restActivityModelsCollection.assertThat().entriesListIsNotEmpty()
+ .and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES, TestGroup.SANITY })
@@ -73,9 +77,11 @@ public class GetPeopleActivitiesSanityTests extends RestTest
UserModel contributorUser = usersWithRoles.getOneUserWithRole(UserRole.SiteContributor);
dataContent.usingUser(contributorUser).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
- restActivityModelsCollection = restClient.authenticateUser(contributorUser).withCoreAPI().usingAuthUser().getPersonActivities();
+ restActivityModelsCollection = restClient.authenticateUser(contributorUser).withCoreAPI()
+ .usingAuthUser().getPersonActivitiesUntilEntriesCountIs(6);
restClient.assertStatusCodeIs(HttpStatus.OK);
- restActivityModelsCollection.assertThat().entriesListIsNotEmpty().and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
+ restActivityModelsCollection.assertThat().entriesListIsNotEmpty()
+ .and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES, TestGroup.SANITY })
@@ -84,18 +90,22 @@ public class GetPeopleActivitiesSanityTests extends RestTest
{
UserModel consumerUser = usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer);
- restActivityModelsCollection = restClient.authenticateUser(consumerUser).withCoreAPI().usingAuthUser().getPersonActivities();
+ restActivityModelsCollection = restClient.authenticateUser(consumerUser).withCoreAPI()
+ .usingAuthUser().getPersonActivitiesUntilEntriesCountIs(6);
restClient.assertStatusCodeIs(HttpStatus.OK);
- restActivityModelsCollection.assertThat().entriesListIsNotEmpty().and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
+ restActivityModelsCollection.assertThat().entriesListIsNotEmpty()
+ .and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES, TestGroup.SANITY })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE,TestGroup.ACTIVITIES }, executionType = ExecutionType.SANITY, description = "Verify admin user gets another user activities with Rest API and response is successful")
public void adminUserShouldGetPeopleActivitiesList() throws Exception
{
- restActivityModelsCollection = restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI().usingUser(userModel).getPersonActivities();
+ restActivityModelsCollection = restClient.authenticateUser(dataUser.getAdminUser()).withCoreAPI()
+ .usingUser(userModel).getPersonActivitiesUntilEntriesCountIs(6);
restClient.assertStatusCodeIs(HttpStatus.OK);
- restActivityModelsCollection.assertThat().entriesListIsNotEmpty().and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
+ restActivityModelsCollection.assertThat().entriesListIsNotEmpty()
+ .and().entriesListContains("siteId", siteModel.getId()).and().paginationExist();
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES, TestGroup.SANITY })
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/renditions/GetRenditionTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/renditions/GetRenditionTests.java
index 297296151e..97ab4cb02c 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/renditions/GetRenditionTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/renditions/GetRenditionTests.java
@@ -145,7 +145,7 @@ public class GetRenditionTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.ACCEPTED);
STEP("2. Make GET rendition content using content-range header");
- Utility.sleep(1000, 30000, () -> {
+ Utility.sleep(500, 30000, () -> {
restClient.configureRequestSpec().addHeader("content-range", "bytes=1-10");
restClient.authenticateUser(user).withCoreAPI().usingNode(file1).getNodeRenditionContent("pdf");
restClient.assertStatusCodeIs(HttpStatus.PARTIAL_CONTENT);
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/sharedLinks/SharedLinksSanityTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/sharedLinks/SharedLinksSanityTests.java
index 31cf778eb4..f724c9840c 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/sharedLinks/SharedLinksSanityTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/sharedLinks/SharedLinksSanityTests.java
@@ -115,7 +115,7 @@ public class SharedLinksSanityTests extends RestTest
* Get all shared-links while allowing indexing to complete and check
* that the created shared-link is displayed
*/
- Utility.sleep(1000, 30000, () ->
+ Utility.sleep(500, 30000, () ->
{
sharedLinksCollection = restClient.withCoreAPI().usingSharedLinks().getSharedLinks();
restClient.assertStatusCodeIs(HttpStatus.OK);
@@ -223,7 +223,7 @@ public class SharedLinksSanityTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.ACCEPTED);
// GET /renditions: wait until all renditions are created and GET all entries
- Utility.sleep(1000, 50000, () ->
+ Utility.sleep(500, 50000, () ->
{
nodeRenditionInfoCollection = restClient.authenticateUser(testUser1).withCoreAPI().usingSharedLinks().getSharedLinkRenditions(sharedLink7);
restClient.assertStatusCodeIs(HttpStatus.OK);
@@ -258,7 +258,7 @@ public class SharedLinksSanityTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.ACCEPTED);
// GET /renditions/{renditionId}/content: get the Range request header for file with shared links endpoints.
- Utility.sleep(1000, 30000, () ->
+ Utility.sleep(500, 30000, () ->
{
restClient.configureRequestSpec().addHeader("content-range", "bytes=1-10");
restClient.authenticateUser(testUser1).withCoreAPI().usingSharedLinks().getSharedLinkRenditionContent(sharedLink8, "pdf");
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/RemoveSiteMemberTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/RemoveSiteMemberTests.java
index a68ce31c0b..2f0f5d21f8 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/RemoveSiteMemberTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/RemoveSiteMemberTests.java
@@ -2,6 +2,7 @@ package org.alfresco.rest.sites.members;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestErrorModel;
+import org.alfresco.utility.Utility;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException;
@@ -47,8 +48,8 @@ public class RemoveSiteMemberTests extends RestTest
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
restClient.withCoreAPI().usingSite(publicSiteModel).deleteSiteMember(testUserModel);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers()
- .assertThat().entriesListDoesNotContain("id", testUserModel.getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat().entriesListDoesNotContain("id", testUserModel.getUsername()));
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@@ -64,8 +65,9 @@ public class RemoveSiteMemberTests extends RestTest
restClient.withCoreAPI().usingSite(publicSiteModel).deleteSiteMember(testUserModel);
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers()
- .assertThat().entriesListContains("id", testUserModel.getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI()
+ .usingSite(publicSiteModel).getSiteMembers()
+ .assertThat().entriesListContains("id", testUserModel.getUsername()));
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@@ -81,8 +83,8 @@ public class RemoveSiteMemberTests extends RestTest
restClient.withCoreAPI().usingSite(publicSiteModel).deleteSiteMember(testUserModel);
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers()
- .assertThat().entriesListContains("id", testUserModel.getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat().entriesListContains("id", testUserModel.getUsername()));
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@@ -98,8 +100,8 @@ public class RemoveSiteMemberTests extends RestTest
.deleteSiteMember(testUserModel);
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers()
- .assertThat().entriesListContains("id", testUserModel.getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat().entriesListContains("id", testUserModel.getUsername()));
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@@ -171,8 +173,8 @@ public class RemoveSiteMemberTests extends RestTest
.withCoreAPI().usingSite(publicSiteModel).deleteSiteMember(anothermanager);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers()
- .assertThat().entriesListDoesNotContain("id", anothermanager.getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat().entriesListDoesNotContain("id", anothermanager.getUsername()));
}
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
@@ -188,8 +190,8 @@ public class RemoveSiteMemberTests extends RestTest
restClient.withCoreAPI().usingSite(publicSiteModel).deleteSiteMember(meUser);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers()
- .assertThat().entriesListDoesNotContain("id", manager.getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat().entriesListDoesNotContain("id", manager.getUsername()));
}
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
@@ -288,8 +290,8 @@ public class RemoveSiteMemberTests extends RestTest
.withCoreAPI().usingSite(publicSiteModel).deleteSiteMember(contributorForDelete);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers()
- .assertThat().entriesListDoesNotContain("id", contributorForDelete.getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat().entriesListDoesNotContain("id", contributorForDelete.getUsername()));
}
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
@@ -346,8 +348,8 @@ public class RemoveSiteMemberTests extends RestTest
.withCoreAPI().usingSite(publicSiteModel).deleteSiteMember(collaboratorForDelete);
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
- restClient.withCoreAPI().usingSite(publicSiteModel).getSiteMembers()
- .assertThat().entriesListDoesNotContain("id", collaboratorForDelete.getUsername());
+ Utility.sleep(300, 10000, () -> restClient.withCoreAPI().usingSite(publicSiteModel)
+ .getSiteMembers().assertThat().entriesListDoesNotContain("id", collaboratorForDelete.getUsername()));
}
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION,
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/GetTagTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/GetTagTests.java
index 2faa4cb847..9e5661816b 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/GetTagTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/GetTagTests.java
@@ -8,19 +8,12 @@ import org.alfresco.utility.model.UserModel;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = {TestGroup.REQUIRE_SOLR})
public class GetTagTests extends TagsDataPrep
{
- @BeforeClass(alwaysRun = true)
- public void dataPreparation() throws Exception
- {
- init();
- }
-
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION, description = "Verify admin user gets tag using REST API and status code is OK (200)")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
public void adminIsAbleToGetTag() throws Exception
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/TagsDataPrep.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/TagsDataPrep.java
index a499ab15b0..fcc5eb75f5 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/TagsDataPrep.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/TagsDataPrep.java
@@ -1,5 +1,6 @@
package org.alfresco.rest.tags;
+import java.util.Date;
import org.alfresco.dataprep.CMISUtil;
import org.alfresco.rest.RestTest;
import org.alfresco.rest.model.RestTagModel;
@@ -13,6 +14,7 @@ import org.alfresco.utility.model.FolderModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = {TestGroup.REQUIRE_SOLR})
@@ -28,18 +30,9 @@ public class TagsDataPrep extends RestTest
protected static String documentTagValue, documentTagValue2, folderTagValue;
protected static RestTagModel documentTag, documentTag2, folderTag, returnedModel;
protected static RestTagModelsCollection returnedCollection;
- private static boolean isInitialized = false;
+ @BeforeClass
public void init() throws Exception
- {
- if(!isInitialized)
- {
- isInitialized = true;
- initialization();
- }
- }
-
- public void initialization() throws Exception
{
adminUserModel = dataUser.getAdminUser();
//Create public site
@@ -58,7 +51,7 @@ public class TagsDataPrep extends RestTest
folderTag = restClient.withCoreAPI().usingResource(folder).addTag(folderTagValue);
// Allow indexing to complete.
- Utility.sleep(1000, 60000, () ->
+ Utility.sleep(500, 60000, () ->
{
returnedCollection = restClient.withParams("maxItems=10000").withCoreAPI().getTags();
returnedCollection.assertThat().entriesListContains("tag", documentTagValue.toLowerCase())
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/UpdateTagTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/UpdateTagTests.java
index 59b0b45843..aa7558c38b 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/UpdateTagTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/UpdateTagTests.java
@@ -12,7 +12,6 @@ import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.http.HttpStatus;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -25,12 +24,6 @@ public class UpdateTagTests extends TagsDataPrep
private RestTagModel oldTag;
private String randomTag = "";
- @BeforeClass(alwaysRun=true)
- public void dataPreparation() throws Exception
- {
- init();
- }
-
@BeforeMethod(alwaysRun=true)
public void addTagToDocument() throws Exception
{
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/AddTagTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/AddTagTests.java
index 816e5426fb..0bb7ad1043 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/AddTagTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/AddTagTests.java
@@ -16,7 +16,6 @@ import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.http.HttpStatus;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -31,12 +30,6 @@ public class AddTagTests extends TagsDataPrep
private RestCommentModel returnedModelComment;
private RestTagModelsCollection returnedModelTags;
- @BeforeClass(alwaysRun = true)
- public void dataPreparation() throws Exception
- {
- init();
- }
-
@BeforeMethod(alwaysRun = true)
public void generateRandomTag()
{
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/AddTagsTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/AddTagsTests.java
index 9beb0c6b3e..ecf26bcb57 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/AddTagsTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/AddTagsTests.java
@@ -14,7 +14,6 @@ import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.testng.Assert;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -28,12 +27,6 @@ public class AddTagsTests extends TagsDataPrep
private String tag1, tag2;
private RestTagModelsCollection returnedCollection;
- @BeforeClass(alwaysRun = true)
- public void dataPreparation() throws Exception
- {
- init();
- }
-
@BeforeMethod(alwaysRun = true)
public void generateRandomTagsList()
{
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/DeleteTagTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/DeleteTagTests.java
index 586dc42389..1967361a8a 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/DeleteTagTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/DeleteTagTests.java
@@ -15,7 +15,6 @@ import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.http.HttpStatus;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
/**
@@ -27,12 +26,6 @@ public class DeleteTagTests extends TagsDataPrep
private RestTagModel tag;
private FileModel contributorDoc;
- @BeforeClass(alwaysRun=true)
- public void dataPreparation() throws Exception
- {
- init();
- }
-
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
description = "Verify Admin user deletes tags with Rest API and status code is 204")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.REGRESSION })
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/GetNodeTagsTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/GetNodeTagsTests.java
index f274fc066b..abfcbc99e9 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/GetNodeTagsTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/tags/nodes/GetNodeTagsTests.java
@@ -13,23 +13,11 @@ import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.http.HttpStatus;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@Test(groups = {TestGroup.REQUIRE_SOLR})
public class GetNodeTagsTests extends TagsDataPrep
{
- private String tagValue;
- private String tagValue2;
-
- @BeforeClass(alwaysRun=true)
- public void dataPreparation() throws Exception
- {
- init();
- tagValue = documentTagValue;
- tagValue2 = documentTagValue2;
- }
-
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
executionType = ExecutionType.SANITY, description = "Verify site Manager is able to get node tags")
@Test(groups = { TestGroup.REST_API, TestGroup.TAGS, TestGroup.SANITY })
@@ -40,8 +28,8 @@ public class GetNodeTagsTests extends TagsDataPrep
returnedCollection = restClient.withCoreAPI().usingResource(document).getNodeTags();
restClient.assertStatusCodeIs(HttpStatus.OK);
returnedCollection.assertThat()
- .entriesListContains("tag", tagValue.toLowerCase())
- .and().entriesListContains("tag", tagValue2.toLowerCase());
+ .entriesListContains("tag", documentTagValue.toLowerCase())
+ .and().entriesListContains("tag", documentTagValue2.toLowerCase());
}
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
@@ -54,8 +42,8 @@ public class GetNodeTagsTests extends TagsDataPrep
returnedCollection = restClient.withCoreAPI().usingResource(document).getNodeTags();
restClient.assertStatusCodeIs(HttpStatus.OK);
returnedCollection.assertThat()
- .entriesListContains("tag", tagValue.toLowerCase())
- .and().entriesListContains("tag", tagValue2.toLowerCase());
+ .entriesListContains("tag", documentTagValue.toLowerCase())
+ .and().entriesListContains("tag", documentTagValue2.toLowerCase());
}
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
@@ -68,8 +56,8 @@ public class GetNodeTagsTests extends TagsDataPrep
returnedCollection = restClient.withCoreAPI().usingResource(document).getNodeTags();
restClient.assertStatusCodeIs(HttpStatus.OK);
returnedCollection.assertThat()
- .entriesListContains("tag", tagValue.toLowerCase())
- .and().entriesListContains("tag", tagValue2.toLowerCase());
+ .entriesListContains("tag", documentTagValue.toLowerCase())
+ .and().entriesListContains("tag", documentTagValue2.toLowerCase());
}
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
@@ -82,8 +70,8 @@ public class GetNodeTagsTests extends TagsDataPrep
returnedCollection = restClient.withCoreAPI().usingResource(document).getNodeTags();
restClient.assertStatusCodeIs(HttpStatus.OK);
returnedCollection.assertThat()
- .entriesListContains("tag", tagValue.toLowerCase())
- .and().entriesListContains("tag", tagValue2.toLowerCase());
+ .entriesListContains("tag", documentTagValue.toLowerCase())
+ .and().entriesListContains("tag", documentTagValue2.toLowerCase());
}
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
@@ -95,8 +83,8 @@ public class GetNodeTagsTests extends TagsDataPrep
returnedCollection = restClient.withCoreAPI().usingResource(document).getNodeTags();
restClient.assertStatusCodeIs(HttpStatus.OK);
returnedCollection.assertThat()
- .entriesListContains("tag", tagValue.toLowerCase())
- .and().entriesListContains("tag", tagValue2.toLowerCase());
+ .entriesListContains("tag", documentTagValue.toLowerCase())
+ .and().entriesListContains("tag", documentTagValue2.toLowerCase());
}
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS },
@@ -181,13 +169,13 @@ public class GetNodeTagsTests extends TagsDataPrep
{
FolderModel folder = dataContent.usingUser(adminUserModel).usingSite(siteModel).createFolder();
- restClient.withCoreAPI().usingResource(folder).addTag(tagValue);
- restClient.withCoreAPI().usingResource(folder).addTag(tagValue2);
+ restClient.withCoreAPI().usingResource(folder).addTag(documentTagValue);
+ restClient.withCoreAPI().usingResource(folder).addTag(documentTagValue2);
restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(folder).getNodeTags()
.assertThat()
- .entriesListContains("tag", tagValue.toLowerCase())
- .and().entriesListContains("tag", tagValue2.toLowerCase());
+ .entriesListContains("tag", documentTagValue.toLowerCase())
+ .and().entriesListContains("tag", documentTagValue2.toLowerCase());
}
@TestRail(section = { TestGroup.REST_API, TestGroup.TAGS }, executionType = ExecutionType.REGRESSION,
@@ -198,8 +186,8 @@ public class GetNodeTagsTests extends TagsDataPrep
returnedCollection = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
.withParams("properties=tag").withCoreAPI().usingResource(document).getNodeTags();
restClient.assertStatusCodeIs(HttpStatus.OK);
- returnedCollection.assertThat().entriesListContains("tag", tagValue.toLowerCase())
- .and().entriesListContains("tag", tagValue2.toLowerCase())
+ returnedCollection.assertThat().entriesListContains("tag", documentTagValue.toLowerCase())
+ .and().entriesListContains("tag", documentTagValue2.toLowerCase())
.and().entriesListDoesNotContain("id");
}
@@ -251,7 +239,7 @@ public class GetNodeTagsTests extends TagsDataPrep
{
FileModel file = dataContent.usingAdmin().usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
- restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).addTag(tagValue);
+ restClient.authenticateUser(adminUserModel).withCoreAPI().usingResource(file).addTag(documentTagValue);
returnedCollection = restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
.withCoreAPI().usingResource(file).getNodeTags();
diff --git a/tests/tas-restapi/src/test/java/org/alfresco/rest/trashcan/GetDeletedNodesTests.java b/tests/tas-restapi/src/test/java/org/alfresco/rest/trashcan/GetDeletedNodesTests.java
index 1fb8eed888..726d7bbb77 100644
--- a/tests/tas-restapi/src/test/java/org/alfresco/rest/trashcan/GetDeletedNodesTests.java
+++ b/tests/tas-restapi/src/test/java/org/alfresco/rest/trashcan/GetDeletedNodesTests.java
@@ -197,7 +197,7 @@ public class GetDeletedNodesTests extends RestTest
dataContent.usingUser(adminUserModel).usingResource(file3).deleteContent();
// GET /deleted-nodes/{nodeId}/renditions
- Utility.sleep(1000, 30000, () ->
+ Utility.sleep(500, 60000, () ->
{
nodeRenditionInfoCollection = restClient.authenticateUser(adminUserModel).withCoreAPI().usingTrashcan().getDeletedNodeRenditions(file3);
restClient.assertStatusCodeIs(HttpStatus.OK);
@@ -236,7 +236,7 @@ public class GetDeletedNodesTests extends RestTest
dataContent.usingUser(adminUserModel).usingResource(file4).deleteContent();
// GET /deleted-nodes/{nodeId}/renditions/{id}/content and verify range request header
- Utility.sleep(1000, 30000, () ->
+ Utility.sleep(500, 60000, () ->
{
restClient.configureRequestSpec().addHeader("content-range", "bytes=1-10");
restClient.authenticateUser(adminUserModel).withCoreAPI().usingTrashcan().getDeletedNodeRenditionContent(file4, "pdf");
diff --git a/tests/tas-restapi/src/test/resources/restapi-suite.xml b/tests/tas-restapi/src/test/resources/restapi-suite.xml
index 9009c8ab92..8fc32e0ffd 100644
--- a/tests/tas-restapi/src/test/resources/restapi-suite.xml
+++ b/tests/tas-restapi/src/test/resources/restapi-suite.xml
@@ -7,9 +7,16 @@
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/tests/tas-restapi/src/test/resources/test-suites/part1-suite.xml b/tests/tas-restapi/src/test/resources/test-suites/part1-suite.xml
new file mode 100644
index 0000000000..2d1bf24ff0
--- /dev/null
+++ b/tests/tas-restapi/src/test/resources/test-suites/part1-suite.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/tas-restapi/src/test/resources/test-suites/part2-suite.xml b/tests/tas-restapi/src/test/resources/test-suites/part2-suite.xml
new file mode 100644
index 0000000000..f4122db9b4
--- /dev/null
+++ b/tests/tas-restapi/src/test/resources/test-suites/part2-suite.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/tas-restapi/src/test/resources/test-suites/part3-suite.xml b/tests/tas-restapi/src/test/resources/test-suites/part3-suite.xml
new file mode 100644
index 0000000000..ed05643430
--- /dev/null
+++ b/tests/tas-restapi/src/test/resources/test-suites/part3-suite.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+