Commits

Kostya Marchenko committed a9af7fd

Added sample configuration to Automated Tests POM file to illustrate how tests can be organized and run using Maven.
Added licensing info and Project URL to POM files.
Added JAR files.
Cleaned up documentation and added info how to install and use.

  • Participants
  • Parent commits ee1272b

Comments (0)

Files changed (28)

 # Intro
+
 This project is an attempt to make test automation efforts easier and more effective.
 There are lots of various tools, libraries and other frameworks for test automation you can find in the internet but individually they are not so usefull comparing to when combined together.
 In this project you will see combination of leading test automation tools and tecnhniques glued together and supplemented with custom helpers and examples to give you powerfull starter kit which you can use straight away.
 I'm not entirely sure that framework is the right word so you can call it whatever word you like: library, template, kit, tool – it doesn't really matter as long as it helps you achieve your goal.
 
 # Contributors
+
 Kostya Marchenko is the project owner. He is working as Senior Consultant at emergn and helping it's clients to improve and optimize software development processes with help of whole bunch of techniques and practices including TDD/BDD/Active Specification/Acceptance Test Driven Development, Test automation, Continuous Integration and Delivery.
 And of course it's all done in an Agile, iterative and evolutionary way.
 
 # Project Structure
+
 Project contains two major modules, they are test automation framework and automated test examples.
 Test Automation Framework, as it's name stays, is the main piece and contains helper methods and other usefull stuff you will use to create and run automated tests.
 Automated test examples are collection of few examples that extensively use framework and will give you good idea how to use it properly.
 
 # 3rd party libraries
 
-This framework mainly uses Concordion, Selenium 2(WebDriver), Hamcrest, JUnit4, TestNG and Maven.
+This framework mainly uses Concordion, Selenium 2(WebDriver), Hamcrest, JUnit4, and Maven/Buildr.
 
 # Documentation
 
 - Do a maven build by typing `mvn clean install` in checked out folder.
 - Open **test-automation-framework/test-automation-framework/target/test-results/com/sqanta/testautomation/framework/Framework.html** page.
 
