From 66196cc2acafa8415b56abfcc5cd20137d1cc034 Mon Sep 17 00:00:00 2001
From: araschitor <71637144+araschitor@users.noreply.github.com>
Date: Tue, 30 Mar 2021 13:28:02 +0300
Subject: [PATCH] Updated blog post edit comments tests (#96)
* feature/APPS-871: Adjusted existing helper methods and deleted all java docs.
* feature/APPS-871: Adjusted existing methods and deleted java docs
* feature/APPS-871: Ajusted helper methods
* feature/APPS-871: Renamed methods
* feature/APPS-871: Addressed suggestions #1
* feature/APPS-871: Renamed test class
* feature/APPS-871: Adjusted helper methods, cleanup the code from unused methods/imports and renamed few methods
* feature/APPS-871: Added loggers and cleanup PageObject class
* feature/APPS-871: Renamed methods and decoupled chaining methods from different objects
* feature/APPS-871: Updated BlogPostEditCommentsTests
* Added BlogPostFilters and let only one method which is called filterPostBy(BlogPostFilters filters)
* deleted .html file
---
...ommentTests_addCommentToDraftBlogPost.html | 627 ------------------
.../alfresco/po/enums/BlogPostFilters.java | 28 +
.../po/share/site/blog/BlogPostListPage.java | 34 +-
.../po/share/site/blog/BlogPostViewPage.java | 20 +-
.../po/share/site/blog/BlogPromptWindow.java | 55 +-
.../blog/BlogPostAddCommentTests.java | 23 +-
.../blog/BlogPostEditCommentsTests.java | 177 ++---
.../blog/BrowsingBlogPostsTests.java | 15 +-
.../blog/CreatingABlogPostTests.java | 7 +-
.../blog/DeletingABlogPostTests.java | 13 +-
.../blog/DeletingACommentTests.java | 2 +-
.../blog/EditingABlogPostTests.java | 21 +-
.../blog/ViewingABlogPostTests.java | 8 +-
13 files changed, 212 insertions(+), 818 deletions(-)
delete mode 100644 alfresco-tas-share-test/Test Results - BlogPostAddCommentTests_addCommentToDraftBlogPost.html
create mode 100644 alfresco-tas-share-test/src/main/java/org/alfresco/po/enums/BlogPostFilters.java
diff --git a/alfresco-tas-share-test/Test Results - BlogPostAddCommentTests_addCommentToDraftBlogPost.html b/alfresco-tas-share-test/Test Results - BlogPostAddCommentTests_addCommentToDraftBlogPost.html
deleted file mode 100644
index 9fcb0e9441..0000000000
--- a/alfresco-tas-share-test/Test Results - BlogPostAddCommentTests_addCommentToDraftBlogPost.html
+++ /dev/null
@@ -1,627 +0,0 @@
-
-
-
-
- Test Results — BlogPostAddCommentTests.addCommentToDraftBlogPost
-
-
-
-
-
-
-
-
-
-
-
-
-
- /Library/Java/JavaVirtualMachines/jdk-11.0.9.jdk/Contents/Home/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=52482:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA.app/Contents/plugins/testng/lib/testng-rt.jar:/opt/disjoinBackup/alfresco-tas-share-test/target/test-classes:/opt/disjoinBackup/alfresco-tas-share-test/target/classes:/Users/andrei.raschitor/.m2/repository/io/github/bonigarcia/webdrivermanager/4.2.2/webdrivermanager-4.2.2.jar:/Users/andrei.raschitor/.m2/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar:/Users/andrei.raschitor/.m2/repository/commons-io/commons-io/2.8.0/commons-io-2.8.0.jar:/Users/andrei.raschitor/.m2/repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar:/Users/andrei.raschitor/.m2/repository/org/apache/commons/commons-lang3/3.11/commons-lang3-3.11.jar:/Users/andrei.raschitor/.m2/repository/org/apache/httpcomponents/client5/httpclient5/5.0.1/httpclient5-5.0.1.jar:/Users/andrei.raschitor/.m2/repository/org/apache/httpcomponents/core5/httpcore5/5.0.1/httpcore5-5.0.1.jar:/Users/andrei.raschitor/.m2/repository/org/apache/httpcomponents/core5/httpcore5-h2/5.0.1/httpcore5-h2-5.0.1.jar:/Users/andrei.raschitor/.m2/repository/commons-codec/commons-codec/1.13/commons-codec-1.13.jar:/Users/andrei.raschitor/.m2/repository/org/rauschig/jarchivelib/1.1.0/jarchivelib-1.1.0.jar:/Users/andrei.raschitor/.m2/repository/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar:/Users/andrei.raschitor/.m2/repository/org/jsoup/jsoup/1.13.1/jsoup-1.13.1.jar:/Users/andrei.raschitor/.m2/repository/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar:/Users/andrei.raschitor/.m2/repository/commons-net/commons-net/3.6/commons-net-3.6.jar:/Users/andrei.raschitor/.m2/repository/org/alfresco/tas/utility/3.0.41/utility-3.0.41.jar:/Users/andrei.raschitor/.m2/repository/org/keycloak/keycloak-admin-client/4.8.3.Final/keycloak-admin-client-4.8.3.Final.jar:/Users/andrei.raschitor/.m2/repository/org/keycloak/keycloak-common/4.8.3.Final/keycloak-common-4.8.3.Final.jar:/Users/andrei.raschitor/.m2/repository/org/keycloak/keycloak-adapter-core/4.8.3.Final/keycloak-adapter-core-4.8.3.Final.jar:/Users/andrei.raschitor/.m2/repository/org/keycloak/keycloak-core/4.8.3.Final/keycloak-core-4.8.3.Final.jar:/Users/andrei.raschitor/.m2/repository/org/keycloak/keycloak-authz-client/4.8.3.Final/keycloak-authz-client-4.8.3.Final.jar:/Users/andrei.raschitor/.m2/repository/org/jboss/resteasy/resteasy-jackson2-provider/3.6.3.Final/resteasy-jackson2-provider-3.6.3.Final.jar:/Users/andrei.raschitor/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.8/jackson-core-2.9.8.jar:/Users/andrei.raschitor/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.8/jackson-annotations-2.9.8.jar:/Users/andrei.raschitor/.m2/repository/com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/2.9.8/jackson-jaxrs-json-provider-2.9.8.jar:/Users/andrei.raschitor/.m2/repository/com/fasterxml/jackson/jaxrs/jackson-jaxrs-base/2.9.8/jackson-jaxrs-base-2.9.8.jar:/Users/andrei.raschitor/.m2/repository/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.9.8/jackson-module-jaxb-annotations-2.9.8.jar:/Users/andrei.raschitor/.m2/repository/com/github/fge/json-patch/1.9/json-patch-1.9.jar:/Users/andrei.raschitor/.m2/repository/com/github/fge/jackson-coreutils/1.6/jackson-coreutils-1.6.jar:/Users/andrei.raschitor/.m2/repository/com/github/fge/msg-simple/1.1/msg-simple-1.1.jar:/Users/andrei.raschitor/.m2/repository/com/github/fge/btf/1.2/btf-1.2.jar:/Users/andrei.raschitor/.m2/repository/org/jboss/resteasy/resteasy-client/3.6.3.Final/resteasy-client-3.6.3.Final.jar:/Users/andrei.raschitor/.m2/repository/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec/1.0.2.Final/jboss-jaxrs-api_2.1_spec-1.0.2.Final.jar:/Users/andrei.raschitor/.m2/repository/org/jboss/resteasy/resteasy-jaxrs/3.6.3.Final/resteasy-jaxrs-3.6.3.Final.jar:/Users/andrei.raschitor/.m2/repository/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec/1.0.1.Final/jboss-jaxb-api_2.3_spec-1.0.1.Final.jar:/Users/andrei.raschitor/.m2/repository/org/reactivestreams/reactive-streams/1.0.2/reactive-streams-1.0.2.jar:/Users/andrei.raschitor/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar:/Users/andrei.raschitor/.m2/repository/org/jboss/spec/javax/annotation/jboss-annotations-api_1.3_spec/1.0.1.Final/jboss-annotations-api_1.3_spec-1.0.1.Final.jar:/Users/andrei.raschitor/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar:/Users/andrei.raschitor/.m2/repository/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar:/Users/andrei.raschitor/.m2/repository/com/google/guava/guava/23.0/guava-23.0.jar:/Users/andrei.raschitor/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/Users/andrei.raschitor/.m2/repository/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar:/Users/andrei.raschitor/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:/Users/andrei.raschitor/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-beans/5.2.4.RELEASE/spring-beans-5.2.4.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-core/5.2.4.RELEASE/spring-core-5.2.4.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-jcl/5.2.4.RELEASE/spring-jcl-5.2.4.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-context/5.2.4.RELEASE/spring-context-5.2.4.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-aop/5.2.4.RELEASE/spring-aop-5.2.4.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-expression/5.2.4.RELEASE/spring-expression-5.2.4.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-tx/5.2.4.RELEASE/spring-tx-5.2.4.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-test/5.2.4.RELEASE/spring-test-5.2.4.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-jdbc/5.2.4.RELEASE/spring-jdbc-5.2.4.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/commons-dbcp/commons-dbcp/1.4/commons-dbcp-1.4.jar:/Users/andrei.raschitor/.m2/repository/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4.jar:/Users/andrei.raschitor/.m2/repository/org/alfresco/test/dataprep/2.6/dataprep-2.6.jar:/Users/andrei.raschitor/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar:/Users/andrei.raschitor/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar:/Users/andrei.raschitor/.m2/repository/junit/junit/4.10/junit-4.10.jar:/Users/andrei.raschitor/.m2/repository/org/json/json/20170516/json-20170516.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-aspects/4.1.7.RELEASE/spring-aspects-4.1.7.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/aspectj/aspectjweaver/1.8.6/aspectjweaver-1.8.6.jar:/Users/andrei.raschitor/.m2/repository/org/springframework/spring-web/4.1.7.RELEASE/spring-web-4.1.7.RELEASE.jar:/Users/andrei.raschitor/.m2/repository/org/apache/chemistry/opencmis/chemistry-opencmis-client-impl/1.1.0/chemistry-opencmis-client-impl-1.1.0.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-rt-frontend-jaxws/3.0.12/cxf-rt-frontend-jaxws-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar:/Users/andrei.raschitor/.m2/repository/asm/asm/3.3.1/asm-3.3.1.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-core/3.0.12/cxf-core-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/org/apache/ws/xmlschema/xmlschema-core/2.2.1/xmlschema-core-2.2.1.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-rt-bindings-soap/3.0.12/cxf-rt-bindings-soap-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-rt-wsdl/3.0.12/cxf-rt-wsdl-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-rt-databinding-jaxb/3.0.12/cxf-rt-databinding-jaxb-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-rt-bindings-xml/3.0.12/cxf-rt-bindings-xml-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-rt-frontend-simple/3.0.12/cxf-rt-frontend-simple-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-rt-ws-addr/3.0.12/cxf-rt-ws-addr-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-rt-transports-http/3.0.12/cxf-rt-transports-http-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/org/apache/cxf/cxf-rt-ws-policy/3.0.12/cxf-rt-ws-policy-3.0.12.jar:/Users/andrei.raschitor/.m2/repository/wsdl4j/wsdl4j/1.6.3/wsdl4j-1.6.3.jar:/Users/andrei.raschitor/.m2/repository/org/apache/neethi/neethi/3.0.3/neethi-3.0.3.jar:/Users/andrei.raschitor/.m2/repository/org/apache/chemistry/opencmis/chemistry-opencmis-client-api/1.1.0/chemistry-opencmis-client-api-1.1.0.jar:/Users/andrei.raschitor/.m2/repository/org/apache/chemistry/opencmis/chemistry-opencmis-client-bindings/1.1.0/chemistry-opencmis-client-bindings-1.1.0.jar:/Users/andrei.raschitor/.m2/repository/org/apache/chemistry/opencmis/chemistry-opencmis-commons-impl/1.1.0/chemistry-opencmis-commons-impl-1.1.0.jar:/Users/andrei.raschitor/.m2/repository/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar:/Users/andrei.raschitor/.m2/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar:/Users/andrei.raschitor/.m2/repository/joda-time/joda-time/2.9.9/joda-time-2.9.9.jar:/Users/andrei.raschitor/.m2/repository/org/testng/testng/6.9.10/testng-6.9.10.jar:/Users/andrei.raschitor/.m2/repository/com/beust/jcommander/1.48/jcommander-1.48.jar:/Users/andrei.raschitor/.m2/repository/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar:/Users/andrei.raschitor/.m2/repository/org/slf4j/slf4j-log4j12/1.7.30/slf4j-log4j12-1.7.30.jar:/Users/andrei.raschitor/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/Users/andrei.raschitor/.m2/repository/com/relevantcodes/extentreports/2.41.2/extentreports-2.41.2.jar:/Users/andrei.raschitor/.m2/repository/org/xerial/sqlite-jdbc/3.8.11.1/sqlite-jdbc-3.8.11.1.jar:/Users/andrei.raschitor/.m2/repository/org/freemarker/freemarker/2.3.23/freemarker-2.3.23.jar:/Users/andrei.raschitor/.m2/repository/org/mongodb/mongodb-driver/3.0.4/mongodb-driver-3.0.4.jar:/Users/andrei.raschitor/.m2/repository/org/mongodb/bson/3.0.4/bson-3.0.4.jar:/Users/andrei.raschitor/.m2/repository/org/mongodb/mongodb-driver-core/3.0.4/mongodb-driver-core-3.0.4.jar:/Users/andrei.raschitor/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.8/jackson-databind-2.9.8.jar:/Users/andrei.raschitor/.m2/repository/org/jvnet/jaxb2_commons/jaxb2-basics/0.6.5/jaxb2-basics-0.6.5.jar:/Users/andrei.raschitor/.m2/repository/org/jvnet/jaxb2_commons/jaxb2-basics-runtime/0.6.5/jaxb2-basics-runtime-0.6.5.jar:/Users/andrei.raschitor/.m2/repository/org/jvnet/jaxb2_commons/jaxb2-basics-tools/0.6.5/jaxb2-basics-tools-0.6.5.jar:/Users/andrei.raschitor/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar:/Users/andrei.raschitor/.m2/repository/commons-lang/commons-lang/2.2/commons-lang-2.2.jar:/Users/andrei.raschitor/.m2/repository/com/google/code/javaparser/javaparser/1.0.8/javaparser-1.0.8.jar:/Users/andrei.raschitor/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar:/Users/andrei.raschitor/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar:/Users/andrei.raschitor/.m2/repository/com/sun/xml/bind/jaxb-core/2.3.0.1/jaxb-core-2.3.0.1.jar:/Users/andrei.raschitor/.m2/repository/com/sun/xml/bind/jaxb-impl/2.3.2/jaxb-impl-2.3.2.jar:/Users/andrei.raschitor/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:/Users/andrei.raschitor/.m2/repository/org/jolokia/jolokia-client-java/1.6.2/jolokia-client-java-1.6.2.jar:/Users/andrei.raschitor/.m2/repository/org/apache/httpcomponents/httpcore/4.4.7/httpcore-4.4.7.jar:/Users/andrei.raschitor/.m2/repository/org/apache/httpcomponents/httpclient/4.5.11/httpclient-4.5.11.jar:/Users/andrei.raschitor/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/andrei.raschitor/.m2/repository/org/postgresql/postgresql/9.4.1211.jre7/postgresql-9.4.1211.jre7.jar:/Users/andrei.raschitor/.m2/repository/mysql/mysql-connector-java/5.1.18/mysql-connector-java-5.1.18.jar:/Users/andrei.raschitor/.m2/repository/javax/mail/javax.mail-api/1.6.2/javax.mail-api-1.6.2.jar:/Users/andrei.raschitor/.m2/repository/com/sun/mail/javax.mail/1.6.2/javax.mail-1.6.2.jar:/Users/andrei.raschitor/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-java/3.141.59/selenium-java-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-api/3.141.59/selenium-api-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-chrome-driver/3.141.59/selenium-chrome-driver-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-edge-driver/3.141.59/selenium-edge-driver-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-firefox-driver/3.141.59/selenium-firefox-driver-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-ie-driver/3.141.59/selenium-ie-driver-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-opera-driver/3.141.59/selenium-opera-driver-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-remote-driver/3.141.59/selenium-remote-driver-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-safari-driver/3.141.59/selenium-safari-driver-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/org/seleniumhq/selenium/selenium-support/3.141.59/selenium-support-3.141.59.jar:/Users/andrei.raschitor/.m2/repository/net/bytebuddy/byte-buddy/1.8.15/byte-buddy-1.8.15.jar:/Users/andrei.raschitor/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar:/Users/andrei.raschitor/.m2/repository/com/squareup/okhttp3/okhttp/3.11.0/okhttp-3.11.0.jar:/Users/andrei.raschitor/.m2/repository/com/squareup/okio/okio/1.14.0/okio-1.14.0.jar:/Users/andrei.raschitor/.m2/repository/ru/yandex/qatools/htmlelements/htmlelements-java/1.20.0/htmlelements-java-1.20.0.jar:/Users/andrei.raschitor/.m2/repository/org/uncommons/reportng/1.1.2/reportng-1.1.2.jar:/Users/andrei.raschitor/.m2/repository/velocity/velocity/1.4/velocity-1.4.jar:/Users/andrei.raschitor/.m2/repository/velocity/velocity-dep/1.4/velocity-dep-1.4.jar:/Users/andrei.raschitor/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar:/Users/andrei.raschitor/.m2/repository/org/alfresco/tas/cmis/1.13/cmis-1.13.jar:/Users/andrei.raschitor/.m2/repository/org/apache/chemistry/opencmis/chemistry-opencmis-commons-api/1.1.0/chemistry-opencmis-commons-api-1.1.0.jar:/Users/andrei.raschitor/.m2/repository/org/alfresco/tas/restapi/1.43/restapi-1.43.jar:/Users/andrei.raschitor/.m2/repository/org/apache/httpcomponents/httpclient-osgi/4.5.3/httpclient-osgi-4.5.3.jar:/Users/andrei.raschitor/.m2/repository/org/apache/httpcomponents/httpmime/4.5.3/httpmime-4.5.3.jar:/Users/andrei.raschitor/.m2/repository/org/apache/httpcomponents/httpclient-cache/4.5.3/httpclient-cache-4.5.3.jar:/Users/andrei.raschitor/.m2/repository/org/apache/httpcomponents/fluent-hc/4.5.3/fluent-hc-4.5.3.jar:/Users/andrei.raschitor/.m2/repository/io/rest-assured/rest-assured/3.3.0/rest-assured-3.3.0.jar:/Users/andrei.raschitor/.m2/repository/org/codehaus/groovy/groovy-xml/2.4.15/groovy-xml-2.4.15.jar:/Users/andrei.raschitor/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/andrei.raschitor/.m2/repository/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar:/Users/andrei.raschitor/.m2/repository/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar:/Users/andrei.raschitor/.m2/repository/io/rest-assured/json-path/3.3.0/json-path-3.3.0.jar:/Users/andrei.raschitor/.m2/repository/io/rest-assured/rest-assured-common/3.3.0/rest-assured-common-3.3.0.jar:/Users/andrei.raschitor/.m2/repository/io/rest-assured/xml-path/3.3.0/xml-path-3.3.0.jar:/Users/andrei.raschitor/.m2/repository/com/sun/xml/bind/jaxb-osgi/2.2.10/jaxb-osgi-2.2.10.jar:/Users/andrei.raschitor/.m2/repository/org/apache/sling/org.apache.sling.javax.activation/0.1.0/org.apache.sling.javax.activation-0.1.0.jar:/Users/andrei.raschitor/.m2/repository/io/rest-assured/json-schema-validator/3.3.0/json-schema-validator-3.3.0.jar:/Users/andrei.raschitor/.m2/repository/com/github/java-json-tools/json-schema-validator/2.2.10/json-schema-validator-2.2.10.jar:/Users/andrei.raschitor/.m2/repository/com/github/java-json-tools/json-schema-core/1.2.10/json-schema-core-1.2.10.jar:/Users/andrei.raschitor/.m2/repository/com/github/java-json-tools/jackson-coreutils/1.9/jackson-coreutils-1.9.jar:/Users/andrei.raschitor/.m2/repository/com/github/fge/uri-template/0.9/uri-template-0.9.jar:/Users/andrei.raschitor/.m2/repository/org/mozilla/rhino/1.7.7.1/rhino-1.7.7.1.jar:/Users/andrei.raschitor/.m2/repository/javax/mail/mailapi/1.4.3/mailapi-1.4.3.jar:/Users/andrei.raschitor/.m2/repository/com/googlecode/libphonenumber/libphonenumber/8.0.0/libphonenumber-8.0.0.jar:/Users/andrei.raschitor/.m2/repository/net/sf/jopt-simple/jopt-simple/5.0.3/jopt-simple-5.0.3.jar:/Users/andrei.raschitor/.m2/repository/com/github/scribejava/scribejava-apis/6.9.0/scribejava-apis-6.9.0.jar:/Users/andrei.raschitor/.m2/repository/com/github/scribejava/scribejava-core/6.9.0/scribejava-core-6.9.0.jar:/Users/andrei.raschitor/.m2/repository/org/glassfish/javax.json/1.1.4/javax.json-1.1.4.jar:/Users/andrei.raschitor/.m2/repository/io/swagger/swagger-parser/1.0.23/swagger-parser-1.0.23.jar:/Users/andrei.raschitor/.m2/repository/io/swagger/swagger-core/1.5.10/swagger-core-1.5.10.jar:/Users/andrei.raschitor/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-joda/2.4.5/jackson-datatype-joda-2.4.5.jar:/Users/andrei.raschitor/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.4.5/jackson-dataformat-yaml-2.4.5.jar:/Users/andrei.raschitor/.m2/repository/org/yaml/snakeyaml/1.12/snakeyaml-1.12.jar:/Users/andrei.raschitor/.m2/repository/io/swagger/swagger-models/1.5.10/swagger-models-1.5.10.jar:/Users/andrei.raschitor/.m2/repository/io/swagger/swagger-annotations/1.5.10/swagger-annotations-1.5.10.jar:/Users/andrei.raschitor/.m2/repository/org/slf4j/slf4j-ext/1.6.3/slf4j-ext-1.6.3.jar:/Users/andrei.raschitor/.m2/repository/ch/qos/cal10n/cal10n-api/0.7.4/cal10n-api-0.7.4.jar:/Users/andrei.raschitor/.m2/repository/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.jar:/Users/andrei.raschitor/.m2/repository/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar:/Users/andrei.raschitor/.m2/repository/org/codehaus/groovy/groovy/2.5.9/groovy-2.5.9.jar:/Users/andrei.raschitor/.m2/repository/org/codehaus/groovy/groovy-json/2.5.9/groovy-json-2.5.9.jar com.intellij.rt.testng.RemoteTestNGStarter -usedefaultlisteners false -socket52481 @w@/private/var/folders/j7/26xwdwjs61q_9t35nh4mslsw0000gq/T/idea_working_dirs_testng.tmp -temp /private/var/folders/j7/26xwdwjs61q_9t35nh4mslsw0000gq/T/idea_testng.tmp
-[TestNG] Running:
- /Users/andrei.raschitor/Library/Caches/JetBrains/IntelliJIdea2020.3/temp-testng-customsuite.xml
-
- -
-
-
13.28 s
- share-test
-
- -
-
-
13.28 s
- BlogPostAddCommentTests
-
- -
- skippedBlogPostAddCommentTests.addCommentToDraftBlogPost
-
- -
- Process finished with exit code 130 (interrupted by signal 2: SIGINT)
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/alfresco-tas-share-test/src/main/java/org/alfresco/po/enums/BlogPostFilters.java b/alfresco-tas-share-test/src/main/java/org/alfresco/po/enums/BlogPostFilters.java
new file mode 100644
index 0000000000..ad5f78de63
--- /dev/null
+++ b/alfresco-tas-share-test/src/main/java/org/alfresco/po/enums/BlogPostFilters.java
@@ -0,0 +1,28 @@
+package org.alfresco.po.enums;
+
+public enum BlogPostFilters
+{
+ MY_DRAFTS_POSTS("ul.filterLink span.mydrafts>a", "My Draft Posts"),
+ MY_PUBLISHED_POSTS("ul.filterLink span.mypublished>a", "My Published Posts"),
+ LATEST_POSTS("ul.filterLink span.new>a", "New Posts"),
+ ALL_POSTS("ul.filterLink span.all>a", "All Posts");
+
+ private final String locator;
+ private final String expectedFilterLabel;
+
+ BlogPostFilters(String locator, String expectedFilterLabel)
+ {
+ this.locator = locator;
+ this.expectedFilterLabel = expectedFilterLabel;
+ }
+
+ public String getLocator()
+ {
+ return locator;
+ }
+
+ public String getExpectedFilterLabel()
+ {
+ return expectedFilterLabel;
+ }
+}
diff --git a/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPostListPage.java b/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPostListPage.java
index 3ad7490070..13917fde07 100644
--- a/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPostListPage.java
+++ b/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPostListPage.java
@@ -12,6 +12,7 @@
import java.util.List;
import java.util.Locale;
import lombok.extern.slf4j.Slf4j;
+import org.alfresco.po.enums.BlogPostFilters;
import org.alfresco.po.share.site.SiteCommon;
import org.alfresco.utility.exception.PageOperationException;
import org.openqa.selenium.By;
@@ -38,19 +39,13 @@ public class BlogPostListPage extends SiteCommon
private final By noBlogPostsFound = By.xpath(".//tbody[@class='yui-dt-message']");
private final By simpleViewButton = By.cssSelector("button[id$='_default-simpleView-button-button']");
private final By newPostButton = By.cssSelector("div.new-blog span[id*='_default-create-button']");
- private final By defaultBlogPostList = By.cssSelector("div[id$='_default-postlist']");
private final By nodeTitle = By.xpath(".//span[@class = 'nodeTitle']");
private final By simpleNodePost = By.cssSelector(".node.post.simple");
private final By postDateTime = By.xpath(".//div[@class = 'published']//span[@class = 'nodeAttrValue']");
private final By readLabel = By.xpath("div[@class = 'nodeFooter']//span[@class = 'nodeAttrValue']//a");
-
private final By editButton = By.xpath(".//../div[@class = 'nodeEdit']//div[@class = 'onEditBlogPost']//a//span[text() = 'Edit']");
private final By blogLinkName = By.id("HEADER_SITE_BLOG-POSTLIST");
- private final By allFilter = By.cssSelector("ul.filterLink span.all>a");
- private final By latestFilter = By.cssSelector("ul.filterLink span.new>a");
- private final By myDraftsFilter = By.cssSelector("ul.filterLink span.mydrafts>a");
private final By listTitle = By.className("listTitle");
- private final By myPublished = By.cssSelector("ul.filterLink span.mypublished>a");
private final By tag = By.xpath("//span[@class ='tag']/a");
private final String postRowPath = "//tr[contains(@class, 'yui-dt-rec')]//div[@class = 'nodeContent']//span/a[text() = '%s']/../../../..";
@@ -304,32 +299,15 @@ public boolean isBlogPostDisplayed(String title)
return isElementDisplayed(getBlogPostRow(title));
}
- public BlogPostListPage navigateToAllFilter()
+ public BlogPostListPage filterPostBy(BlogPostFilters blogPostFilters)
{
- log.info("Navigate to all filter");
- clickElement(allFilter);
+ log.info("Filter blog post by {}", blogPostFilters);
+ By filter = By.cssSelector(blogPostFilters.getLocator());
+ clickElement(filter);
+ waitUntilElementContainsText(listTitle, blogPostFilters.getExpectedFilterLabel());
return this;
}
- public void clickLatestFilter()
- {
- clickElement(latestFilter);
- waitUntilElementContainsText(listTitle, "New Posts");
- }
-
- public BlogPostListPage navigateToMyDrafts()
- {
- clickElement(myDraftsFilter);
- waitUntilElementContainsText(listTitle, "My Draft Posts");
- return this;
- }
-
- public void clickMyPublishedFilter()
- {
- clickElement(myPublished);
- waitUntilElementContainsText(listTitle, "My Published Posts");
- }
-
public void clickTag(String tag)
{
mouseOver(selectTagsByTagName(tag));
diff --git a/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPostViewPage.java b/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPostViewPage.java
index 3f7de0c58d..07dedf8602 100644
--- a/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPostViewPage.java
+++ b/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPostViewPage.java
@@ -1,5 +1,7 @@
package org.alfresco.po.share.site.blog;
+import static org.testng.Assert.assertEquals;
+
import java.util.ArrayList;
import java.util.List;
@@ -15,8 +17,8 @@
@Slf4j
public class BlogPostViewPage extends SiteCommon
{
- public final By commentText = By.cssSelector("div[class ='comment-content'] p");
public final By noCommentsText = By.xpath("//tbody[@class = 'yui-dt-message']//div[@class = 'yui-dt-liner']");
+ private final By commentText = By.cssSelector("div[class ='comment-content'] p");
private final By blogPostTitle = By.cssSelector("div[id*='_blog-postview'] div.nodeTitle>a");
private final By blogPostContent = By.cssSelector("div[id*='_blog-postview'] div.content");
private final By blogPostAuthor = By.cssSelector(".published .nodeAttrValue>a");
@@ -25,7 +27,6 @@ public class BlogPostViewPage extends SiteCommon
private final By editButton = By.cssSelector(".onEditBlogPost>a");
private final By deleteButton = By.cssSelector(".onDeleteBlogPost>a");
private final By addCommentButton = By.cssSelector(".onAddCommentClick button");
- private final By commentAuthorName = By.xpath("//span[@class = 'info']/a");
private final By editCommentButton = By.xpath("//a[@title='Edit Comment']");
private final By deleteCommentButton = By.xpath("//a[@title = 'Delete Comment']");
private final By newPostButton = By.cssSelector("button[id$='_default-create-button-button']");
@@ -112,18 +113,17 @@ public List getBlogPostTags()
return tagsList;
}
- public String commentAuthorName(String user)
- {
- return getElementText(selectComment(user).findElement(commentAuthorName));
- }
-
- public String getCommentText(String user)
+ public BlogPostViewPage assertCommentEqualsTo(String user, String expectedComment)
{
- return getElementText(selectComment(user).findElement(commentText));
+ log.info("Assert comment equals {}", expectedComment);
+ String actualComment = getElementText(selectComment(user).findElement(commentText));
+ assertEquals(actualComment, expectedComment, String.format("Comment not equals %s ", expectedComment));
+ return this;
}
- public void clickEditComment(String user)
+ public void openEditCommentEditor(String user)
{
+ log.info("Open edit comment editor");
mouseOver(selectComment(user));
clickElement(editCommentButton);
}
diff --git a/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPromptWindow.java b/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPromptWindow.java
index d573d36dbd..ca247cb8eb 100644
--- a/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPromptWindow.java
+++ b/alfresco-tas-share-test/src/main/java/org/alfresco/po/share/site/blog/BlogPromptWindow.java
@@ -1,5 +1,7 @@
package org.alfresco.po.share.site.blog;
+import static org.testng.Assert.assertEquals;
+
import lombok.extern.slf4j.Slf4j;
import org.alfresco.po.share.TinyMce.TinyMceEditor;
import org.alfresco.po.share.site.SiteCommon;
@@ -7,22 +9,16 @@
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
-import static org.testng.Assert.assertEquals;
-
@Slf4j
public class BlogPromptWindow extends SiteCommon
{
- private TinyMceEditor tinyMceEditor;
-
- private final By addCommentBoxLabel = By.xpath("//div[@class = 'comment-form']//h2[text()='Add Your Comment...']");
private final By addCommentButton = By.xpath("//button[contains(@id, '_default-add-submit-button')]");
- private final By cancelButtonCommentWindow = By.xpath("//button[contains(@id, '_default-add-cancel')]");
private final By saveButtonEditCommentWindow = By.xpath("//button[text()='Save']");
- private final By cancelButtonEditCommentWindow = By.xpath("//button[text()='Cancel']");
- private final By editCommentBoxLabel = By.xpath("//div[@class = 'comment-form']//h2[text()='Edit Comment...']");
private final By editorIframe = By.xpath("//div[@class = 'comment-form']//form[contains(@id, '_default-add-form')]//div[@class = 'mce-tinymce mce-container mce-panel']//iframe");
private final By editor = By.id("tinymce");
+ private final String commentBoxLabel = "//div[@class = 'comment-form']//h2[text()='%s']";
+
public BlogPromptWindow(ThreadLocal webDriver)
{
super(webDriver);
@@ -31,8 +27,7 @@ public BlogPromptWindow(ThreadLocal webDriver)
@Override
public String getRelativePath()
{
- // TODO Auto-generated method stub
- return null;
+ return "Empty relative path!";
}
public BlogPromptWindow writePostComment(String postComment)
@@ -45,11 +40,11 @@ public BlogPromptWindow writePostComment(String postComment)
return this;
}
- public BlogPromptWindow assertAddCommentLabelEqualsTo(String expectedLabel)
+ public BlogPromptWindow assertCommentBoxLabelEqualsTo(String expectedLabel)
{
- log.info("Assert Add comment label equals to {}", expectedLabel);
- String actualLabel = getElementText(addCommentBoxLabel);
- assertEquals(actualLabel, expectedLabel, String.format("Add comment label not equals %s", expectedLabel));
+ log.info("Assert comment box label equals to {}", expectedLabel);
+ String actualLabel = getElementText(By.xpath(String.format(commentBoxLabel, expectedLabel)));
+ assertEquals(actualLabel, expectedLabel, String.format("Comment box label not equals %s", expectedLabel));
return this;
}
@@ -61,34 +56,18 @@ public BlogPromptWindow addPostComment()
return this;
}
- public void clickCancelOnAddCommentWindow()
+ public void saveEditedComment()
{
- findElement(cancelButtonCommentWindow).click();
- }
-
- public void clickSaveButtonOnEditComment()
- {
- findElement(saveButtonEditCommentWindow).click();
- }
-
-
- public void clickCancelButtonOnEditComment()
- {
- findElement(cancelButtonEditCommentWindow).click();
- }
-
- public boolean isEditCommentDisplayed()
- {
- return isElementDisplayed(By.xpath("//div[@class = 'comment-form']//h2[text()='Edit Comment...']"));
- }
-
- public String getEditCommentBoxLabel()
- {
- return findElement(editCommentBoxLabel).getText();
+ log.info("Save edited comment");
+ clickElement(saveButtonEditCommentWindow);
+ waitUntilNotificationMessageDisappears();
}
- public void testEditComment(String comment)
+ public BlogPromptWindow editComment(String comment)
{
+ log.info("Edit comment {}", comment);
+ TinyMceEditor tinyMceEditor = new TinyMceEditor(webDriver);
tinyMceEditor.setText(comment);
+ return this;
}
}
diff --git a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BlogPostAddCommentTests.java b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BlogPostAddCommentTests.java
index 1ee617fda9..dff8356172 100644
--- a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BlogPostAddCommentTests.java
+++ b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BlogPostAddCommentTests.java
@@ -1,10 +1,13 @@
package org.alfresco.share.sitesFeatures.blog;
+import static org.alfresco.po.enums.BlogPostFilters.ALL_POSTS;
+import static org.alfresco.po.enums.BlogPostFilters.MY_DRAFTS_POSTS;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
import org.alfresco.dataprep.DashboardCustomization.Page;
import org.alfresco.dataprep.SitePagesService;
import org.alfresco.dataprep.SiteService;
+import org.alfresco.po.enums.BlogPostFilters;
import org.alfresco.po.share.site.blog.BlogPostListPage;
import org.alfresco.po.share.site.blog.BlogPostViewPage;
import org.alfresco.po.share.site.blog.BlogPromptWindow;
@@ -69,11 +72,13 @@ public void shouldAddCommentToBlogPost()
blogPostListPage
.navigate(siteModel.get())
- .readPost(blogTitle)
- .openCommentEditor()
- .assertAddCommentLabelEqualsTo(ADD_YOUR_COMMENT_LABEL);
+ .readPost(blogTitle);
+
+ blogPostViewPage
+ .openCommentEditor();
blogPromptWindow
+ .assertCommentBoxLabelEqualsTo(ADD_YOUR_COMMENT_LABEL)
.writePostComment(blogComment)
.addPostComment();
@@ -91,22 +96,24 @@ public void addCommentToDraftBlogPost()
blogPostListPage
.navigate(siteModel.get())
- .navigateToMyDrafts()
+ .filterPostBy(MY_DRAFTS_POSTS)
.readPost(blogTitle);
blogPostViewPage
- .openCommentEditor()
- .assertAddCommentLabelEqualsTo(ADD_YOUR_COMMENT_LABEL)
+ .openCommentEditor();
+
+ blogPromptWindow
+ .assertCommentBoxLabelEqualsTo(ADD_YOUR_COMMENT_LABEL)
.writePostComment(blogComment)
.addPostComment();
blogPostViewPage
.navigateBackToBlogList()
- .navigateToMyDrafts()
+ .filterPostBy(MY_DRAFTS_POSTS)
.assertPostNumberOfRepliesEqualTo(blogTitle, EXPECTED_NUMBER_OF_REPLIES);
blogPostListPage
- .navigateToAllFilter()
+ .filterPostBy(ALL_POSTS)
.assertPostNumberOfRepliesEqualTo(blogTitle, EXPECTED_NUMBER_OF_REPLIES);
}
diff --git a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BlogPostEditCommentsTests.java b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BlogPostEditCommentsTests.java
index b389746e4e..c10ef3e0cc 100644
--- a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BlogPostEditCommentsTests.java
+++ b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BlogPostEditCommentsTests.java
@@ -1,115 +1,128 @@
package org.alfresco.share.sitesFeatures.blog;
+import static org.alfresco.po.enums.BlogPostFilters.MY_DRAFTS_POSTS;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
+
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.alfresco.dataprep.DashboardCustomization.Page;
+import org.alfresco.dataprep.SitePagesService;
import org.alfresco.dataprep.SiteService;
import org.alfresco.po.share.site.blog.BlogPostListPage;
import org.alfresco.po.share.site.blog.BlogPostViewPage;
import org.alfresco.po.share.site.blog.BlogPromptWindow;
-import org.alfresco.share.ContextAwareWebTest;
+import org.alfresco.share.BaseTest;
import org.alfresco.testrail.TestRail;
-import org.alfresco.utility.data.RandomData;
+import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
-import org.openqa.selenium.By;
-import org.testng.Assert;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
+import org.alfresco.utility.model.UserModel;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-public class BlogPostEditCommentsTests extends ContextAwareWebTest
+public class BlogPostEditCommentsTests extends BaseTest
{
- //@Autowired
- BlogPostListPage blogPage;
-
- //@Autowired
- BlogPostViewPage blogPostView;
-
- //@Autowired
- BlogPromptWindow commentWindow;
-
- private String user = String.format("C6061User%s", RandomData.getRandomAlphanumeric());
- private String siteName = String.format("C6061SiteName%s", RandomData.getRandomAlphanumeric());
- private String description = String.format("C6061SiteDescription%s", RandomData.getRandomAlphanumeric());
- private String blogPostContentText = "C6061 post content text";
- private List tags = Collections.singletonList("tagc6011");
- private String blogPostTitleC6061 = "C6061 blog post title";
- private String comment = "C6061 comment text";
- private String commentUser = user + " " + user;
- private String editedComment = "C6061 edited comment text";
-
- @BeforeClass (alwaysRun = true)
+ private final String EMPTY_SPACE = " ";
+ private final String EDIT_COMMENT_LABEL = "Edit Comment...";
+
+ @Autowired
+ private SiteService siteService;
+
+ @Autowired
+ protected SitePagesService sitePagesService;
+
+ private BlogPostListPage blogPostListPage;
+ private BlogPostViewPage blogPostViewPage;
+ private BlogPromptWindow blogPromptWindow;
+
+ private final ThreadLocal userModel = new ThreadLocal<>();
+ private final ThreadLocal siteModel = new ThreadLocal<>();
+
+ private final String blogTitle = "Blog Title ".concat(randomAlphanumeric(5));
+ private final String blogContent = "Blog Content ".concat(randomAlphanumeric(5));
+ private final String blogComment = "Blog Comment ".concat(randomAlphanumeric(5));
+ private final List noTags = Collections.synchronizedList(new ArrayList<>());
+
+ private String fullUsername;
+ private String editedComment = "Edited Comment".concat(randomAlphanumeric(5));
+
+ @BeforeMethod(alwaysRun = true)
public void setupTest()
{
- userService.create(adminUser, adminPassword, user, password, user + domain, user, user);
- siteService.create(user, password, domain, siteName, description, SiteService.Visibility.PUBLIC);
- siteService.addPageToSite(user, password, siteName, Page.BLOG, null);
- setupAuthenticatedSession(user, password);
+ userModel.set(getDataUser().usingAdmin().createRandomTestUser());
+ siteModel.set(getDataSite().usingUser(userModel.get()).createPublicRandomSite());
+ siteService.addPageToSite(userModel.get().getUsername(), userModel.get().getPassword(),
+ siteModel.get().getId(), Page.BLOG, null);
+
+ fullUsername = userModel.get().getFirstName().concat(EMPTY_SPACE).concat(userModel.get().getLastName());
+
+ authenticateUsingCookies(userModel.get());
+
+ blogPostViewPage = new BlogPostViewPage(webDriver);
+ blogPostListPage = new BlogPostListPage(webDriver);
+ blogPromptWindow = new BlogPromptWindow(webDriver);
}
- @AfterClass (alwaysRun = true)
- public void cleanup()
+ @TestRail(id = "C6061")
+ @Test(groups = {TestGroup.SANITY, TestGroup.SITES_FEATURES})
+ public void shouldEditBlogPostComment()
{
- userService.delete(adminUser, adminPassword, user);
- contentService.deleteTreeByPath(adminUser, adminPassword, "/User Homes/" + user);
- siteService.delete(adminUser, adminPassword, siteName);
- }
+ sitePagesService.createBlogPost(userModel.get().getUsername(), userModel.get().getPassword(),
+ siteModel.get().getId(), blogTitle, blogContent, false, noTags);
+
+ sitePagesService.commentBlog(userModel.get().getUsername(), userModel.get().getPassword(),
+ siteModel.get().getId(), blogTitle, false, blogComment);
+ blogPostListPage
+ .navigate(siteModel.get())
+ .readPost(blogTitle);
- @TestRail (id = "C6061")
- @Test (groups = { TestGroup.SANITY, TestGroup.SITES_FEATURES })
+ blogPostViewPage
+ .openEditCommentEditor(fullUsername);
- public void editBlogPostComment()
+ blogPromptWindow
+ .assertCommentBoxLabelEqualsTo(EDIT_COMMENT_LABEL)
+ .editComment(editedComment)
+ .saveEditedComment();
+
+ blogPostViewPage
+ .assertCommentEqualsTo(fullUsername, editedComment);
+ }
+
+ @TestRail(id = "C6062")
+ @Test(groups = {TestGroup.SANITY, TestGroup.SITES_FEATURES})
+ public void shouldEditDraftBlogPostComment()
{
- sitePagesService.createBlogPost(user, password, siteName, blogPostTitleC6061, blogPostContentText, false, tags);
- sitePagesService.commentBlog(user, password, siteName, blogPostTitleC6061, false, comment);
+ sitePagesService.createBlogPost(userModel.get().getUsername(), userModel.get().getPassword(),
+ siteModel.get().getId(), blogTitle, blogContent, true, noTags);
- blogPage.navigate(siteName);
- blogPage.readPost(blogPostTitleC6061);
+ sitePagesService.commentBlog(userModel.get().getUsername(), userModel.get().getPassword(),
+ siteModel.get().getId(), blogTitle, true, blogComment);
- LOG.info("Step 1: Click Edit to the right of the comment.");
- blogPostView.clickEditComment(commentUser);
- getBrowser().waitUntilElementVisible(By.xpath("//div[@class = 'comment-form']//h2[text()='Edit Comment...']"));
- Assert.assertEquals(commentWindow.getEditCommentBoxLabel(), "Edit Comment...");
+ blogPostListPage
+ .navigate(siteModel.get())
+ .filterPostBy(MY_DRAFTS_POSTS)
+ .readPost(blogTitle);
- LOG.info("Step 2: Type your comment in the Add Your Comment box.");
- commentWindow.testEditComment(editedComment);
+ blogPostViewPage
+ .openEditCommentEditor(fullUsername);
- LOG.info("Step 3: Click the Save button");
- commentWindow.clickSaveButtonOnEditComment();
- getBrowser().waitUntilElementVisible(blogPostView.commentText);
- Assert.assertEquals(blogPostView.getCommentText(commentUser), editedComment);
- }
+ blogPromptWindow
+ .assertCommentBoxLabelEqualsTo(EDIT_COMMENT_LABEL)
+ .editComment(editedComment)
+ .saveEditedComment();
- @TestRail (id = "C6062")
- @Test (groups = { TestGroup.SANITY, TestGroup.SITES_FEATURES })
+ blogPostViewPage
+ .assertCommentEqualsTo(fullUsername, editedComment);
+ }
- public void editDraftBlogPostComment()
+ @AfterMethod(alwaysRun = true)
+ public void cleanupTest()
{
- LOG.info("Test setup");
- String blogPostTitleC6062 = "C6062 Blog post title";
- String commentC6062 = "C6062 Comment";
- String C6062editedComment = "C6062 edited comment";
- sitePagesService.createBlogPost(user, password, siteName, blogPostTitleC6062, blogPostContentText, true, tags);
- sitePagesService.commentBlog(user, password, siteName, blogPostTitleC6062, true, commentC6062);
-
- LOG.info("Step 1: Click edit for Draft Comment");
- blogPage.navigate(siteName);
- blogPage.navigateToMyDrafts();
- blogPage.readPost(blogPostTitleC6062);
- blogPostView.clickEditComment(commentUser);
- getBrowser().waitUntilElementVisible(By.xpath("//div[@class = 'comment-form']//h2[text()='Edit Comment...']"));
- Assert.assertEquals(commentWindow.getEditCommentBoxLabel(), "Edit Comment...");
-
- LOG.info("Step 2: Type your comment in the Add Your Comment box.");
- commentWindow.testEditComment(C6062editedComment);
-
- LOG.info("Step 3: Click the Save button");
- commentWindow.clickSaveButtonOnEditComment();
- getBrowser().waitUntilElementVisible(blogPostView.commentText);
- getBrowser().waitUntilElementContainsText(getBrowser().findElement(blogPostView.commentText), C6062editedComment);
- Assert.assertEquals(blogPostView.getCommentText(commentUser), C6062editedComment);
+ deleteSitesIfNotNull(siteModel.get());
+ deleteUsersIfNotNull(userModel.get());
}
-
}
diff --git a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BrowsingBlogPostsTests.java b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BrowsingBlogPostsTests.java
index 9e79a74956..c4a5c6bf0e 100644
--- a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BrowsingBlogPostsTests.java
+++ b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/BrowsingBlogPostsTests.java
@@ -1,5 +1,9 @@
package org.alfresco.share.sitesFeatures.blog;
+import static org.alfresco.po.enums.BlogPostFilters.ALL_POSTS;
+import static org.alfresco.po.enums.BlogPostFilters.LATEST_POSTS;
+import static org.alfresco.po.enums.BlogPostFilters.MY_DRAFTS_POSTS;
+import static org.alfresco.po.enums.BlogPostFilters.MY_PUBLISHED_POSTS;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
@@ -10,6 +14,7 @@
import org.alfresco.dataprep.DashboardCustomization.Page;
import org.alfresco.dataprep.SiteService;
+import org.alfresco.po.enums.BlogPostFilters;
import org.alfresco.po.share.site.blog.BlogPostListPage;
import org.alfresco.share.ContextAwareWebTest;
import org.alfresco.testrail.TestRail;
@@ -76,7 +81,7 @@ public void browseTheBlogPosts()
blogPage.navigate(siteName);
LOG.info("Step 1: Click the 'All' view.");
- blogPage.navigateToAllFilter();
+ blogPage.filterPostBy(ALL_POSTS);
LOG.info("Step 2: Check that all published blog posts are displayed");
assertEquals(blogPage.getPageTitle(), "All Posts");
@@ -94,10 +99,10 @@ public void browseTheBlogPosts()
public void browseTheBlogPostsLatestPosts()
{
blogPage.navigate(siteName);
- blogPage.navigateToAllFilter();
+ blogPage.filterPostBy(ALL_POSTS);
LOG.info("Step 1: Click on Latest filter");
- blogPage.clickLatestFilter();
+ blogPage.filterPostBy(LATEST_POSTS);
LOG.info("Step 2: Check that only published blog posts are displayed. Drafts should not be displayed");
assertEquals(blogPage.getPageTitle(), "New Posts");
@@ -116,7 +121,7 @@ public void browseTheBlogPostsMyDrafts()
blogPage.navigate(siteName);
LOG.info("Step 1: Click on My Drafts filter");
- blogPage.navigateToMyDrafts();
+ blogPage.filterPostBy(MY_DRAFTS_POSTS);
LOG.info("Step 2: Check that only the draft blog posts of user1 are displayed");
assertEquals(blogPage.getPageTitle(), "My Draft Posts");
@@ -133,7 +138,7 @@ public void browseTheBlogPostsMyPublishedPosts()
blogPage.navigate(siteName);
LOG.info("Step 1: Click on My Published Filter");
- blogPage.clickMyPublishedFilter();
+ blogPage.filterPostBy(MY_PUBLISHED_POSTS);
LOG.info("Step 2 : Check that only blog posts published by User1 are displayed");
assertEquals(blogPage.getPageTitle(), "My Published Posts");
diff --git a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/CreatingABlogPostTests.java b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/CreatingABlogPostTests.java
index 06fdde9d72..dde4af4502 100644
--- a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/CreatingABlogPostTests.java
+++ b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/CreatingABlogPostTests.java
@@ -1,9 +1,12 @@
package org.alfresco.share.sitesFeatures.blog;
+import static org.alfresco.po.enums.BlogPostFilters.ALL_POSTS;
+
import java.util.Collections;
import org.alfresco.dataprep.DashboardCustomization.Page;
import org.alfresco.dataprep.SiteService;
+import org.alfresco.po.enums.BlogPostFilters;
import org.alfresco.po.share.site.blog.BlogPostListPage;
import org.alfresco.po.share.site.blog.BlogPostViewPage;
import org.alfresco.po.share.site.blog.CreateBlogPostPage;
@@ -159,7 +162,7 @@ public void creatingANewDraftPost()
Assert.assertFalse(blogPostList.isBlogPostDisplayed(blogPostTitleC5541), "Blog post is displayed on the Blog Post List View");
LOG.info("Step 6: Click the All filter'");
- blogPostList.navigateToAllFilter();
+ blogPostList.filterPostBy(ALL_POSTS);
Assert.assertTrue(blogPostList.isBlogPostDisplayed(blogPostTitleC5541),
"Blog post is not displayed on the Blog Post List View when All filter is applied");
}
@@ -223,7 +226,7 @@ public void creatingANewDraftBlogPostFromBlogPostView()
Assert.assertFalse(blogPostList.isBlogPostDisplayed(blogPostTitleC6120), "Draft blog post is displayed on the Blog Post List page.");
LOG.info("Step 5: Click All filter");
- blogPostList.navigateToAllFilter();
+ blogPostList.filterPostBy(ALL_POSTS);
Assert.assertTrue(blogPostList.isBlogPostDisplayed(blogPostTitleC6120), "Draft blog post is not displayed when All filter is applied.");
}
}
diff --git a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/DeletingABlogPostTests.java b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/DeletingABlogPostTests.java
index adc662fd97..7171192c8c 100644
--- a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/DeletingABlogPostTests.java
+++ b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/DeletingABlogPostTests.java
@@ -1,10 +1,13 @@
package org.alfresco.share.sitesFeatures.blog;
+import static org.alfresco.po.enums.BlogPostFilters.ALL_POSTS;
+
import java.util.Collections;
import java.util.List;
import org.alfresco.dataprep.DashboardCustomization.Page;
import org.alfresco.dataprep.SiteService;
+import org.alfresco.po.enums.BlogPostFilters;
import org.alfresco.po.share.DeleteDialog;
import org.alfresco.po.share.site.blog.BlogPostListPage;
import org.alfresco.po.share.site.blog.BlogPostViewPage;
@@ -87,7 +90,7 @@ public void deletingADraftBlogPostDirectlyFromBlogPage()
List tags = Collections.singletonList("c5957tag");
sitePagesService.createBlogPost(user, password, siteName, blogPostTitleC5957, blogPostContentTextC5957, true, tags);
blogPage.navigate(siteName);
- blogPage.navigateToMyDrafts();
+// blogPage.filterPostBy();
LOG.info("Test steps");
LOG.info("Step 1: Click Delete for draft blog post");
@@ -98,7 +101,7 @@ public void deletingADraftBlogPostDirectlyFromBlogPage()
LOG.info("Step 2: Click Delete button on the Delete Blog Post prompt");
deleteDialog.clickDelete();
// TODO get popup text for Post Deleted
- blogPage.navigateToMyDrafts();
+// blogPage.filterPostBy();
getBrowser().waitUntilElementContainsText(getBrowser().findElement(By.cssSelector("tbody.yui-dt-message")), "No blog posts found");
Assert.assertEquals(blogPage.assertBlogContentEqualsTo(""), "No blog posts found");
}
@@ -124,7 +127,7 @@ public void deletingABlogPostFromBlogPostView()
getBrowser().waitUntilElementContainsText(blogPage.pageTitle, "New Posts");
Assert.assertEquals(blogPage.assertBlogContentEqualsTo(""), "No blog posts found");
// TODO get popup text for Post Deleted
- blogPage.navigateToAllFilter();
+ blogPage.filterPostBy(ALL_POSTS);
getBrowser().waitUntilElementContainsText(blogPage.pageTitle, "All Posts");
Assert.assertEquals(blogPage.assertBlogContentEqualsTo(""), "No blog posts found");
}
@@ -138,7 +141,7 @@ public void deletingABlogDraftPostFromBlogPostView()
String blogPostTitleC5967 = "C5967 blog post title";
sitePagesService.createBlogPost(user, password, siteName, blogPostTitleC5967, blogPostContentText, true, tags);
blogPage.navigate(siteName);
- blogPage.navigateToMyDrafts();
+// blogPage.filterPostBy();
blogPage.readPost(blogPostTitleC5967);
LOG.info("Test Steps");
@@ -152,7 +155,7 @@ public void deletingABlogDraftPostFromBlogPostView()
getBrowser().waitUntilElementContainsText(blogPage.pageTitle, "New Posts");
Assert.assertEquals(blogPage.getPageTitle(), "New Posts");
Assert.assertEquals(blogPage.assertBlogContentEqualsTo(""), "No blog posts found");
- blogPage.navigateToMyDrafts();
+// blogPage.filterPostBy();
getBrowser().waitUntilElementContainsText(getBrowser().findElement(By.cssSelector("tbody.yui-dt-message")), "No blog posts found");
Assert.assertEquals(blogPage.assertBlogContentEqualsTo(""), "No blog posts found");
}
diff --git a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/DeletingACommentTests.java b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/DeletingACommentTests.java
index a3e077cf4f..fd16cfd3ac 100644
--- a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/DeletingACommentTests.java
+++ b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/DeletingACommentTests.java
@@ -85,7 +85,7 @@ public void deletingACommentOfADraftPost()
sitePagesService.commentBlog(user, password, siteName, blogPostTitleC6064, true, comment);
blogPage.navigate(siteName);
- blogPage.navigateToMyDrafts();
+// blogPage.filterPostBy();
blogPage.readPost(blogPostTitleC6064);
LOG.info("Step 1: Click Delete Comment to the right of the comment.");
diff --git a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/EditingABlogPostTests.java b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/EditingABlogPostTests.java
index 4f097f62e5..6a1f3f30b3 100644
--- a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/EditingABlogPostTests.java
+++ b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/EditingABlogPostTests.java
@@ -1,11 +1,14 @@
package org.alfresco.share.sitesFeatures.blog;
+import static org.alfresco.po.enums.BlogPostFilters.ALL_POSTS;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.alfresco.dataprep.DashboardCustomization.Page;
import org.alfresco.dataprep.SiteService;
+import org.alfresco.po.enums.BlogPostFilters;
import org.alfresco.po.share.site.blog.BlogPostListPage;
import org.alfresco.po.share.site.blog.BlogPostViewPage;
import org.alfresco.po.share.site.blog.EditBlogPostPage;
@@ -134,7 +137,7 @@ public void editABlogDraftPostDirectlyFromBlogPage()
LOG.info("Test steps");
LOG.info("Step 1: Select the draft post and click the Edit button");
- blogPage.navigateToAllFilter();
+ blogPage.filterPostBy(ALL_POSTS);
blogPage.selectBlogPostWithTitle(blogTitle);
blogPage.clickEditButton(blogTitle);
Assert.assertEquals(editBlogPost.getEditBlogPostPageTitle(), expectedPageTitle);
@@ -161,9 +164,9 @@ private void editBlogDraftPostFromBlogPostView()
LOG.info("Test Setup");
String blogPostTitleC6108 = "C5967 blog post title";
sitePagesService.createBlogPost(user, password, siteName, blogPostTitleC6108, blogPostContentText, true, tags);
- blogPage.navigate(siteName);
- blogPage.navigateToMyDrafts();
- blogPage.readPost(blogPostTitleC6108);
+// blogPage.navigate(siteName);
+// blogPage.filterPostBy();
+// blogPage.readPost(blogPostTitleC6108);
String newTitle = "C6108 edited title";
String newContent = "C6108 edited content";
@@ -202,13 +205,13 @@ public void editABlogDraftPostAndPublishIt()
String newContent = "C6110 edited content";
String newTag = "c6110editedtag";
sitePagesService.createBlogPost(user, password, siteName, blogTitle, blogContent, true, tags);
- blogPage.navigate(siteName);
+// blogPage.navigate(siteName);
LOG.info("Test steps");
LOG.info("Step 1: Select the draft post and click the Edit button");
- blogPage.navigateToAllFilter();
- blogPage.selectBlogPostWithTitle(blogTitle);
- blogPage.clickEditButton(blogTitle);
+// blogPage.navigateToAllFilter();
+// blogPage.selectBlogPostWithTitle(blogTitle);
+// blogPage.clickEditButton(blogTitle);
Assert.assertEquals(editBlogPost.getEditBlogPostPageTitle(), expectedPageTitle);
LOG.info("Step 2: Update title, content, tag then click Publish Internally button.");
@@ -225,7 +228,7 @@ public void editABlogDraftPostAndPublishIt()
LOG.info("Step 3: Go to Blog post list");
blogPostView.navigateBackToBlogList();
Assert.assertTrue(blogPage.isBlogPostDisplayed(newTitle), "The blog post is not visible in the Latest view");
- blogPage.navigateToMyDrafts();
+// blogPage.filterPostBy();
getBrowser().waitUntilElementsVisible(By.xpath("//td[@class = 'yui-dt-empty']//div[text() = 'No blog posts found']"));
Assert.assertFalse(blogPage.isBlogPostDisplayed(newTitle), "The blog post is still displayed in My Drafts view");
Assert.assertFalse(blogPage.isBlogPostDisplayed(blogTitle), "The original draft blog post is still displayed in My Drafts view");
diff --git a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/ViewingABlogPostTests.java b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/ViewingABlogPostTests.java
index 6900a83916..ae3c9d7765 100644
--- a/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/ViewingABlogPostTests.java
+++ b/alfresco-tas-share-test/src/test/java/org/alfresco/share/sitesFeatures/blog/ViewingABlogPostTests.java
@@ -1,5 +1,6 @@
package org.alfresco.share.sitesFeatures.blog;
+import static org.alfresco.po.enums.BlogPostFilters.ALL_POSTS;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
@@ -8,6 +9,7 @@
import org.alfresco.dataprep.DashboardCustomization.Page;
import org.alfresco.dataprep.SiteService;
+import org.alfresco.po.enums.BlogPostFilters;
import org.alfresco.po.share.site.blog.BlogPostListPage;
import org.alfresco.po.share.site.blog.BlogPostViewPage;
import org.alfresco.po.share.site.blog.EditBlogPostPage;
@@ -110,7 +112,7 @@ public void visibilityOfPublishedDraft()
blogPostListPage.navigate(siteName);
LOG.info("Step 1: Click 'All' view.");
- blogPostListPage.navigateToAllFilter();
+ blogPostListPage.filterPostBy(ALL_POSTS);
assertEquals(blogPostListPage.assertBlogContentEqualsTo(""), "No blog posts found");
assertFalse(blogPostListPage.isBlogPostDisplayed(blogTitleUser2Draft), "Blog post draft of user 2 is visible for user one before it was published");
@@ -118,7 +120,7 @@ public void visibilityOfPublishedDraft()
userService.logout();
setupAuthenticatedSession(user2, password);
blogPostListPage.navigate(siteName);
- blogPostListPage.navigateToMyDrafts();
+// blogPostListPage.filterPostBy();
Assert.assertTrue(blogPostListPage.isBlogPostDisplayed(blogTitleUser2Draft), "Draft blog post of user 2 is not displayed");
@@ -136,7 +138,7 @@ public void visibilityOfPublishedDraft()
userService.logout();
setupAuthenticatedSession(user1, password);
blogPostListPage.navigate(siteName);
- blogPostListPage.navigateToAllFilter();
+ blogPostListPage.filterPostBy(ALL_POSTS);
// assertEquals(blogPostListPage.getBlogPostTitle(blogPostListPage.getBlogPostTitle(blogTitleUser2Draft)), blogTitleUser2Draft);
}
}