DEVPLAT-6: Fix regression and functional IT (still needs proper release of share-po)

This commit is contained in:
Martin Bergljung 2015-04-27 14:22:35 +01:00
parent cf86202c28
commit 4c0e340ab4
11 changed files with 462 additions and 89 deletions

View File

@ -56,13 +56,13 @@
<module id="share-amp" dir="share-amp" name="share-amp"> <module id="share-amp" dir="share-amp" name="share-amp">
<fileSets> <fileSets>
<fileSet filtered="false" packaged="true" encoding="UTF-8"> <fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory> <directory>src/main/java</directory>
<includes> <includes>
<include>**/*.java</include> <include>**/*.java</include>
</includes> </includes>
</fileSet> </fileSet>
<fileSet filtered="false" packaged="true" encoding="UTF-8"> <fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/test/java</directory> <directory>src/test/java</directory>
<includes> <includes>
<include>**/*.java</include> <include>**/*.java</include>
@ -74,7 +74,7 @@
<include>**</include> <include>**</include>
</includes> </includes>
</fileSet> </fileSet>
<fileSet encoding="UTF-8" filtered="false"> <fileSet filtered="true" packaged="false" encoding="UTF-8">
<directory>src/test/resources</directory> <directory>src/test/resources</directory>
<includes> <includes>
<include>**</include> <include>**</include>

View File

@ -23,9 +23,9 @@
--> -->
<properties> <properties>
<!-- The following are default values for data location, Alfresco Community version, and Records Management Module version. <!-- 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) Uncomment if you need to change (Note. current default version for Enterprise edition is @@alfresco.enterprise.default.version@@)
<alfresco.version>5.0.d</alfresco.version> <alfresco.version>@@alfresco.community.default.version@@</alfresco.version>
<alfresco.rm.version>2.3</alfresco.rm.version> <alfresco.rm.version>@@alfresco.rm.version@@</alfresco.rm.version>
<alfresco.data.location>alf_data_dev</alfresco.data.location> --> <alfresco.data.location>alf_data_dev</alfresco.data.location> -->
<!-- This control the root logging level for all apps uncomment and change, defaults to WARN <!-- 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. for embedded run, defaults to the 'local' environment. See SDK Parent POM for more info.
<env>local</env> <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> </properties>
<!-- Here we realize the connection with the Alfresco selected platform (e.g.version and edition) --> <!-- Here we realize the connection with the Alfresco selected platform (e.g.version and edition) -->

View File