+Also look at [Sample Automated Tests](https://bitbucket.org/zyxit/test-automation-framework/raw/tip/test-automation-framework/automated-tests/) to get better idea how your tests can use framework.
+
+# How to Install and Use
+
+There are three options:
+- Checkout sources by typing `hg clone https://bitbucket.org/zyxit/test-automation-framework` and add them as modules into your project
+- Download **Framework Jar** and **custom concordion Jar** and put them into your classpath
+- Add Maven dependencies to your project POM
+
 # Support & Feedback
-Feedback is the only way to improvement and we desperately want to hear your thoughts, ideas, concerns and problems.
+
+Listening to feedback is the best way to improve and we desperately want to hear your thoughts, ideas, concerns and problems.
 If you have any please drop an email to `kostya (at) sqanta.com` or fire and issue request at **Issues** tab.

File automated-tests/pom.xml

     <packaging>jar</packaging>
     <name>Automated Tests</name>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.9</version>
+                <configuration>
+                    <skipTests>false</skipTests>
+                    <testClassesDirectory>target/classes</testClassesDirectory>
+                    <!-- Uncomment for parallel test execution
+                    <parallel>classes</parallel>
+                    <forkMode>always</forkMode>-->
+                    <systemPropertyVariables>
+                        <test.runconfig.browser>HTML_UNIT</test.runconfig.browser>
+                        <test.runconfig.dataset/>
+                        <test.runconfig.env/>
+                    </systemPropertyVariables>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>slow-tests</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <includes>
+                                <include>**/*DataDrivenTest.java</include>
+                            </includes>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
     <dependencies>
         <dependency>
             <groupId>com.sqanta.testautomation</groupId>

File automated-tests/src/main/java/com/sqanta/testautomation/examples/search/testdata/default.xml

-<com.sqanta.testautomation.examples.search.domainmodel.Search>
-    <query>
-        <query>Twitter</query>
-    </query>
-    <searchResults>
-        <com.sqanta.testautomation.examples.search.domainmodel.SearchResult>
-            <name>Twitter</name>
-            <url>twitter.com</url>
-        </com.sqanta.testautomation.examples.search.domainmodel.SearchResult>
-    </searchResults>
-</com.sqanta.testautomation.examples.search.domainmodel.Search>

File automated-tests/src/main/resources/com/sqanta/testautomation/examples/search/testdata/default.xml

+<com.sqanta.testautomation.examples.search.domainmodel.Search>
+    <query>
+        <query>Twitter</query>
+    </query>
+    <searchResults>
+        <com.sqanta.testautomation.examples.search.domainmodel.SearchResult>
+            <name>Twitter</name>
+            <url>twitter.com</url>
+        </com.sqanta.testautomation.examples.search.domainmodel.SearchResult>
+    </searchResults>
+</com.sqanta.testautomation.examples.search.domainmodel.Search>

File automated-tests/src/main/resources/configuration.properties

+#
+# Test Automation Framework Configuration
+#
+
+# Relative or absolute path to the folder where test results should be stored
+testResultsDirectory = target/test-results
+
+# Comma-separated list of Concordion extensions that should be used.
+# Read more about extensions here Đ http://www.concordion.org/Extensions.html
+concordionExtensions = org.concordion.ext.ScreenshotExtension
+
+# Default browser type to use in test automation framework
+# Allowed values are IE, CHROME, FIREFOX, HTML_UNIT. If no value specified then HTML Unit will be used.
+# If CHROME is selected then pathToChromeDriver variable should point to Google Chrome executable
+defaultBrowserType = HTML_UNIT
+
+# Amount in seconds how long WebDriver should wait for elements to appear on page
+defaultElementTimeout=0
+
+# Name of environment from environments.properties that should be used by default. If no value specified environments will not be used
+defaultEnvironment=
+
+# Name of test data set name that should be used by default. If no value specified default.xml will be used
+defaultTestDataSetName=

File automated-tests/src/main/resources/environments.properties

+#
+# Test Environments Definition
+#
+
+# Define environments in form
+# envName.envProperty=value
+#
+# Example
+#
+# myEnv.url = http://localhost:8080/
+# myEnv.access.user = kostya
+#

File concordion-1.4.1-custom/target/concordion-custom-1.4.1-custom.jar

Binary file added.
     <version>0.1</version>
     <packaging>pom</packaging>
     <name>Test Automation Template</name>
+    <url>https://bitbucket.org/zyxit/test-automation-framework</url>
     <description>General purpose test automation framework for Java. Based on Concordion and Selenium2</description>
 
+    <licenses>
+        <license>
+            <name>The Apache Software License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+
     <modules>
         <module>test-automation-framework</module>
         <module>automated-tests</module>
             <organization>SQANTA</organization>
             <organizationUrl>http://www.sqanta.com</organizationUrl>
             <roles>
-                <role>Owner</role>
+                <role>Project Owner</role>
+                <role>Developer</role>
             </roles>
         </developer>
     </developers>

File test-automation-framework/TODO.txt

-1. Single place to manage web driver instances
-2. Single place to manage test configuration: test data, environment, browser type
-3. Single place to manage environment properties
-5. Clever page factory which will initialize web elements automatically based on location data from property files
-6. Stubbed mode and normal mode. For stubbed mode can use local pages + need mechanism in framework how to switch between modes.
-7. Logger with tooltip extension

File test-automation-framework/pom.xml

     <version>0.1</version>
     <packaging>jar</packaging>
     <name>Test Automation Framework</name>
+    <url>https://bitbucket.org/zyxit/test-automation-framework</url>
+
+    <licenses>
+        <license>
+            <name>The Apache Software License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
 
     <build>
         <plugins>

File test-automation-framework/src/spec/resources/com/sqanta/testautomation/framework/Framework.html

     or <a href="http://sikuli.org/">Sikuli</a>. However at the moment it's optimized only for WebDriver.
 </p>
 
-<p>
-    <a href="http://testng.org/">TestNG</a> is used for test management and test execution.
-</p>
 
 <p>
     <a href="http://code.google.com/p/hamcrest/">Hamcrest</a> is used to write human-friendly assertions.
 </p>
 
 <p>
-    <a href="http://maven.apache.org/">Maven</a> is used as a build and release tool.
+    <a href="http://maven.apache.org/">Maven</a> and
+    <a href="http://buildr.apache.org/">Buildr</a> are used as build and release tool.
+</p>
+
+<p>
+    To run tests we normally use JUnit 4 and Ant/Maven/Whatever_other_build_tool to form test suites and execute them.
+    There are some plans for a future to add support for TestNG, but those plans are not concrete yet as there no immediate need for that.
+    You can find an example of maven pom.xml to run tests in <b>automated-tests</b> module.
+</p>
+
+<p>
+    To run tests in parallel we prefer to use clustered
+    <a href="http://jenkins-ci.org/">Jenkins</a> as it gives proven and reliable way to execute and manage distributed test runs.
 </p>
 
 <h3>Framework Key Components</h3>
     <li><a href="helpers/Helpers.html">Helpers</a></li>
     <li><a href="TestExecutionControl.html">Test Execution Control</a></li>
     <li><a href="TestData.html">Test Data</a></li>
+    <li><a href="TestEnvironments.html">Test Environments</a></li>
 </ul>
 
 

File test-automation-framework/target/test-automation-framework-0.1.jar

Binary file added.

File test-automation-framework/target/test-results/automated/com/sqanta/testautomation/framework/tests/dummy/Dummy.html

 </p>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 69 ms on 20-Sep-2011 at 17:59:31 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 105 ms on 21-Sep-2011 at 14:12:57 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/Configuration.html

     <b>configuration.properties</b>
     file.
 </p>
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 397 ms on 20-Sep-2011 at 17:59:31 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 342 ms on 21-Sep-2011 at 14:12:57 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/Framework.html

     or <a href="http://sikuli.org/">Sikuli</a>. However at the moment it's optimized only for WebDriver.
 </p>
 
-<p>
-    <a href="http://testng.org/">TestNG</a> is used for test management and test execution.
-</p>
 
 <p>
     <a href="http://code.google.com/p/hamcrest/">Hamcrest</a> is used to write human-friendly assertions.
 </p>
 
 <p>
-    <a href="http://maven.apache.org/">Maven</a> is used as a build and release tool.
+    <a href="http://maven.apache.org/">Maven</a> and
+    <a href="http://buildr.apache.org/">Buildr</a> are used as build and release tool.
+</p>
+
+<p>
+    To run tests we normally use JUnit 4 and Ant/Maven/Whatever_other_build_tool to form test suites and execute them.
+    There are some plans for a future to add support for TestNG, but those plans are not concrete yet as there no immediate need for that.
+    You can find an example of maven pom.xml to run tests in <b>automated-tests</b> module.
+</p>
+
+<p>
+    To run tests in parallel we prefer to use clustered
+    <a href="http://jenkins-ci.org/">Jenkins</a> as it gives proven and reliable way to execute and manage distributed test runs.
 </p>
 
 <h3>Framework Key Components</h3>
     <li><a href="helpers/Helpers.html">Helpers</a></li>
     <li><a href="TestExecutionControl.html">Test Execution Control</a></li>
     <li><a href="TestData.html">Test Data</a></li>
+    <li><a href="TestEnvironments.html">Test Environments</a></li>
 </ul>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 25 ms on 20-Sep-2011 at 17:59:31 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 4 ms on 21-Sep-2011 at 14:12:57 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/RunConfiguration.html

 </ul>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 10 ms on 20-Sep-2011 at 17:59:49 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 78 ms on 21-Sep-2011 at 14:13:18 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/TestData.html

     </li>
 </ul>
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 507 ms on 20-Sep-2011 at 17:59:49 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 833 ms on 21-Sep-2011 at 14:13:19 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/TestEnvironments.html

 </div>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 68 ms on 20-Sep-2011 at 17:59:49 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 304 ms on 21-Sep-2011 at 14:13:20 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/TestExecutionControl.html

 <h4>InstantiationError</h4>
 
 <p>
-    <code>InstantiationError</code> also <span c:assertTrue="testInstantiationErrorStopsTest()" class="success">stops test execution</span>
+    <code>InstantiationError</code> also
+    <span c:assertTrue="testInstantiationErrorStopsTest()" class="success">stops test execution</span>
     as it usually mean that key part of test was not instantiated properly.
 </p>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 2640 ms on 20-Sep-2011 at 17:59:52 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 2176 ms on 21-Sep-2011 at 14:13:22 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/helpers/Helpers.html

 </ul>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 15 ms on 20-Sep-2011 at 17:59:31 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 12 ms on 21-Sep-2011 at 14:12:57 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/helpers/WindowHelper.html

 </p>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 11 ms on 20-Sep-2011 at 17:59:31 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 20 ms on 21-Sep-2011 at 14:12:57 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/pages/BasePage.html

 </p>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 244 ms on 20-Sep-2011 at 17:59:33 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 227 ms on 21-Sep-2011 at 14:12:59 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/pages/PageDefinition.html

     Also take a look at
     <a href="http://saucelabs.com/blog/index.php/2011/05/why-css-locators-are-the-way-to-go-vs-xpath/">intriguing post</a> with comparison of locator strategies performance.
 </p>
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 93 ms on 20-Sep-2011 at 17:59:33 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 114 ms on 21-Sep-2011 at 14:12:59 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/pages/PageFactory.html

 </div>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 15274 ms on 20-Sep-2011 at 17:59:49 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 18926 ms on 21-Sep-2011 at 14:13:18 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/pages/Pages.html

 </ul>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 8 ms on 20-Sep-2011 at 17:59:49 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 8 ms on 21-Sep-2011 at 14:13:18 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/tests/dummy/Dummy.html

 </p>
 
 
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 5 ms on 20-Sep-2011 at 17:59:52 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 7 ms on 21-Sep-2011 at 14:13:22 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/tests/dummy/DummyTestThatThrowsInstantiationError.html

         <span c:execute="methodThatShouldNotBeExecuted()">should not be executed</span>
     </p>
 </div>
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 133 ms on 20-Sep-2011 at 17:59:52 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 151 ms on 21-Sep-2011 at 14:13:22 MSD</div></div></body>
 </html>

File test-automation-framework/target/test-results/com/sqanta/testautomation/framework/tests/dummy/DummyTestThatThrowsStopTestException.html

         <b>Then</b> subsequent methods <span c:execute="methodThatShouldNotBeExecuted()">should not be executed</span>
     </p>
 </div>
-<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 2447 ms on 20-Sep-2011 at 17:59:52 MSD</div></div></body>
+<div class="footer">Results generated by <a href="http://www.concordion.org"><img src="../../../../../../image/concordion-logo.png" alt="Concordion" border="0" /></a><div class="testTime">in 1808 ms on 21-Sep-2011 at 14:13:22 MSD</div></div></body>
 </html>