<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>bin/bluecloth</filename>
    </added>
    <added>
      <filename>doc/index.html</filename>
    </added>
    <added>
      <filename>doc/tutorial/index.gif</filename>
    </added>
    <added>
      <filename>doc/tutorial/tutorial.html</filename>
    </added>
    <added>
      <filename>tasks/doc.rake</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,8 @@ require 'rake'
 require 'rake/testtask'
 require 'rake/rdoctask'
 
+load File.dirname(__FILE__) + '/tasks/doc.rake'
+
 desc 'Default: run unit tests.'
 task :default =&gt; :test
 </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -4,9 +4,43 @@
 
 In this tutorial we will assume the development of a tiny application: **The Postcard Galley**. 
 
-There's this artist who designs very fancy postcards. He sells them using his web site. To see it load the following file in your web browser: 
+There's this artist who designs very fancy postcards. He sells them using his web site. To see it load the following file in your web browser:
 
-    doc/tutorial/app/index.html 
+	doc/tutorial/app/index.html
+
+Or look the image and code below:
+
+![Index](index.gif)
+
+	&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;
+	  &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
+	&lt;html&gt;
+	  &lt;head&gt;
+	    &lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
+	    &lt;link rel=&quot;stylesheet&quot; href=&quot;application.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; charset=&quot;utf-8&quot;&gt;
+	    &lt;title&gt;Postcard Gallery&lt;/title&gt;
+	  &lt;/head&gt;
+
+	  &lt;body&gt;
+	    &lt;h1&gt;Postcard Gallery&lt;/h1&gt;
+
+	    &lt;p&gt;Drag the postcards you like to the area on the right. After that, click on Buy.&lt;/p&gt;
+
+	    &lt;div id=&quot;postcards&quot;&gt;
+	      &lt;ul&gt;
+	        &lt;li&gt;&lt;img src=&quot;images/norway.jpg&quot; alt=&quot;Norway&quot; title=&quot;Norway&quot;&gt;&lt;/li&gt;
+	        &lt;li&gt;&lt;img src=&quot;images/littleboy.jpg&quot; alt=&quot;Littleboy&quot; title=&quot;Littleboy&quot;&gt;&lt;/li&gt;
+	        &lt;li&gt;&lt;img src=&quot;images/riodejaneiro.jpg&quot; alt=&quot;Rio de Janeiro&quot; title=&quot;Rio de Janeiro&quot;&gt;&lt;/li&gt;
+	        &lt;li&gt;&lt;img src=&quot;images/recife.jpg&quot; alt=&quot;Recife&quot; title=&quot;Recife&quot;&gt;&lt;/li&gt;
+	      &lt;/ul&gt;
+	    &lt;/div&gt;
+
+	    &lt;div id=&quot;selection&quot;&gt;&lt;/div&gt;
+
+	    &lt;a href=&quot;checkout.html&quot;&gt;Buy&lt;/a&gt;
+	  &lt;/body&gt;
+	&lt;/html&gt;
+	
 
 The application has only three pages. The postcards are located in the very homepage. A visitor interested in buying a few of them can drag them to the selection area on the right. Clicking on 'Buy' the visitor is presented with a form where he should provide contact info. Finally, after submitting the form, the visitor will see a thank-you-page.
 
@@ -25,15 +59,79 @@ The tests are located in the directories:
 
 Let's begin with the tests for the homepage. Look at the file:
 
-    doc/tutorial/test/selenium_poetry/index.rsel
+	doc/tutorial/test/selenium_poetry/index.rsel
+	
+Or look the code below:
+
+	load_selectors        :index
+
+	should_have_text      &quot;page heading&quot;, &quot;Postcard Gallery&quot;
+
+	should_have           &quot;postcard of rio de janeiro&quot;,
+	                      &quot;postcard of recife&quot;,
+	                      &quot;postcard of norway&quot;,
+	                      &quot;postcard of littleboy&quot;,
+	                      &quot;selection area&quot;,
+	                      &quot;postcards area&quot;,
+	                      &quot;buy button&quot;
+
+	should_equal          &quot;number of postcards&quot; =&gt; 4
+
+	should_be             &quot;empty selection area&quot;  
+
+	should_drag_and_drop  &quot;postcard of rio de janeiro&quot;, &quot;selection area&quot;
+
+	should_wait_for_equal &quot;number of postcards&quot; =&gt; 3,
+	                      &quot;number of postcards selected&quot; =&gt; 1
+
+	should_not_be         &quot;empty selection area&quot;
+
+	should_store          &quot;number of postcards&quot; =&gt; &quot;numberOfPostarcdsAvaliable&quot;
+
+	should_drag_and_drop  &quot;postcard of recife&quot;, &quot;selection area&quot;
+
+	should_be             &quot;less postcards after drag&quot;
+
+	click_on_and_wait     &quot;buy button&quot;
+	
 
 Take a moment and try to read it all. As you go, try to figure out what the purpose of the test is. 
 
-Are you done? Then, let's move on. Open the file:
+Are you done? Then, let's move on. Open the file: 
+	
+	doc/tutorial/test/selenium_regular/index.rsel
 