@ -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"> <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> <modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}</artifactId> <artifactId>${artifactId}</artifactId>
<name>Alfresco, Share and Solr Tomcat Runner</name> <name>Alfresco, Share and Solr4 Tomcat Runner</name>
<packaging>pom</packaging> <packaging>pom</packaging>
<description>Alfresco, Share and Solr Tomcat Runner</description> <description>Alfresco, Share and Solr4 Tomcat Runner</description>
<parent> <parent>
<groupId>${groupId}</groupId> <groupId>${groupId}</groupId>
@ -25,6 +25,7 @@
<build> <build>
<plugins> <plugins>
<!-- Copy and filter webapp context files - output dir is runner/target/contexts -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
@ -72,7 +73,9 @@
<systemProperties> <systemProperties>
<solr.solr.home>${alfresco.solr.home.dir}</solr.solr.home> <solr.solr.home>${alfresco.solr.home.dir}</solr.solr.home>
</systemProperties> </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 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. 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 This also fixes issues with the Google Guava Library, which this tomcat plugin uses
@ -84,7 +87,8 @@
<artifactId>repo</artifactId> <artifactId>repo</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
<type>war</type> <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> <asWebapp>true</asWebapp>
<contextPath>/alfresco</contextPath> <contextPath>/alfresco</contextPath>
<contextFile>${project.build.directory}/contexts/context-repo.xml</contextFile> <contextFile>${project.build.directory}/contexts/context-repo.xml</contextFile>
@ -105,7 +109,7 @@
<type>war</type> <type>war</type>
<asWebapp>true</asWebapp> <asWebapp>true</asWebapp>
<contextPath>/solr4</contextPath> <contextPath>/solr4</contextPath>
<contextFile>${alfresco.solr.home.dir}/context.xml</contextFile> <contextFile>${project.build.directory}/contexts/context-solr.xml</contextFile>
</webapp> </webapp>
</webapps> </webapps>
</configuration> </configuration>
@ -114,18 +118,30 @@
</build> </build>
</profile> </profile>
<!-- Runs regression tests using Alfresco Share PO (Page Object) vanilla Selenium / Webdrone driven functional test, during integration-test phase. <!-- 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 ${app.share.url} (e.g. by invoking -Prun,regression) --> 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> <profile>
<id>regression</id> <id>regression-testing</id>
<properties> <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> <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> </properties>
<build> <build>
<plugins> <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> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
@ -137,77 +153,82 @@
<goal>unpack</goal> <goal>unpack</goal>
</goals> </goals>
<configuration> <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> <outputDirectory>${project.build.directory}/testng-resources</outputDirectory>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-failsafe-plugin</artifactId>
<version>2.17</version> <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> <executions>
<execution> <execution>
<id>run-regression-tests</id> <id>regression-tests</id>
<goals>
<goal>test</goal>
</goals>
<phase>integration-test</phase> <phase>integration-test</phase>
<configuration> <goals>
<systemProperties> <goal>integration-test</goal>
<share.target>${app.share.url}</share.target> </goals>
</systemProperties> </execution>
<dependenciesToScan> <execution>
<dependency>${alfresco.groupId}:share-po</dependency> <id>verify-tests</id>
</dependenciesToScan> <phase>verify</phase>
<additionalClasspathElements> <goals>
<additionalClasspathElement>${project.build.directory}/testng-resources</additionalClasspathElement> <goal>verify</goal>
</additionalClasspathElements> </goals>
<suiteXmlFiles>
<suiteXmlFile>${project.build.directory}/testng-resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<!-- Bring in the Share Page Objects (PO) used in the regression tests -->
<dependency> <dependency>
<groupId>${alfresco.groupId}</groupId> <groupId>${alfresco.groupId}</groupId>
<artifactId>share-po</artifactId> <artifactId>share-po</artifactId>
<version>${alfresco.version}</version> <version>${share.po.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<!-- Bring in the Share Page Object (PO) regression tests that comes with Alfresco.
These tests cover the Alfresco Share Web Application -->
<dependency> <dependency>
<groupId>${alfresco.groupId}</groupId> <groupId>${alfresco.groupId}</groupId>
<artifactId>share-po</artifactId> <artifactId>share-po</artifactId>
<version>${alfresco.version}</version> <version>${share.po.version}</version>
<classifier>tests</classifier> <classifier>tests</classifier>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </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> <dependency>
<groupId>org.springframework</groupId> <groupId>org.alfresco.test</groupId>
<artifactId>spring-beans</artifactId> <artifactId>alfresco-testng</artifactId>
<version>3.1.1.RELEASE</version> <version>1.1</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>
<scope>test</scope> <scope>test</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
@ -219,7 +240,94 @@
</dependencies> </dependencies>
</profile> </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> </profiles>
</project> </project>

View File

@ -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>

View File

@ -14,19 +14,19 @@
</parent> </parent>
<!-- <!--
| SDK properties have sensible defaults in the SDK parent, SDK properties have sensible defaults in the SDK parent,
| but you can override the properties below to use another version. but you can override the properties below to use another version.
| For more available properties see the alfresco-sdk-parent POM. For more available properties see the alfresco-sdk-parent POM.
--> -->
<properties> <properties>
<!-- Defines the target WAR artifactId to run this amp, only used with the -Pamp-to-war switch <!-- 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> <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> <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> <alfresco.repo.url>http://localhost:8080/alfresco</alfresco.repo.url>
<!-- Defines the log level used in log4j.properties --> <!-- Defines the log level used in log4j.properties -->
@ -50,6 +50,44 @@
<artifactId>spring-surf-api</artifactId> <artifactId>spring-surf-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </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> </dependencies>
</project> </project>

View File

@ -13,12 +13,14 @@ model.jsonModel = {
widgetWidth: 50, widgetWidth: 50,
widgets: [ widgets: [
{ {
id: "DEMO_SIMPLE_LOGO",
name: "alfresco/logo/Logo", name: "alfresco/logo/Logo",
config: { config: {
logoClasses: "alfresco-logo-only" logoClasses: "alfresco-logo-only"
} }
}, },
{ {
id: "DEMO_SIMPLE_MSG",
name: "example/widgets/TemplateWidget" name: "example/widgets/TemplateWidget"
} }
] ]

View File

@ -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);
}
}

View File

@ -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();
}
}

View File

@ -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>

View File

@ -86,7 +86,6 @@
<configuration> <configuration>
<regex>false</regex> <regex>false</regex>
<includes> <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}/archive-SpacesStore/conf/solrcore.properties</include>
<include>${alfresco.solr.home.dir}/workspace-SpacesStore/conf/solrcore.properties</include> <include>${alfresco.solr.home.dir}/workspace-SpacesStore/conf/solrcore.properties</include>
</includes> </includes>

View File

@ -22,8 +22,8 @@
--> -->
<properties> <properties>
<!-- The following are default values for data location and Alfresco Community version. <!-- 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) Uncomment if you need to change (Note. current default version for Enterprise edition is @@alfresco.enterprise.default.version@@)
<alfresco.version>5.0.d</alfresco.version> <alfresco.version>@@alfresco.community.default.version@@</alfresco.version>
<alfresco.data.location>alf_data_dev</alfresco.data.location> --> <alfresco.data.location>alf_data_dev</alfresco.data.location> -->
<!-- This control the root logging level for all apps uncomment and change, defaults to WARN <!-- This control the root logging level for all apps uncomment and change, defaults to WARN