- Revision
- 1323
- Author
- mauro
- Date
- 2009-10-11 09:22:05 -0500 (Sun, 11 Oct 2009)
Log Message
Added basic documentation, as contained on wiki.
Modified Paths
- trunk/web/distribution/src/main/site/content/index.html
- trunk/web/distribution/src/main/site/content/sitemap.xml
Added Paths
- trunk/web/distribution/src/main/site/content/customising-web-runner.html
- trunk/web/distribution/src/main/site/content/download.html
- trunk/web/distribution/src/main/site/content/javadoc.html
- trunk/web/distribution/src/main/site/content/license.html
- trunk/web/distribution/src/main/site/content/selenium-steps.html
- trunk/web/distribution/src/main/site/content/using-web-runner.html
Diff
Added: trunk/web/distribution/src/main/site/content/customising-web-runner.html (0 => 1323)
--- trunk/web/distribution/src/main/site/content/customising-web-runner.html (rev 0) +++ trunk/web/distribution/src/main/site/content/customising-web-runner.html 2009-10-11 14:22:05 UTC (rev 1323) @@ -0,0 +1,52 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> +<head> +<title>Customising Web Runner</title> +</head> + +<body> + +<h2>Registering your Steps in the Web Runner</h2> + +<p>The Web Runner is a webapp that allows users to run any generic +textual scenario. In order to do this, the appropriate JBehave Steps +instances required to match the textual steps need to be registered with +the application.</p> + +<p>Maven users can model their own module on the <a + href="" +web example</a></p> + +<p>Ant users can download the web distribution from <a + href="" page</a></p> + +<ul> + <li>Unzip it to a local directory</li> + <li>Add a jar containing your Steps and Registrar instances to + lib/ directory</li> + <li>Edit <b>webapp/WEB-INF/web.xml</b> to configure the + Registrar class name that you've defined, replacing the <b>org.jbehave.web.runner.waffle.JBehaveRegistrar</b> + class name with your fully-qualified Registrar class name. See <a + href="" + for an example of how easy it is. The minimal requirement is to + specify the one or more instances of Steps that you need to run the + scenarios.</li> + <li>In <b>bin/</b> dir execute: <b>ant -f deploy.xml + deploy:webapp</b>, which will deploy a new jbehave-web.war to your local + Jetty installation (provided you have <b>$JETTY_HOME</b> defined). + You can configure your own deploy dir via the <b>deploy.properties</b> + file or simply copy the war created in the target/ dir to your + favourite webapp container.</li> +</ul> + +<h2>Customising the Web Runner resources</h2> + +<p>The Web Runner comes with default web resources, but these can be +overridden by adding them to the <b>src/main/webapp</b> directory. Only +custom resources that override the default ones are required. So, e.g. +to change the default style, only <b>src/main/webapp/style/jbehave/jbehave.css</b> +needs to be added. Similary, to change home page template, only <b>src/main/webapp/ftl/home.ftl</b> +is needed. If any of these are removed the defaults will apply.</p> + +</body> +</html> \ No newline at end of file
Added: trunk/web/distribution/src/main/site/content/download.html (0 => 1323)
--- trunk/web/distribution/src/main/site/content/download.html (rev 0) +++ trunk/web/distribution/src/main/site/content/download.html 2009-10-11 14:22:05 UTC (rev 1323) @@ -0,0 +1,50 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> +<head> +<title>Download</title> +</head> + +<body> + +<h2>Stable releases</h2> + +<p>The stable releases of JBehave Web can be found on the <a + href="" +Repository</a>:</p> + +<ul> + <li><a + href="" + bin distribution</a></li> + <li><a + href="" + src distribution</a></li> +</ul> + +<h2 id="snapshot">Latest Snapshot</h2> + +<p>The snapshot builds of JBehave Web can be found on the <a + href="" +Snapshots Repository</a>. Be sure to choose the snapshot with the latest 2.x +version and the filename with the latest timestamp.</p> + +<h2 id="maven">Using Maven Artifacts</h2> + +<p>If you use Maven as the build system (or one that is compatible +with the Maven Repository, such as Ivy), you can declare JBehave Web +dependencies as</p> +<pre class="brush: xml"> + <dependency> + <groupId>org.jbehave.web</groupId> + <artifactId>jbehave-web-runner</artifactId> + <version>[version]</version> + </dependency> +</pre> +<p>specifying the correct version.</p> + +<div class="clear"> +<hr /> +</div> + +</body> +</html>
Modified: trunk/web/distribution/src/main/site/content/index.html (1322 => 1323)
--- trunk/web/distribution/src/main/site/content/index.html 2009-10-11 12:43:31 UTC (rev 1322) +++ trunk/web/distribution/src/main/site/content/index.html 2009-10-11 14:22:05 UTC (rev 1323) @@ -6,6 +6,19 @@ <body> +<h2>What is JBehave Web?</h2> +<p>JBehave Web provides a web-integration layer for the <a + href="" framework for +<a href="" +Development</a> (BDD).</p> +<p>Features of JBehave Web include:</p> + +<ul> + <li>A <a href="" Runner</a> to allow generic scenarios to be run via a simple web interface.</li> + <li>A <a href="" integration</a> module to allow automation of scenarios for web applications.</li> +</ul> + + </body> </html> \ No newline at end of file
Added: trunk/web/distribution/src/main/site/content/javadoc.html (0 => 1323)
--- trunk/web/distribution/src/main/site/content/javadoc.html (rev 0) +++ trunk/web/distribution/src/main/site/content/javadoc.html 2009-10-11 14:22:05 UTC (rev 1323) @@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html> +<head> + <title>Javadoc</title> +</head> +<body> + +<h2>JBehave Web Modules</h2> + +<p><a href="" Web I/O</a></p> + +<p><a href="" Web Selenium</a></p> + +<p><a href="" Web Runner</a></p> + +</body> + +</html>
Added: trunk/web/distribution/src/main/site/content/license.html (0 => 1323)
--- trunk/web/distribution/src/main/site/content/license.html (rev 0) +++ trunk/web/distribution/src/main/site/content/license.html 2009-10-11 14:22:05 UTC (rev 1323) @@ -0,0 +1,47 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html> +<head> +<title>License</title> +</head> + +<body> + +<h2>Overview</h2> + +<p>Typically the licenses listed for the project are that of the +project itself, and not of dependencies.</p> + +<h2>JBehave License</h2> + +<p>JBehave is released under a BSD-style license:</p> +<pre class="brush: plain"> +Copyright (c) 2003-2009 jbehave.org + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of +conditions and the following disclaimer. Redistributions in binary form must reproduce +the above copyright notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the distribution. + +Neither the name of JBehave nor the names of its contributors may be used to endorse +or promote products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ÒAS ISÓ AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. +</pre> +</body> +</html>
Added: trunk/web/distribution/src/main/site/content/selenium-steps.html (0 => 1323)
--- trunk/web/distribution/src/main/site/content/selenium-steps.html (rev 0) +++ trunk/web/distribution/src/main/site/content/selenium-steps.html 2009-10-11 14:22:05 UTC (rev 1323) @@ -0,0 +1,108 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> +<head> +<title>Selenium Steps</title> +</head> + +<body> + +<h2>Running Scenarios with Selenium</h2> + +<p><a href="" is a powerful +open-source tool for automated web testing. To demonstrate the use of +JBehave with Selenium, we'll draw upon the fully-functional <a + href="" +Email example webapp</a> from <a href="" +Web</a> project.</p> + +<p>Let's see how we can easily use Selenium to run web-based +scenarios. As usual, we'll have a Scenario class that maps to a textual +scenario, e.g.</p> + +<pre class="brush: bdd">Scenario: User logs in successfully + +Given nobody is logged in +When user Gill Bates with password 1234 attempts to log in +Then the Inbox is selected +And there are some messages listed + +Scenario: User fails to login with invalid password + +Given nobody is logged in +When user Gill Bates with password 99999 attempts to log in +And there are no messages listed +And the text "Invalid Login" should be visible + +Scenario: User fails to login with invalid username + +Given nobody is logged in +When user Fred with password 1234 attempts to log in +Then the Inbox should not be visible +And the text "Invalid Login" should be visible +</pre> + +<p>The objective in creating a DSL is to represent the +business-domain functionality whilst abstracting away the details of the +implementation, in this case the access to the web layer via a specific +testing tool, such as Selenium. The same DSL should be re-usable with +different testing tools.</p> +<p>The Scenario class will specify the Steps class is where all the +Selenium magic happens:</p> +<pre class="brush: java">public class AjaxEmailSteps extends SeleniumSteps { + + private Main main; + private String[] lastFormValues; + private String prefix; + + @Given("nobody is logged in") + public void nobodyLoggedIn() { + Main.logout(selenium); + } + + @Given("user is viewing their Inbox") + public void theyreInTheirInbox() { + nobodyLoggedIn(); + logIn("Gill Bates", "1234"); + boxIsSelected("Inbox"); + } + + @When("user $userName with password $password attempts to log in") + public void logIn(String userName, String password) { + main = new LoginForm(selenium, runner).login(userName, password); + } + + @Then("the Inbox should not be visible") + public void inBoxIsNotVisible() { + main.textIsNotVisible("Instant Millionaire"); + } + + @Then("the text \"$text\" should be visible") + public void textIsVisible(String text) { + main.waitFor(new Text(text)); + } + + @Then("the text \"$text\" should not be visible") + public void textIsNotVisible(String text) { + waitFor(new Not(new Text(text))); + } + + private void waitFor(Condition condition) { + runner.waitFor(condition); + waitFor(1); + } +} +</pre> +<p>The <b>@BeforeScenario</b> and <b>@AfterScenario</b> annotations +in the SeleniumSteps methods allow to start and stop the selenium server +before and after scenario. Users can of course override the default +behaviour, but generally don't need to bother for most use cases.</p> + +<p><strong>NOTE</strong>: To get the Selenium based tests running in +an automated way, you need to run both a webapp server (e.g. Jetty) and +the Selenium server. See the <a + href="" +Email example webapp</a> for a way to do this using <a + href="" + +</body> +</html>
Modified: trunk/web/distribution/src/main/site/content/sitemap.xml (1322 => 1323)
--- trunk/web/distribution/src/main/site/content/sitemap.xml 2009-10-11 12:43:31 UTC (rev 1322) +++ trunk/web/distribution/src/main/site/content/sitemap.xml 2009-10-11 14:22:05 UTC (rev 1323) @@ -2,5 +2,17 @@ <section> <name>About</name> <page>index.html</page> + <page>license.html</page> + <page>download.html</page> + <page>javadoc.html</page> </section> + <section> + <name>Web Runner</name> + <page>customising-web-runner.html</page> + <page>using-web-runner.html</page> + </section> + <section> + <name>Selenium</name> + <page>selenium-steps.html</page> + </section> </sitemap> \ No newline at end of file
Added: trunk/web/distribution/src/main/site/content/using-web-runner.html (0 => 1323)
--- trunk/web/distribution/src/main/site/content/using-web-runner.html (rev 0) +++ trunk/web/distribution/src/main/site/content/using-web-runner.html 2009-10-11 14:22:05 UTC (rev 1323) @@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> +<head> +<title>Using Web Runner</title> +</head> + +<body> + +<h2>Running generic scenarios via a web-based interface</h2> + +<p>The Web Runner provides a simple web-based interface to running +generic scenarios. A typical use case is for BAs, QAs or stakeholders to +be able to access the results of scenario running without needing access +to developer resources.</p> + +<p>A fully functional example webapp is provided in <a + href="" +web example</a>. We'll be using this example to illustrate the use of Web +Runner:</p> + +<ul> + <li><a href="" Web + Runner</a></li> + <li>Deploy webapp to your favourite webapp container</li> + <li>Open page <b>http://localhost:8080/jbehave-trader</b> + (assuming normal port conventions)</li> + <li>On Menu, click on <b>Run Scenario</b>, which will take you + to a page where you can enter your textual scenario.</li> + <li>Input textual scenario in textarea (e.g you can cut & + paste the one found in the <a + href="" + web example</a>) and click on <b>Run Scenario</b> link.</li> + <li>Upon execution, the output of the scenario is shown below. + By default the same output is shown as the one you would see when running + JBehave via a command-line interface. This includes any details of failed + and pending steps. If any failures occur, the user has be option to + expand the stack trace.</li> +</ul> + +</body> +</html> \ No newline at end of file
To unsubscribe from this list please visit:
