mirror of
https://github.com/Alfresco/alfresco-sdk.git
synced 2025-05-19 17:15:24 +00:00
DEVPLAT-6: Fix regression and functional IT (still needs proper release of share-po)
This commit is contained in:
parent
cf86202c28
commit
4c0e340ab4
@ -56,13 +56,13 @@
|
||||
|
||||
<module id="share-amp" dir="share-amp" name="share-amp">
|
||||
<fileSets>
|
||||
<fileSet filtered="false" packaged="true" encoding="UTF-8">
|
||||
<fileSet filtered="true" packaged="true" encoding="UTF-8">
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet filtered="false" packaged="true" encoding="UTF-8">
|
||||
<fileSet filtered="true" packaged="true" encoding="UTF-8">
|
||||
<directory>src/test/java</directory>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
@ -74,7 +74,7 @@
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet encoding="UTF-8" filtered="false">
|
||||
<fileSet filtered="true" packaged="false" encoding="UTF-8">
|
||||
<directory>src/test/resources</directory>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
|
@ -23,9 +23,9 @@
|
||||
-->
|
||||
<properties>
|
||||
<!-- The following are default values for data location, Alfresco Community version, and Records Management Module version.
|
||||
Uncomment if you need to change (Note. current default version for Enterprise edition is 5.0.1)
|
||||
<alfresco.version>5.0.d</alfresco.version>
|
||||
<alfresco.rm.version>2.3</alfresco.rm.version>
|
||||
Uncomment if you need to change (Note. current default version for Enterprise edition is @@alfresco.enterprise.default.version@@)
|
||||
<alfresco.version>@@alfresco.community.default.version@@</alfresco.version>
|
||||
<alfresco.rm.version>@@alfresco.rm.version@@</alfresco.rm.version>
|
||||
<alfresco.data.location>alf_data_dev</alfresco.data.location> -->
|
||||
|
||||
<!-- This control the root logging level for all apps uncomment and change, defaults to WARN
|
||||
@ -36,6 +36,13 @@
|
||||
for embedded run, defaults to the 'local' environment. See SDK Parent POM for more info.
|
||||
<env>local</env>
|
||||
-->
|
||||
|
||||
<!-- The Alfresco Share web application is accessible via this URL -->
|
||||
<share.client.url>http://localhost:8080/share</share.client.url>
|
||||
|
||||
<!-- For the Regression tests and Functional tests
|
||||
we are using the following Share Page Objects (PO) release -->
|
||||
<share.po.version>5.1-SNAPSHOT</share.po.version>
|
||||
</properties>
|
||||
|
||||
<!-- Here we realize the connection with the Alfresco selected platform (e.g.version and edition) -->
|
||||
|
@ -2,9 +2,9 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<name>Alfresco, Share and Solr Tomcat Runner</name>
|
||||
<name>Alfresco, Share and Solr4 Tomcat Runner</name>
|
||||
<packaging>pom</packaging>
|
||||
<description>Alfresco, Share and Solr Tomcat Runner</description>
|
||||
<description>Alfresco, Share and Solr4 Tomcat Runner</description>
|
||||
|
||||
<parent>
|
||||
<groupId>${groupId}</groupId>
|
||||
@ -25,6 +25,7 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- Copy and filter webapp context files - output dir is runner/target/contexts -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
@ -72,7 +73,9 @@
|
||||
<systemProperties>
|
||||
<solr.solr.home>${alfresco.solr.home.dir}</solr.solr.home>
|
||||
</systemProperties>
|
||||
<!-- Prevent classloader delegation, each webapp loads.
|
||||
<!-- Should this class loader delegate to the parent class loader before searching its
|
||||
own repositories (i.e. the usual Java2 delegation model) -->
|
||||
<!-- Prevent parent classloader delegation, each webapp loads.
|
||||
If set to true then you will get a truckload of Solr logging as
|
||||
the alf_data_dev/solr4/config/log4j-solr.properties file is not picked up.
|
||||
This also fixes issues with the Google Guava Library, which this tomcat plugin uses
|
||||
@ -84,7 +87,8 @@
|
||||
<artifactId>repo</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>war</type>
|
||||
<!-- Make sure webapp is loaded as webapp and not as just context -->
|
||||
<!-- Make sure webapp is loaded with context and everything,
|
||||
if set to 'false' then you will get 404 when trying to access the webapp from browser -->
|
||||
<asWebapp>true</asWebapp>
|
||||
<contextPath>/alfresco</contextPath>
|
||||
<contextFile>${project.build.directory}/contexts/context-repo.xml</contextFile>
|
||||
@ -105,7 +109,7 @@
|
||||
<type>war</type>
|
||||
<asWebapp>true</asWebapp>
|
||||
<contextPath>/solr4</contextPath>
|
||||
<contextFile>${alfresco.solr.home.dir}/context.xml</contextFile>
|
||||
<contextFile>${project.build.directory}/contexts/context-solr.xml</contextFile>
|
||||
</webapp>
|
||||
</webapps>
|
||||
</configuration>
|
||||
@ -114,18 +118,30 @@
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<!-- Runs regression tests using Alfresco Share PO (Page Object) vanilla Selenium / Webdrone driven functional test, during integration-test phase.
|
||||
NOTE: Assumes an already running Alfresco + Share at the default location ${app.share.url} (e.g. by invoking -Prun,regression) -->
|
||||
<!-- Runs Share User Interface regression tests using Alfresco Share PO (Page Object) vanilla Selenium / Webdrone (WebDriver wrapper).
|
||||
NOTE: Assumes an already running Alfresco + Share at the default location ${share.client.url}
|
||||
(e.g. by invoking:
|
||||
$ mvn clean install -Prun,regression-testing
|
||||
to run a specific test do:
|
||||
$ mvn clean install -Prun,regression-testing -Dit.test=LoginPageTest
|
||||
-->
|
||||
<profile>
|
||||
<id>regression</id>
|
||||
<id>regression-testing</id>
|
||||
<properties>
|
||||
<!-- Re-configure Tomcat 7 Plugin (see run profile) to fork so we can run tests in parallel -->
|
||||
<!-- Note. the fork option does not fork a new JVM. Rather it is run in a thread created by the
|
||||
Maven Launcher class (org.codehaus.plexus.classworlds.launcher.Launcher) that is invoked by the mvn command. -->
|
||||
<maven.tomcat.fork>true</maven.tomcat.fork>
|
||||
<!-- The URL Under Test -->
|
||||
<app.share.url>http://localhost:8080/share</app.share.url>
|
||||
|
||||
<!-- Make sure we are actually testing something -->
|
||||
<skipTests>false</skipTests>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- Workaround for classloading issue in share-po (need to unpack it) -->
|
||||
<!-- Need to unpack the tests becuase of Jiras: -->
|
||||
<!-- https://jira.codehaus.org/browse/SUREFIRE-997 -->
|
||||
<!-- https://jira.codehaus.org/browse/SUREFIRE-1024 -->
|
||||
<!-- Workaround for classloading issue in share-po (need to unpack it)-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
@ -137,77 +153,82 @@
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifact>${alfresco.groupId}:share-po:${alfresco.version}:jar:tests</artifact>
|
||||
<artifact>${alfresco.groupId}:share-po:${share.po.version}:jar:tests</artifact>
|
||||
<outputDirectory>${project.build.directory}/testng-resources</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.17</version>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.18.1</version>
|
||||
<configuration>
|
||||
<suiteXmlFiles>
|
||||
<!-- Smaller test suite for Share, essential stuff like Login, Navigation, DocLib, and Search -->
|
||||
<suiteXmlFile>${project.build.directory}/testng-resources/testng-alfresco-share.xml</suiteXmlFile>
|
||||
|
||||
<!-- Everthing takes a long time, hours-->
|
||||
<!--<suiteXmlFile>${project.build.directory}/testng-resources/testng.xml</suiteXmlFile> -->
|
||||
</suiteXmlFiles>
|
||||
<testClassesDirectory>${project.build.directory}/testng-resources</testClassesDirectory>
|
||||
<systemPropertyVariables>
|
||||
<!-- Where is the Alfresco Share Webapp that we are testing -->
|
||||
<share.target>${share.client.url}</share.target>
|
||||
</systemPropertyVariables>
|
||||
|
||||
<!-- The out-of-the-box Alfresco Share PO test classes does not follow the *IT.java
|
||||
naming convention, they use *Test.java, so need to add that -->
|
||||
<includes>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>run-regression-tests</id>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<id>regression-tests</id>
|
||||
<phase>integration-test</phase>
|
||||
<configuration>
|
||||
<systemProperties>
|
||||
<share.target>${app.share.url}</share.target>
|
||||
</systemProperties>
|
||||
<dependenciesToScan>
|
||||
<dependency>${alfresco.groupId}:share-po</dependency>
|
||||
</dependenciesToScan>
|
||||
<additionalClasspathElements>
|
||||
<additionalClasspathElement>${project.build.directory}/testng-resources</additionalClasspathElement>
|
||||
</additionalClasspathElements>
|
||||
<suiteXmlFiles>
|
||||
<suiteXmlFile>${project.build.directory}/testng-resources/testng.xml</suiteXmlFile>
|
||||
</suiteXmlFiles>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>verify-tests</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<!-- Bring in the Share Page Objects (PO) used in the regression tests -->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>share-po</artifactId>
|
||||
<version>${alfresco.version}</version>
|
||||
<version>${share.po.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- Bring in the Share Page Object (PO) regression tests that comes with Alfresco.
|
||||
These tests cover the Alfresco Share Web Application -->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>share-po</artifactId>
|
||||
<version>${alfresco.version}</version>
|
||||
<version>${share.po.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-cli</groupId>
|
||||
<artifactId>commons-cli</artifactId>
|
||||
<version>1.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Test NG is defined with test scope in share-po, so need it here too -->
|
||||
<!-- Alfresco code creates a wrapper around Test NG -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
<version>3.1.1.RELEASE</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>3.1.1.RELEASE</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
<version>6.8.8</version>
|
||||
<groupId>org.alfresco.test</groupId>
|
||||
<artifactId>alfresco-testng</artifactId>
|
||||
<version>1.1</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@ -219,7 +240,94 @@
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
<!-- Runs functional domain specific tests using Alfresco Share PO (Page Object) vanilla Selenium / Webdrone (WebDriver wrapper).
|
||||
NOTE: Assumes an already running Alfresco + Share at the default location ${share.client.url}
|
||||
(e.g. by invoking:
|
||||
$ mvn clean install -Prun,functional-testing
|
||||
to run a specific test do:
|
||||
$ mvn clean install -Prun,functional-testing -Dit.test=DemoPageTestIT
|
||||
-->
|
||||
<profile>
|
||||
<id>functional-testing</id>
|
||||
<properties>
|
||||
<!-- Re-configure Tomcat 7 Plugin (see run profile) to fork so we can run tests in parallel -->
|
||||
<!-- Note. the fork option does not fork a new JVM. Rather it is run in a thread created by the
|
||||
Maven Launcher class (org.codehaus.plexus.classworlds.launcher.Launcher) that is invoked by the mvn command. -->
|
||||
<maven.tomcat.fork>true</maven.tomcat.fork>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.18.1</version>
|
||||
<configuration>
|
||||
<suiteXmlFiles>
|
||||
<suiteXmlFile>${project.parent.basedir}/share-amp/target/test-classes/testng.xml</suiteXmlFile>
|
||||
</suiteXmlFiles>
|
||||
<testClassesDirectory>${project.parent.basedir}/share-amp/target/test-classes</testClassesDirectory>
|
||||
<systemPropertyVariables>
|
||||
<!-- Where is the Alfresco Share Webapp that we are testing -->
|
||||
<share.target>${share.client.url}</share.target>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>functional-tests</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>integration-test</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>verify-tests</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>verify</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<!-- Bring in the Share Page Objects (PO) used in our functional tests.
|
||||
Without it TestNG cannot load our test class when it uses page objects such as LoginPage -->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>share-po</artifactId>
|
||||
<version>${share.po.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Bring in the Share Page Object (PO) Tests that comes with Alfresco. It has
|
||||
the org.alfresco.po.share.AbstractTest class that our custom tests extend.
|
||||
Without it TestNG cannot load our test class -->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>share-po</artifactId>
|
||||
<version>${share.po.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Test NG is defined with test scope in share-po, so need it here too -->
|
||||
<!-- Alfresco code creates a wrapper around Test NG -->
|
||||
<dependency>
|
||||
<groupId>org.alfresco.test</groupId>
|
||||
<artifactId>alfresco-testng</artifactId>
|
||||
<version>1.1</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Context>
|
||||
<Environment name="solr/home" type="java.lang.String" value="${project.parent.basedir}/alf_data_dev/solr4/config/" override="true"/>
|
||||
<Environment name="solr/model/dir" type="java.lang.String" value="${project.parent.basedir}/alf_data_dev/solr4/config/alfrescoModels/" override="true"/>
|
||||
<Environment name="solr/content/dir" type="java.lang.String" value="${project.parent.basedir}/alf_data_dev/solr4/data/content/" override="true"/>
|
||||
|
||||
<!-- Pick up static resource files from any Solr extensions, being it a JAR or an AMP,
|
||||
by default there are no extensions, just the standard Solr webapp files.
|
||||
(this should not include docBase)-->
|
||||
<Resources className="org.apache.naming.resources.VirtualDirContext"
|
||||
extraResourcePaths="/=${project.parent.basedir}/runner/target/tomcat/webapps/alfresco-solr4" />
|
||||
|
||||
<!-- Configure where the Solr (solr4.war) web application can load classes, test classes, and config -->
|
||||
<!-- Solr is not customized by default so just points to standard Solr classes. -->
|
||||
<!-- Setup the virtual class path like this:
|
||||
1) target/classes
|
||||
3) target/test-classes
|
||||
|
||||
This way mvn compile can be invoked and all changes will be picked up-->
|
||||
|
||||
<Loader className="org.apache.catalina.loader.VirtualWebappLoader"
|
||||
searchVirtualFirst="true"
|
||||
virtualClasspath="${project.parent.basedir}/runner/target/tomcat/webapps/alfresco-solr4/WEB-INF/classes" />
|
||||
|
||||
<!-- Load from all directories, not just when the META-INF directory is found in exploded JAR -->
|
||||
<JarScanner scanAllDirectories="true" />
|
||||
</Context>
|
@ -14,19 +14,19 @@
|
||||
</parent>
|
||||
|
||||
<!--
|
||||
| SDK properties have sensible defaults in the SDK parent,
|
||||
| but you can override the properties below to use another version.
|
||||
| For more available properties see the alfresco-sdk-parent POM.
|
||||
SDK properties have sensible defaults in the SDK parent,
|
||||
but you can override the properties below to use another version.
|
||||
For more available properties see the alfresco-sdk-parent POM.
|
||||
-->
|
||||
<properties>
|
||||
<!-- Defines the target WAR artifactId to run this amp, only used with the -Pamp-to-war switch
|
||||
| Allowed values: alfresco | share. In this case it's configured to use OOTB share -->
|
||||
Allowed values: alfresco | share. In this case it's configured to use OOTB share -->
|
||||
<alfresco.client.war>share</alfresco.client.war>
|
||||
|
||||
<!-- Since Alfresco is already running on port 8080, we run Share on port 8081 -->
|
||||
<!-- Since Alfresco Repository is already running on port 8080, we run Share on port 8081 -->
|
||||
<maven.tomcat.port>8081</maven.tomcat.port>
|
||||
|
||||
<!-- Used in share-config-custom.xml. By default points to standard location of Alfresco -->
|
||||
<!-- Used in share-config-custom.xml. By default points to standard location of Alfresco Repository -->
|
||||
<alfresco.repo.url>http://localhost:8080/alfresco</alfresco.repo.url>
|
||||
|
||||
<!-- Defines the log level used in log4j.properties -->
|
||||
@ -50,6 +50,44 @@
|
||||
<artifactId>spring-surf-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!--===============================================================
|
||||
The following dependencies are needed to be able to compile the
|
||||
custom functional tests that are based on Page Objects (PO)
|
||||
===============================================================-->
|
||||
|
||||
<!-- Bring in the Share Page Objects (PO) used in our functional tests.
|
||||
It contains page objects such as LoginPage -->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>share-po</artifactId>
|
||||
<version>${share.po.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- Bring in the Share Page Object (PO) Tests that comes with Alfresco. It has
|
||||
the org.alfresco.po.share.AbstractTest class that our custom tests extend. -->
|
||||
<dependency>
|
||||
<groupId>${alfresco.groupId}</groupId>
|
||||
<artifactId>share-po</artifactId>
|
||||
<version>${share.po.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- Test NG is defined with test scope in share-po, so need it here too -->
|
||||
<!-- Alfresco code creates a wrapper around Test NG -->
|
||||
<dependency>
|
||||
<groupId>org.alfresco.test</groupId>
|
||||
<artifactId>alfresco-testng</artifactId>
|
||||
<version>1.1</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-core</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -6,22 +6,24 @@ model.jsonModel = {
|
||||
title: "This is a simple page"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "MY_HORIZONTAL_WIDGET_LAYOUT",
|
||||
name: "alfresco/layout/HorizontalWidgets",
|
||||
config: {
|
||||
widgetWidth: 50,
|
||||
widgets: [
|
||||
{
|
||||
name: "alfresco/logo/Logo",
|
||||
config: {
|
||||
logoClasses: "alfresco-logo-only"
|
||||
{
|
||||
id: "MY_HORIZONTAL_WIDGET_LAYOUT",
|
||||
name: "alfresco/layout/HorizontalWidgets",
|
||||
config: {
|
||||
widgetWidth: 50,
|
||||
widgets: [
|
||||
{
|
||||
id: "DEMO_SIMPLE_LOGO",
|
||||
name: "alfresco/logo/Logo",
|
||||
config: {
|
||||
logoClasses: "alfresco-logo-only"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "DEMO_SIMPLE_MSG",
|
||||
name: "example/widgets/TemplateWidget"
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "example/widgets/TemplateWidget"
|
||||
}
|
||||
]
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
}]
|
||||
};
|
@ -0,0 +1,92 @@
|
||||
#set($symbol_pound='#')
|
||||
#set($symbol_dollar='$')
|
||||
#set($symbol_escape='\' )
|
||||
/*
|
||||
* Copyright (C) 2005-2015 Alfresco Software Limited.
|
||||
* This file is part of Alfresco
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ${package}.demoamp;
|
||||
|
||||
import ${package}.demoamp.po.DemoPage;
|
||||
import org.alfresco.po.share.AbstractTest;
|
||||
import org.alfresco.po.share.LoginPage;
|
||||
import org.alfresco.po.share.PeopleFinderPage;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* Functional test that demonstrates how to write and
|
||||
* extend an alfresco share page object.
|
||||
* This test shows the interaction with page objects
|
||||
* brought from share-po project along with newly created ones
|
||||
* that are present in the Demo amp.
|
||||
*
|
||||
* @author Michael Suzuki
|
||||
* @since 2.0.1
|
||||
*/
|
||||
public class DemoPageTestIT extends AbstractTest {
|
||||
DemoPage page;
|
||||
|
||||
@BeforeClass(groups = {"alfresco-one"})
|
||||
public void prepare() throws Exception {
|
||||
// Navigate to share
|
||||
drone.navigateTo(shareUrl + "/page/hdp/ws/simple-page");
|
||||
// Reuse Alfresco Share login page object from share-po lib.
|
||||
LoginPage loginPage = new LoginPage(drone);
|
||||
loginPage.loginAs(username, password);
|
||||
}
|
||||
|
||||
@BeforeMethod
|
||||
public void loadPage() {
|
||||
// Goto demo page
|
||||
drone.navigateTo(shareUrl + "/page/hdp/ws/simple-page");
|
||||
page = new DemoPage(drone);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void findLogo() {
|
||||
Assert.assertTrue(page.isSimpleLogoDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void messageIsDisplayed() {
|
||||
page.render();
|
||||
String msg = page.getMessage();
|
||||
Assert.assertNotNull(msg);
|
||||
Assert.assertEquals("Hello from i18n!", msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Example of test reusing methods in abstract share page objects.
|
||||
*/
|
||||
@Test
|
||||
public void titleDisplayed() {
|
||||
// Invoke render when ready to use page object.
|
||||
page.render();
|
||||
Assert.assertNotNull(page);
|
||||
Assert.assertTrue(page.getTitle().contains("This is a simple page"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that show how we are able to reuse share page objects
|
||||
* objects in particular the navigation object.
|
||||
*/
|
||||
@Test
|
||||
public void navigate() {
|
||||
Assert.assertNotNull(page.getNav());
|
||||
PeopleFinderPage peoppleFinderPage = page.getNav().selectPeople().render();
|
||||
Assert.assertNotNull(peoppleFinderPage);
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
#set($symbol_pound='#')
|
||||
#set($symbol_dollar='$')
|
||||
#set($symbol_escape='\' )
|
||||
/*
|
||||
* Copyright (C) 2005-2015 Alfresco Software Limited.
|
||||
* This file is part of Alfresco
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package ${package}.demoamp.po;
|
||||
|
||||
import org.alfresco.po.share.SharePage;
|
||||
import org.alfresco.webdrone.RenderTime;
|
||||
import org.alfresco.webdrone.WebDrone;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.NoSuchElementException;
|
||||
|
||||
/**
|
||||
* Demo of simple share page object that encapsulates the demo of simple page.
|
||||
*
|
||||
* @author Michael Suzuki
|
||||
* @since 2.0.1
|
||||
*/
|
||||
public class DemoPage extends SharePage {
|
||||
private By SIMPLE_DEMO_LOGO = By.id("DEMO_SIMPLE_LOGO");
|
||||
private By SIMPLE_DEMO_MESSAGE = By.id("DEMO_SIMPLE_MSG");
|
||||
|
||||
public DemoPage(WebDrone drone) {
|
||||
super(drone);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public DemoPage render() {
|
||||
return render(new RenderTime(maxPageLoadingTime));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public DemoPage render(RenderTime timer) {
|
||||
while (true) {
|
||||
timer.start();
|
||||
try {
|
||||
if (isSimpleLogoDisplayed() && isMessageDisplayed()) {
|
||||
break;
|
||||
}
|
||||
} catch (NoSuchElementException nse) {
|
||||
} finally {
|
||||
timer.end();
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public DemoPage render(long time) {
|
||||
return render(new RenderTime(time));
|
||||
}
|
||||
|
||||
public boolean isSimpleLogoDisplayed() {
|
||||
try {
|
||||
return drone.find(SIMPLE_DEMO_LOGO).isDisplayed();
|
||||
} catch (NoSuchElementException se) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isMessageDisplayed() {
|
||||
try {
|
||||
return drone.find(SIMPLE_DEMO_MESSAGE).isDisplayed();
|
||||
} catch (NoSuchElementException se) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return drone.find(SIMPLE_DEMO_MESSAGE).getText();
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
#set($symbol_pound='#')
|
||||
#set($symbol_dollar='$')
|
||||
#set($symbol_escape='\' )
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
||||
<suite name="Custom Share AMP Page Object Tests" parallel="none">
|
||||
<test name="DemoPageTest">
|
||||
<classes>
|
||||
<class name="${package}.demoamp.DemoPageTestIT"/>
|
||||
</classes>
|
||||
</test>
|
||||
</suite>
|
@ -86,7 +86,6 @@
|
||||
<configuration>
|
||||
<regex>false</regex>
|
||||
<includes>
|
||||
<include>${alfresco.solr.home.dir}/context.xml</include>
|
||||
<include>${alfresco.solr.home.dir}/archive-SpacesStore/conf/solrcore.properties</include>
|
||||
<include>${alfresco.solr.home.dir}/workspace-SpacesStore/conf/solrcore.properties</include>
|
||||
</includes>
|
||||
|
@ -22,8 +22,8 @@
|
||||
-->
|
||||
<properties>
|
||||
<!-- The following are default values for data location and Alfresco Community version.
|
||||
Uncomment if you need to change (Note. current default version for Enterprise edition is 5.0.1)
|
||||
<alfresco.version>5.0.d</alfresco.version>
|
||||
Uncomment if you need to change (Note. current default version for Enterprise edition is @@alfresco.enterprise.default.version@@)
|
||||
<alfresco.version>@@alfresco.community.default.version@@</alfresco.version>
|
||||
<alfresco.data.location>alf_data_dev</alfresco.data.location> -->
|
||||
|
||||
<!-- This control the root logging level for all apps uncomment and change, defaults to WARN
|
||||
|
Loading…
x
Reference in New Issue
Block a user