-    doc/tutorial/test/selenium_regular/index.rsel
-    
-This file tests the very same things as the previous one. But, boy, what a difference! Isn't that much more confusing and polluted?
+Or look the code below:
+
+	assert_text            &quot;//h1&quot;, &quot;Postcard Gallery&quot;
+
+	assert_element_present '//ul/li/img[@src=&quot;images/riodejaneiro.jpg&quot; and @alt=&quot;Rio de Janeiro&quot; and @title=&quot;Rio de Janeiro&quot;]'
+	assert_element_present '//ul/li/img[@src=&quot;images/recife.jpg&quot; and @alt=&quot;Recife&quot; and @title=&quot;Recife&quot;]'
+	assert_element_present '//ul/li/img[@src=&quot;images/norway.jpg&quot; and @alt=&quot;Norway&quot; and @title=&quot;Norway&quot;]'
+	assert_element_present '//ul/li/img[@src=&quot;images/littleboy.jpg&quot; and @alt=&quot;Littleboy&quot; and @title=&quot;Littleboy&quot;]'
+	assert_element_present '//div[@id=&quot;selection&quot;]'
+	assert_element_present '//div[@id=&quot;postcards&quot;]'
+	assert_element_present 'buy button'
+
+	assert_eval             &quot;this.page().findElement('postcards').select('img').length;&quot;, 4
+	assert_eval             &quot;this.page().findElement('selection').select('img').length == 0;&quot;, true                 
+
+	drag_and_drop_to_object '//ul/li/img[@src=&quot;images/riodejaneiro.jpg&quot; and @alt=&quot;Rio de Janeiro&quot; and @title=&quot;Rio de Janeiro&quot;]', '//div[@id=&quot;selection&quot;]'
+
+	wait_for_eval           'this.page().findElement('postcards').select('img').length;', 3
+	wait_for_eval           'this.page().findElement('selection').select('img').length;', 1 
+
+	assert_eval             &quot;this.page().findElement('selection').select('img').length == 0;&quot;, false
+
+	store_eval              &quot;this.page().findElement('postcards').select('img').length;&quot;, &quot;numberOfPostarcdsAvaliable&quot;
+
+	drag_and_drop_to_object '//ul/li/img[@src=&quot;images/recife.jpg&quot; and @alt=&quot;Recife&quot; and @title=&quot;Recife&quot;]', '//div[@id=&quot;selection&quot;]'
+
+	assertEval              &quot;this.page().findElement('selection').select('img').length &lt; numberOfPostarcdsAvaliable;&quot;, true
+
+	click_and_wait          '//a[@href=&quot;checkout.html&quot; and text()=&quot;Buy&quot;]'
+
+This tests the very same things as the previous one. But, boy, what a difference! Isn't that much more confusing and polluted?
 
 The source of the problem is the use of XPath selectors in the same file where we place the test actions. To understand that, let's forget about Selenium mechanics for a moment. Say we're just writing a test script on a piece of paper. We'd probably write things like these:
 
@@ -47,6 +145,44 @@ This is straightforward and easy to communicate to anyone else, except the compu
 We solved this problem separating concerns. We decided to place test purposes in one place and selectors in another. Take a look at the file:
 
     doc/tutorial/test/selenium_poetry/selectors/index.yml
+
+Or look the code below:
+
+	page heading:
+	    //h1
+
+	postcard of rio de janeiro:
+	    //ul/li/img[@src=&quot;images/riodejaneiro.jpg&quot; and @alt=&quot;Rio de Janeiro&quot; and @title=&quot;Rio de Janeiro&quot;]
+
+	postcard of recife:
+	    //ul/li/img[@src=&quot;images/recife.jpg&quot; and @alt=&quot;Recife&quot; and @title=&quot;Recife&quot;]
+
+	postcard of norway:
+	    //ul/li/img[@src=&quot;images/norway.jpg&quot; and @alt=&quot;Norway&quot; and @title=&quot;Norway&quot;]
+
+	postcard of littleboy:
+	    //ul/li/img[@src=&quot;images/littleboy.jpg&quot; and @alt=&quot;Littleboy&quot; and @title=&quot;Littleboy&quot;]
+
+	selection area:
+	    //div[@id=&quot;selection&quot;]
+
+	postcards area:
+	    //div[@id=&quot;postcards&quot;]
+
+	buy button:
+	    //a[@href=&quot;checkout.html&quot; and text()=&quot;Buy&quot;]
+
+	number of postcards:    
+	    this.page().findElement('postcards').select('img').length;
+
+	number of postcards selected:    
+	    this.page().findElement('selection').select('img').length;
+
+	empty selection area:
+	    this.page().findElement('selection').select('img').length == 0;
+
+	less postcards after drag:
+	    this.page().findElement('selection').select('img').length &lt; numberOfPostarcdsAvaliable;
     
 This file contains only selectors. Actually that's not completely true. There are selectors and keys. It's like a Ruby Hash. There's a *key* and *value*. In this case, the *key* is a phrase that describes the selector, while the *value* is the selector itself. Let's see an example. In the selector's file, you might find something like this:
 </diff>
      <filename>doc/tutorial/tutorial.text</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d1bbe99e57241dcd420293a7e00fe093665b1f04</id>
    </parent>
  </parents>
  <author>
    <name>Marcos Tapajos</name>
    <email>tapajos@gmail.com</email>
  </author>
  <url>http://github.com/viniciusteles/selenium_poetry/commit/b7bfddc2737c7b9358e288f60ad2e1fbd841ea85</url>
  <id>b7bfddc2737c7b9358e288f60ad2e1fbd841ea85</id>
  <committed-date>2008-05-23T07:36:28-07:00</committed-date>
  <authored-date>2008-05-23T07:36:28-07:00</authored-date>
  <message>Adding images and code in tutorial.
Task to generate tutorial.html from markdown.</message>
  <tree>e1815b846253160444f0262297ae348986292f82</tree>
  <committer>
    <name>Marcos Tapajos</name>
    <email>tapajos@gmail.com</email>
  </committer>
</commit>
