README.txt in cohitre-caculo-0.0.4 vs README.txt in cohitre-caculo-0.0.6
- old
+ new
@@ -3,35 +3,39 @@
* http://caculo.cohitre.com
== The Succinct Summary:
-Caculo lets you simulate interaction with a browser via Ruby. It has the option to load a Javascript Library and call Javascript functions on the document. This allows for simple code that takes advantage of exisiting libraries.
+Caculo lets you simulate interaction with a browser via Ruby. It has the option to load a Javascript Library and call Javascript functions on the document. This allows for simple code that takes advantage of existing libraries.
Caculo is inspired by the Watir/FireWatir/SafariWatir trio, However, by simplifying the way of communicating with the browser it tries to offer an integrated cross-browser solution. It also extends the Test/Unit framework to provide some abbreviations to common functions.
-
== The Polite Apology
I haven't really tested Caculo outside of my computer, so things may not work as expected out of the box.
== The Descriptive Example:
- browser = Caculo.open :safari
- browser.libraries = [:jquery]
+Here's a short example of how to use caculo to do a very fun google search.
- browser.visit( 'http://google.com' )
+ require "rubygems"
+ require "caculo"
- browser["input[@name='q']"].val! 'cohitre'
- browser["form[@name='f']"].submit!
+ page = Caculo::Browser.open(:safari)
+
+ page.visit( "http://www.google.com" )
+ page.search("input[name=q]") { |obj| obj.val("cohitre") }
+ page.search("form[name=f]") { |form| form.submit }
+
+ sleep(1)
+ page.load_libraries!
+ sleep(1)
+
+ puts page.search("ol li:first a:first"){|f| f.text }
+ puts page.search("ol li:first a:first"){|f| f.attr("href") }
- browser.wait
- browser.load_libraries
- browser.visit browser['#res .g:eq(1) h2.r a'].attr('href').execute
-
-
== The Required Requirements
For testing in Firefox you will need the JSSh plugin. After the plugin has been installed and turned on, you need to call firefox with:
$ firefox -jssh
@@ -41,10 +45,11 @@
$ sudo gem install rubyosa
== The Daunting Installation:
-$ gem install caculo
+$ gem sources -a http://gems.github.com
+$ sudo gem install cohitre-caculo
== The Permissive License
(The MIT License)
\ No newline at end of file