Update selenium on rails using 'official' git repo

git://github.com/paytonrules/selenium-on-rails.git
This commit is contained in:
Reinier Balt 2008-12-02 10:05:41 +01:00
parent 198f3240b8
commit 9b504b3e47
159 changed files with 16409 additions and 11794 deletions

View file

@ -0,0 +1,125 @@
== REVISION 38[http://svn.openqa.org/fisheye/changelog/selenium-on-rails/?cs=38]
=== change made by Flanagan
* SOR-13[http://jira.openqa.org/browse/SOR-13] Corrected an omission of require statements.
== REVISION 37
=== change made by Flanagan
* Undone an unwanted commit of modified Rakefile.
== REVISION 36[http://svn.openqa.org/fisheye/changelog/selenium-on-rails/?cs=36]
=== change made by Flanagan
* SOR-13[http://jira.openqa.org/browse/SOR-13] Added (experimental) support for user-extensions.js.
== REVISION 35[http://svn.openqa.org/fisheye/changelog/selenium-on-rails/?cs=35]
=== all changes made by Jonas
* SOR-12[http://jira.openqa.org/browse/SOR-12] removed all support for selenium gem
* Selenium Core 0.8.2 is now bundled with Selenium on Rails. If you want to use other version set the 'selenium_path' in config.yml
* Updated installation instructions for Windows
== REVISION 34[http://svn.openqa.org/fisheye/changelog/selenium-on-rails/?cs=34]
=== all changes made by Flanagan
* SOR-11[http://jira.openqa.org/browse/SOR-11] Fixed related assertions for store_checked to use only locator parameter
Warning: Users must change tests that pass two parameters (locator, pattern) to +verify_checked+, +verify_not_checked+, +assert_checked+, +assert_not_checked+, +wait_for_checked+, or +wait_for_not_checked+.
Test scripts that continue to use two parameters will be broken, only one parameter, the locator, should be passed.
For example, <tt>|verify_checked|my_checkbox|true|</tt> will be interpreted as <tt>|verify_checked|my_checkboxtrue||</tt> so change the test to <tt>|verify_checked|my_checkbox||</tt>
* SOR-9[http://jira.openqa.org/browse/SOR-9] Added Mac OS X browsers to config.yml.example
* SOR-10[http://jira.openqa.org/browse/SOR-10] Added support for baseUrl to acceptance_test_runner.rb as added to selenium-core 0.8.2
* Added 'webrick' to SERVER_COMMAND in acceptance_test_runner.rb as parameters do not work with lighttpd
* Reversed expected query string in test/renderer_testrb to make tests pass
Note: On Mac OS X, at least, clear_tables comes before fixtures in the query string; this may be an environment-specific issue if the test now fails on other OSes.
* Added this CHANGELOG file and amended the rake rdoc task to include it
* Added support in rselenese for a long list of actions and accessors that are included in selenium-core (0.8.2 and possibly earlier) but were previously missing in selenium-on-rails.
Here are the newly supported actions:
Useful for debugging:
* <tt>brake</tt> (alias for selenium-core's break, a reserved word in Ruby)
* <tt>echo, :string</tt>
* <tt>highlight, :locator</tt>
Keyboard events:
* <tt>alt_key_down</tt>
* <tt>alt_key_up</tt>
* <tt>control_key_down</tt>
* <tt>control_key_up</tt>
* <tt>meta_key_down</tt>
* <tt>meta_key_up</tt>
* <tt>shift_key_down</tt>
* <tt>shift_key_up</tt>
* <tt>type_keys, :locator, :string</tt>
Mouse events:
* <tt>click_at, :locator, :coord_string</tt>
* <tt>double_click, :locator</tt>
* <tt>double_click_at, :locator, :coord_string</tt>
* <tt>drag_and_drop, :locator, :movements_string</tt>
* <tt>drag_and_drop_to_object, :locator, :locator</tt>
* <tt>mouse_down_at, :locator, :coord_string</tt>
* <tt>mouse_move, :locator</tt>
* <tt>mouse_move_at, :locator, :coord_string</tt>
* <tt>mouse_out, :locator</tt>
* <tt>mouse_up, :locator</tt>
* <tt>mouse_up_at, :locator, :coord_string</tt>
* <tt>set_mouse_speed, :integer</tt>
Other actions:
* <tt>create_cookie, :name_value_pair, :options_string</tt>
* <tt>delete_cookie, :string, :string</tt>
* <tt>open_window, :url, :integer</tt>
* <tt>pause, :timeout</tt>
* <tt>remove_all_selections, :locator</tt>
* <tt>select_frame, :locator</tt>
* <tt>set_cursor_position, :locator, :integer</tt>
* <tt>store, :script, :variable</tt>
* <tt>window_focus, :window_name</tt>
* <tt>window_maximize, :window_name</tt>
Here are the newly supported accessors:
The following store_* accessors and their associated assert, verify and wait_for brethren are fully supported:
* <tt>store_selected_id, :locator, :variable</tt>
* <tt>store_selected_ids, :locator, :variable</tt>
* <tt>store_selected_index, :locator, :variable</tt>
* <tt>store_selected_indexes, :locator, :variable</tt>
* <tt>store_selected_label, :locator, :variable</tt>
* <tt>store_selected_labels, :locator, :variable</tt>
* <tt>store_selected_value, :locator, :variable</tt>
* <tt>store_selected_values, :locator, :variable</tt>
* <tt>store_something_selected, :locator, :variable</tt>
* <tt>store_all_window_ids, :variable</tt>
* <tt>store_all_window_names, :variable</tt>
* <tt>store_all_window_titles, :variable</tt>
* <tt>store_cookie, :variable</tt>
* <tt>store_log_messages, :variable</tt>
* <tt>store_mouse_speed, :variable</tt>
* <tt>store_cursor_position, :locator, :variable</tt>
* <tt>store_attribute_from_all_windows, :attribute_name, :variable</tt>
* <tt>store_element_height, :locator, :variable</tt>
* <tt>store_element_index, :locator, :variable</tt>
* <tt>store_element_width, :locator, :variable</tt>
* <tt>store_element_position_left, :locator, :variable</tt>
* <tt>store_element_position_top, :locator, :variable</tt>
Only the associated assert, verify and wait_for brethren of the following store_* accessors are supported by the selenium-core, so these store_* accessors create exceptions in SOR:
* <tt>store_ordered, :locator, :locator, :variable</tt>
* <tt>store_error_on_next, :string</tt>
* <tt>store_failure_on_next, :string</tt>
* <tt>store_whether_this_frame_match_frame_expression, :string, :string, :variable</tt>
* <tt>store_whether_this_window_match_window_expression, :string, :string, :variable</tt>

View file

@ -1,192 +1,332 @@
= Selenium on Rails
== Overview
Selenium on Rails provides an easy way to test Rails application with
SeleniumCore[http://www.openqa.org/selenium-core/].
This plugin does four things:
1. The Selenium Core files don't have to pollute <tt>/public</tt>, they can stay in the Selenium gem or in <tt>/vendor/selenium</tt>.
2. No need to create suite files, they are generated on the fly -- one suite per directory in <tt>/test/selenium</tt> (suites can be nested).
3. Instead of writing the test cases in HTML you can use a number of better formats (see <tt>Formats</tt>).
4. Loading of fixtures and wiping of session (<tt>/selenium/setup</tt>).
== Installation
1. Selenium Core needs to be available. It could either be installed as a gem (<tt>gem install selenium</tt>) or in <tt>/vendor/selenium/</tt>.
2. Install Selenium on Rails: <tt>script/plugin install http://svn.openqa.org/svn/selenium-on-rails/selenium-on-rails</tt>
3. <i>If RedCloth is available the Selenese test cases can use it for better markup.</i>
4. Run the Rakefile in the plugin's directory to run the tests in order to see that everything works. (If RedCloth isn't installed a few tests will fail since they assume RedCloth is installed.)
5. Create a test case: <tt>script/generate selenium login</tt>
6. Start the server: <tt>script/server -e test</tt>
7. Point your browser to <tt>http://localhost:3000/selenium</tt>
8. If everything works as expected you should see the Selenium test runner. The north east frame contains all your test cases (just one for now), and the north frame contains your test case.
=== win32-open3
win32-open3[http://raa.ruby-lang.org/project/win32-open3/] is needed if you're
on Windows and want to run your tests as a Rake task
(see <tt>test:acceptance</tt>), i.e. you don't have to install it but it's
recommended.
You can build it from source or install the binary:
1. Download the latest version of win32-open3, open3-0.2.2.so[http://rubyforge.org/frs/download.php/8515/open3-0.2.2.so] at the time of this writing.
2. Open up irb and run this snippet: <tt>require 'rbconfig'; include Config; puts CONFIG['sitearchdir']</tt>
3. Create a <tt>win32</tt> directory under the directory you got, e.g. <tt>c:\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt</tt>
4. Rename the .so file to <tt>open3.so</tt> and put it in the <tt>win32</tt> directory.
5. Profit! (unless you get an error when doing <tt>require 'win32/open3'</tt>)
== Formats
The test cases can be written in a number of formats. Which one you choose is a
matter of taste. You can generate your test files by running
<tt>script/generate selenium</tt> or by creating them manually in your
<tt>/test/selenium</tt> directory.
=== Selenese, .sel
Selenese is the dumbest format (in a good way). You just write your commands
delimited by | characters.
|open|/selenium/setup|
|open|/|
|goBack|
If you don't want to write Selenese tests by hand you can use
SeleniumIDE[http://www.openqa.org/selenium-ide/] which has
support[http://wiki.openqa.org/display/SIDE/SeleniumOnRails] for Selenese.
SeleniumIDE makes it super easy to record test and edit them.
=== RSelenese, .rsel
RSelenese enable you to write your tests in Ruby.
setup :fixtures => :all
open '/'
assert_title 'Home'
('a'..'z').each {|c| open :controller => 'user', :action => 'create', :name => c }
See SeleniumOnRails::TestBuilder for available commands.
=== HTML/RHTML
You can write your tests in HTML/RHTML but that's mostly useful if you have
existing tests you want to reuse.
=== Partial test cases
If you have some common actions you want to do in several test cases you can put
them in a separate partial test case and include them in your other test cases.
A partial test case is just like a normal test case besides that its filename
has to start with _:
#_login.rsel
open '/login'
type 'name', name
type 'password', password
click 'submit', :wait=>true
To include a partial test case you write like this in a Selenese test case:
|includePartial|login|name=John Doe|password=eoD nhoJ|
in a RSelenese test case:
include_partial 'login', :name => 'Jane Doe', :password => 'Jane Doe'.reverse
and in a RHTML test case:
<%= render :partial => 'login', :locals => {:name = 'Joe Schmo', :password => 'Joe Schmo'.reverse} %>
== Configuration
There are a number of settings available. You make them by renaming
<tt>config.yml.example</tt> to <tt>config.yml</tt> and make your changes in that
file.
=== Environments
Per default this plugin is only available in test environment. You can change
this by setting <tt>environments</tt>, such as:
#config.yml
environments:
- test
- development
== <tt>test:acceptance</tt>
You can run all your Selenium tests as a Rake task.
First, if you're on Windows, you have to make sure win32-open3 is installed.
Then you have to configure which browsers you want to run, like this:
#config.yml
browsers:
firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
ie: 'c:\Program Files\Internet Explorer\iexplore.exe'
Now you're all set. First start a server:
script/server -e test
Then run the tests:
rake test:acceptance
Now it should work, otherwise let me know!
=== Store results
If you want to store the results from a <tt>test:acceptance</tt> you just need
to set in which directory they should be stored:
#config.yml
result_dir: 'c:\result'
So when you run <tt>rake test:acceptance</tt> the tables with the results will
be stored as <tt>.html</tt> files in that directory.
This can be useful especially for continous integration.
== Todo
=== Standalone mode
More work is needed on <tt>test:acceptance</tt> on Windows to be able to start
the server when needed.
=== user_extension.js
Selenium has support for <tt>user_extension.js</tt> which is a way to extend the
functionality of Selenium Core. However there is currently no easy way to add
such a file in Selenium on Rails.
=== More setup/teardown support?
Currently there is only support to load fixtures and to wipe the session in
<tt>/selenium/setup</tt>. Is there a need for more kinds of setups or teardowns?
=== More documentation
== Not todo
=== Editor
Creating an editor for the test cases is currently considered out of scope for
this plugin. SeleniumIDE[http://www.openqa.org/selenium-ide/] does such a good
job and has support[http://wiki.openqa.org/display/SIDE/SeleniumOnRails] for
the Selenese format.
== Credits
* Jon Tirsen, http://jutopia.tirsen.com -- initial inspiration[http://wiki.rubyonrails.com/rails/pages/SeleniumIntegration]
* Eric Kidd, http://www.randomhacks.net -- contribution of RSelenese
== Information
For more information, check out the website[http://www.openqa.org/selenium-on-rails/].
Installation for rails versions before Rails 2.1
Rails has been changed in ways that break the original versions of Selenium on Rails. If you're using versions before Rails 2.1 you need to use this release. There are no plans to update this release with new changes or bug fixes unless there is sufficient demand, so if you can update then do so.
1. Install Selenium on Rails: script/plugin install http://svn.openqa.org/svn/selenium-on-rails/tags/pre-rails-2-1/selenium-on-rails
2. If youre on Windows, gem install win32-open3
3. If the RedCloth gem is available the Selenese test cases can use it for better markup.
4. Run the Rakefile in the plugins directory to run the tests in order to see that everything works. (If RedCloth isnt installed a few tests will fail since they assume RedCloth is installed.)
5. Create a test case: script/generate selenium login
6. Start the server: script/server -e test
7. Point your browser to localhost:3000/selenium
8. If everything works as expected you should see the Selenium test runner. The north east frame contains all your test cases (just one for now), and the north frame contains your test case.
Formats
The test cases can be written in a number of formats. Which one you choose is a matter of taste. You can generate your test files by running script/generate selenium or by creating them manually in your /test/selenium directory.
RSelenese, .rsel
RSelenese enable you to write your tests in Ruby. This is my favorite format.
setup :fixtures => :all
open '/'
assert_title 'Home'
('a'..'z').each {|c| open :controller => 'user', :action => 'create', :name => c }
See SeleniumOnRails::TestBuilder for available commands. This is also available in the SeleniumIDE, using the format here. IMPORTANT NOTE: RSelenese generates the HTML tables for Selenium behind the scenes when the page is loaded - ONCE. That means code like this:
(1..10).each do |index|
do something
end
Will only be executed when the test is loaded, not when the test is run. This is a common error and leads to tests that work the first time and fail the second time.
Selenese, .sel
Selenese is the dumbest format (in a good way). You just write your commands delimited by | characters.
|open|/selenium/setup|
|open|/|
|goBack|
If you dont want to write Selenese tests by hand you can use SeleniumIDE which has support for Selenese.
SeleniumIDE makes it super easy to record test and edit them.
HTML/RHTML
You can write your tests in HTML/RHTML but thats mostly useful if you have existing tests you want to reuse.
Partial test cases
If you have some common actions you want to do in several test cases you can put them in a separate partial test case and include them in your other test cases. This is highly recommended, just as small functions would be recommended in structured programming.
A partial test case is just like a normal test case besides that its filename has to start with _:
#_login.rsel
open '/login'
type 'name', name
type 'password', password
click 'submit', :wait=>true
To include a partial test case in a RSelenese test case:
include_partial 'login', :name => 'Jane Doe', :password => 'Jane Doe'.reverse
in a Selenese test case:
|includePartial|login|name=John Doe|password=eoD nhoJ|
and in a RHTML test case:
<%= render :partial => 'login', :locals => {:name = 'Joe Schmo', :password => 'Joe Schmo'.reverse} %>
Configuration
There are a number of settings available. You make them by renaming config.yml.example to config.yml and make your changes in that file.
Environments
Per default this plugin is only available in test environment. You can change this by setting environments, such as:
#config.yml
environments:
- test
- development
Selenium Core path
If you dont want to use the bundled Selenium Core version you can set selenium_path to the directory where Selenium Core is stored.
#config.yml
selenium_path: 'c:\selenium'
test:acceptance
You can run all your Selenium tests as a Rake task. If you're using a continuous builder this is a great way to integrate selenium into your build process.
First, if youre on Windows, you have to make sure win32-open3 is installed. Then you have to configure which browsers you want to run, like this:
#config.yml
browsers:
firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
ie: 'c:\Program Files\Internet Explorer\iexplore.exe'
Now youre all set. First start a server:
script/server -e test
Then run the tests:
rake test:acceptance
Now it should work, otherwise let me know!
Store results
If you want to store the results from a test:acceptance you just need to set in which directory they should be stored:
#config.yml
result_dir: 'c:\result'
So when you run rake test:acceptance the tables with the results will be stored as .html files in that directory.
This can be useful especially for continous integration.
= Selenium on Rails
== Overview
Selenium on Rails provides an easy way to test Rails application with
SeleniumCore[http://www.openqa.org/selenium-core/].
This plugin does four things:
1. The Selenium Core files don't have to pollute <tt>/public</tt>.
2. No need to create suite files, they are generated on the fly -- one suite per directory in <tt>/test/selenium</tt> (suites can be nested).
3. Instead of writing the test cases in HTML you can use a number of better formats (see <tt>Formats</tt>).
4. Loading of fixtures and wiping of session (<tt>/selenium/setup</tt>).
== Installation
== Installation for Rails 2.1
1. Install Selenium on Rails: script/plugin install http://svn.openqa.org/svn/selenium-on-rails/current/selenium-on-rails
2. If youre on Windows, gem install win32-open3
3. If the RedCloth gem is available the Selenese test cases can use it for better markup.
4. Run the Rakefile in the plugins directory to run the tests in order to see that everything works. (If RedCloth isnt installed a few tests will fail since they assume RedCloth is installed.)
5. Create a test case: script/generate selenium login
6. Start the server: script/server -e test
7. Point your browser to localhost:3000/selenium
8. If everything works as expected you should see the Selenium test runner. The north east frame contains all your test cases (just one for now), and the north frame contains your test case.
== Installation for rails versions before Rails 2.1
Rails has been changed in ways that break the original versions of Selenium on Rails. If you're using versions before Rails 2.1 you need to use this release. There are no plans to update this release with new changes or bug fixes unless there is sufficient demand, so if you can update then do so.
1. Install Selenium on Rails: script/plugin install http://svn.openqa.org/svn/selenium-on-rails/tags/pre-rails-2-1/selenium-on-rails
2. If youre on Windows, gem install win32-open3
3. If the RedCloth gem is available the Selenese test cases can use it for better markup.
4. Run the Rakefile in the plugins directory to run the tests in order to see that everything works. (If RedCloth isnt installed a few tests will fail since they assume RedCloth is installed.)
5. Create a test case: script/generate selenium login
6. Start the server: script/server -e test
7. Point your browser to localhost:3000/selenium
8. If everything works as expected you should see the Selenium test runner. The north east frame contains all your test cases (just one for now), and the north frame contains your test case.
== Formats
The test cases can be written in a number of formats. Which one you choose is a
matter of taste. You can generate your test files by running
<tt>script/generate selenium</tt> or by creating them manually in your
<tt>/test/selenium</tt> directory.
=== Selenese, .sel
Selenese is the dumbest format (in a good way). You just write your commands
delimited by | characters.
|open|/selenium/setup|
|open|/|
|goBack|
If you don't want to write Selenese tests by hand you can use
SeleniumIDE[http://www.openqa.org/selenium-ide/] which has
support[http://wiki.openqa.org/display/SIDE/SeleniumOnRails] for Selenese.
SeleniumIDE makes it super easy to record test and edit them.
=== RSelenese, .rsel
RSelenese enable you to write your tests in Ruby.
setup :fixtures => :all
open '/'
assert_title 'Home'
('a'..'z').each {|c| open :controller => 'user', :action => 'create', :name => c }
See SeleniumOnRails::TestBuilder for available commands.
=== HTML/RHTML
You can write your tests in HTML/RHTML but that's mostly useful if you have
existing tests you want to reuse.
=== Partial test cases
If you have some common actions you want to do in several test cases you can put
them in a separate partial test case and include them in your other test cases.
A partial test case is just like a normal test case besides that its filename
has to start with _:
#_login.rsel
open '/login'
type 'name', name
type 'password', password
click 'submit', :wait=>true
To include a partial test case you write like this in a Selenese test case:
|includePartial|login|name=John Doe|password=eoD nhoJ|
in a RSelenese test case:
include_partial 'login', :name => 'Jane Doe', :password => 'Jane Doe'.reverse
and in a RHTML test case:
<%= render :partial => 'login', :locals => {:name = 'Joe Schmo', :password => 'Joe Schmo'.reverse} %>
== Configuration
There are a number of settings available. You make them by copying <tt>config.yml.example</tt> to <tt>config/selenium.yml</tt> in your application and make your changes in that file.
=== Environments
Per default this plugin is only available in test environment. You can change
this by setting <tt>environments</tt>, such as:
#config.yml
environments:
- test
- development
=== Selenium Core path
If you don't want to use the bundled Selenium Core version you can set
<tt>selenium_path</tt> to the directory where Selenium Core is stored.
#config.yml
selenium_path: 'c:\selenium'
== <tt>test:acceptance</tt>
You can run all your Selenium tests as a Rake task.
First, if you're on Windows, you have to make sure win32-open3 is installed.
Then you have to configure which browsers you want to run, like this:
#config.yml
browsers:
firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
ie: 'c:\Program Files\Internet Explorer\iexplore.exe'
Now you're all set. First start a server:
script/server -e test
Then run the tests:
rake test:acceptance
Now it should work, otherwise let me know!
=== Store results
If you want to store the results from a <tt>test:acceptance</tt> you just need
to set in which directory they should be stored:
#config.yml
result_dir: 'c:\result'
So when you run <tt>rake test:acceptance</tt> the tables with the results will
be stored as <tt>.html</tt> files in that directory.
This can be useful especially for continous integration.
=== user_extension.js
Selenium has support for <tt>user_extension.js</tt> which is a way to extend the
functionality of Selenium Core. Selenium on Rails now provides the means for you
to extend it's functionality to match.
To get you started, we've included the example files
<tt>lib/test_builder_user_accessors.rb.example</tt> and
<tt>lib/test_builder_user_actions.rb.example</tt> that replicate the sample
extensions in Selenium Core's <tt>user-extensions.js.sample</tt>
To get these examples running, simply remove the .example and .sample extensions
from the files and restart your server.
== Todo
=== Standalone mode
More work is needed on <tt>test:acceptance</tt> on Windows to be able to start
the server when needed.
=== More setup/teardown support?
Currently there is only support to load fixtures and to wipe the session in
<tt>/selenium/setup</tt>. Is there a need for more kinds of setups or teardowns?
=== More documentation
== Not todo
=== Editor
Creating an editor for the test cases is currently considered out of scope for
this plugin. SeleniumIDE[http://www.openqa.org/selenium-ide/] does such a good
job and has support[http://wiki.openqa.org/display/SIDE/SeleniumOnRails] for
the Selenese format.
== Credits
* Jon Tirsen, http://jutopia.tirsen.com -- initial inspiration[http://wiki.rubyonrails.com/rails/pages/SeleniumIntegration]
* Eric Kidd, http://www.randomhacks.net -- contribution of RSelenese
* Jonas Bengston -- original creator
* Marcos Tapajos -- Several useful features
* Ryan Bates, http://railscasts.com -- Fixes for Rails 2.1
== Information
For more information, check out the website[http://www.openqa.org/selenium-on-rails/].

View file

@ -15,7 +15,7 @@ end
desc 'Generate documentation for the Selenium on Rails plugin.'
task :rdoc do
rm_rf 'doc'
RDoc::RDoc.new.document(%w(--line-numbers --inline-source --title SeleniumOnRails README lib))
RDoc::RDoc.new.document(%w(--line-numbers --inline-source --title SeleniumOnRails README CHANGELOG lib))
end
begin

View file

@ -1,27 +0,0 @@
# Rename this file to config.yml in order to configure the plugin
#
# General settings
#
environments:
- test
# - development # Uncomment this line to enable in development environment. N.B. your development database will likely be altered/destroyed/abducted
#selenium_path: 'c:\selenium' #path to selenium installation. only needed when selenium isn't installed in /vendor/selenium or as a gem
#
# rake test:acceptance settings
#
browsers:
firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
ie: 'c:\Program Files\Internet Explorer\iexplore.exe'
#host: 'localhost'
#port_start: 3000
#port_end: 3005
#max_browser_duration: 120
#multi_window: false
#result_dir: 'c:\result' # the directory where the results will be stored after a test:acceptance run

View file

@ -1,27 +1,33 @@
# Rename this file to config.yml in order to configure the plugin
#
# General settings
#
environments:
- test
# - development # Uncomment this line to enable in development environment. N.B. your development database will likely be altered/destroyed/abducted
#selenium_path: 'c:\selenium' #path to selenium installation. only needed when selenium isn't installed in /vendor/selenium or as a gem
#
# rake test:acceptance settings
#
browsers:
firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
ie: 'c:\Program Files\Internet Explorer\iexplore.exe'
#host: 'localhost'
#port_start: 3000
#port_end: 3005
#max_browser_duration: 120
#multi_window: false
#result_dir: 'c:\result' # the directory where the results will be stored after a test:acceptance run
# Move this file to your rails apps config directory and rename it to selenium.yml in order to configure the plugin
#
# General settings
#
environments:
- test
# - development # Uncomment this line to enable in development environment. N.B. your development database will likely be altered/destroyed/abducted
#selenium_path: 'c:\selenium' #path to selenium installation. only needed if you for some reason don't want to use the bundled version of selenium core
#
# rake test:acceptance settings
#
browsers:
# Windows
firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
ie: 'c:\Program Files\Internet Explorer\iexplore.exe'
# Mac OS X
#firefox: '/Applications/Firefox.app/Contents/MacOS/firefox-bin'
#safari: '/Applications/Safari.app/Contents/MacOS/Safari'
#host: 'localhost'
#port_start: 3000
#port_end: 3005
#base_url_path: '/'
#max_browser_duration: 120
#multi_window: false
#result_dir: 'c:\result' # the directory where the results will be stored after a test:acceptance run

View file

@ -1,265 +1,265 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumController</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumController</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/controllers/selenium_controller_rb.html">
lib/controllers/selenium_controller.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
ActionController::Base
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000006">record</a>&nbsp;&nbsp;
<a href="#M000003">setup</a>&nbsp;&nbsp;
<a href="#M000005">support_file</a>&nbsp;&nbsp;
<a href="#M000004">test_file</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="SeleniumOnRails/FixtureLoader.html">SeleniumOnRails::FixtureLoader</a></span>
<span class="include-name"><a href="SeleniumOnRails/Renderer.html">SeleniumOnRails::Renderer</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000006" class="method-detail">
<a name="M000006"></a>
<div class="method-heading">
<a href="#M000006" class="method-signature">
<span class="method-name">record</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000006-source">
<pre>
<span class="ruby-comment cmt"># File lib/controllers/selenium_controller.rb, line 50</span>
50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">record</span>
51: <span class="ruby-identifier">dir</span> = <span class="ruby-identifier">record_table</span>
52:
53: <span class="ruby-ivar">@result</span> = {<span class="ruby-value str">'resultDir'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">dir</span>}
54: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">p</span> <span class="ruby-keyword kw">in</span> [<span class="ruby-value str">'result'</span>, <span class="ruby-value str">'numTestFailures'</span>, <span class="ruby-value str">'numTestPasses'</span>, <span class="ruby-value str">'numCommandFailures'</span>, <span class="ruby-value str">'numCommandPasses'</span>, <span class="ruby-value str">'numCommandErrors'</span>, <span class="ruby-value str">'totalTime'</span>]
55: <span class="ruby-ivar">@result</span>[<span class="ruby-identifier">p</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">p</span>]
56: <span class="ruby-keyword kw">end</span>
57: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">log_path</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:logFile</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'default.yml'</span>), <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-ivar">@result</span>, <span class="ruby-identifier">f</span>)}
58:
59: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">view_path</span>(<span class="ruby-value str">'record.rhtml'</span>), <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">layout_path</span>
60: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000003" class="method-detail">
<a name="M000003"></a>
<div class="method-heading">
<a href="#M000003" class="method-signature">
<span class="method-name">setup</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000003-source">
<pre>
<span class="ruby-comment cmt"># File lib/controllers/selenium_controller.rb, line 7</span>
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
8: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">:keep_session</span>
9: <span class="ruby-identifier">reset_session</span>
10: <span class="ruby-ivar">@session_wiped</span> = <span class="ruby-keyword kw">true</span>
11: <span class="ruby-keyword kw">end</span>
12: <span class="ruby-ivar">@cleared_tables</span> = <span class="ruby-identifier">clear_tables</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:clear_tables</span>].<span class="ruby-identifier">to_s</span>
13: <span class="ruby-ivar">@loaded_fixtures</span> = <span class="ruby-identifier">load_fixtures</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:fixtures</span>].<span class="ruby-identifier">to_s</span>
14: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">view_path</span>(<span class="ruby-value str">'setup.rhtml'</span>), <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">layout_path</span>
15: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000005" class="method-detail">
<a name="M000005"></a>
<div class="method-heading">
<a href="#M000005" class="method-signature">
<span class="method-name">support_file</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000005-source">
<pre>
<span class="ruby-comment cmt"># File lib/controllers/selenium_controller.rb, line 34</span>
34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">support_file</span>
35: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:filename</span>].<span class="ruby-identifier">empty?</span>
36: <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:filename</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'TestRunner.html'</span>, <span class="ruby-identifier">:test</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'tests'</span>
37: <span class="ruby-keyword kw">return</span>
38: <span class="ruby-keyword kw">end</span>
39:
40: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span> <span class="ruby-identifier">selenium_path</span>, <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:filename</span>]
41: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span> <span class="ruby-identifier">filename</span>
42: <span class="ruby-identifier">type</span> = <span class="ruby-constant">WEBrick</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPUtils</span><span class="ruby-operator">::</span><span class="ruby-constant">DefaultMimeTypes</span>[<span class="ruby-identifier">$1</span>.<span class="ruby-identifier">downcase</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\.(\w+)$/</span>
43: <span class="ruby-identifier">type</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'text/html'</span>
44: <span class="ruby-identifier">send_file</span> <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type</span>, <span class="ruby-identifier">:disposition</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'inline'</span>, <span class="ruby-identifier">:stream</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>
45: <span class="ruby-keyword kw">else</span>
46: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Not found'</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">404</span>
47: <span class="ruby-keyword kw">end</span>
48: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000004" class="method-detail">
<a name="M000004"></a>
<div class="method-heading">
<a href="#M000004" class="method-signature">
<span class="method-name">test_file</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000004-source">
<pre>
<span class="ruby-comment cmt"># File lib/controllers/selenium_controller.rb, line 17</span>
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_file</span>
18: <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:testname</span>] = <span class="ruby-value str">''</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:testname</span>].<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'TestSuite.html'</span>
19: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span> <span class="ruby-identifier">selenium_tests_path</span>, <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:testname</span>]
20: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">filename</span>
21: <span class="ruby-ivar">@suite_path</span> = <span class="ruby-identifier">filename</span>
22: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">view_path</span>(<span class="ruby-value str">'test_suite.rhtml'</span>), <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">layout_path</span>
23: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">readable?</span> <span class="ruby-identifier">filename</span>
24: <span class="ruby-identifier">render_test_case</span> <span class="ruby-identifier">filename</span>
25: <span class="ruby-keyword kw">else</span>
26: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">selenium_tests_path</span>
27: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Not found'</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">404</span>
28: <span class="ruby-keyword kw">else</span>
29: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;Did not find the Selenium tests path (#{selenium_tests_path}). Run script/generate selenium&quot;</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">404</span>
30: <span class="ruby-keyword kw">end</span>
31: <span class="ruby-keyword kw">end</span>
32: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumController</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumController</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/controllers/selenium_controller_rb.html">
lib/controllers/selenium_controller.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
ActionController::Base
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000006">record</a>&nbsp;&nbsp;
<a href="#M000003">setup</a>&nbsp;&nbsp;
<a href="#M000005">support_file</a>&nbsp;&nbsp;
<a href="#M000004">test_file</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="SeleniumOnRails/FixtureLoader.html">SeleniumOnRails::FixtureLoader</a></span>
<span class="include-name"><a href="SeleniumOnRails/Renderer.html">SeleniumOnRails::Renderer</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000006" class="method-detail">
<a name="M000006"></a>
<div class="method-heading">
<a href="#M000006" class="method-signature">
<span class="method-name">record</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000006-source">
<pre>
<span class="ruby-comment cmt"># File lib/controllers/selenium_controller.rb, line 50</span>
50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">record</span>
51: <span class="ruby-identifier">dir</span> = <span class="ruby-identifier">record_table</span>
52:
53: <span class="ruby-ivar">@result</span> = {<span class="ruby-value str">'resultDir'</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">dir</span>}
54: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">p</span> <span class="ruby-keyword kw">in</span> [<span class="ruby-value str">'result'</span>, <span class="ruby-value str">'numTestFailures'</span>, <span class="ruby-value str">'numTestPasses'</span>, <span class="ruby-value str">'numCommandFailures'</span>, <span class="ruby-value str">'numCommandPasses'</span>, <span class="ruby-value str">'numCommandErrors'</span>, <span class="ruby-value str">'totalTime'</span>]
55: <span class="ruby-ivar">@result</span>[<span class="ruby-identifier">p</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-identifier">p</span>]
56: <span class="ruby-keyword kw">end</span>
57: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">log_path</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:logFile</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'default.yml'</span>), <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-ivar">@result</span>, <span class="ruby-identifier">f</span>)}
58:
59: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">view_path</span>(<span class="ruby-value str">'record.rhtml'</span>), <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">layout_path</span>
60: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000003" class="method-detail">
<a name="M000003"></a>
<div class="method-heading">
<a href="#M000003" class="method-signature">
<span class="method-name">setup</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000003-source">
<pre>
<span class="ruby-comment cmt"># File lib/controllers/selenium_controller.rb, line 7</span>
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
8: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">:keep_session</span>
9: <span class="ruby-identifier">reset_session</span>
10: <span class="ruby-ivar">@session_wiped</span> = <span class="ruby-keyword kw">true</span>
11: <span class="ruby-keyword kw">end</span>
12: <span class="ruby-ivar">@cleared_tables</span> = <span class="ruby-identifier">clear_tables</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:clear_tables</span>].<span class="ruby-identifier">to_s</span>
13: <span class="ruby-ivar">@loaded_fixtures</span> = <span class="ruby-identifier">load_fixtures</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:fixtures</span>].<span class="ruby-identifier">to_s</span>
14: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">view_path</span>(<span class="ruby-value str">'setup.rhtml'</span>), <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">layout_path</span>
15: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000005" class="method-detail">
<a name="M000005"></a>
<div class="method-heading">
<a href="#M000005" class="method-signature">
<span class="method-name">support_file</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000005-source">
<pre>
<span class="ruby-comment cmt"># File lib/controllers/selenium_controller.rb, line 34</span>
34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">support_file</span>
35: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:filename</span>].<span class="ruby-identifier">empty?</span>
36: <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:filename</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'TestRunner.html'</span>, <span class="ruby-identifier">:test</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'tests'</span>
37: <span class="ruby-keyword kw">return</span>
38: <span class="ruby-keyword kw">end</span>
39:
40: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span> <span class="ruby-identifier">selenium_path</span>, <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:filename</span>]
41: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span> <span class="ruby-identifier">filename</span>
42: <span class="ruby-identifier">type</span> = <span class="ruby-constant">WEBrick</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPUtils</span><span class="ruby-operator">::</span><span class="ruby-constant">DefaultMimeTypes</span>[<span class="ruby-identifier">$1</span>.<span class="ruby-identifier">downcase</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filename</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\.(\w+)$/</span>
43: <span class="ruby-identifier">type</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'text/html'</span>
44: <span class="ruby-identifier">send_file</span> <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type</span>, <span class="ruby-identifier">:disposition</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'inline'</span>, <span class="ruby-identifier">:stream</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>
45: <span class="ruby-keyword kw">else</span>
46: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Not found'</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">404</span>
47: <span class="ruby-keyword kw">end</span>
48: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000004" class="method-detail">
<a name="M000004"></a>
<div class="method-heading">
<a href="#M000004" class="method-signature">
<span class="method-name">test_file</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000004-source">
<pre>
<span class="ruby-comment cmt"># File lib/controllers/selenium_controller.rb, line 17</span>
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_file</span>
18: <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:testname</span>] = <span class="ruby-value str">''</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:testname</span>].<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'TestSuite.html'</span>
19: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span> <span class="ruby-identifier">selenium_tests_path</span>, <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:testname</span>]
20: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">filename</span>
21: <span class="ruby-ivar">@suite_path</span> = <span class="ruby-identifier">filename</span>
22: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">view_path</span>(<span class="ruby-value str">'test_suite.rhtml'</span>), <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">layout_path</span>
23: <span class="ruby-keyword kw">elsif</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">readable?</span> <span class="ruby-identifier">filename</span>
24: <span class="ruby-identifier">render_test_case</span> <span class="ruby-identifier">filename</span>
25: <span class="ruby-keyword kw">else</span>
26: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">selenium_tests_path</span>
27: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'Not found'</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">404</span>
28: <span class="ruby-keyword kw">else</span>
29: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;Did not find the Selenium tests path (#{selenium_tests_path}). Run script/generate selenium&quot;</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">404</span>
30: <span class="ruby-keyword kw">end</span>
31: <span class="ruby-keyword kw">end</span>
32: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,148 +1,148 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumHelper</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumHelper</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/selenium_helper_rb.html">
lib/selenium_helper.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000008">test_case_name</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="SeleniumOnRails/SuiteRenderer.html">SeleniumOnRails::SuiteRenderer</a></span>
<span class="include-name"><a href="SeleniumOnRails/FixtureLoader.html">SeleniumOnRails::FixtureLoader</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000008" class="method-detail">
<a name="M000008"></a>
<div class="method-heading">
<a href="#M000008" class="method-signature">
<span class="method-name">test_case_name</span><span class="method-args">(filename)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000008-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_helper.rb, line 5</span>
5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_case_name</span> <span class="ruby-identifier">filename</span>
6: <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\..*/</span>,<span class="ruby-value str">''</span>).<span class="ruby-identifier">humanize</span>
7: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumHelper</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumHelper</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/selenium_helper_rb.html">
lib/selenium_helper.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000008">test_case_name</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="SeleniumOnRails/SuiteRenderer.html">SeleniumOnRails::SuiteRenderer</a></span>
<span class="include-name"><a href="SeleniumOnRails/FixtureLoader.html">SeleniumOnRails::FixtureLoader</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000008" class="method-detail">
<a name="M000008"></a>
<div class="method-heading">
<a href="#M000008" class="method-signature">
<span class="method-name">test_case_name</span><span class="method-args">(filename)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000008-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_helper.rb, line 5</span>
5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_case_name</span> <span class="ruby-identifier">filename</span>
6: <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\..*/</span>,<span class="ruby-value str">''</span>).<span class="ruby-identifier">humanize</span>
7: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,124 +1,126 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/selenium_on_rails/paths_rb.html">
lib/selenium_on_rails/paths.rb
</a>
<br />
<a href="../files/lib/selenium_on_rails_rb.html">
lib/selenium_on_rails.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<div id="class-list">
<h3 class="section-bar">Classes and Modules</h3>
Module <a href="SeleniumOnRails/FixtureLoader.html" class="link">SeleniumOnRails::FixtureLoader</a><br />
Module <a href="SeleniumOnRails/PartialsSupport.html" class="link">SeleniumOnRails::PartialsSupport</a><br />
Module <a href="SeleniumOnRails/Paths.html" class="link">SeleniumOnRails::Paths</a><br />
Module <a href="SeleniumOnRails/Renderer.html" class="link">SeleniumOnRails::Renderer</a><br />
Module <a href="SeleniumOnRails/SuiteRenderer.html" class="link">SeleniumOnRails::SuiteRenderer</a><br />
Module <a href="SeleniumOnRails/TestBuilderAccessors.html" class="link">SeleniumOnRails::TestBuilderAccessors</a><br />
Module <a href="SeleniumOnRails/TestBuilderActions.html" class="link">SeleniumOnRails::TestBuilderActions</a><br />
Class <a href="SeleniumOnRails/RSelenese.html" class="link">SeleniumOnRails::RSelenese</a><br />
Class <a href="SeleniumOnRails/Selenese.html" class="link">SeleniumOnRails::Selenese</a><br />
Class <a href="SeleniumOnRails/TestBuilder.html" class="link">SeleniumOnRails::TestBuilder</a><br />
</div>
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/selenium_on_rails/paths_rb.html">
lib/selenium_on_rails/paths.rb
</a>
<br />
<a href="../files/lib/selenium_on_rails_rb.html">
lib/selenium_on_rails.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<div id="class-list">
<h3 class="section-bar">Classes and Modules</h3>
Module <a href="SeleniumOnRails/FixtureLoader.html" class="link">SeleniumOnRails::FixtureLoader</a><br />
Module <a href="SeleniumOnRails/PartialsSupport.html" class="link">SeleniumOnRails::PartialsSupport</a><br />
Module <a href="SeleniumOnRails/Paths.html" class="link">SeleniumOnRails::Paths</a><br />
Module <a href="SeleniumOnRails/Renderer.html" class="link">SeleniumOnRails::Renderer</a><br />
Module <a href="SeleniumOnRails/SuiteRenderer.html" class="link">SeleniumOnRails::SuiteRenderer</a><br />
Module <a href="SeleniumOnRails/TestBuilderAccessors.html" class="link">SeleniumOnRails::TestBuilderAccessors</a><br />
Module <a href="SeleniumOnRails/TestBuilderActions.html" class="link">SeleniumOnRails::TestBuilderActions</a><br />
Module <a href="SeleniumOnRails/TestBuilderUserAccessors.html" class="link">SeleniumOnRails::TestBuilderUserAccessors</a><br />
Module <a href="SeleniumOnRails/TestBuilderUserActions.html" class="link">SeleniumOnRails::TestBuilderUserActions</a><br />
Class <a href="SeleniumOnRails/RSelenese.html" class="link">SeleniumOnRails::RSelenese</a><br />
Class <a href="SeleniumOnRails/Selenese.html" class="link">SeleniumOnRails::Selenese</a><br />
Class <a href="SeleniumOnRails/TestBuilder.html" class="link">SeleniumOnRails::TestBuilder</a><br />
</div>
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,231 +1,231 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::FixtureLoader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::FixtureLoader</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/fixture_loader_rb.html">
lib/selenium_on_rails/fixture_loader.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000049">available_fixtures</a>&nbsp;&nbsp;
<a href="#M000051">clear_tables</a>&nbsp;&nbsp;
<a href="#M000050">load_fixtures</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="Paths.html">SeleniumOnRails::Paths</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000049" class="method-detail">
<a name="M000049"></a>
<div class="method-heading">
<a href="#M000049" class="method-signature">
<span class="method-name">available_fixtures</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000049-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/fixture_loader.rb, line 6</span>
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">available_fixtures</span>
7: <span class="ruby-identifier">fixtures</span> = {}
8: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">fixtures_path</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span>
9: <span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-node">&quot;#{path}**/*.{yml,csv}&quot;</span>]
10: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
11: <span class="ruby-identifier">rel_path</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value str">''</span>)
12: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">skip_file?</span> <span class="ruby-identifier">rel_path</span>
13: <span class="ruby-identifier">fixture_set</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">rel_path</span>)
14: <span class="ruby-identifier">fixture_set</span> = <span class="ruby-value str">''</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fixture_set</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'.'</span>
15: <span class="ruby-identifier">fixture</span> = <span class="ruby-identifier">rel_path</span>.<span class="ruby-identifier">sub</span> <span class="ruby-regexp re">/\.[^.]*$/</span>, <span class="ruby-value str">''</span>
16: <span class="ruby-identifier">fixtures</span>[<span class="ruby-identifier">fixture_set</span>] <span class="ruby-operator">||=</span> []
17: <span class="ruby-identifier">fixtures</span>[<span class="ruby-identifier">fixture_set</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fixture</span>
18: <span class="ruby-keyword kw">end</span>
19:
20: <span class="ruby-identifier">fixtures</span>
21: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000051" class="method-detail">
<a name="M000051"></a>
<div class="method-heading">
<a href="#M000051" class="method-signature">
<span class="method-name">clear_tables</span><span class="method-args">(tables)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000051-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/fixture_loader.rb, line 45</span>
45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_tables</span> <span class="ruby-identifier">tables</span>
46: <span class="ruby-identifier">table_names</span> = <span class="ruby-identifier">tables</span>.<span class="ruby-identifier">split</span> <span class="ruby-regexp re">/\s*,\s*/</span>
47: <span class="ruby-identifier">connection</span> = <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">connection</span>
48: <span class="ruby-identifier">table_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">table</span><span class="ruby-operator">|</span>
49: <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;DELETE FROM #{table}&quot;</span>
50: <span class="ruby-keyword kw">end</span>
51: <span class="ruby-identifier">table_names</span>
52: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000050" class="method-detail">
<a name="M000050"></a>
<div class="method-heading">
<a href="#M000050" class="method-signature">
<span class="method-name">load_fixtures</span><span class="method-args">(fixtures_param)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000050-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/fixture_loader.rb, line 23</span>
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_fixtures</span> <span class="ruby-identifier">fixtures_param</span>
24: <span class="ruby-identifier">available</span> = <span class="ruby-keyword kw">nil</span>
25: <span class="ruby-identifier">fixtures</span> = <span class="ruby-identifier">fixtures_param</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/\s*,\s*/</span>).<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
26: <span class="ruby-identifier">fixture_set</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span> <span class="ruby-identifier">f</span>
27: <span class="ruby-identifier">fixture_set</span> = <span class="ruby-value str">''</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fixture_set</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'.'</span>
28: <span class="ruby-identifier">fixture</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span> <span class="ruby-identifier">f</span>
29: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fixture</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'all'</span>
30: <span class="ruby-identifier">available</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">available_fixtures</span>
31: <span class="ruby-identifier">available</span>[<span class="ruby-identifier">fixture_set</span>]
32: <span class="ruby-keyword kw">else</span>
33: <span class="ruby-identifier">f</span>
34: <span class="ruby-keyword kw">end</span>
35: <span class="ruby-keyword kw">end</span>
36: <span class="ruby-identifier">fixtures</span>.<span class="ruby-identifier">flatten!</span>
37: <span class="ruby-identifier">fixtures</span>.<span class="ruby-identifier">reject!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">blank?</span> }
38:
39: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fixtures</span>.<span class="ruby-identifier">any?</span>
40: <span class="ruby-constant">Fixtures</span>.<span class="ruby-identifier">create_fixtures</span> <span class="ruby-identifier">fixtures_path</span>, <span class="ruby-identifier">fixtures</span>
41: <span class="ruby-keyword kw">end</span>
42: <span class="ruby-identifier">fixtures</span>
43: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::FixtureLoader</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::FixtureLoader</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/fixture_loader_rb.html">
lib/selenium_on_rails/fixture_loader.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000083">available_fixtures</a>&nbsp;&nbsp;
<a href="#M000085">clear_tables</a>&nbsp;&nbsp;
<a href="#M000084">load_fixtures</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="Paths.html">SeleniumOnRails::Paths</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000083" class="method-detail">
<a name="M000083"></a>
<div class="method-heading">
<a href="#M000083" class="method-signature">
<span class="method-name">available_fixtures</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000083-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/fixture_loader.rb, line 7</span>
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">available_fixtures</span>
8: <span class="ruby-identifier">fixtures</span> = {}
9: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">fixtures_path</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/'</span>
10: <span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-node">&quot;#{path}**/*.{yml,csv}&quot;</span>]
11: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
12: <span class="ruby-identifier">rel_path</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value str">''</span>)
13: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">skip_file?</span> <span class="ruby-identifier">rel_path</span>
14: <span class="ruby-identifier">fixture_set</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">rel_path</span>)
15: <span class="ruby-identifier">fixture_set</span> = <span class="ruby-value str">''</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fixture_set</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'.'</span>
16: <span class="ruby-identifier">fixture</span> = <span class="ruby-identifier">rel_path</span>.<span class="ruby-identifier">sub</span> <span class="ruby-regexp re">/\.[^.]*$/</span>, <span class="ruby-value str">''</span>
17: <span class="ruby-identifier">fixtures</span>[<span class="ruby-identifier">fixture_set</span>] <span class="ruby-operator">||=</span> []
18: <span class="ruby-identifier">fixtures</span>[<span class="ruby-identifier">fixture_set</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fixture</span>
19: <span class="ruby-keyword kw">end</span>
20:
21: <span class="ruby-identifier">fixtures</span>
22: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000085" class="method-detail">
<a name="M000085"></a>
<div class="method-heading">
<a href="#M000085" class="method-signature">
<span class="method-name">clear_tables</span><span class="method-args">(tables)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000085-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/fixture_loader.rb, line 46</span>
46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_tables</span> <span class="ruby-identifier">tables</span>
47: <span class="ruby-identifier">table_names</span> = <span class="ruby-identifier">tables</span>.<span class="ruby-identifier">split</span> <span class="ruby-regexp re">/\s*,\s*/</span>
48: <span class="ruby-identifier">connection</span> = <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">connection</span>
49: <span class="ruby-identifier">table_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">table</span><span class="ruby-operator">|</span>
50: <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;DELETE FROM #{table}&quot;</span>
51: <span class="ruby-keyword kw">end</span>
52: <span class="ruby-identifier">table_names</span>
53: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000084" class="method-detail">
<a name="M000084"></a>
<div class="method-heading">
<a href="#M000084" class="method-signature">
<span class="method-name">load_fixtures</span><span class="method-args">(fixtures_param)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000084-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/fixture_loader.rb, line 24</span>
24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_fixtures</span> <span class="ruby-identifier">fixtures_param</span>
25: <span class="ruby-identifier">available</span> = <span class="ruby-keyword kw">nil</span>
26: <span class="ruby-identifier">fixtures</span> = <span class="ruby-identifier">fixtures_param</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/\s*,\s*/</span>).<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
27: <span class="ruby-identifier">fixture_set</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span> <span class="ruby-identifier">f</span>
28: <span class="ruby-identifier">fixture_set</span> = <span class="ruby-value str">''</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fixture_set</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'.'</span>
29: <span class="ruby-identifier">fixture</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span> <span class="ruby-identifier">f</span>
30: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fixture</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'all'</span>
31: <span class="ruby-identifier">available</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">available_fixtures</span>
32: <span class="ruby-identifier">available</span>[<span class="ruby-identifier">fixture_set</span>]
33: <span class="ruby-keyword kw">else</span>
34: <span class="ruby-identifier">f</span>
35: <span class="ruby-keyword kw">end</span>
36: <span class="ruby-keyword kw">end</span>
37: <span class="ruby-identifier">fixtures</span>.<span class="ruby-identifier">flatten!</span>
38: <span class="ruby-identifier">fixtures</span>.<span class="ruby-identifier">reject!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">blank?</span> }
39:
40: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fixtures</span>.<span class="ruby-identifier">any?</span>
41: <span class="ruby-constant">Fixtures</span>.<span class="ruby-identifier">create_fixtures</span> <span class="ruby-identifier">fixtures_path</span>, <span class="ruby-identifier">fixtures</span>
42: <span class="ruby-keyword kw">end</span>
43: <span class="ruby-identifier">fixtures</span>
44: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,195 +1,195 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::PartialsSupport</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::PartialsSupport</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/partials_support_rb.html">
lib/selenium_on_rails/partials_support.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Provides partials support to test cases so they can include other partial
test cases.
</p>
<p>
The partial&#8217;s commands are returned as html table rows.
</p>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000081">extract_commands_from_partial</a>&nbsp;&nbsp;
<a href="#M000080">render_partial</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="Paths.html">SeleniumOnRails::Paths</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000081" class="method-detail">
<a name="M000081"></a>
<div class="method-heading">
<a href="#M000081" class="method-signature">
<span class="method-name">extract_commands_from_partial</span><span class="method-args">(partial)</span>
</a>
</div>
<div class="method-description">
<p>
Extracts the commands from a partial. The partial must contain a html table
and the first row is ignored since it cannot contain a command.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000081-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/partials_support.rb, line 19</span>
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extract_commands_from_partial</span> <span class="ruby-identifier">partial</span>
20: <span class="ruby-identifier">partial</span> = <span class="ruby-identifier">partial</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/.*&lt;table&gt;.*?&lt;tr&gt;.*?&lt;\/tr&gt;(.*?)&lt;\/table&gt;/i</span><span class="ruby-identifier">m</span>)[<span class="ruby-value">1</span>]
21: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Partial '#{name}' doesn't contain any table&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">partial</span>
22: <span class="ruby-identifier">partial</span>
23: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000080" class="method-detail">
<a name="M000080"></a>
<div class="method-heading">
<a href="#M000080" class="method-signature">
<span class="method-name">render_partial</span><span class="method-args">(partial_path = default_template_name, object = nil, local_assigns = nil, status = nil)</span>
</a>
</div>
<div class="method-description">
<p>
Overrides where the partial is searched for, and returns only the command
table rows.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000080-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/partials_support.rb, line 9</span>
9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_partial</span> <span class="ruby-identifier">partial_path</span> = <span class="ruby-identifier">default_template_name</span>, <span class="ruby-identifier">object</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">local_assigns</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">status</span> = <span class="ruby-keyword kw">nil</span>
10: <span class="ruby-identifier">pattern</span> = <span class="ruby-identifier">partial_pattern</span> <span class="ruby-identifier">partial_path</span>
11: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-identifier">pattern</span>].<span class="ruby-identifier">first</span>
12: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Partial '#{partial_path}' cannot be found! (Looking for file: '#{pattern}')&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filename</span>
13: <span class="ruby-identifier">partial</span> = <span class="ruby-identifier">render</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">:use_full_path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:locals</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">local_assigns</span>
14: <span class="ruby-identifier">extract_commands_from_partial</span> <span class="ruby-identifier">partial</span>
15: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::PartialsSupport</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::PartialsSupport</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/partials_support_rb.html">
lib/selenium_on_rails/partials_support.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Provides partials support to test cases so they can include other partial
test cases.
</p>
<p>
The partial&#8216;s commands are returned as html table rows.
</p>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000142">extract_commands_from_partial</a>&nbsp;&nbsp;
<a href="#M000141">render_partial</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="Paths.html">SeleniumOnRails::Paths</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000142" class="method-detail">
<a name="M000142"></a>
<div class="method-heading">
<a href="#M000142" class="method-signature">
<span class="method-name">extract_commands_from_partial</span><span class="method-args">(partial)</span>
</a>
</div>
<div class="method-description">
<p>
Extracts the commands from a partial. The partial must contain a html table
and the first row is ignored since it cannot contain a command.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000142-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000142-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/partials_support.rb, line 19</span>
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extract_commands_from_partial</span> <span class="ruby-identifier">partial</span>
20: <span class="ruby-identifier">partial</span> = <span class="ruby-identifier">partial</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/.*&lt;table&gt;.*?&lt;tr&gt;.*?&lt;\/tr&gt;(.*?)&lt;\/table&gt;/i</span><span class="ruby-identifier">m</span>)[<span class="ruby-value">1</span>]
21: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Partial '#{name}' doesn't contain any table&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">partial</span>
22: <span class="ruby-identifier">partial</span>
23: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000141" class="method-detail">
<a name="M000141"></a>
<div class="method-heading">
<a href="#M000141" class="method-signature">
<span class="method-name">render_partial</span><span class="method-args">(partial_path = default_template_name, object = nil, local_assigns = nil, status = nil)</span>
</a>
</div>
<div class="method-description">
<p>
Overrides where the partial is searched for, and returns only the command
table rows.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000141-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/partials_support.rb, line 9</span>
9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_partial</span> <span class="ruby-identifier">partial_path</span> = <span class="ruby-identifier">default_template_name</span>, <span class="ruby-identifier">object</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">local_assigns</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">status</span> = <span class="ruby-keyword kw">nil</span>
10: <span class="ruby-identifier">pattern</span> = <span class="ruby-identifier">partial_pattern</span> <span class="ruby-identifier">partial_path</span>
11: <span class="ruby-identifier">filename</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-identifier">pattern</span>].<span class="ruby-identifier">first</span>
12: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Partial '#{partial_path}' cannot be found! (Looking for file: '#{pattern}')&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filename</span>
13: <span class="ruby-identifier">partial</span> = <span class="ruby-identifier">render</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">:use_full_path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:locals</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">local_assigns</span>
14: <span class="ruby-identifier">extract_commands_from_partial</span> <span class="ruby-identifier">partial</span>
15: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,295 +1,295 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::Paths</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::Paths</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/paths_rb.html">
lib/selenium_on_rails/paths.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000042">fixtures_path</a>&nbsp;&nbsp;
<a href="#M000041">layout_path</a>&nbsp;&nbsp;
<a href="#M000043">log_path</a>&nbsp;&nbsp;
<a href="#M000038">selenium_path</a>&nbsp;&nbsp;
<a href="#M000039">selenium_tests_path</a>&nbsp;&nbsp;
<a href="#M000044">skip_file?</a>&nbsp;&nbsp;
<a href="#M000040">view_path</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000042" class="method-detail">
<a name="M000042"></a>
<div class="method-heading">
<a href="#M000042" class="method-signature">
<span class="method-name">fixtures_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000042-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 25</span>
25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fixtures_path</span>
26: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RAILS_ROOT</span>, <span class="ruby-value str">'test/fixtures'</span>)
27: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000041" class="method-detail">
<a name="M000041"></a>
<div class="method-heading">
<a href="#M000041" class="method-signature">
<span class="method-name">layout_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p>
Returns the path to the layout template. The path is relative in relation
to the app/views/ directory since Rails doesn&#8217;t support absolute
paths to layout templates.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000041-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 19</span>
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">layout_path</span>
20: <span class="ruby-identifier">rails_root</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RAILS_ROOT</span>, <span class="ruby-value str">'app/views'</span>))
21: <span class="ruby-identifier">view_path</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">view_path</span>(<span class="ruby-value str">'layout'</span>)
22: <span class="ruby-identifier">view_path</span>.<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-identifier">rails_root</span>).<span class="ruby-identifier">to_s</span>
23: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000043" class="method-detail">
<a name="M000043"></a>
<div class="method-heading">
<a href="#M000043" class="method-signature">
<span class="method-name">log_path</span><span class="method-args">(log_file)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000043-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 29</span>
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_path</span> <span class="ruby-identifier">log_file</span>
30: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">'/../../log/'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">log_file</span>)
31: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000038" class="method-detail">
<a name="M000038"></a>
<div class="method-heading">
<a href="#M000038" class="method-signature">
<span class="method-name">selenium_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000038-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 3</span>
3: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">selenium_path</span>
4: <span class="ruby-ivar">@@selenium_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">find_selenium_path</span>
5: <span class="ruby-ivar">@@selenium_path</span>
6: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000039" class="method-detail">
<a name="M000039"></a>
<div class="method-heading">
<a href="#M000039" class="method-signature">
<span class="method-name">selenium_tests_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000039-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 8</span>
8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">selenium_tests_path</span>
9: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RAILS_ROOT</span>, <span class="ruby-value str">'test/selenium'</span>))
10: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000044" class="method-detail">
<a name="M000044"></a>
<div class="method-heading">
<a href="#M000044" class="method-signature">
<span class="method-name">skip_file?</span><span class="method-args">(file)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000044-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 33</span>
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skip_file?</span> <span class="ruby-identifier">file</span>
34: <span class="ruby-identifier">file</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
35: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">upcase</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'CVS'</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">starts_with?</span>(<span class="ruby-value str">'.'</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">ends_with?</span>(<span class="ruby-value str">'~'</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">starts_with?</span>(<span class="ruby-value str">'_'</span>)
36: <span class="ruby-keyword kw">end</span>
37: <span class="ruby-keyword kw">false</span>
38: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000040" class="method-detail">
<a name="M000040"></a>
<div class="method-heading">
<a href="#M000040" class="method-signature">
<span class="method-name">view_path</span><span class="method-args">(view)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000040-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 12</span>
12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">view_path</span> <span class="ruby-identifier">view</span>
13: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">'/../views/'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">view</span>)
14: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::Paths</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::Paths</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/paths_rb.html">
lib/selenium_on_rails/paths.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000076">fixtures_path</a>&nbsp;&nbsp;
<a href="#M000075">layout_path</a>&nbsp;&nbsp;
<a href="#M000077">log_path</a>&nbsp;&nbsp;
<a href="#M000072">selenium_path</a>&nbsp;&nbsp;
<a href="#M000073">selenium_tests_path</a>&nbsp;&nbsp;
<a href="#M000078">skip_file?</a>&nbsp;&nbsp;
<a href="#M000074">view_path</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000076" class="method-detail">
<a name="M000076"></a>
<div class="method-heading">
<a href="#M000076" class="method-signature">
<span class="method-name">fixtures_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000076-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 25</span>
25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fixtures_path</span>
26: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RAILS_ROOT</span>, <span class="ruby-value str">'test/fixtures'</span>)
27: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000075" class="method-detail">
<a name="M000075"></a>
<div class="method-heading">
<a href="#M000075" class="method-signature">
<span class="method-name">layout_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p>
Returns the path to the layout template. The path is relative in relation
to the app/views/ directory since Rails doesn&#8216;t support absolute
paths to layout templates.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000075-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 19</span>
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">layout_path</span>
20: <span class="ruby-identifier">rails_root</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RAILS_ROOT</span>, <span class="ruby-value str">'app/views'</span>))
21: <span class="ruby-identifier">view_path</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">view_path</span>(<span class="ruby-value str">'layout'</span>)
22: <span class="ruby-identifier">view_path</span>.<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-identifier">rails_root</span>).<span class="ruby-identifier">to_s</span>
23: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000077" class="method-detail">
<a name="M000077"></a>
<div class="method-heading">
<a href="#M000077" class="method-signature">
<span class="method-name">log_path</span><span class="method-args">(log_file)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000077-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 29</span>
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_path</span> <span class="ruby-identifier">log_file</span>
30: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">'/../../log/'</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">log_file</span>))
31: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000072" class="method-detail">
<a name="M000072"></a>
<div class="method-heading">
<a href="#M000072" class="method-signature">
<span class="method-name">selenium_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000072-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 3</span>
3: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">selenium_path</span>
4: <span class="ruby-ivar">@@selenium_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">find_selenium_path</span>
5: <span class="ruby-ivar">@@selenium_path</span>
6: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000073" class="method-detail">
<a name="M000073"></a>
<div class="method-heading">
<a href="#M000073" class="method-signature">
<span class="method-name">selenium_tests_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000073-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 8</span>
8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">selenium_tests_path</span>
9: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RAILS_ROOT</span>, <span class="ruby-value str">'test/selenium'</span>))
10: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000078" class="method-detail">
<a name="M000078"></a>
<div class="method-heading">
<a href="#M000078" class="method-signature">
<span class="method-name">skip_file?</span><span class="method-args">(file)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000078-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 33</span>
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skip_file?</span> <span class="ruby-identifier">file</span>
34: <span class="ruby-identifier">file</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
35: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">upcase</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'CVS'</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">starts_with?</span>(<span class="ruby-value str">'.'</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">ends_with?</span>(<span class="ruby-value str">'~'</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">starts_with?</span>(<span class="ruby-value str">'_'</span>)
36: <span class="ruby-keyword kw">end</span>
37: <span class="ruby-keyword kw">false</span>
38: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000074" class="method-detail">
<a name="M000074"></a>
<div class="method-heading">
<a href="#M000074" class="method-signature">
<span class="method-name">view_path</span><span class="method-args">(view)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000074-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 12</span>
12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">view_path</span> <span class="ruby-identifier">view</span>
13: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">'/../views/'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">view</span>)
14: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,219 +1,219 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumOnRails::RSelenese</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumOnRails::RSelenese</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/rselenese_rb.html">
lib/selenium_on_rails/rselenese.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
<a href="TestBuilder.html">
SeleniumOnRails::TestBuilder
</a>
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Renders Selenium test templates in a fashion analogous to <tt>rxml</tt> and
<tt>rjs</tt> templates.
</p>
<pre>
setup
open :controller =&gt; 'customer', :action =&gt; 'list'
assert_title 'Customers'
</pre>
<p>
See <a href="TestBuilder.html">SeleniumOnRails::TestBuilder</a> for a list
of available commands.
</p>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000084">new</a>&nbsp;&nbsp;
<a href="#M000085">render</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<div id="attribute-list">
<h3 class="section-bar">Attributes</h3>
<div class="name-list">
<table>
<tr class="top-aligned-row context-row">
<td class="context-item-name">view</td>
<td class="context-item-value">&nbsp;[RW]&nbsp;</td>
<td class="context-item-desc"></td>
</tr>
</table>
</div>
</div>
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000084" class="method-detail">
<a name="M000084"></a>
<div class="method-heading">
<a href="#M000084" class="method-signature">
<span class="method-name">new</span><span class="method-args">(view)</span>
</a>
</div>
<div class="method-description">
<p>
Create a new <a href="RSelenese.html">RSelenese</a> renderer bound to
<em>view</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000084-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/rselenese.rb, line 17</span>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumOnRails::RSelenese</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumOnRails::RSelenese</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/rselenese_rb.html">
lib/selenium_on_rails/rselenese.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
<a href="TestBuilder.html">
SeleniumOnRails::TestBuilder
</a>
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Renders Selenium test templates in a fashion analogous to <tt>rxml</tt> and
<tt>rjs</tt> templates.
</p>
<pre>
setup
open :controller =&gt; 'customer', :action =&gt; 'list'
assert_title 'Customers'
</pre>
<p>
See <a href="TestBuilder.html">SeleniumOnRails::TestBuilder</a> for a list
of available commands.
</p>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000145">new</a>&nbsp;&nbsp;
<a href="#M000146">render</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<div id="attribute-list">
<h3 class="section-bar">Attributes</h3>
<div class="name-list">
<table>
<tr class="top-aligned-row context-row">
<td class="context-item-name">view</td>
<td class="context-item-value">&nbsp;[RW]&nbsp;</td>
<td class="context-item-desc"></td>
</tr>
</table>
</div>
</div>
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000145" class="method-detail">
<a name="M000145"></a>
<div class="method-heading">
<a href="#M000145" class="method-signature">
<span class="method-name">new</span><span class="method-args">(view)</span>
</a>
</div>
<div class="method-description">
<p>
Create a <a href="RSelenese.html#M000145">new</a> <a
href="RSelenese.html">RSelenese</a> renderer bound to <em>view</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000145-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000145-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/rselenese.rb, line 17</span>
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">view</span>
18: <span class="ruby-keyword kw">super</span> <span class="ruby-identifier">view</span>
19: <span class="ruby-ivar">@view</span> = <span class="ruby-identifier">view</span>
20: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000085" class="method-detail">
<a name="M000085"></a>
<div class="method-heading">
<a href="#M000085" class="method-signature">
<span class="method-name">render</span><span class="method-args">(template, local_assigns)</span>
</a>
</div>
<div class="method-description">
<p>
Render <em>template</em> using <em>local_assigns</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000085-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/rselenese.rb, line 23</span>
20: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000146" class="method-detail">
<a name="M000146"></a>
<div class="method-heading">
<a href="#M000146" class="method-signature">
<span class="method-name">render</span><span class="method-args">(template, local_assigns)</span>
</a>
</div>
<div class="method-description">
<p>
Render <em>template</em> using <em>local_assigns</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000146-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000146-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/rselenese.rb, line 23</span>
23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span> <span class="ruby-identifier">template</span>, <span class="ruby-identifier">local_assigns</span>
24: <span class="ruby-identifier">title</span> = (<span class="ruby-ivar">@view</span>.<span class="ruby-identifier">assigns</span>[<span class="ruby-value str">'page_title'</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">local_assigns</span>[<span class="ruby-value str">'page_title'</span>])
25: <span class="ruby-identifier">table</span>(<span class="ruby-identifier">title</span>) <span class="ruby-keyword kw">do</span>
26: <span class="ruby-identifier">test</span> = <span class="ruby-keyword kw">self</span> <span class="ruby-comment cmt">#to enable test.command</span>
26: <span class="ruby-identifier">test</span> = <span class="ruby-keyword kw">self</span> <span class="ruby-comment cmt">#to enable test.command </span>
27:
28: <span class="ruby-identifier">assign_locals_code</span> = <span class="ruby-value str">''</span>
29: <span class="ruby-identifier">local_assigns</span>.<span class="ruby-identifier">each_key</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-identifier">assign_locals_code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{key} = local_assigns[#{key.inspect}];&quot;</span>}
30:
31: <span class="ruby-identifier">eval</span> <span class="ruby-identifier">assign_locals_code</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">template</span>
32: <span class="ruby-keyword kw">end</span>
33: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
33: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,156 +1,156 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::Renderer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::Renderer</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/renderer_rb.html">
lib/selenium_on_rails/renderer.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000037">render_test_case</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="Paths.html">SeleniumOnRails::Paths</a></span>
<span class="include-name"><a href="../SeleniumHelper.html">SeleniumHelper</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000037" class="method-detail">
<a name="M000037"></a>
<div class="method-heading">
<a href="#M000037" class="method-signature">
<span class="method-name">render_test_case</span><span class="method-args">(filename)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000037-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/renderer.rb, line 5</span>
5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_test_case</span> <span class="ruby-identifier">filename</span>
6: <span class="ruby-ivar">@template</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">SeleniumOnRails</span><span class="ruby-operator">::</span><span class="ruby-constant">PartialsSupport</span>
7: <span class="ruby-ivar">@page_title</span> = <span class="ruby-identifier">test_case_name</span> <span class="ruby-identifier">filename</span>
8: <span class="ruby-identifier">output</span> = <span class="ruby-identifier">render_to_string</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">filename</span>
9: <span class="ruby-identifier">layout</span> = (<span class="ruby-identifier">output</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/&lt;html&gt;/i</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">layout_path</span>)
10: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">output</span>, <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">layout</span>
11:
12: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'Cache-control'</span>] = <span class="ruby-value str">'no-cache'</span>
13: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'Pragma'</span>] = <span class="ruby-value str">'no-cache'</span>
14: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'Expires'</span>] = <span class="ruby-value str">'-1'</span>
15: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::Renderer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::Renderer</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/renderer_rb.html">
lib/selenium_on_rails/renderer.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000071">render_test_case</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="Paths.html">SeleniumOnRails::Paths</a></span>
<span class="include-name"><a href="../SeleniumHelper.html">SeleniumHelper</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000071" class="method-detail">
<a name="M000071"></a>
<div class="method-heading">
<a href="#M000071" class="method-signature">
<span class="method-name">render_test_case</span><span class="method-args">(filename)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000071-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/renderer.rb, line 5</span>
5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_test_case</span> <span class="ruby-identifier">filename</span>
6: <span class="ruby-ivar">@template</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">SeleniumOnRails</span><span class="ruby-operator">::</span><span class="ruby-constant">PartialsSupport</span>
7: <span class="ruby-ivar">@page_title</span> = <span class="ruby-identifier">test_case_name</span> <span class="ruby-identifier">filename</span>
8: <span class="ruby-identifier">output</span> = <span class="ruby-identifier">render_to_string</span> <span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">filename</span>
9: <span class="ruby-identifier">layout</span> = (<span class="ruby-identifier">output</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/&lt;html&gt;/i</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">layout_path</span>)
10: <span class="ruby-identifier">render</span> <span class="ruby-identifier">:text</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">output</span>, <span class="ruby-identifier">:layout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">layout</span>
11:
12: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'Cache-control'</span>] = <span class="ruby-value str">'no-cache'</span>
13: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'Pragma'</span>] = <span class="ruby-value str">'no-cache'</span>
14: <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'Expires'</span>] = <span class="ruby-value str">'-1'</span>
15: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,179 +1,179 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumOnRails::Selenese</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumOnRails::Selenese</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/selenese_rb.html">
lib/selenium_on_rails/selenese.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
Object
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000082">new</a>&nbsp;&nbsp;
<a href="#M000083">render</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000082" class="method-detail">
<a name="M000082"></a>
<div class="method-heading">
<a href="#M000082" class="method-signature">
<span class="method-name">new</span><span class="method-args">(view)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000082-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/selenese.rb, line 7</span>
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">view</span>
8: <span class="ruby-ivar">@view</span> = <span class="ruby-identifier">view</span>
9: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000083" class="method-detail">
<a name="M000083"></a>
<div class="method-heading">
<a href="#M000083" class="method-signature">
<span class="method-name">render</span><span class="method-args">(template, local_assigns)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000083-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/selenese.rb, line 11</span>
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span> <span class="ruby-identifier">template</span>, <span class="ruby-identifier">local_assigns</span>
12: <span class="ruby-identifier">name</span> = (<span class="ruby-ivar">@view</span>.<span class="ruby-identifier">assigns</span>[<span class="ruby-value str">'page_title'</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">local_assigns</span>[<span class="ruby-value str">'page_title'</span>])
13: <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">template</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">split</span> <span class="ruby-value str">&quot;\n&quot;</span>
14: <span class="ruby-identifier">html</span> = <span class="ruby-value str">''</span>
15: <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">extract_comments</span>(<span class="ruby-identifier">lines</span>)
16: <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">extract_commands</span>(<span class="ruby-identifier">lines</span>, <span class="ruby-identifier">name</span>)
17: <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">extract_comments</span>(<span class="ruby-identifier">lines</span>)
18: <span class="ruby-identifier">raise</span> <span class="ruby-value str">'You cannot have comments in the middle of commands!'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">next_line</span> <span class="ruby-identifier">lines</span>, <span class="ruby-identifier">:any</span>
19: <span class="ruby-identifier">html</span>
20: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumOnRails::Selenese</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumOnRails::Selenese</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/selenese_rb.html">
lib/selenium_on_rails/selenese.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
Object
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000143">new</a>&nbsp;&nbsp;
<a href="#M000144">render</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000143" class="method-detail">
<a name="M000143"></a>
<div class="method-heading">
<a href="#M000143" class="method-signature">
<span class="method-name">new</span><span class="method-args">(view)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000143-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000143-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/selenese.rb, line 7</span>
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">view</span>
8: <span class="ruby-ivar">@view</span> = <span class="ruby-identifier">view</span>
9: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000144" class="method-detail">
<a name="M000144"></a>
<div class="method-heading">
<a href="#M000144" class="method-signature">
<span class="method-name">render</span><span class="method-args">(template, local_assigns)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000144-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000144-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/selenese.rb, line 11</span>
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span> <span class="ruby-identifier">template</span>, <span class="ruby-identifier">local_assigns</span>
12: <span class="ruby-identifier">name</span> = (<span class="ruby-ivar">@view</span>.<span class="ruby-identifier">assigns</span>[<span class="ruby-value str">'page_title'</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">local_assigns</span>[<span class="ruby-value str">'page_title'</span>])
13: <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">template</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">split</span> <span class="ruby-value str">&quot;\n&quot;</span>
14: <span class="ruby-identifier">html</span> = <span class="ruby-value str">''</span>
15: <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">extract_comments</span>(<span class="ruby-identifier">lines</span>)
16: <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">extract_commands</span>(<span class="ruby-identifier">lines</span>, <span class="ruby-identifier">name</span>)
17: <span class="ruby-identifier">html</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">extract_comments</span>(<span class="ruby-identifier">lines</span>)
18: <span class="ruby-identifier">raise</span> <span class="ruby-value str">'You cannot have comments in the middle of commands!'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">next_line</span> <span class="ruby-identifier">lines</span>, <span class="ruby-identifier">:any</span>
19: <span class="ruby-identifier">html</span>
20: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,223 +1,223 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::SuiteRenderer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::SuiteRenderer</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/suite_renderer_rb.html">
lib/selenium_on_rails/suite_renderer.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000048">link_to_test_case</a>&nbsp;&nbsp;
<a href="#M000047">test_cases</a>&nbsp;&nbsp;
<a href="#M000045">test_suite_name</a>&nbsp;&nbsp;
<a href="#M000046">test_suites</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000048" class="method-detail">
<a name="M000048"></a>
<div class="method-heading">
<a href="#M000048" class="method-signature">
<span class="method-name">link_to_test_case</span><span class="method-args">(suite_name, filename)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000048-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/suite_renderer.rb, line 24</span>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::SuiteRenderer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::SuiteRenderer</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/suite_renderer_rb.html">
lib/selenium_on_rails/suite_renderer.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000082">link_to_test_case</a>&nbsp;&nbsp;
<a href="#M000081">test_cases</a>&nbsp;&nbsp;
<a href="#M000079">test_suite_name</a>&nbsp;&nbsp;
<a href="#M000080">test_suites</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000082" class="method-detail">
<a name="M000082"></a>
<div class="method-heading">
<a href="#M000082" class="method-signature">
<span class="method-name">link_to_test_case</span><span class="method-args">(suite_name, filename)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000082-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/suite_renderer.rb, line 24</span>
24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">link_to_test_case</span> <span class="ruby-identifier">suite_name</span>, <span class="ruby-identifier">filename</span>
25: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">suite_name</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">test_case_name</span>(<span class="ruby-identifier">filename</span>)
26: <span class="ruby-identifier">link_to</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:test_file</span>, <span class="ruby-identifier">:testname</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">path_to_relative_url</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/^\//</span>,<span class="ruby-value str">''</span>)
27: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000047" class="method-detail">
<a name="M000047"></a>
<div class="method-heading">
<a href="#M000047" class="method-signature">
<span class="method-name">test_cases</span><span class="method-args">(path)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000047-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/suite_renderer.rb, line 18</span>
27: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000081" class="method-detail">
<a name="M000081"></a>
<div class="method-heading">
<a href="#M000081" class="method-signature">
<span class="method-name">test_cases</span><span class="method-args">(path)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000081-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/suite_renderer.rb, line 18</span>
18: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_cases</span> <span class="ruby-identifier">path</span>
19: <span class="ruby-identifier">tests</span> = []
20: <span class="ruby-identifier">visit_all_tests</span> <span class="ruby-identifier">path</span>, <span class="ruby-value str">''</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">tests</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">n</span>,<span class="ruby-identifier">p</span>]}
21: <span class="ruby-identifier">tests</span>
22: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000045" class="method-detail">
<a name="M000045"></a>
<div class="method-heading">
<a href="#M000045" class="method-signature">
<span class="method-name">test_suite_name</span><span class="method-args">(path)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000045-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/suite_renderer.rb, line 2</span>
22: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000079" class="method-detail">
<a name="M000079"></a>
<div class="method-heading">
<a href="#M000079" class="method-signature">
<span class="method-name">test_suite_name</span><span class="method-args">(path)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000079-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/suite_renderer.rb, line 2</span>
2: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_suite_name</span> <span class="ruby-identifier">path</span>
3: <span class="ruby-keyword kw">return</span> <span class="ruby-value str">'All test cases'</span> <span class="ruby-keyword kw">if</span> [<span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">'/'</span>].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">path_to_relative_url</span>(<span class="ruby-identifier">path</span>)
4: <span class="ruby-constant">File</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">path</span>)[<span class="ruby-value">-1</span>].<span class="ruby-identifier">humanize</span>
5: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000046" class="method-detail">
<a name="M000046"></a>
<div class="method-heading">
<a href="#M000046" class="method-signature">
<span class="method-name">test_suites</span><span class="method-args">(path)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000046-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/suite_renderer.rb, line 7</span>
5: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000080" class="method-detail">
<a name="M000080"></a>
<div class="method-heading">
<a href="#M000080" class="method-signature">
<span class="method-name">test_suites</span><span class="method-args">(path)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000080-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/suite_renderer.rb, line 7</span>
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_suites</span> <span class="ruby-identifier">path</span>
8: <span class="ruby-identifier">suites</span> = []
9:
10: <span class="ruby-identifier">parent_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">slice</span>(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>)) <span class="ruby-comment cmt">#all but last</span>
10: <span class="ruby-identifier">parent_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">slice</span>(<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>)) <span class="ruby-comment cmt">#all but last </span>
11: <span class="ruby-identifier">parent_path</span> = <span class="ruby-identifier">path_to_relative_url</span> <span class="ruby-identifier">parent_path</span>
12: <span class="ruby-identifier">suites</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-value str">'..'</span>, <span class="ruby-identifier">parent_path</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">parent_path</span>.<span class="ruby-identifier">nil?</span>
13:
14: <span class="ruby-identifier">visit_all_tests</span> <span class="ruby-identifier">path</span>, <span class="ruby-value str">''</span>, <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">suites</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">n</span>,<span class="ruby-identifier">path_to_relative_url</span>(<span class="ruby-identifier">p</span>)]}, <span class="ruby-keyword kw">nil</span>
15: <span class="ruby-identifier">suites</span>
16: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
16: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,372 +1,441 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumOnRails::TestBuilder</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumOnRails::TestBuilder</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/test_builder_rb.html">
lib/selenium_on_rails/test_builder.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
Object
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Builds Selenium test table using a high-level Ruby interface. Normally
invoked through <a href="RSelenese.html">SeleniumOnRails::RSelenese</a>.
</p>
<p>
See <a
href="TestBuilderActions.html">SeleniumOnRails::TestBuilderActions</a> for
the available actions and <a
href="TestBuilderAccessors.html">SeleniumOnRails::TestBuilderAccessors</a>
for the available checks.
</p>
<p>
For more information on the commands supported by <a
href="TestBuilder.html">TestBuilder</a>, see the Selenium Commands
Documentation at <a
href="http://release.openqa.org/selenium-core/nightly/reference.html">release.openqa.org/selenium-core/nightly/reference.html</a>.
</p>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000090">command</a>&nbsp;&nbsp;
<a href="#M000092">command_and_wait</a>&nbsp;&nbsp;
<a href="#M000091">command_verbatim</a>&nbsp;&nbsp;
<a href="#M000087">exactize</a>&nbsp;&nbsp;
<a href="#M000093">make_command_waiting</a>&nbsp;&nbsp;
<a href="#M000088">new</a>&nbsp;&nbsp;
<a href="#M000086">selenize</a>&nbsp;&nbsp;
<a href="#M000089">table</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="TestBuilderActions.html">SeleniumOnRails::TestBuilderActions</a></span>
<span class="include-name"><a href="TestBuilderAccessors.html">SeleniumOnRails::TestBuilderAccessors</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000088" class="method-detail">
<a name="M000088"></a>
<div class="method-heading">
<a href="#M000088" class="method-signature">
<span class="method-name">new</span><span class="method-args">(view)</span>
</a>
</div>
<div class="method-description">
<p>
Create a new <a href="TestBuilder.html">TestBuilder</a> for <em>view</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000088-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 26</span>
26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">view</span>
27: <span class="ruby-ivar">@view</span> = <span class="ruby-identifier">view</span>
28: <span class="ruby-ivar">@output</span> = <span class="ruby-value str">''</span>
29: <span class="ruby-ivar">@xml</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:indent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">2</span>, <span class="ruby-identifier">:target</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@output</span>
30: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000086" class="method-detail">
<a name="M000086"></a>
<div class="method-heading">
<a href="#M000086" class="method-signature">
<span class="method-name">selenize</span><span class="method-args">(str)</span>
</a>
</div>
<div class="method-description">
<p>
Convert <em>str</em> to a Selenium command name.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000086-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 15</span>
15: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">selenize</span> <span class="ruby-identifier">str</span>
16: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">camelize</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^[A-Z]/</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">downcase</span> }
17: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000090" class="method-detail">
<a name="M000090"></a>
<div class="method-heading">
<a href="#M000090" class="method-signature">
<span class="method-name">command</span><span class="method-args">(cmd, target=nil, value=nil)</span>
</a>
</div>
<div class="method-description">
<p>
Add a new test command using <em>cmd</em>, <em>target</em> and
<em>value</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000090-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 41</span>
41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">command</span> <span class="ruby-identifier">cmd</span>, <span class="ruby-identifier">target</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>
42: <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">tr</span> <span class="ruby-keyword kw">do</span>
43: <span class="ruby-identifier">_tdata</span> <span class="ruby-identifier">cmd</span>
44: <span class="ruby-identifier">_tdata</span> <span class="ruby-identifier">target</span>
45: <span class="ruby-identifier">_tdata</span> <span class="ruby-identifier">value</span>
46: <span class="ruby-keyword kw">end</span>
47: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000092" class="method-detail">
<a name="M000092"></a>
<div class="method-heading">
<a href="#M000092" class="method-signature">
<span class="method-name">command_and_wait</span><span class="method-args">(cmd, target=nil, value=nil)</span>
</a>
</div>
<div class="method-description">
<p>
Same as <em>command</em> but add <em>AndWait</em> to the name of
<em>cmd</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000092-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 52</span>
52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">command_and_wait</span> <span class="ruby-identifier">cmd</span>, <span class="ruby-identifier">target</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>
53: <span class="ruby-identifier">command_verbatim</span> <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'AndWait'</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">value</span>
54: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000091" class="method-detail">
<a name="M000091"></a>
<div class="method-heading">
<span class="method-name">command_verbatim</span><span class="method-args">(cmd, target=nil, value=nil)</span>
</div>
<div class="method-description">
<p>
Alias for <a href="TestBuilder.html#M000090">command</a>
</p>
</div>
</div>
<div id="method-M000087" class="method-detail">
<a name="M000087"></a>
<div class="method-heading">
<a href="#M000087" class="method-signature">
<span class="method-name">exactize</span><span class="method-args">(pattern)</span>
</a>
</div>
<div class="method-description">
<p>
Prepends <em>pattern</em> with &#8216;exact:&#8217; if it would be
considered containing string-match pattern otherwise.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000087-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 21</span>
21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exactize</span> <span class="ruby-identifier">pattern</span>
22: <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">':'</span>) <span class="ruby-operator">?</span> <span class="ruby-node">&quot;exact:#{pattern}&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">pattern</span>
23: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000093" class="method-detail">
<a name="M000093"></a>
<div class="method-heading">
<a href="#M000093" class="method-signature">
<span class="method-name">make_command_waiting</span><span class="method-args">() {|| ...}</span>
</a>
</div>
<div class="method-description">
<p>
Re routes commands in the provided block to <a
href="TestBuilder.html#M000092">command_and_wait</a> instead of <a
href="TestBuilder.html#M000090">command</a>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000093-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 58</span>
58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_command_waiting</span>
59: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:alias_method</span>, <span class="ruby-identifier">:command</span>, <span class="ruby-identifier">:command_and_wait</span>
60: <span class="ruby-keyword kw">yield</span>
61: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:alias_method</span>, <span class="ruby-identifier">:command</span>, <span class="ruby-identifier">:command_verbatim</span>
62: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000089" class="method-detail">
<a name="M000089"></a>
<div class="method-heading">
<a href="#M000089" class="method-signature">
<span class="method-name">table</span><span class="method-args">(title) {|self| ...}</span>
</a>
</div>
<div class="method-description">
<p>
Add a new table of tests, and return the HTML.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000089-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 33</span>
33: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">table</span> <span class="ruby-identifier">title</span>
34: <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">table</span> <span class="ruby-keyword kw">do</span>
35: <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">tr</span> <span class="ruby-keyword kw">do</span> <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">th</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">:colspan</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">3</span>) <span class="ruby-keyword kw">end</span>
36: <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span>
37: <span class="ruby-keyword kw">end</span>
38: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumOnRails::TestBuilder</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumOnRails::TestBuilder</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/test_builder_rb.html">
lib/selenium_on_rails/test_builder.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
Object
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Builds Selenium test <a href="TestBuilder.html#M000150">table</a> using a
high-level Ruby interface. Normally invoked through <a
href="RSelenese.html">SeleniumOnRails::RSelenese</a>.
</p>
<p>
See <a
href="TestBuilderActions.html">SeleniumOnRails::TestBuilderActions</a> for
the available actions and <a
href="TestBuilderAccessors.html">SeleniumOnRails::TestBuilderAccessors</a>
for the available checks.
</p>
<p>
For more information on the commands supported by <a
href="TestBuilder.html">TestBuilder</a>, see the Selenium Commands
Documentation at <a
href="http://release.openqa.org/selenium-core/nightly/reference.html">release.openqa.org/selenium-core/nightly/reference.html</a>.
</p>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000156">collection_arg</a>&nbsp;&nbsp;
<a href="#M000151">command</a>&nbsp;&nbsp;
<a href="#M000153">command_and_wait</a>&nbsp;&nbsp;
<a href="#M000152">command_verbatim</a>&nbsp;&nbsp;
<a href="#M000148">exactize</a>&nbsp;&nbsp;
<a href="#M000154">make_command_waiting</a>&nbsp;&nbsp;
<a href="#M000149">new</a>&nbsp;&nbsp;
<a href="#M000147">selenize</a>&nbsp;&nbsp;
<a href="#M000150">table</a>&nbsp;&nbsp;
<a href="#M000155">url_arg</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name"><a href="TestBuilderActions.html">SeleniumOnRails::TestBuilderActions</a></span>
<span class="include-name"><a href="TestBuilderAccessors.html">SeleniumOnRails::TestBuilderAccessors</a></span>
<span class="include-name"><a href="TestBuilderUserActions.html">SeleniumOnRails::TestBuilderUserActions</a></span>
<span class="include-name"><a href="TestBuilderUserAccessors.html">SeleniumOnRails::TestBuilderUserAccessors</a></span>
</div>
</div>
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000149" class="method-detail">
<a name="M000149"></a>
<div class="method-heading">
<a href="#M000149" class="method-signature">
<span class="method-name">new</span><span class="method-args">(view)</span>
</a>
</div>
<div class="method-description">
<p>
Create a <a href="TestBuilder.html#M000149">new</a> <a
href="TestBuilder.html">TestBuilder</a> for <em>view</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000149-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000149-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 47</span>
47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">view</span>
48: <span class="ruby-ivar">@view</span> = <span class="ruby-identifier">view</span>
49: <span class="ruby-ivar">@output</span> = <span class="ruby-value str">''</span>
50: <span class="ruby-ivar">@xml</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:indent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">2</span>, <span class="ruby-identifier">:target</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@output</span>
51: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000147" class="method-detail">
<a name="M000147"></a>
<div class="method-heading">
<a href="#M000147" class="method-signature">
<span class="method-name">selenize</span><span class="method-args">(str)</span>
</a>
</div>
<div class="method-description">
<p>
Convert <em>str</em> to a Selenium <a
href="TestBuilder.html#M000151">command</a> name.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000147-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000147-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 36</span>
36: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">selenize</span> <span class="ruby-identifier">str</span>
37: <span class="ruby-identifier">str</span>.<span class="ruby-identifier">camelize</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^[A-Z]/</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">downcase</span> }
38: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000151" class="method-detail">
<a name="M000151"></a>
<div class="method-heading">
<a href="#M000151" class="method-signature">
<span class="method-name">command</span><span class="method-args">(cmd, target=nil, value=nil)</span>
</a>
</div>
<div class="method-description">
<p>
Add a <a href="TestBuilder.html#M000149">new</a> test <a
href="TestBuilder.html#M000151">command</a> using <em>cmd</em>,
<em>target</em> and <em>value</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000151-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000151-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 62</span>
62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">command</span> <span class="ruby-identifier">cmd</span>, <span class="ruby-identifier">target</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>
63: <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">tr</span> <span class="ruby-keyword kw">do</span>
64: <span class="ruby-identifier">_tdata</span> <span class="ruby-identifier">cmd</span>
65: <span class="ruby-identifier">_tdata</span> <span class="ruby-identifier">target</span>
66: <span class="ruby-identifier">_tdata</span> <span class="ruby-identifier">value</span>
67: <span class="ruby-keyword kw">end</span>
68: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000153" class="method-detail">
<a name="M000153"></a>
<div class="method-heading">
<a href="#M000153" class="method-signature">
<span class="method-name">command_and_wait</span><span class="method-args">(cmd, target=nil, value=nil)</span>
</a>
</div>
<div class="method-description">
<p>
Same as <em><a href="TestBuilder.html#M000151">command</a></em> but add
<em>AndWait</em> to the name of <em>cmd</em>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000153-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000153-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 73</span>
73: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">command_and_wait</span> <span class="ruby-identifier">cmd</span>, <span class="ruby-identifier">target</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>
74: <span class="ruby-identifier">command_verbatim</span> <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'AndWait'</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">value</span>
75: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000152" class="method-detail">
<a name="M000152"></a>
<div class="method-heading">
<span class="method-name">command_verbatim</span><span class="method-args">(cmd, target=nil, value=nil)</span>
</div>
<div class="method-description">
<p>
Alias for <a href="TestBuilder.html#M000151">command</a>
</p>
</div>
</div>
<div id="method-M000148" class="method-detail">
<a name="M000148"></a>
<div class="method-heading">
<a href="#M000148" class="method-signature">
<span class="method-name">exactize</span><span class="method-args">(pattern)</span>
</a>
</div>
<div class="method-description">
<p>
Prepends <em>pattern</em> with &#8216;exact:&#8217; if it would be
considered containing string-match pattern otherwise.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000148-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000148-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 42</span>
42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exactize</span> <span class="ruby-identifier">pattern</span>
43: <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">':'</span>) <span class="ruby-operator">?</span> <span class="ruby-node">&quot;exact:#{pattern}&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">pattern</span>
44: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000154" class="method-detail">
<a name="M000154"></a>
<div class="method-heading">
<a href="#M000154" class="method-signature">
<span class="method-name">make_command_waiting</span><span class="method-args">() {|| ...}</span>
</a>
</div>
<div class="method-description">
<p>
Re routes commands in the provided block to <a
href="TestBuilder.html#M000153">command_and_wait</a> instead of <a
href="TestBuilder.html#M000151">command</a>.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000154-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000154-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 79</span>
79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_command_waiting</span>
80: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:alias_method</span>, <span class="ruby-identifier">:command</span>, <span class="ruby-identifier">:command_and_wait</span>
81: <span class="ruby-keyword kw">yield</span>
82: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">send</span> <span class="ruby-identifier">:alias_method</span>, <span class="ruby-identifier">:command</span>, <span class="ruby-identifier">:command_verbatim</span>
83: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000150" class="method-detail">
<a name="M000150"></a>
<div class="method-heading">
<a href="#M000150" class="method-signature">
<span class="method-name">table</span><span class="method-args">(title) {|self| ...}</span>
</a>
</div>
<div class="method-description">
<p>
Add a <a href="TestBuilder.html#M000149">new</a> <a
href="TestBuilder.html#M000150">table</a> of tests, and return the HTML.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000150-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000150-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 54</span>
54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">table</span> <span class="ruby-identifier">title</span>
55: <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">table</span> <span class="ruby-keyword kw">do</span>
56: <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">tr</span> <span class="ruby-keyword kw">do</span> <span class="ruby-ivar">@xml</span>.<span class="ruby-identifier">th</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">:colspan</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">3</span>) <span class="ruby-keyword kw">end</span>
57: <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span>
58: <span class="ruby-keyword kw">end</span>
59: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<h3 class="section-bar">Protected Instance methods</h3>
<div id="method-M000156" class="method-detail">
<a name="M000156"></a>
<div class="method-heading">
<a href="#M000156" class="method-signature">
<span class="method-name">collection_arg</span><span class="method-args">(arg)</span>
</a>
</div>
<div class="method-description">
<p>
If <em>arg</em> is an array formats <em>arg</em> to a textual
representation. Otherwise return unchanged.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000156-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000156-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 95</span>
95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collection_arg</span> <span class="ruby-identifier">arg</span>
96: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Array</span>
97: <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[\\,]/</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;\\#{s}&quot;</span> } }.<span class="ruby-identifier">join</span>(<span class="ruby-value str">','</span>)
98: <span class="ruby-keyword kw">else</span>
99: <span class="ruby-identifier">arg</span>
100: <span class="ruby-keyword kw">end</span>
101: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000155" class="method-detail">
<a name="M000155"></a>
<div class="method-heading">
<a href="#M000155" class="method-signature">
<span class="method-name">url_arg</span><span class="method-args">(url)</span>
</a>
</div>
<div class="method-description">
<p>
If <em>url</em> is a string, return unchanged. Otherwise, pass it to
ActionView#UrlHelper#url_for.
</p>
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000155-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000155-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/test_builder.rb, line 89</span>
89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url_arg</span> <span class="ruby-identifier">url</span>
90: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">url</span>.<span class="ruby-identifier">instance_of?</span>(<span class="ruby-constant">String</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">url</span> <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">exactize</span>(<span class="ruby-ivar">@view</span>.<span class="ruby-identifier">url_for</span>(<span class="ruby-identifier">url</span>)) <span class="ruby-keyword kw">end</span>
91: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::TestBuilderUserAccessors</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::TestBuilderUserAccessors</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/test_builder_rb.html">
lib/selenium_on_rails/test_builder.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Create test_builder_user_accessors.rb to support accessors included in
selenium-core&#8216;s user-extensions.js
</p>
<p>
See test_builder_user_accessors.rb.example for examples matching
selenium-core&#8216;s user-extensions.js.sample
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module: SeleniumOnRails::TestBuilderUserActions</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Module</strong></td>
<td class="class-name-in-header">SeleniumOnRails::TestBuilderUserActions</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../../files/lib/selenium_on_rails/test_builder_rb.html">
lib/selenium_on_rails/test_builder.rb
</a>
<br />
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Create test_builder_user_actions.rb to support actions included in
selenium-core&#8216;s user-extensions.js
</p>
<p>
See test_builder_user_actions.rb.example for examples matching
selenium-core&#8216;s user-extensions.js.sample
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,150 +1,150 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumOnRailsConfig</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumOnRailsConfig</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/selenium_on_rails_config_rb.html">
lib/selenium_on_rails_config.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
Object
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000007">get</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000007" class="method-detail">
<a name="M000007"></a>
<div class="method-heading">
<a href="#M000007" class="method-signature">
<span class="method-name">get</span><span class="method-args">(var, default = nil) {|if block_given?| ...}</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000007-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails_config.rb, line 5</span>
5: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get</span> <span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span> = <span class="ruby-keyword kw">nil</span>
6: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">configs</span>[<span class="ruby-identifier">var</span>.<span class="ruby-identifier">to_s</span>]
7: <span class="ruby-identifier">value</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@@defaults</span>[<span class="ruby-identifier">var</span>]
8: <span class="ruby-identifier">value</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">default</span>
9: <span class="ruby-identifier">value</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
10: <span class="ruby-identifier">value</span>
11: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: SeleniumOnRailsConfig</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">SeleniumOnRailsConfig</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/selenium_on_rails_config_rb.html">
lib/selenium_on_rails_config.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
Object
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000007">get</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000007" class="method-detail">
<a name="M000007"></a>
<div class="method-heading">
<a href="#M000007" class="method-signature">
<span class="method-name">get</span><span class="method-args">(var, default = nil) {|if block_given?| ...}</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000007-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails_config.rb, line 5</span>
5: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get</span> <span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span> = <span class="ruby-keyword kw">nil</span>
6: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">configs</span>[<span class="ruby-identifier">var</span>.<span class="ruby-identifier">to_s</span>]
7: <span class="ruby-identifier">value</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@@defaults</span>[<span class="ruby-identifier">var</span>]
8: <span class="ruby-identifier">value</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">default</span>
9: <span class="ruby-identifier">value</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
10: <span class="ruby-identifier">value</span>
11: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -0,0 +1,422 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: CHANGELOG</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>CHANGELOG</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>CHANGELOG
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 23:49:15 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<h2>REVISION <a href="http://svn.openqa.org/fisheye/changelog/selenium-on-rails/?cs=38">38</a></h2>
<h3>change made by Flanagan</h3>
<ul>
<li><a href="http://jira.openqa.org/browse/SOR-13">SOR-13</a> Corrected an
omission of require statements.
</li>
</ul>
<h2>REVISION 37</h2>
<h3>change made by Flanagan</h3>
<ul>
<li>Undone an unwanted commit of modified Rakefile.
</li>
</ul>
<h2>REVISION <a href="http://svn.openqa.org/fisheye/changelog/selenium-on-rails/?cs=36">36</a></h2>
<h3>change made by Flanagan</h3>
<ul>
<li><a href="http://jira.openqa.org/browse/SOR-13">SOR-13</a> Added
(experimental) support for user-extensions.js.
</li>
</ul>
<h2>REVISION <a href="http://svn.openqa.org/fisheye/changelog/selenium-on-rails/?cs=35">35</a></h2>
<h3>all changes made by Jonas</h3>
<ul>
<li><a href="http://jira.openqa.org/browse/SOR-12">SOR-12</a> removed all
support for selenium gem
</li>
<li>Selenium Core 0.8.2 is now bundled with Selenium on Rails. If you want to
use other version set the &#8216;selenium_path&#8217; in config.yml
</li>
<li>Updated installation instructions for Windows
</li>
</ul>
<h2>REVISION <a href="http://svn.openqa.org/fisheye/changelog/selenium-on-rails/?cs=34">34</a></h2>
<h3>all changes made by Flanagan</h3>
<ul>
<li><a href="http://jira.openqa.org/browse/SOR-11">SOR-11</a> Fixed related
assertions for store_checked to use only locator parameter
</li>
</ul>
<p>
Warning: Users must change tests that pass two parameters (locator,
pattern) to <tt>verify_checked</tt>, <tt>verify_not_checked</tt>,
<tt>assert_checked</tt>, <tt>assert_not_checked</tt>,
<tt>wait_for_checked</tt>, or <tt>wait_for_not_checked</tt>.
</p>
<p>
Test scripts that continue to use two parameters will be broken, only one
parameter, the locator, should be passed.
</p>
<p>
For example, <tt>|verify_checked|my_checkbox|true|</tt> will be interpreted
as <tt>|verify_checked|my_checkboxtrue||</tt> so change the test to
<tt>|verify_checked|my_checkbox||</tt>
</p>
<ul>
<li><a href="http://jira.openqa.org/browse/SOR-9">SOR-9</a> Added Mac OS X
browsers to config.yml.example
</li>
<li><a href="http://jira.openqa.org/browse/SOR-10">SOR-10</a> Added support for
baseUrl to acceptance_test_runner.rb as added to selenium-core 0.8.2
</li>
<li>Added &#8216;webrick&#8217; to SERVER_COMMAND in acceptance_test_runner.rb
as parameters do not work with lighttpd
</li>
<li>Reversed expected query string in test/renderer_testrb to make tests pass
</li>
</ul>
<p>
Note: On Mac OS X, at least, clear_tables comes before fixtures in the
query string; this may be an environment-specific issue if the test now
fails on other OSes.
</p>
<ul>
<li>Added this CHANGELOG file and amended the rake rdoc task to include it
</li>
<li>Added support in rselenese for a long list of actions and accessors that
are included in selenium-core (0.8.2 and possibly earlier) but were
previously missing in selenium-on-rails.
</li>
</ul>
<p>
Here are the newly supported actions:
</p>
<p>
Useful for debugging:
</p>
<ul>
<li><tt>brake</tt> (alias for selenium-core&#8216;s break, a reserved word in
Ruby)
</li>
<li><tt>echo, :string</tt>
</li>
<li><tt>highlight, :locator</tt>
</li>
</ul>
<p>
Keyboard events:
</p>
<ul>
<li><tt>alt_key_down</tt>
</li>
<li><tt>alt_key_up</tt>
</li>
<li><tt>control_key_down</tt>
</li>
<li><tt>control_key_up</tt>
</li>
<li><tt>meta_key_down</tt>
</li>
<li><tt>meta_key_up</tt>
</li>
<li><tt>shift_key_down</tt>
</li>
<li><tt>shift_key_up</tt>
</li>
<li><tt>type_keys, :locator, :string</tt>
</li>
</ul>
<p>
Mouse events:
</p>
<ul>
<li><tt>click_at, :locator, :coord_string</tt>
</li>
<li><tt>double_click, :locator</tt>
</li>
<li><tt>double_click_at, :locator, :coord_string</tt>
</li>
<li><tt>drag_and_drop, :locator, :movements_string</tt>
</li>
<li><tt>drag_and_drop_to_object, :locator, :locator</tt>
</li>
<li><tt>mouse_down_at, :locator, :coord_string</tt>
</li>
<li><tt>mouse_move, :locator</tt>
</li>
<li><tt>mouse_move_at, :locator, :coord_string</tt>
</li>
<li><tt>mouse_out, :locator</tt>
</li>
<li><tt>mouse_up, :locator</tt>
</li>
<li><tt>mouse_up_at, :locator, :coord_string</tt>
</li>
<li><tt>set_mouse_speed, :integer</tt>
</li>
</ul>
<p>
Other actions:
</p>
<ul>
<li><tt>create_cookie, :name_value_pair, :options_string</tt>
</li>
<li><tt>delete_cookie, :string, :string</tt>
</li>
<li><tt>open_window, :url, :integer</tt>
</li>
<li><tt>pause, :timeout</tt>
</li>
<li><tt>remove_all_selections, :locator</tt>
</li>
<li><tt>select_frame, :locator</tt>
</li>
<li><tt>set_cursor_position, :locator, :integer</tt>
</li>
<li><tt>store, :script, :variable</tt>
</li>
<li><tt>window_focus, :window_name</tt>
</li>
<li><tt>window_maximize, :window_name</tt>
</li>
</ul>
<p>
Here are the newly supported accessors:
</p>
<p>
The following store_* accessors and their associated assert, verify and
wait_for brethren are fully supported:
</p>
<ul>
<li><tt>store_selected_id, :locator, :variable</tt>
</li>
<li><tt>store_selected_ids, :locator, :variable</tt>
</li>
<li><tt>store_selected_index, :locator, :variable</tt>
</li>
<li><tt>store_selected_indexes, :locator, :variable</tt>
</li>
<li><tt>store_selected_label, :locator, :variable</tt>
</li>
<li><tt>store_selected_labels, :locator, :variable</tt>
</li>
<li><tt>store_selected_value, :locator, :variable</tt>
</li>
<li><tt>store_selected_values, :locator, :variable</tt>
</li>
<li><tt>store_something_selected, :locator, :variable</tt>
</li>
<li><tt>store_all_window_ids, :variable</tt>
</li>
<li><tt>store_all_window_names, :variable</tt>
</li>
<li><tt>store_all_window_titles, :variable</tt>
</li>
<li><tt>store_cookie, :variable</tt>
</li>
<li><tt>store_log_messages, :variable</tt>
</li>
<li><tt>store_mouse_speed, :variable</tt>
</li>
<li><tt>store_cursor_position, :locator, :variable</tt>
</li>
<li><tt>store_attribute_from_all_windows, :attribute_name, :variable</tt>
</li>
<li><tt>store_element_height, :locator, :variable</tt>
</li>
<li><tt>store_element_index, :locator, :variable</tt>
</li>
<li><tt>store_element_width, :locator, :variable</tt>
</li>
<li><tt>store_element_position_left, :locator, :variable</tt>
</li>
<li><tt>store_element_position_top, :locator, :variable</tt>
</li>
</ul>
<p>
Only the associated assert, verify and wait_for brethren of the following
store_* accessors are supported by the selenium-core, so these store_*
accessors create exceptions in SOR:
</p>
<ul>
<li><tt>store_ordered, :locator, :locator, :variable</tt>
</li>
<li><tt>store_error_on_next, :string</tt>
</li>
<li><tt>store_failure_on_next, :string</tt>
</li>
<li><tt>store_whether_this_frame_match_frame_expression, :string, :string,
:variable</tt>
</li>
<li><tt>store_whether_this_window_match_window_expression, :string, :string,
:variable</tt>
</li>
</ul>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,388 +1,372 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: README</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>README</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>README
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Fri Dec 08 00:50:30 GMT Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<h1>Selenium on Rails</h1>
<h2>Overview</h2>
<p>
Selenium on Rails provides an easy way to test Rails application with <a
href="http://www.openqa.org/selenium-core/">Selenium Core</a>.
</p>
<p>
This plugin does four things:
</p>
<ol>
<li>The Selenium Core files don&#8217;t have to pollute <tt>/public</tt>, they
can stay in the Selenium gem or in <tt>/vendor/selenium</tt>.
</li>
<li>No need to create suite files, they are generated on the fly &#8212; one
suite per directory in <tt>/test/selenium</tt> (suites can be nested).
</li>
<li>Instead of writing the test cases in HTML you can use a number of better
formats (see <tt>Formats</tt>).
</li>
<li>Loading of fixtures and wiping of session (<tt>/selenium/setup</tt>).
</li>
</ol>
<h2>Installation</h2>
<ol>
<li>Selenium Core needs to be available. It could either be installed as a gem
(<tt>gem install selenium</tt>) or in <tt>/vendor/selenium/</tt>.
</li>
<li>Install Selenium on Rails: <tt>script/plugin install <a
href="http://svn.openqa.org/svn/selenium-on-rails/selenium-on-rails">http://svn.openqa.org/svn/selenium-on-rails/selenium-on-rails</a>/</tt>
</li>
<li><em>If RedCloth is available the Selenese test cases can use it for better
markup.</em>
</li>
<li>Run the Rakefile in the plugin&#8217;s directory to run the tests in order
to see that everything works. (If RedCloth isn&#8217;t installed a few
tests will fail since they assume RedCloth is installed.)
</li>
<li>Create a test case: <tt>script/generate selenium login</tt>
</li>
<li>Start the server: <tt>script/server -e test</tt>
</li>
<li>Point your browser to <tt><a
href="http://localhost:3000/selenium">http://localhost:3000/selenium</a></tt>
</li>
<li>If everything works as expected you should see the Selenium test runner.
The north east frame contains all your test cases (just one for now), and
the north frame contains your test case.
</li>
</ol>
<h3>win32-open3</h3>
<p>
<a href="http://raa.ruby-lang.org/project/win32-open3/">win32-open3</a> is
needed if you&#8217;re on Windows and want to run your tests as a Rake task
(see <tt>test:acceptance</tt>), i.e. you don&#8217;t have to install it but
it&#8217;s recommended.
</p>
<p>
You can build it from source or install the binary:
</p>
<ol>
<li>Download the latest version of win32-open3, <a
href="http://rubyforge.org/frs/download.php/8515/open3-0.2.2.so">open3-0.2.2.so</a>
at the time of this writing.
</li>
<li>Open up irb and run this snippet: <tt>require &#8216;rbconfig&#8217;;
include Config; puts CONFIG[&#8216;sitearchdir&#8217;]</tt>
</li>
<li>Create a <tt>win32</tt> directory under the directory you got, e.g.
<tt>c:\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt</tt>
</li>
<li>Rename the .so file to <tt>open3.so</tt> and put it in the <tt>win32</tt>
directory.
</li>
<li>Profit! (unless you get an error when doing <tt>require
&#8216;win32/open3&#8216;</tt>)
</li>
</ol>
<h2>Formats</h2>
<p>
The test cases can be written in a number of formats. Which one you choose
is a matter of taste. You can generate your test files by running
<tt>script/generate selenium</tt> or by creating them manually in your
<tt>/test/selenium</tt> directory.
</p>
<h3>Selenese, .sel</h3>
<p>
Selenese is the dumbest format (in a good way). You just write your
commands delimited by | characters.
</p>
<pre>
|open|/selenium/setup|
|open|/|
|goBack|
</pre>
<p>
If you don&#8217;t want to write Selenese tests by hand you can use <a
href="http://www.openqa.org/selenium-ide/">SeleniumIDE</a> which has <a
href="http://wiki.openqa.org/display/SIDE/SeleniumOnRails">support</a> for
Selenese.
</p>
<p>
SeleniumIDE makes it super easy to record test and edit them.
</p>
<h3>RSelenese, .rsel</h3>
<p>
RSelenese enable you to write your tests in Ruby.
</p>
<pre>
setup :fixtures =&gt; :all
open '/'
assert_title 'Home'
('a'..'z').each {|c| open :controller =&gt; 'user', :action =&gt; 'create', :name =&gt; c }
</pre>
<p>
See <a
href="../classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a>
for available commands.
</p>
<h3>HTML/RHTML</h3>
<p>
You can write your tests in HTML/RHTML but that&#8217;s mostly useful if
you have existing tests you want to reuse.
</p>
<h3>Partial test cases</h3>
<p>
If you have some common actions you want to do in several test cases you
can put them in a separate partial test case and include them in your other
test cases.
</p>
<p>
A partial test case is just like a normal test case besides that its
filename has to start with _:
</p>
<pre>
#_login.rsel
open '/login'
type 'name', name
type 'password', password
click 'submit', :wait=&gt;true
</pre>
<p>
To include a partial test case you write like this in a Selenese test case:
</p>
<pre>
|includePartial|login|name=John Doe|password=eoD nhoJ|
</pre>
<p>
in a RSelenese test case:
</p>
<pre>
include_partial 'login', :name =&gt; 'Jane Doe', :password =&gt; 'Jane Doe'.reverse
</pre>
<p>
and in a RHTML test case:
</p>
<pre>
&lt;%= render :partial =&gt; 'login', :locals =&gt; {:name = 'Joe Schmo', :password =&gt; 'Joe Schmo'.reverse} %&gt;
</pre>
<h2>Configuration</h2>
<p>
There are a number of settings available. You make them by renaming
<tt>config.yml.example</tt> to <tt>config.yml</tt> and make your changes in
that file.
</p>
<h3>Environments</h3>
<p>
Per default this plugin is only available in test environment. You can
change this by setting <tt>environments</tt>, such as:
</p>
<pre>
#config.yml
environments:
- test
- development
</pre>
<h2><tt>test:acceptance</tt></h2>
<p>
You can run all your Selenium tests as a Rake task.
</p>
<p>
First, if you&#8217;re on Windows, you have to make sure win32-open3 is
installed. Then you have to configure which browsers you want to run, like
this:
</p>
<pre>
#config.yml
browsers:
firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
ie: 'c:\Program Files\Internet Explorer\iexplore.exe'
</pre>
<p>
Now you&#8217;re all set. First start a server:
</p>
<pre>
script/server -e test
</pre>
<p>
Then run the tests:
</p>
<pre>
rake test:acceptance
</pre>
<p>
Now it should work, otherwise let me know!
</p>
<h3>Store results</h3>
<p>
If you want to store the results from a <tt>test:acceptance</tt> you just
need to set in which directory they should be stored:
</p>
<pre>
#config.yml
result_dir: 'c:\result'
</pre>
<p>
So when you run <tt>rake test:acceptance</tt> the tables with the results
will be stored as <tt>.html</tt> files in that directory.
</p>
<p>
This can be useful especially for continous integration.
</p>
<h2>Todo</h2>
<h3>Standalone mode</h3>
<p>
More work is needed on <tt>test:acceptance</tt> on Windows to be able to
start the server when needed.
</p>
<h3>user_extension.js</h3>
<p>
Selenium has support for <tt>user_extension.js</tt> which is a way to
extend the functionality of Selenium Core. However there is currently no
easy way to add such a file in Selenium on Rails.
</p>
<h3>More setup/teardown support?</h3>
<p>
Currently there is only support to load fixtures and to wipe the session in
<tt>/selenium/setup</tt>. Is there a need for more kinds of setups or
teardowns?
</p>
<h3>More documentation</h3>
<h2>Not todo</h2>
<h3>Editor</h3>
<p>
Creating an editor for the test cases is currently considered out of scope
for this plugin. <a
href="http://www.openqa.org/selenium-ide/">SeleniumIDE</a> does such a good
job and has <a
href="http://wiki.openqa.org/display/SIDE/SeleniumOnRails">support</a> for
the Selenese format.
</p>
<h2>Credits</h2>
<ul>
<li>Jon Tirsen, <a href="http://jutopia.tirsen.com">jutopia.tirsen.com</a>
&#8212; initial <a
href="http://wiki.rubyonrails.com/rails/pages/SeleniumIntegration">inspiration</a>
</li>
<li>Eric Kidd, <a href="http://www.randomhacks.net">www.randomhacks.net</a>
&#8212; contribution of RSelenese
</li>
</ul>
<h2>Information</h2>
<p>
For more information, check out the <a
href="http://www.openqa.org/selenium-on-rails/">website</a>.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: README</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>README</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>README
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:11 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<h1>Selenium on Rails</h1>
<h2>Overview</h2>
<p>
Selenium on Rails provides an easy way to test Rails application with <a
href="http://www.openqa.org/selenium-core/">SeleniumCore</a>.
</p>
<p>
This plugin does four things:
</p>
<ol>
<li>The Selenium Core files don&#8216;t have to pollute <tt>/public</tt>.
</li>
<li>No need to create suite files, they are generated on the fly &#8212; one
suite per directory in <tt>/test/selenium</tt> (suites can be nested).
</li>
<li>Instead of writing the test cases in HTML you can use a number of better
formats (see <tt>Formats</tt>).
</li>
<li>Loading of fixtures and wiping of session (<tt>/selenium/setup</tt>).
</li>
</ol>
<h2>Installation</h2>
<ol>
<li>Install Selenium on Rails: <tt>script/plugin install <a
href="http://svn.openqa.org/svn/selenium-on-rails/selenium-on-rails">svn.openqa.org/svn/selenium-on-rails/selenium-on-rails</a></tt>
</li>
<li>If you&#8216;re on Windows, <tt>gem install win32-open3</tt>
</li>
<li><em>If the RedCloth gem is available the Selenese test cases can use it for
better markup.</em>
</li>
<li>Run the Rakefile in the plugin&#8216;s directory to run the tests in order
to see that everything works. (If RedCloth isn&#8216;t installed a few
tests will fail since they assume RedCloth is installed.)
</li>
<li>Create a test case: <tt>script/generate selenium login</tt>
</li>
<li>Start the server: <tt>script/server -e test</tt>
</li>
<li>Point your browser to <tt><a
href="http://localhost:3000/selenium">localhost:3000/selenium</a></tt>
</li>
<li>If everything works as expected you should see the Selenium test runner.
The north east frame contains all your test cases (just one for now), and
the north frame contains your test case.
</li>
</ol>
<h2>Formats</h2>
<p>
The test cases can be written in a number of formats. Which one you choose
is a matter of taste. You can generate your test files by running
<tt>script/generate selenium</tt> or by creating them manually in your
<tt>/test/selenium</tt> directory.
</p>
<h3>Selenese, .sel</h3>
<p>
Selenese is the dumbest format (in a good way). You just write your
commands delimited by | characters.
</p>
<pre>
|open|/selenium/setup|
|open|/|
|goBack|
</pre>
<p>
If you don&#8216;t want to write Selenese tests by hand you can use <a
href="http://www.openqa.org/selenium-ide/">SeleniumIDE</a> which has <a
href="http://wiki.openqa.org/display/SIDE/SeleniumOnRails">support</a> for
Selenese.
</p>
<p>
SeleniumIDE makes it super easy to record test and edit them.
</p>
<h3>RSelenese, .rsel</h3>
<p>
RSelenese enable you to write your tests in Ruby.
</p>
<pre>
setup :fixtures =&gt; :all
open '/'
assert_title 'Home'
('a'..'z').each {|c| open :controller =&gt; 'user', :action =&gt; 'create', :name =&gt; c }
</pre>
<p>
See <a
href="../classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a>
for available commands.
</p>
<h3>HTML/RHTML</h3>
<p>
You can write your tests in HTML/RHTML but that&#8216;s mostly useful if
you have existing tests you want to reuse.
</p>
<h3>Partial test cases</h3>
<p>
If you have some common actions you want to do in several test cases you
can put them in a separate partial test case and include them in your other
test cases.
</p>
<p>
A partial test case is just like a normal test case besides that its
filename has to start with _:
</p>
<pre>
#_login.rsel
open '/login'
type 'name', name
type 'password', password
click 'submit', :wait=&gt;true
</pre>
<p>
To include a partial test case you write like this in a Selenese test case:
</p>
<pre>
|includePartial|login|name=John Doe|password=eoD nhoJ|
</pre>
<p>
in a RSelenese test case:
</p>
<pre>
include_partial 'login', :name =&gt; 'Jane Doe', :password =&gt; 'Jane Doe'.reverse
</pre>
<p>
and in a RHTML test case:
</p>
<pre>
&lt;%= render :partial =&gt; 'login', :locals =&gt; {:name = 'Joe Schmo', :password =&gt; 'Joe Schmo'.reverse} %&gt;
</pre>
<h2>Configuration</h2>
<p>
There are a number of settings available. You make them by renaming
<tt>config.yml.example</tt> to <tt>config.yml</tt> and make your changes in
that file.
</p>
<h3>Environments</h3>
<p>
Per default this plugin is only available in test environment. You can
change this by setting <tt>environments</tt>, such as:
</p>
<pre>
#config.yml
environments:
- test
- development
</pre>
<h3>Selenium Core path</h3>
<p>
If you don&#8216;t want to use the bundled Selenium Core version you can
set <tt>selenium_path</tt> to the directory where Selenium Core is stored.
</p>
<pre>
#config.yml
selenium_path: 'c:\selenium'
</pre>
<h2><tt>test:acceptance</tt></h2>
<p>
You can run all your Selenium tests as a Rake task.
</p>
<p>
First, if you&#8216;re on Windows, you have to make sure win32-open3 is
installed. Then you have to configure which browsers you want to run, like
this:
</p>
<pre>
#config.yml
browsers:
firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
ie: 'c:\Program Files\Internet Explorer\iexplore.exe'
</pre>
<p>
Now you&#8216;re all set. First start a server:
</p>
<pre>
script/server -e test
</pre>
<p>
Then run the tests:
</p>
<pre>
rake test:acceptance
</pre>
<p>
Now it should work, otherwise let me know!
</p>
<h3>Store results</h3>
<p>
If you want to store the results from a <tt>test:acceptance</tt> you just
need to set in which directory they should be stored:
</p>
<pre>
#config.yml
result_dir: 'c:\result'
</pre>
<p>
So when you run <tt>rake test:acceptance</tt> the tables with the results
will be stored as <tt>.html</tt> files in that directory.
</p>
<p>
This can be useful especially for continous integration.
</p>
<h3>user_extension.js</h3>
<p>
Selenium has support for <tt>user_extension.js</tt> which is a way to
extend the functionality of Selenium Core. Selenium on Rails now provides
the means for you to extend it&#8216;s functionality to match.
</p>
<p>
To get you started, we&#8216;ve included the example files
<tt>lib/test_builder_user_accessors.rb.example</tt> and
<tt>lib/test_builder_user_actions.rb.example</tt> that replicate the sample
extensions in Selenium Core&#8216;s <tt>user-extensions.js.sample</tt>
</p>
<p>
To get these examples running, simply remove the .example and .sample
extensions from the files and restart your server.
</p>
<h2>Todo</h2>
<h3>Standalone mode</h3>
<p>
More work is needed on <tt>test:acceptance</tt> on Windows to be able to
start the server when needed.
</p>
<h3>More setup/teardown support?</h3>
<p>
Currently there is only support to load fixtures and to wipe the session in
<tt>/selenium/setup</tt>. Is there a need for more kinds of setups or
teardowns?
</p>
<h3>More documentation</h3>
<h2>Not todo</h2>
<h3>Editor</h3>
<p>
Creating an editor for the test cases is currently considered out of scope
for this plugin. <a
href="http://www.openqa.org/selenium-ide/">SeleniumIDE</a> does such a good
job and has <a
href="http://wiki.openqa.org/display/SIDE/SeleniumOnRails">support</a> for
the Selenese format.
</p>
<h2>Credits</h2>
<ul>
<li>Jon Tirsen, <a href="http://jutopia.tirsen.com">jutopia.tirsen.com</a>
&#8212; initial <a
href="http://wiki.rubyonrails.com/rails/pages/SeleniumIntegration">inspiration</a>
</li>
<li>Eric Kidd, <a href="http://www.randomhacks.net">www.randomhacks.net</a>
&#8212; contribution of RSelenese
</li>
</ul>
<h2>Information</h2>
<p>
For more information, check out the <a
href="http://www.openqa.org/selenium-on-rails/">website</a>.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,108 +1,108 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenium_controller.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenium_controller.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/controllers/selenium_controller.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Fri Dec 08 00:52:51 GMT Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
webrick/httputils&nbsp;&nbsp;
</div>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenium_controller.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenium_controller.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/controllers/selenium_controller.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:05 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
webrick/httputils&nbsp;&nbsp;
</div>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,101 +1,101 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenium_helper.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenium_helper.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_helper.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sun Feb 05 01:02:10 W. Europe Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenium_helper.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenium_helper.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_helper.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,207 +1,222 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: acceptance_test_runner.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>acceptance_test_runner.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/acceptance_test_runner.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Fri Dec 08 00:16:44 GMT Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
net/http&nbsp;&nbsp;
tempfile&nbsp;&nbsp;
</div>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000001">c</a>&nbsp;&nbsp;
<a href="#M000002">c_b</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<div id="constants-list">
<h3 class="section-bar">Constants</h3>
<div class="name-list">
<table summary="Constants">
<tr class="top-aligned-row context-row">
<td class="context-item-name">BROWSERS</td>
<td>=</td>
<td class="context-item-value">c :browsers, {}</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">REUSE_EXISTING_SERVER</td>
<td>=</td>
<td class="context-item-value">c :reuse_existing_server, true</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">START_SERVER</td>
<td>=</td>
<td class="context-item-value">c :start_server, false</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">PORTS</td>
<td>=</td>
<td class="context-item-value">c(:port_start, 3000)..c(:port_end, 3005)</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">TEST_RUNNER_URL</td>
<td>=</td>
<td class="context-item-value">c :test_runner_url, '/selenium/TestRunner.html'</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">MAX_BROWSER_DURATION</td>
<td>=</td>
<td class="context-item-value">c :max_browser_duration, 2*60</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">SERVER_COMMAND</td>
<td>=</td>
<td class="context-item-value">c_b :server_command do server_path = File.expand_path(File.dirname(__FILE__) + '/../../../../../script/server')</td>
</tr>
</table>
</div>
</div>
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000001" class="method-detail">
<a name="M000001"></a>
<div class="method-heading">
<a href="#M000001" class="method-signature">
<span class="method-name">c</span><span class="method-args">(var, default = nil)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000001-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/acceptance_test_runner.rb, line 7</span>
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">c</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span> = <span class="ruby-keyword kw">nil</span>) <span class="ruby-constant">SeleniumOnRailsConfig</span>.<span class="ruby-identifier">get</span> <span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span> <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000002" class="method-detail">
<a name="M000002"></a>
<div class="method-heading">
<a href="#M000002" class="method-signature">
<span class="method-name">c_b</span><span class="method-args">(var, default = nil) {|| ...}</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000002-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/acceptance_test_runner.rb, line 8</span>
8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">c_b</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span> = <span class="ruby-keyword kw">nil</span>) <span class="ruby-constant">SeleniumOnRailsConfig</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span>) { <span class="ruby-keyword kw">yield</span> } <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: acceptance_test_runner.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>acceptance_test_runner.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/acceptance_test_runner.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
net/http&nbsp;&nbsp;
tempfile&nbsp;&nbsp;
</div>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000001">c</a>&nbsp;&nbsp;
<a href="#M000002">c_b</a>&nbsp;&nbsp;
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<div id="constants-list">
<h3 class="section-bar">Constants</h3>
<div class="name-list">
<table summary="Constants">
<tr class="top-aligned-row context-row">
<td class="context-item-name">BROWSERS</td>
<td>=</td>
<td class="context-item-value">c :browsers, {}</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">REUSE_EXISTING_SERVER</td>
<td>=</td>
<td class="context-item-value">c :reuse_existing_server, true</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">START_SERVER</td>
<td>=</td>
<td class="context-item-value">c :start_server, false</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">HOST</td>
<td>=</td>
<td class="context-item-value">c :host, 'localhost'</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">PORTS</td>
<td>=</td>
<td class="context-item-value">c(:port_start, 3000)..c(:port_end, 3005)</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">BASE_URL_PATH</td>
<td>=</td>
<td class="context-item-value">c :base_url_path, '/'</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">TEST_RUNNER_URL</td>
<td>=</td>
<td class="context-item-value">c :test_runner_url, '/selenium/TestRunner.html'</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">MAX_BROWSER_DURATION</td>
<td>=</td>
<td class="context-item-value">c :max_browser_duration, 2*60</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">MULTI_WINDOW</td>
<td>=</td>
<td class="context-item-value">c :multi_window, false</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">SERVER_COMMAND</td>
<td>=</td>
<td class="context-item-value">c_b :server_command do server_path = File.expand_path(File.dirname(__FILE__) + '/../../../../../script/server')</td>
</tr>
</table>
</div>
</div>
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000001" class="method-detail">
<a name="M000001"></a>
<div class="method-heading">
<a href="#M000001" class="method-signature">
<span class="method-name">c</span><span class="method-args">(var, default = nil)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000001-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/acceptance_test_runner.rb, line 7</span>
7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">c</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span> = <span class="ruby-keyword kw">nil</span>) <span class="ruby-constant">SeleniumOnRailsConfig</span>.<span class="ruby-identifier">get</span> <span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span> <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div id="method-M000002" class="method-detail">
<a name="M000002"></a>
<div class="method-heading">
<a href="#M000002" class="method-signature">
<span class="method-name">c_b</span><span class="method-args">(var, default = nil) {|| ...}</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
<div class="method-source-code" id="M000002-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/acceptance_test_runner.rb, line 8</span>
8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">c_b</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span> = <span class="ruby-keyword kw">nil</span>) <span class="ruby-constant">SeleniumOnRailsConfig</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">var</span>, <span class="ruby-identifier">default</span>) { <span class="ruby-keyword kw">yield</span> } <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,108 +1,109 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: fixture_loader.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>fixture_loader.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/fixture_loader.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sun Feb 05 00:59:28 W. Europe Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
active_record/fixtures&nbsp;&nbsp;
</div>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: fixture_loader.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>fixture_loader.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/fixture_loader.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
test/unit&nbsp;&nbsp;
active_record/fixtures&nbsp;&nbsp;
</div>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,111 +1,111 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: partials_support.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>partials_support.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/partials_support.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Tue May 02 00:43:37 W. Europe Daylight Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Provides partials support to test cases so they can include other partial
test cases.
</p>
<p>
The partial&#8217;s commands are returned as html table rows.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: partials_support.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>partials_support.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/partials_support.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Provides partials support to test cases so they can include other partial
test cases.
</p>
<p>
The partial&#8216;s commands are returned as html table rows.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,101 +1,101 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: paths.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>paths.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/paths.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sun Feb 05 00:59:28 W. Europe Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: paths.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>paths.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/paths.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,101 +1,101 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: renderer.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>renderer.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/renderer.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sun Feb 05 00:59:29 W. Europe Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: renderer.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>renderer.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/renderer.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,118 +1,118 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: rselenese.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>rselenese.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/rselenese.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sun Feb 19 12:59:40 W. Europe Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Renders Selenium test templates in a fashion analogous to <tt>rxml</tt> and
<tt>rjs</tt> templates.
</p>
<pre>
setup
open :controller =&gt; 'customer', :action =&gt; 'list'
assert_title 'Customers'
</pre>
<p>
See <a
href="../../../classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a>
for a list of available commands.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: rselenese.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>rselenese.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/rselenese.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Renders Selenium test templates in a fashion analogous to <tt>rxml</tt> and
<tt>rjs</tt> templates.
</p>
<pre>
setup
open :controller =&gt; 'customer', :action =&gt; 'list'
assert_title 'Customers'
</pre>
<p>
See <a
href="../../../classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a>
for a list of available commands.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,101 +1,101 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenese.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenese.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/selenese.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sun Feb 05 00:56:55 W. Europe Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenese.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenese.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/selenese.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,101 +1,101 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: suite_renderer.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>suite_renderer.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/suite_renderer.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sun Feb 05 04:12:56 W. Europe Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: suite_renderer.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>suite_renderer.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/suite_renderer.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,114 +1,114 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: test_builder_accessors.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>test_builder_accessors.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/test_builder_accessors.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Tue Jun 06 03:01:29 W. Europe Daylight Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
The accessors available for <a
href="../../../classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a>
tests.
</p>
<p>
For each <tt>store_foo</tt> there&#8217;s <tt>assert_foo</tt>,
<tt>assert_not_foo</tt>, <tt>verify_foo</tt>, <tt>verify_not_foo</tt>,
<tt>wait_for_foo</tt>, <tt>wait_for_not_foo</tt>.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: test_builder_accessors.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>test_builder_accessors.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/test_builder_accessors.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
The accessors available for <a
href="../../../classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a>
tests.
</p>
<p>
For each <tt>store_foo</tt> there&#8216;s <tt>assert_foo</tt>,
<tt>assert_not_foo</tt>, <tt>verify_foo</tt>, <tt>verify_not_foo</tt>,
<tt>wait_for_foo</tt>, <tt>wait_for_not_foo</tt>.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,113 +1,113 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: test_builder_actions.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>test_builder_actions.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/test_builder_actions.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Tue Jun 06 03:12:04 W. Europe Daylight Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
The actions available for <a
href="../../../classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a>
tests.
</p>
<p>
For each action <tt>foo</tt> there&#8217;s also an action
<tt>foo_and_wait</tt>.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: test_builder_actions.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>test_builder_actions.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/test_builder_actions.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
The actions available for <a
href="../../../classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a>
tests.
</p>
<p>
For each action <tt>foo</tt> there&#8216;s also an action
<tt>foo_and_wait</tt>.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,121 +1,120 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: test_builder.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>test_builder.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/test_builder.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Tue Jun 06 02:47:24 W. Europe Daylight Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Builds Selenium test table using a high-level Ruby interface. Normally
invoked through <a
href="../../../classes/SeleniumOnRails/RSelenese.html">SeleniumOnRails::RSelenese</a>.
</p>
<p>
See <a
href="../../../classes/SeleniumOnRails/TestBuilderActions.html">SeleniumOnRails::TestBuilderActions</a>
for the available actions and <a
href="../../../classes/SeleniumOnRails/TestBuilderAccessors.html">SeleniumOnRails::TestBuilderAccessors</a>
for the available checks.
</p>
<p>
For more information on the commands supported by TestBuilder, see the
Selenium Commands Documentation at <a
href="http://release.openqa.org/selenium-core/nightly/reference.html">release.openqa.org/selenium-core/nightly/reference.html</a>.
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: test_builder.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>test_builder.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails/test_builder.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 23:42:13 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<p>
Create test_builder_user_actions.rb to support actions included in
selenium-core&#8216;s user-extensions.js
</p>
<p>
See test_builder_user_actions.rb.example for examples matching
selenium-core&#8216;s user-extensions.js.sample
</p>
</div>
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
selenium_on_rails/test_builder_user_actions&nbsp;&nbsp;
selenium_on_rails/test_builder_user_accessors&nbsp;&nbsp;
</div>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,108 +1,108 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenium_on_rails_config.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenium_on_rails_config.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails_config.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Feb 20 21:58:17 W. Europe Standard Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
yaml&nbsp;&nbsp;
</div>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenium_on_rails_config.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenium_on_rails_config.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails_config.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 22:54:06 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
yaml&nbsp;&nbsp;
</div>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,115 +1,115 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenium_on_rails.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenium_on_rails.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Thu May 04 01:18:20 W. Europe Daylight Time 2006</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
selenium_on_rails/selenese&nbsp;&nbsp;
selenium_on_rails/test_builder&nbsp;&nbsp;
selenium_on_rails/rselenese&nbsp;&nbsp;
selenium_on_rails/suite_renderer&nbsp;&nbsp;
selenium_on_rails/paths&nbsp;&nbsp;
selenium_on_rails/fixture_loader&nbsp;&nbsp;
selenium_on_rails/partials_support&nbsp;&nbsp;
selenium_on_rails/renderer&nbsp;&nbsp;
</div>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: selenium_on_rails.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>selenium_on_rails.rb</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>lib/selenium_on_rails.rb
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Sat Feb 03 23:38:50 +0100 2007</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="requires-list">
<h3 class="section-bar">Required files</h3>
<div class="name-list">
selenium_on_rails/selenese&nbsp;&nbsp;
selenium_on_rails/test_builder&nbsp;&nbsp;
selenium_on_rails/rselenese&nbsp;&nbsp;
selenium_on_rails/suite_renderer&nbsp;&nbsp;
selenium_on_rails/paths&nbsp;&nbsp;
selenium_on_rails/fixture_loader&nbsp;&nbsp;
selenium_on_rails/partials_support&nbsp;&nbsp;
selenium_on_rails/renderer&nbsp;&nbsp;
</div>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>

View file

@ -1,40 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Classes
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Classes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="rdoc-style.css" type="text/css" />
<base target="docwin" />
</head>
<body>
<div id="index">
<h1 class="section-bar">Classes</h1>
<div id="index-entries">
<a href="classes/SeleniumController.html">SeleniumController</a><br />
<a href="classes/SeleniumHelper.html">SeleniumHelper</a><br />
<a href="classes/SeleniumOnRails.html">SeleniumOnRails</a><br />
<a href="classes/SeleniumOnRails/FixtureLoader.html">SeleniumOnRails::FixtureLoader</a><br />
<a href="classes/SeleniumOnRails/PartialsSupport.html">SeleniumOnRails::PartialsSupport</a><br />
<a href="classes/SeleniumOnRails/Paths.html">SeleniumOnRails::Paths</a><br />
<a href="classes/SeleniumOnRails/RSelenese.html">SeleniumOnRails::RSelenese</a><br />
<a href="classes/SeleniumOnRails/Renderer.html">SeleniumOnRails::Renderer</a><br />
<a href="classes/SeleniumOnRails/Selenese.html">SeleniumOnRails::Selenese</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html">SeleniumOnRails::SuiteRenderer</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html">SeleniumOnRails::TestBuilderAccessors</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html">SeleniumOnRails::TestBuilderActions</a><br />
<a href="classes/SeleniumOnRailsConfig.html">SeleniumOnRailsConfig</a><br />
</div>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Classes
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Classes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="rdoc-style.css" type="text/css" />
<base target="docwin" />
</head>
<body>
<div id="index">
<h1 class="section-bar">Classes</h1>
<div id="index-entries">
<a href="classes/SeleniumController.html">SeleniumController</a><br />
<a href="classes/SeleniumHelper.html">SeleniumHelper</a><br />
<a href="classes/SeleniumOnRails.html">SeleniumOnRails</a><br />
<a href="classes/SeleniumOnRails/FixtureLoader.html">SeleniumOnRails::FixtureLoader</a><br />
<a href="classes/SeleniumOnRails/PartialsSupport.html">SeleniumOnRails::PartialsSupport</a><br />
<a href="classes/SeleniumOnRails/Paths.html">SeleniumOnRails::Paths</a><br />
<a href="classes/SeleniumOnRails/RSelenese.html">SeleniumOnRails::RSelenese</a><br />
<a href="classes/SeleniumOnRails/Renderer.html">SeleniumOnRails::Renderer</a><br />
<a href="classes/SeleniumOnRails/Selenese.html">SeleniumOnRails::Selenese</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html">SeleniumOnRails::SuiteRenderer</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html">SeleniumOnRails::TestBuilder</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html">SeleniumOnRails::TestBuilderAccessors</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html">SeleniumOnRails::TestBuilderActions</a><br />
<a href="classes/SeleniumOnRails/TestBuilderUserAccessors.html">SeleniumOnRails::TestBuilderUserAccessors</a><br />
<a href="classes/SeleniumOnRails/TestBuilderUserActions.html">SeleniumOnRails::TestBuilderUserActions</a><br />
<a href="classes/SeleniumOnRailsConfig.html">SeleniumOnRailsConfig</a><br />
</div>
</div>
</body>
</html>

View file

@ -1,42 +1,43 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Files
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Files</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="rdoc-style.css" type="text/css" />
<base target="docwin" />
</head>
<body>
<div id="index">
<h1 class="section-bar">Files</h1>
<div id="index-entries">
<a href="files/README.html">README</a><br />
<a href="files/lib/controllers/selenium_controller_rb.html">lib/controllers/selenium_controller.rb</a><br />
<a href="files/lib/selenium_helper_rb.html">lib/selenium_helper.rb</a><br />
<a href="files/lib/selenium_on_rails_rb.html">lib/selenium_on_rails.rb</a><br />
<a href="files/lib/selenium_on_rails/acceptance_test_runner_rb.html">lib/selenium_on_rails/acceptance_test_runner.rb</a><br />
<a href="files/lib/selenium_on_rails/fixture_loader_rb.html">lib/selenium_on_rails/fixture_loader.rb</a><br />
<a href="files/lib/selenium_on_rails/partials_support_rb.html">lib/selenium_on_rails/partials_support.rb</a><br />
<a href="files/lib/selenium_on_rails/paths_rb.html">lib/selenium_on_rails/paths.rb</a><br />
<a href="files/lib/selenium_on_rails/renderer_rb.html">lib/selenium_on_rails/renderer.rb</a><br />
<a href="files/lib/selenium_on_rails/rselenese_rb.html">lib/selenium_on_rails/rselenese.rb</a><br />
<a href="files/lib/selenium_on_rails/selenese_rb.html">lib/selenium_on_rails/selenese.rb</a><br />
<a href="files/lib/selenium_on_rails/suite_renderer_rb.html">lib/selenium_on_rails/suite_renderer.rb</a><br />
<a href="files/lib/selenium_on_rails/test_builder_rb.html">lib/selenium_on_rails/test_builder.rb</a><br />
<a href="files/lib/selenium_on_rails/test_builder_accessors_rb.html">lib/selenium_on_rails/test_builder_accessors.rb</a><br />
<a href="files/lib/selenium_on_rails/test_builder_actions_rb.html">lib/selenium_on_rails/test_builder_actions.rb</a><br />
<a href="files/lib/selenium_on_rails_config_rb.html">lib/selenium_on_rails_config.rb</a><br />
</div>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Files
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Files</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="rdoc-style.css" type="text/css" />
<base target="docwin" />
</head>
<body>
<div id="index">
<h1 class="section-bar">Files</h1>
<div id="index-entries">
<a href="files/CHANGELOG.html">CHANGELOG</a><br />
<a href="files/README.html">README</a><br />
<a href="files/lib/controllers/selenium_controller_rb.html">lib/controllers/selenium_controller.rb</a><br />
<a href="files/lib/selenium_helper_rb.html">lib/selenium_helper.rb</a><br />
<a href="files/lib/selenium_on_rails_rb.html">lib/selenium_on_rails.rb</a><br />
<a href="files/lib/selenium_on_rails/acceptance_test_runner_rb.html">lib/selenium_on_rails/acceptance_test_runner.rb</a><br />
<a href="files/lib/selenium_on_rails/fixture_loader_rb.html">lib/selenium_on_rails/fixture_loader.rb</a><br />
<a href="files/lib/selenium_on_rails/partials_support_rb.html">lib/selenium_on_rails/partials_support.rb</a><br />
<a href="files/lib/selenium_on_rails/paths_rb.html">lib/selenium_on_rails/paths.rb</a><br />
<a href="files/lib/selenium_on_rails/renderer_rb.html">lib/selenium_on_rails/renderer.rb</a><br />
<a href="files/lib/selenium_on_rails/rselenese_rb.html">lib/selenium_on_rails/rselenese.rb</a><br />
<a href="files/lib/selenium_on_rails/selenese_rb.html">lib/selenium_on_rails/selenese.rb</a><br />
<a href="files/lib/selenium_on_rails/suite_renderer_rb.html">lib/selenium_on_rails/suite_renderer.rb</a><br />
<a href="files/lib/selenium_on_rails/test_builder_rb.html">lib/selenium_on_rails/test_builder.rb</a><br />
<a href="files/lib/selenium_on_rails/test_builder_accessors_rb.html">lib/selenium_on_rails/test_builder_accessors.rb</a><br />
<a href="files/lib/selenium_on_rails/test_builder_actions_rb.html">lib/selenium_on_rails/test_builder_actions.rb</a><br />
<a href="files/lib/selenium_on_rails_config_rb.html">lib/selenium_on_rails_config.rb</a><br />
</div>
</div>
</body>
</html>

View file

@ -1,119 +1,182 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Methods
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Methods</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="rdoc-style.css" type="text/css" />
<base target="docwin" />
</head>
<body>
<div id="index">
<h1 class="section-bar">Methods</h1>
<div id="index-entries">
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000022">add_selection (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000029">answer_on_next_prompt (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/FixtureLoader.html#M000049">available_fixtures (SeleniumOnRails::FixtureLoader)</a><br />
<a href="files/lib/selenium_on_rails/acceptance_test_runner_rb.html#M000001">c (lib/selenium_on_rails/acceptance_test_runner.rb)</a><br />
<a href="files/lib/selenium_on_rails/acceptance_test_runner_rb.html#M000002">c_b (lib/selenium_on_rails/acceptance_test_runner.rb)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000019">check (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000028">choose_cancel_on_next_confirmation (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/FixtureLoader.html#M000051">clear_tables (SeleniumOnRails::FixtureLoader)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000011">click (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000032">close (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000090">command (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000092">command_and_wait (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000091">command_verbatim (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000087">exactize (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/PartialsSupport.html#M000081">extract_commands_from_partial (SeleniumOnRails::PartialsSupport)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000012">fire_event (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000042">fixtures_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRailsConfig.html#M000007">get (SeleniumOnRailsConfig)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000030">go_back (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000010">include_partial (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000014">key_down (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000013">key_press (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000015">key_up (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000041">layout_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html#M000048">link_to_test_case (SeleniumOnRails::SuiteRenderer)</a><br />
<a href="classes/SeleniumOnRails/FixtureLoader.html#M000050">load_fixtures (SeleniumOnRails::FixtureLoader)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000043">log_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000093">make_command_waiting (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000017">mouse_down (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000016">mouse_over (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Selenese.html#M000082">new (SeleniumOnRails::Selenese)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000088">new (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/RSelenese.html#M000084">new (SeleniumOnRails::RSelenese)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000025">open (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumController.html#M000006">record (SeleniumController)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000031">refresh (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000023">remove_selection (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Selenese.html#M000083">render (SeleniumOnRails::Selenese)</a><br />
<a href="classes/SeleniumOnRails/RSelenese.html#M000085">render (SeleniumOnRails::RSelenese)</a><br />
<a href="classes/SeleniumOnRails/PartialsSupport.html#M000080">render_partial (SeleniumOnRails::PartialsSupport)</a><br />
<a href="classes/SeleniumOnRails/Renderer.html#M000037">render_test_case (SeleniumOnRails::Renderer)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000021">select (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000026">select_window (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000038">selenium_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000039">selenium_tests_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000086">selenize (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000033">set_context (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000035">set_timeout (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumController.html#M000003">setup (SeleniumController)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000009">setup (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000044">skip_file? (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000058">store_absolute_location (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000055">store_alert (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000052">store_alert_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000075">store_all_buttons (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000077">store_all_fields (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000076">store_all_links (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000070">store_attribute (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000061">store_body_text (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000065">store_checked (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000056">store_confirmation (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000054">store_confirmation_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000074">store_editable (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000072">store_element_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000064">store_eval (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000079">store_expression (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000078">store_html_source (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000059">store_location (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000057">store_prompt (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000053">store_prompt_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000069">store_select_options (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000067">store_selected (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000068">store_selected_options (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000066">store_table (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000063">store_text (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000071">store_text_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000060">store_title (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000062">store_value (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000073">store_visible (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000024">submit (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumController.html#M000005">support_file (SeleniumController)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000089">table (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumHelper.html#M000008">test_case_name (SeleniumHelper)</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html#M000047">test_cases (SeleniumOnRails::SuiteRenderer)</a><br />
<a href="classes/SeleniumController.html#M000004">test_file (SeleniumController)</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html#M000045">test_suite_name (SeleniumOnRails::SuiteRenderer)</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html#M000046">test_suites (SeleniumOnRails::SuiteRenderer)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000018">type (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000020">uncheck (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000040">view_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000034">wait_for_condition (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000036">wait_for_page_to_load (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000027">wait_for_popup (SeleniumOnRails::TestBuilderActions)</a><br />
</div>
</div>
</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Methods
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Methods</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="rdoc-style.css" type="text/css" />
<base target="docwin" />
</head>
<body>
<div id="index">
<h1 class="section-bar">Methods</h1>
<div id="index-entries">
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000023">add_selection (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000034">alt_key_down (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000035">alt_key_up (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000030">answer_on_next_prompt (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/FixtureLoader.html#M000083">available_fixtures (SeleniumOnRails::FixtureLoader)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000036">brake (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="files/lib/selenium_on_rails/acceptance_test_runner_rb.html#M000001">c (lib/selenium_on_rails/acceptance_test_runner.rb)</a><br />
<a href="files/lib/selenium_on_rails/acceptance_test_runner_rb.html#M000002">c_b (lib/selenium_on_rails/acceptance_test_runner.rb)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000020">check (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000029">choose_cancel_on_next_confirmation (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/FixtureLoader.html#M000085">clear_tables (SeleniumOnRails::FixtureLoader)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000011">click (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000012">click_at (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000033">close (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000156">collection_arg (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000151">command (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000153">command_and_wait (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000152">command_verbatim (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000037">control_key_down (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000038">control_key_up (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000039">create_cookie (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000040">delete_cookie (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000041">double_click (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000042">double_click_at (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000043">drag_and_drop (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000044">drag_and_drop_to_object (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000045">echo (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000148">exactize (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/PartialsSupport.html#M000142">extract_commands_from_partial (SeleniumOnRails::PartialsSupport)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000013">fire_event (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000076">fixtures_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRailsConfig.html#M000007">get (SeleniumOnRailsConfig)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000031">go_back (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000046">highlight (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000010">include_partial (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000015">key_down (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000014">key_press (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000016">key_up (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000075">layout_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html#M000082">link_to_test_case (SeleniumOnRails::SuiteRenderer)</a><br />
<a href="classes/SeleniumOnRails/FixtureLoader.html#M000084">load_fixtures (SeleniumOnRails::FixtureLoader)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000077">log_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000154">make_command_waiting (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000047">meta_key_down (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000048">meta_key_up (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000018">mouse_down (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000049">mouse_down_at (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000050">mouse_move (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000051">mouse_move_at (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000052">mouse_out (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000017">mouse_over (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000053">mouse_up (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000054">mouse_up_at (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000149">new (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/RSelenese.html#M000145">new (SeleniumOnRails::RSelenese)</a><br />
<a href="classes/SeleniumOnRails/Selenese.html#M000143">new (SeleniumOnRails::Selenese)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000026">open (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000055">open_window (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000056">pause (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumController.html#M000006">record (SeleniumController)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000032">refresh (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000057">remove_all_selections (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000024">remove_selection (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/RSelenese.html#M000146">render (SeleniumOnRails::RSelenese)</a><br />
<a href="classes/SeleniumOnRails/Selenese.html#M000144">render (SeleniumOnRails::Selenese)</a><br />
<a href="classes/SeleniumOnRails/PartialsSupport.html#M000141">render_partial (SeleniumOnRails::PartialsSupport)</a><br />
<a href="classes/SeleniumOnRails/Renderer.html#M000071">render_test_case (SeleniumOnRails::Renderer)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000022">select (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000058">select_frame (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000027">select_window (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000072">selenium_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000073">selenium_tests_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000147">selenize (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000067">set_context (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000059">set_cursor_position (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000060">set_mouse_speed (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000069">set_timeout (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000009">setup (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumController.html#M000003">setup (SeleniumController)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000061">shift_key_down (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000062">shift_key_up (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000078">skip_file? (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000063">store (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000100">store_absolute_location (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000097">store_alert (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000091">store_alert_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000134">store_all_buttons (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000136">store_all_fields (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000135">store_all_links (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000088">store_all_window_ids (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000089">store_all_window_names (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000090">store_all_window_titles (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000122">store_attribute (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000092">store_attribute_from_all_windows (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000104">store_body_text (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000108">store_checked (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000098">store_confirmation (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000094">store_confirmation_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000095">store_cookie (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000096">store_cursor_position (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000133">store_editable (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000127">store_element_height (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000128">store_element_index (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000130">store_element_position_left (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000131">store_element_position_top (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000125">store_element_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000129">store_element_width (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000086">store_error_on_next (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000107">store_eval (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000138">store_expression (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000087">store_failure_on_next (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000137">store_html_source (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000101">store_location (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000132">store_log_messages (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000102">store_mouse_speed (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000123">store_ordered (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000099">store_prompt (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000093">store_prompt_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000121">store_select_options (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000110">store_selected (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000111">store_selected_id (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000112">store_selected_ids (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000113">store_selected_index (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000114">store_selected_indexes (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000115">store_selected_label (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000116">store_selected_labels (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000120">store_selected_options (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000117">store_selected_value (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000118">store_selected_values (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000119">store_something_selected (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000109">store_table (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000106">store_text (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000124">store_text_present (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000103">store_title (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000105">store_value (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000126">store_visible (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000139">store_whether_this_frame_match_frame_expression (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderAccessors.html#M000140">store_whether_this_window_match_window_expression (SeleniumOnRails::TestBuilderAccessors)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000025">submit (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumController.html#M000005">support_file (SeleniumController)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000150">table (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumHelper.html#M000008">test_case_name (SeleniumHelper)</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html#M000081">test_cases (SeleniumOnRails::SuiteRenderer)</a><br />
<a href="classes/SeleniumController.html#M000004">test_file (SeleniumController)</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html#M000079">test_suite_name (SeleniumOnRails::SuiteRenderer)</a><br />
<a href="classes/SeleniumOnRails/SuiteRenderer.html#M000080">test_suites (SeleniumOnRails::SuiteRenderer)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000019">type (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000064">type_keys (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000021">uncheck (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilder.html#M000155">url_arg (SeleniumOnRails::TestBuilder)</a><br />
<a href="classes/SeleniumOnRails/Paths.html#M000074">view_path (SeleniumOnRails::Paths)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000068">wait_for_condition (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000070">wait_for_page_to_load (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000028">wait_for_popup (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000065">window_focus (SeleniumOnRails::TestBuilderActions)</a><br />
<a href="classes/SeleniumOnRails/TestBuilderActions.html#M000066">window_maximize (SeleniumOnRails::TestBuilderActions)</a><br />
</div>
</div>
</body>
</html>

View file

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<!--
SeleniumOnRails
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>SeleniumOnRails</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<frameset rows="20%, 80%">
<frameset cols="25%,35%,45%">
<frame src="fr_file_index.html" title="Files" name="Files" />
<frame src="fr_class_index.html" name="Classes" />
<frame src="fr_method_index.html" name="Methods" />
</frameset>
<frame src="files/README.html" name="docwin" />
</frameset>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<!--
SeleniumOnRails
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>SeleniumOnRails</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<frameset rows="20%, 80%">
<frameset cols="25%,35%,45%">
<frame src="fr_file_index.html" title="Files" name="Files" />
<frame src="fr_class_index.html" name="Classes" />
<frame src="fr_method_index.html" name="Methods" />
</frameset>
<frame src="files/README.html" name="docwin" />
</frameset>
</html>

View file

@ -1,208 +1,208 @@
body {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 90%;
margin: 0;
margin-left: 40px;
padding: 0;
background: white;
}
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
h1 { font-size: 150%; }
h2,h3,h4 { margin-top: 1em; }
a { background: #eef; color: #039; text-decoration: none; }
a:hover { background: #039; color: #eef; }
/* Override the base stylesheet's Anchor inside a table cell */
td > a {
background: transparent;
color: #039;
text-decoration: none;
}
/* and inside a section title */
.section-title > a {
background: transparent;
color: #eee;
text-decoration: none;
}
/* === Structural elements =================================== */
div#index {
margin: 0;
margin-left: -40px;
padding: 0;
font-size: 90%;
}
div#index a {
margin-left: 0.7em;
}
div#index .section-bar {
margin-left: 0px;
padding-left: 0.7em;
background: #ccc;
font-size: small;
}
div#classHeader, div#fileHeader {
width: auto;
color: white;
padding: 0.5em 1.5em 0.5em 1.5em;
margin: 0;
margin-left: -40px;
border-bottom: 3px solid #006;
}
div#classHeader a, div#fileHeader a {
background: inherit;
color: white;
}
div#classHeader td, div#fileHeader td {
background: inherit;
color: white;
}
div#fileHeader {
background: #057;
}
div#classHeader {
background: #048;
}
.class-name-in-header {
font-size: 180%;
font-weight: bold;
}
div#bodyContent {
padding: 0 1.5em 0 1.5em;
}
div#description {
padding: 0.5em 1.5em;
background: #efefef;
border: 1px dotted #999;
}
div#description h1,h2,h3,h4,h5,h6 {
color: #125;;
background: transparent;
}
div#validator-badges {
text-align: center;
}
div#validator-badges img { border: 0; }
div#copyright {
color: #333;
background: #efefef;
font: 0.75em sans-serif;
margin-top: 5em;
margin-bottom: 0;
padding: 0.5em 2em;
}
/* === Classes =================================== */
table.header-table {
color: white;
font-size: small;
}
.type-note {
font-size: small;
color: #DEDEDE;
}
.xxsection-bar {
background: #eee;
color: #333;
padding: 3px;
}
.section-bar {
color: #333;
border-bottom: 1px solid #999;
margin-left: -20px;
}
.section-title {
background: #79a;
color: #eee;
padding: 3px;
margin-top: 2em;
margin-left: -30px;
border: 1px solid #999;
}
.top-aligned-row { vertical-align: top }
.bottom-aligned-row { vertical-align: bottom }
/* --- Context section classes ----------------------- */
.context-row { }
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
.context-item-value { font-size: small; color: #448; }
.context-item-desc { color: #333; padding-left: 2em; }
/* --- Method classes -------------------------- */
.method-detail {
background: #efefef;
padding: 0;
margin-top: 0.5em;
margin-bottom: 1em;
border: 1px dotted #ccc;
}
.method-heading {
color: black;
background: #ccc;
border-bottom: 1px solid #666;
padding: 0.2em 0.5em 0 0.5em;
}
.method-signature { color: black; background: inherit; }
.method-name { font-weight: bold; }
.method-args { font-style: italic; }
.method-description { padding: 0 0.5em 0 0.5em; }
/* --- Source code sections -------------------- */
a.source-toggle { font-size: 90%; }
div.method-source-code {
background: #262626;
color: #ffdead;
margin: 1em;
padding: 0.5em;
border: 1px dashed #999;
overflow: hidden;
}
div.method-source-code pre { color: #ffdead; overflow: hidden; }
/* --- Ruby keyword styles --------------------- */
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
.ruby-constant { color: #7fffd4; background: transparent; }
.ruby-keyword { color: #00ffff; background: transparent; }
.ruby-ivar { color: #eedd82; background: transparent; }
.ruby-operator { color: #00ffee; background: transparent; }
.ruby-identifier { color: #ffdead; background: transparent; }
.ruby-node { color: #ffa07a; background: transparent; }
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
.ruby-regexp { color: #ffa07a; background: transparent; }
body {
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 90%;
margin: 0;
margin-left: 40px;
padding: 0;
background: white;
}
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
h1 { font-size: 150%; }
h2,h3,h4 { margin-top: 1em; }
a { background: #eef; color: #039; text-decoration: none; }
a:hover { background: #039; color: #eef; }
/* Override the base stylesheet's Anchor inside a table cell */
td > a {
background: transparent;
color: #039;
text-decoration: none;
}
/* and inside a section title */
.section-title > a {
background: transparent;
color: #eee;
text-decoration: none;
}
/* === Structural elements =================================== */
div#index {
margin: 0;
margin-left: -40px;
padding: 0;
font-size: 90%;
}
div#index a {
margin-left: 0.7em;
}
div#index .section-bar {
margin-left: 0px;
padding-left: 0.7em;
background: #ccc;
font-size: small;
}
div#classHeader, div#fileHeader {
width: auto;
color: white;
padding: 0.5em 1.5em 0.5em 1.5em;
margin: 0;
margin-left: -40px;
border-bottom: 3px solid #006;
}
div#classHeader a, div#fileHeader a {
background: inherit;
color: white;
}
div#classHeader td, div#fileHeader td {
background: inherit;
color: white;
}
div#fileHeader {
background: #057;
}
div#classHeader {
background: #048;
}
.class-name-in-header {
font-size: 180%;
font-weight: bold;
}
div#bodyContent {
padding: 0 1.5em 0 1.5em;
}
div#description {
padding: 0.5em 1.5em;
background: #efefef;
border: 1px dotted #999;
}
div#description h1,h2,h3,h4,h5,h6 {
color: #125;;
background: transparent;
}
div#validator-badges {
text-align: center;
}
div#validator-badges img { border: 0; }
div#copyright {
color: #333;
background: #efefef;
font: 0.75em sans-serif;
margin-top: 5em;
margin-bottom: 0;
padding: 0.5em 2em;
}
/* === Classes =================================== */
table.header-table {
color: white;
font-size: small;
}
.type-note {
font-size: small;
color: #DEDEDE;
}
.xxsection-bar {
background: #eee;
color: #333;
padding: 3px;
}
.section-bar {
color: #333;
border-bottom: 1px solid #999;
margin-left: -20px;
}
.section-title {
background: #79a;
color: #eee;
padding: 3px;
margin-top: 2em;
margin-left: -30px;
border: 1px solid #999;
}
.top-aligned-row { vertical-align: top }
.bottom-aligned-row { vertical-align: bottom }
/* --- Context section classes ----------------------- */
.context-row { }
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
.context-item-value { font-size: small; color: #448; }
.context-item-desc { color: #333; padding-left: 2em; }
/* --- Method classes -------------------------- */
.method-detail {
background: #efefef;
padding: 0;
margin-top: 0.5em;
margin-bottom: 1em;
border: 1px dotted #ccc;
}
.method-heading {
color: black;
background: #ccc;
border-bottom: 1px solid #666;
padding: 0.2em 0.5em 0 0.5em;
}
.method-signature { color: black; background: inherit; }
.method-name { font-weight: bold; }
.method-args { font-style: italic; }
.method-description { padding: 0 0.5em 0 0.5em; }
/* --- Source code sections -------------------- */
a.source-toggle { font-size: 90%; }
div.method-source-code {
background: #262626;
color: #ffdead;
margin: 1em;
padding: 0.5em;
border: 1px dashed #999;
overflow: hidden;
}
div.method-source-code pre { color: #ffdead; overflow: hidden; }
/* --- Ruby keyword styles --------------------- */
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
.ruby-constant { color: #7fffd4; background: transparent; }
.ruby-keyword { color: #00ffff; background: transparent; }
.ruby-ivar { color: #eedd82; background: transparent; }
.ruby-operator { color: #00ffee; background: transparent; }
.ruby-identifier { color: #ffdead; background: transparent; }
.ruby-node { color: #ffa07a; background: transparent; }
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
.ruby-regexp { color: #ffa07a; background: transparent; }
.ruby-value { color: #7fffd4; background: transparent; }

View file

@ -1,16 +1,16 @@
<p>It's often a good idea to start the test with opening <tt>/selenium/setup</tt> (see <%%= link_to 'here', :controller => 'selenium', :action => 'setup' %> for more info).</p>
<table>
<tr><th colspan="3"><%%= @page_title %></th></tr>
<tr><td>open</td><td>/selenium/setup</td><td>&nbsp;</td></tr>
<%% for page in ['/', '/home'] -%>
<tr><td>open</td><td><%%= page %></td><td>&nbsp;</td></tr>
<tr><td>assertTitle</td><td>Home</td><td>&nbsp;</td></tr>
<%% end -%>
</table>
<p>More information about the commands is available <a href="http://release.openqa.org/selenium-core/nightly/reference.html">here</a>.</p>
<p>You can write comments above and below the commands, but you can only have one set of commands, i.e. one table, per test.</p>
<p>Point the browser to <a href="<%= testcase_link %>"><%= testcase_link %></a> to see how this test is rendered, or to <a href="<%= suite_link %>"><%= suite_link %></a> to run the suite.</p>
<p>It's often a good idea to start the test with opening <tt>/selenium/setup</tt> (see <%%= link_to 'here', :controller => 'selenium', :action => 'setup' %> for more info).</p>
<table>
<tr><th colspan="3"><%%= @page_title %></th></tr>
<tr><td>open</td><td>/selenium/setup</td><td>&nbsp;</td></tr>
<%% for page in ['/', '/home'] -%>
<tr><td>open</td><td><%%= page %></td><td>&nbsp;</td></tr>
<tr><td>assertTitle</td><td>Home</td><td>&nbsp;</td></tr>
<%% end -%>
</table>
<p>More information about the commands is available <a href="http://release.openqa.org/selenium-core/nightly/reference.html">here</a>.</p>
<p>You can write comments above and below the commands, but you can only have one set of commands, i.e. one table, per test.</p>
<p>Point the browser to <a href="<%= testcase_link %>"><%= testcase_link %></a> to see how this test is rendered, or to <a href="<%= suite_link %>"><%= suite_link %></a> to run the suite.</p>

View file

@ -1,14 +1,14 @@
# It's often a good idea to start the test with 'setup'.
# See /selenium/setup for more info.
setup
open '/'
assert_title 'Home'
# More information about the commands is available at:
# http://release.openqa.org/selenium-core/nightly/reference.html
# See also the RDoc for SeleniumOnRails::TestBuilder.
#
# Point the browser to <%= testcase_link %> to see
# how this test is rendered, or to <%= suite_link %> to
# run the suite.
# It's often a good idea to start the test with 'setup'.
# See /selenium/setup for more info.
setup
open '/'
assert_title 'Home'
# More information about the commands is available at:
# http://release.openqa.org/selenium-core/nightly/reference.html
# See also the RDoc for SeleniumOnRails::TestBuilder.
#
# Point the browser to <%= testcase_link %> to see
# how this test is rendered, or to <%= suite_link %> to
# run the suite.

View file

@ -1,11 +1,11 @@
It's often a good idea to start the test with opening <tt>/selenium/setup</tt> (see "here":/selenium/setup for more info).
|open|/selenium/setup|
|open|/|
|assertTitle|Home|
More information about the commands is available "here":http://release.openqa.org/selenium-core/nightly/reference.html.
You can write comments above and below the commands, but you can only have one set of commands, i.e. one table, per test. "RedCloth":http://www.whytheluckystiff.net/ruby/redcloth/ is used for formatting if installed.
Point the browser to "<%= testcase_link %>":<%= testcase_link %> to see how this test is rendered, or to "<%= suite_link %>":<%= suite_link %> to run the suite.
It's often a good idea to start the test with opening <tt>/selenium/setup</tt> (see "here":/selenium/setup for more info).
|open|/selenium/setup|
|open|/|
|assertTitle|Home|
More information about the commands is available "here":http://release.openqa.org/selenium-core/nightly/reference.html.
You can write comments above and below the commands, but you can only have one set of commands, i.e. one table, per test. "RedCloth":http://www.whytheluckystiff.net/ruby/redcloth/ is used for formatting if installed.
Point the browser to "<%= testcase_link %>":<%= testcase_link %> to see how this test is rendered, or to "<%= suite_link %>":<%= suite_link %> to run the suite.

View file

@ -1,5 +1,5 @@
require 'selenium_on_rails_config'
envs = SeleniumOnRailsConfig.get :environments
envs = SeleniumOnRailsConfig.new.get :environments
if envs.include? RAILS_ENV
#initialize the plugin
@ -8,14 +8,8 @@ if envs.include? RAILS_ENV
require File.dirname(__FILE__) + '/routes'
SeleniumController.prepend_view_path File.expand_path(File.dirname(__FILE__) + '/lib/views')
else
#erase all traces
$LOAD_PATH.delete lib_path
#but help user figure out what to do
unless RAILS_ENV == 'production' # don't pollute production
require File.dirname(__FILE__) + '/switch_environment/init'
end
end

View file

@ -1,120 +1,122 @@
require 'webrick/httputils'
class SeleniumController < ActionController::Base
include SeleniumOnRails::FixtureLoader
include SeleniumOnRails::Renderer
def setup
unless params.has_key? :keep_session
reset_session
@session_wiped = true
end
@cleared_tables = clear_tables params[:clear_tables].to_s
Fixtures.reset_cache # added in during Rails 2 transition to address issue with selenium tests not relaoding fixtures
@loaded_fixtures = load_fixtures params[:fixtures].to_s
render :file => view_path('setup.rhtml'), :layout => layout_path
end
def test_file
params[:testname] = '' if params[:testname].to_s == 'TestSuite.html'
filename = File.join selenium_tests_path, params[:testname]
if File.directory? filename
@suite_path = filename
render :file => view_path('test_suite.rhtml'), :layout => layout_path
elsif File.readable? filename
render_test_case filename
else
if File.directory? selenium_tests_path
render :text => 'Not found', :status => 404
else
render :text => "Did not find the Selenium tests path (#{selenium_tests_path}). Run script/generate selenium", :status => 404
end
end
end
def support_file
if params[:filename].empty?
redirect_to :filename => 'TestRunner.html', :test => 'tests'
return
end
filename = File.join selenium_path, params[:filename]
if File.file? filename
type = WEBrick::HTTPUtils::DefaultMimeTypes[$1.downcase] if filename =~ /\.(\w+)$/
type ||= 'text/html'
send_file filename, :type => type, :disposition => 'inline', :stream => false
else
render :text => 'Not found', :status => 404
end
end
def record
dir = record_table
@result = {'resultDir' => dir}
for p in ['result', 'numTestFailures', 'numTestPasses', 'numCommandFailures', 'numCommandPasses', 'numCommandErrors', 'totalTime']
@result[p] = params[p]
end
File.open(log_path(params[:logFile] || 'default.yml'), 'w') {|f| YAML.dump(@result, f)}
render :file => view_path('record.rhtml'), :layout => layout_path
end
def record_table
return nil unless result_dir = SeleniumOnRailsConfig.get(:result_dir)
cur_result_dir = File.join(result_dir, (params[:logFile] || "default").sub(/\.yml$/, ''))
FileUtils.mkdir_p(cur_result_dir)
File.open("#{cur_result_dir}/index.html", "wb") do |f|
f.write <<EOS
<html>
<head><title>Selenium Test Result</title></head>
<frameset cols="30%,*">
<frame name="suite" src="suite.html">
<frame name="testcase" src="blank.html">
</frameset>
</html>
EOS
end
html_header = <<EOS
<html>
<head>
<link rel="stylesheet" type="text/css" href="selenium-test.css">
</head>
<body>
EOS
html_footer = "</body></html>\n"
if selenium_path
css_file = File.join selenium_path, "selenium-test.css"
if File.exist?(css_file)
FileUtils.cp css_file, cur_result_dir
end
end
File.open("#{cur_result_dir}/blank.html", "wb") do |f|
f.write "<html><body></body></html>"
end
File.open("#{cur_result_dir}/suite.html", "wb") do |f|
suite = params[:suite]
suite.sub!(/^.*(<table[\s>])/im, '\1')
i = 1
suite.gsub!(/(\shref=)"[^"]*"/i) do |m|
link = "#{$1}\"test#{i}.html\" target=\"testcase\""
File.open("#{cur_result_dir}/test#{i}.html", "wb") do |testcase|
testcase.write html_header
testcase.write(params["testTable.#{i}"])
testcase.write html_footer
end
i += 1
link
end
f.write html_header
f.write suite
f.write html_footer
end
cur_result_dir
end
private :record_table
end
require 'webrick/httputils'
class SeleniumController < ActionController::Base
include SeleniumOnRails::FixtureLoader
include SeleniumOnRails::Renderer
def initialize
@config = SeleniumOnRailsConfig.new
end
def setup
unless params.has_key? :keep_session
reset_session
@session_wiped = true
end
@cleared_tables = clear_tables params[:clear_tables].to_s
@loaded_fixtures = load_fixtures params[:fixtures].to_s
render :file => view_path('setup.rhtml'), :layout => layout_path\
end
def test_file
params[:testname] = '' if params[:testname].to_s == 'TestSuite.html'
filename = File.join selenium_tests_path, params[:testname]
if File.directory? filename
@suite_path = filename
render :file => view_path('test_suite.rhtml'), :layout => layout_path
elsif File.readable? filename
render_test_case filename
else
if File.directory? selenium_tests_path
render :text => 'Not found', :status => 404
else
render :text => "Did not find the Selenium tests path (#{selenium_tests_path}). Run script/generate selenium", :status => 404
end
end
end
def support_file
if params[:filename].empty?
redirect_to :filename => 'TestRunner.html', :test => 'tests'
return
end
filename = File.join selenium_path, params[:filename]
if File.file? filename
type = WEBrick::HTTPUtils::DefaultMimeTypes[$1.downcase] if filename =~ /\.(\w+)$/
type ||= 'text/html'
send_file filename, :type => type, :disposition => 'inline', :stream => false
else
render :text => 'Not found', :status => 404
end
end
def record
dir = record_table
@result = {'resultDir' => dir}
['result', 'numTestFailures', 'numTestPasses', 'numCommandFailures', 'numCommandPasses', 'numCommandErrors', 'totalTime'].each do |item|
@result[item] = params[item]
end
File.open(log_path(params[:logFile] || 'default.yml'), 'w') {|f| YAML.dump(@result, f)}
render :file => view_path('record.rhtml'), :layout => layout_path
end
def record_table
return nil unless result_dir = @config.get(:result_dir)
cur_result_dir = File.join(result_dir, (params[:logFile] || "default").sub(/\.yml$/, ''))
FileUtils.mkdir_p(cur_result_dir)
File.open("#{cur_result_dir}/index.html", "wb") do |f|
f.write <<EOS
<html>
<head><title>Selenium Test Result</title></head>
<frameset cols="30%,*">
<frame name="suite" src="suite.html">
<frame name="testcase" src="blank.html">
</frameset>
</html>
EOS
end
html_header = <<EOS
<html>
<head>
<link rel="stylesheet" type="text/css" href="selenium-test.css">
</head>
<body>
EOS
html_footer = "</body></html>\n"
if selenium_path
css_file = File.join selenium_path, "selenium-test.css"
if File.exist?(css_file)
FileUtils.cp css_file, cur_result_dir
end
end
File.open("#{cur_result_dir}/blank.html", "wb") do |f|
f.write "<html><body></body></html>"
end
File.open("#{cur_result_dir}/suite.html", "wb") do |f|
suite = params[:suite]
suite.sub!(/^.*(<table[\s>])/im, '\1')
i = 1
suite.gsub!(/(\shref=)"[^"]*"/i) do |m|
link = "#{$1}\"test#{i}.html\" target=\"testcase\""
File.open("#{cur_result_dir}/test#{i}.html", "wb") do |testcase|
testcase.write html_header
testcase.write(params["testTable.#{i}"])
testcase.write html_footer
end
i += 1
link
end
f.write html_header
f.write suite
f.write html_footer
end
cur_result_dir
end
private :record_table
end

View file

@ -1,16 +1,16 @@
class SwitchEnvironmentController < ActionController::Base
def index
readme_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'README')
render :status => 500, :locals => {:readme_path => readme_path }, :inline => <<END
<p>
Selenium on Rails is only activated for <%= SeleniumOnRailsConfig.get(:environments).join ', ' %>
environment<%= SeleniumOnRailsConfig.get(:environments).size > 1 ? 's' : '' %> (you're running
<%= RAILS_ENV %>).
</p>
<p>
Start your server in a different environment or see <tt><%= readme_path %></tt>
for information regarding how to change this behavior.
</p>
END
end
class SwitchEnvironmentController < ActionController::Base
def index
readme_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'README')
render :status => 500, :locals => {:readme_path => readme_path }, :inline => <<END
<p>
Selenium on Rails is only activated for <%= SeleniumOnRailsConfig.new.get(:environments).join ', ' %>
environment<%= SeleniumOnRailsConfig.get(:environments).size > 1 ? 's' : '' %> (you're running
<%= RAILS_ENV %>).
</p>
<p>
Start your server in a different environment or see <tt><%= readme_path %></tt>
for information regarding how to change this behavior.
</p>
END
end
end

View file

@ -1,9 +1,8 @@
module SeleniumHelper
include SeleniumOnRails::SuiteRenderer
include SeleniumOnRails::FixtureLoader
def test_case_name filename
File.basename(filename).sub(/\..*/,'').humanize
end
end
module SeleniumHelper
include SeleniumOnRails::SuiteRenderer
include SeleniumOnRails::FixtureLoader
def test_case_name filename
File.basename(filename).sub(/\..*/,'').humanize
end
end

View file

@ -1,11 +1,11 @@
module SeleniumOnRails # :nodoc
end
require 'selenium_on_rails/selenese'
require 'selenium_on_rails/test_builder'
require 'selenium_on_rails/rselenese'
require 'selenium_on_rails/suite_renderer'
require 'selenium_on_rails/paths'
require 'selenium_on_rails/fixture_loader'
require 'selenium_on_rails/partials_support'
require 'selenium_on_rails/renderer'
module SeleniumOnRails # :nodoc
end
require 'selenium_on_rails/selenese'
require 'selenium_on_rails/test_builder'
require 'selenium_on_rails/rselenese'
require 'selenium_on_rails/suite_renderer'
require 'selenium_on_rails/paths'
require 'selenium_on_rails/fixture_loader'
require 'selenium_on_rails/partials_support'
require 'selenium_on_rails/renderer'

View file

@ -1,210 +1,214 @@
require File.dirname(__FILE__) + '/paths'
require File.dirname(__FILE__) + '/../selenium_on_rails_config'
require 'net/http'
require 'tempfile'
def c(var, default = nil) SeleniumOnRailsConfig.get var, default end
def c_b(var, default = nil) SeleniumOnRailsConfig.get(var, default) { yield } end
BROWSERS = c :browsers, {}
REUSE_EXISTING_SERVER = c :reuse_existing_server, true
START_SERVER = c :start_server, false #TODO can't get it to work reliably on Windows, perhaps it's just on my computer, but I leave it off by default for now
HOST = c :host, 'localhost'
PORTS = c(:port_start, 3000)..c(:port_end, 3005)
TEST_RUNNER_URL = c :test_runner_url, '/selenium/TestRunner.html'
MAX_BROWSER_DURATION = c :max_browser_duration, 2*60
MULTI_WINDOW = c :multi_window, false
SERVER_COMMAND = c_b :server_command do
server_path = File.expand_path(File.dirname(__FILE__) + '/../../../../../script/server')
if RUBY_PLATFORM =~ /mswin/
"ruby #{server_path} -p %d -e test > NUL 2>&1"
else
# don't use redirects to /dev/nul since it makes the fork return wrong pid
# see UnixSubProcess
"#{server_path} -p %d -e test"
end
end
module SeleniumOnRails
class AcceptanceTestRunner
include SeleniumOnRails::Paths
def run
raise 'no browser specified, edit/create config.yml' if BROWSERS.empty?
start_server
has_error = false
begin
BROWSERS.each_pair do |browser, path|
log_file = start_browser browser, path
wait_for_completion log_file
stop_browser
result = YAML::load_file log_file
print_result result
has_error ||= result['numTestFailures'].to_i > 0
File.delete log_file unless has_error
end
rescue
stop_server
raise
end
stop_server
raise 'Test failures' if has_error
end
private
def start_server
PORTS.each do |p|
@port = p
case server_check
when :success
return if REUSE_EXISTING_SERVER
next
when Fixnum
next
when :no_response
next unless START_SERVER
do_start_server
return
end
end
raise START_SERVER ? 'failed to start server': 'failed to find existing server, run script/server -e test'
end
def do_start_server
puts 'Starting server'
@server = start_subprocess(format(SERVER_COMMAND, @port))
while true
print '.'
r = server_check
if r == :success
puts
return
end
raise "server returned error: #{r}" if r.instance_of? Fixnum
sleep 3
end
end
def server_check
begin
res = Net::HTTP.get_response HOST, TEST_RUNNER_URL, @port
return :success if (200..399).include? res.code.to_i
return res.code.to_i
rescue Errno::ECONNREFUSED
return :no_response
end
end
def stop_server
return unless defined? @server
puts
@server.stop 'server'
end
def start_browser browser, path
puts
puts "Starting #{browser}"
log = log_file browser
command = "\"#{path}\" \"http://#{HOST}:#{@port}#{TEST_RUNNER_URL}?test=tests&auto=true&resultsUrl=postResults/#{log}&multiWindow=#{MULTI_WINDOW}\""
@browser = start_subprocess command
log_path log
end
def stop_browser
@browser.stop 'browser'
end
def start_subprocess command
if RUBY_PLATFORM =~ /mswin/
SeleniumOnRails::AcceptanceTestRunner::Win32SubProcess.new command
elsif RUBY_PLATFORM =~ /darwin/i && command =~ /safari/i
SeleniumOnRails::AcceptanceTestRunner::SafariSubProcess.new command
else
SeleniumOnRails::AcceptanceTestRunner::UnixSubProcess.new command
end
end
def log_file browser
(0..100).each do |i|
name = browser + (i==0 ? '' : "(#{i})") + '.yml'
return name unless File.exist?(log_path(name))
end
raise 'there are way too many files in the log directory...'
end
def wait_for_completion log_file
duration = 0
while true
raise 'browser takes too long' if duration > MAX_BROWSER_DURATION
print '.'
break if File.exist? log_file
sleep 5
duration += 5
end
puts
end
def print_result result
puts "Finished in #{result['totalTime']} seconds."
puts
puts "#{result['numTestPasses']} tests passed, #{result['numTestFailures']} tests failed"
puts "(Results stored in '#{result['resultDir']}')" if result['resultDir']
end
end
end
class SeleniumOnRails::AcceptanceTestRunner::SubProcess
def stop what
begin
puts "Stopping #{what} (pid=#{@pid}) ..."
Process.kill 9, @pid
rescue Errno::EPERM #such as the process is already closed (tabbed browser)
end
end
end
class SeleniumOnRails::AcceptanceTestRunner::Win32SubProcess < SeleniumOnRails::AcceptanceTestRunner::SubProcess
def initialize command
require 'win32/open3' #win32-open3 http://raa.ruby-lang.org/project/win32-open3/
puts command
input, output, error, @pid = Open4.popen4 command, 't', true
end
end
class SeleniumOnRails::AcceptanceTestRunner::UnixSubProcess < SeleniumOnRails::AcceptanceTestRunner::SubProcess
def initialize command
puts command
@pid = fork do
# Since we can't use shell redirects without screwing
# up the pid, we'll reopen stdin and stdout instead
# to get the same effect.
[STDOUT,STDERR].each {|f| f.reopen '/dev/null', 'w' }
exec command
end
end
end
# The path to Safari should look like this: /Applications/Safari.app/Contents/MacOS/Safari
class SeleniumOnRails::AcceptanceTestRunner::SafariSubProcess < SeleniumOnRails::AcceptanceTestRunner::UnixSubProcess
def initialize command
f = File.open(Tempfile.new('selenium-on-rails').path, 'w')
f.puts <<-HTML
<html>
<head>
<script type="text/javascript" charset="utf-8">
window.location.href = #{command.split.last};
</script>
</head>
<body></body>
</html>
HTML
f.close
super "#{command.split.first} #{f.path}"
end
end
$: << File.expand_path(File.dirname(__FILE__) + "/")
$: << File.expand_path(File.dirname(__FILE__) + "/../")
require 'paths'
require 'net/http'
require 'tempfile'
def c(var, default = nil) SeleniumOnRailsConfig.new.get var, default end
def c_b(var, default = nil) SeleniumOnRailsConfig.new.get(var, default) { yield } end
BROWSERS = c :browsers, {}
REUSE_EXISTING_SERVER = c :reuse_existing_server, true
START_SERVER = c :start_server, false #TODO can't get it to work reliably on Windows, perhaps it's just on my computer, but I leave it off by default for now
HOST = c :host, 'localhost'
PORTS = c(:port_start, 3000)..c(:port_end, 3005)
BASE_URL_PATH = c :base_url_path, '/'
TEST_RUNNER_URL = c :test_runner_url, '/selenium/TestRunner.html'
MAX_BROWSER_DURATION = c :max_browser_duration, 2*60
MULTI_WINDOW = c :multi_window, false
SERVER_COMMAND = c_b :server_command do
server_path = File.expand_path(File.dirname(__FILE__) + '/../../../../../script/server')
if RUBY_PLATFORM =~ /mswin/
"ruby #{server_path} webrick -p %d -e test > NUL 2>&1"
else
# don't use redirects to /dev/nul since it makes the fork return wrong pid
# see UnixSubProcess
"#{server_path} webrick -p %d -e test"
end
end
module SeleniumOnRails
class AcceptanceTestRunner
include SeleniumOnRails::Paths
def run
raise 'no browser specified, edit/create config.yml' if BROWSERS.empty?
start_server
has_error = false
begin
BROWSERS.each_pair do |browser, path|
log_file = start_browser browser, path
wait_for_completion log_file
stop_browser
result = YAML::load_file log_file
print_result result
has_error ||= result['numTestFailures'].to_i > 0
# File.delete log_file unless has_error
end
rescue
stop_server
raise
end
stop_server
raise 'Test failures' if has_error
end
private
def start_server
PORTS.each do |p|
@port = p
case server_check
when :success
return if REUSE_EXISTING_SERVER
next
when Fixnum
next
when :no_response
next unless START_SERVER
do_start_server
return
end
end
raise START_SERVER ? 'failed to start server': 'failed to find existing server, run script/server -e test'
end
def do_start_server
puts 'Starting server'
@server = start_subprocess(format(SERVER_COMMAND, @port))
while true
print '.'
r = server_check
if r == :success
puts
return
end
raise "server returned error: #{r}" if r.instance_of? Fixnum
sleep 3
end
end
def server_check
begin
res = Net::HTTP.get_response HOST, TEST_RUNNER_URL, @port
return :success if (200..399).include? res.code.to_i
return res.code.to_i
rescue Errno::ECONNREFUSED
return :no_response
end
end
def stop_server
return unless defined? @server
puts
@server.stop 'server'
end
def start_browser browser, path
puts
puts "Starting #{browser}"
base_url = "http://#{HOST}:#{@port}#{BASE_URL_PATH}"
log = log_file browser
command = "\"#{path}\" \"http://#{HOST}:#{@port}#{TEST_RUNNER_URL}?test=tests&auto=true&baseUrl=#{base_url}&resultsUrl=postResults/#{log}&multiWindow=#{MULTI_WINDOW}\""
@browser = start_subprocess command
log_path log
end
def stop_browser
@browser.stop 'browser'
end
def start_subprocess command
if RUBY_PLATFORM =~ /mswin/
SeleniumOnRails::AcceptanceTestRunner::Win32SubProcess.new command
elsif RUBY_PLATFORM =~ /darwin/i && command =~ /safari/i
SeleniumOnRails::AcceptanceTestRunner::SafariSubProcess.new command
else
SeleniumOnRails::AcceptanceTestRunner::UnixSubProcess.new command
end
end
def log_file browser
FileUtils.mkdir_p(log_path(''))
(0..100).each do |i|
name = browser + (i==0 ? '' : "(#{i})") + '.yml'
return name unless File.exist?(log_path(name))
end
raise 'there are way too many files in the log directory...'
end
def wait_for_completion log_file
duration = 0
while true
raise 'browser takes too long' if duration > MAX_BROWSER_DURATION
print '.'
break if File.exist? log_file
sleep 5
duration += 5
end
puts
end
def print_result result
puts "Finished in #{result['totalTime']} seconds."
puts
puts "#{result['numTestPasses']} tests passed, #{result['numTestFailures']} tests failed"
puts "(Results stored in '#{result['resultDir']}')" if result['resultDir']
end
end
end
class SeleniumOnRails::AcceptanceTestRunner::SubProcess
def stop what
begin
puts "Stopping #{what} (pid=#{@pid}) ..."
Process.kill 9, @pid
rescue Errno::EPERM #such as the process is already closed (tabbed browser)
end
end
end
class SeleniumOnRails::AcceptanceTestRunner::Win32SubProcess < SeleniumOnRails::AcceptanceTestRunner::SubProcess
def initialize command
require 'win32/open3' #win32-open3 http://raa.ruby-lang.org/project/win32-open3/
puts command
input, output, error, @pid = Open4.popen4 command, 't', true
end
end
class SeleniumOnRails::AcceptanceTestRunner::UnixSubProcess < SeleniumOnRails::AcceptanceTestRunner::SubProcess
def initialize command
puts command
@pid = fork do
# Since we can't use shell redirects without screwing
# up the pid, we'll reopen stdin and stdout instead
# to get the same effect.
[STDOUT,STDERR].each {|f| f.reopen '/dev/null', 'w' }
exec command
end
end
end
# The path to Safari should look like this: /Applications/Safari.app/Contents/MacOS/Safari
class SeleniumOnRails::AcceptanceTestRunner::SafariSubProcess < SeleniumOnRails::AcceptanceTestRunner::UnixSubProcess
def initialize command
f = File.open(Tempfile.new('selenium-on-rails').path, 'w')
f.puts <<-HTML
<html>
<head>
<script type="text/javascript" charset="utf-8">
window.location.href = #{command.split.last};
</script>
</head>
<body></body>
</html>
HTML
f.close
super "#{command.split.first} #{f.path}"
end
end

View file

@ -1,54 +1,57 @@
require 'active_record/fixtures'
module SeleniumOnRails::FixtureLoader
include SeleniumOnRails::Paths
def available_fixtures
fixtures = {}
path = fixtures_path + '/'
files = Dir["#{path}**/*.{yml,csv}"]
files.each do |file|
rel_path = file.sub(path, '')
next if skip_file? rel_path
fixture_set = File.dirname(rel_path)
fixture_set = '' if fixture_set == '.'
fixture = rel_path.sub /\.[^.]*$/, ''
fixtures[fixture_set] ||= []
fixtures[fixture_set] << fixture
end
fixtures
end
def load_fixtures fixtures_param
available = nil
fixtures = fixtures_param.split(/\s*,\s*/).collect do |f|
fixture_set = File.dirname f
fixture_set = '' if fixture_set == '.'
fixture = File.basename f
if fixture == 'all'
available ||= available_fixtures
available[fixture_set]
else
f
end
end
fixtures.flatten!
fixtures.reject! {|f| f.blank? }
if fixtures.any?
Fixtures.create_fixtures fixtures_path, fixtures
end
fixtures
end
def clear_tables tables
table_names = tables.split /\s*,\s*/
connection = ActiveRecord::Base.connection
table_names.each do |table|
connection.execute "DELETE FROM #{table}"
end
table_names
end
end
require 'test/unit'
require 'active_record'
require 'active_record/fixtures'
module SeleniumOnRails::FixtureLoader
include SeleniumOnRails::Paths
def available_fixtures
fixtures = {}
path = fixtures_path + '/'
files = Dir["#{path}**/*.{yml,csv}"]
files.each do |file|
rel_path = file.sub(path, '')
next if skip_file? rel_path
fixture_set = File.dirname(rel_path)
fixture_set = '' if fixture_set == '.'
fixture = rel_path.sub /\.[^.]*$/, ''
fixtures[fixture_set] ||= []
fixtures[fixture_set] << fixture
end
fixtures
end
def load_fixtures fixtures_param
available = nil
fixtures = fixtures_param.split(/\s*,\s*/).collect do |f|
fixture_set = File.dirname f
fixture_set = '' if fixture_set == '.'
fixture = File.basename f
if fixture == 'all'
available ||= available_fixtures
available[fixture_set]
else
f
end
end
fixtures.flatten!
fixtures.reject! {|f| f.blank? }
if fixtures.any?
Fixtures.reset_cache # in case they've already been loaded and things have changed
Fixtures.create_fixtures fixtures_path, fixtures
end
fixtures
end
def clear_tables tables
table_names = tables.split /\s*,\s*/
connection = ActiveRecord::Base.connection
table_names.each do |table|
connection.execute "DELETE FROM #{table}"
end
table_names
end
end

View file

@ -1,38 +1,36 @@
# Provides partials support to test cases so they can include other partial test
# cases.
#
# The partial's commands are returned as html table rows.
module SeleniumOnRails::PartialsSupport
include SeleniumOnRails::Paths
# Overrides where the partial is searched for, and returns only the command table rows.
def render_partial partial_path = default_template_name, object = nil, local_assigns = nil, status = nil
pattern = partial_pattern partial_path
filename = Dir[pattern].first
raise "Partial '#{partial_path}' cannot be found! (Looking for file: '#{pattern}')" unless filename
partial = render :file => filename, :use_full_path => false, :locals => local_assigns
extract_commands_from_partial partial
end
# Extracts the commands from a partial. The partial must contain a html table
# and the first row is ignored since it cannot contain a command.
def extract_commands_from_partial partial
partial = partial.match(/.*<table>.*?<tr>.*?<\/tr>(.*?)<\/table>/im)[1]
raise "Partial '#{name}' doesn't contain any table" unless partial
partial
end
private
# Generates the file pattern from the provided partial path.
# The starting _ and file extension don't have too be provided.
def partial_pattern partial_path
path = partial_path.split '/'
filename = path.delete_at(-1)
filename = '_' + filename unless filename.starts_with? '_'
filename << '.*' unless filename.include? '.'
pattern = selenium_tests_path + '/'
pattern << path.join('/') + '/' if path
pattern << filename
end
require 'selenium_on_rails/paths'
module SeleniumOnRails::PartialsSupport
include SeleniumOnRails::Paths
# Overrides where the partial is searched for, and returns only the command table rows.
def render_partial(options)
pattern = partial_pattern options[:partial]
filename = Dir[pattern].first
raise "Partial '#{partial_path}' cannot be found! (Looking for file: '#{pattern}')" unless filename
partial = render :file => filename, :use_full_path => false, :locals => options[:locals]
extract_commands_from_partial partial
end
# Extracts the commands from a partial. The partial must contain a html table
# and the first row is ignored since it cannot contain a command.
def extract_commands_from_partial partial
partial = partial.match(/.*<table>.*?<tr>.*?<\/tr>(.*?)<\/table>/im)[1]
raise "Partial '#{name}' doesn't contain any table" unless partial
partial
end
private
# Generates the file pattern from the provided partial path.
# The starting _ and file extension don't have too be provided.
def partial_pattern partial_path
path = partial_path.split '/'
filename = path.delete_at(-1)
filename = '_' + filename unless filename.starts_with? '_'
filename << '.*' unless filename.include? '.'
pattern = selenium_tests_path + '/'
pattern << path.join('/') + '/' if path
pattern << filename
end
end

View file

@ -1,5 +1,9 @@
require 'selenium_on_rails_config'
module SeleniumOnRails
module Paths
attr_accessor :config
def selenium_path
@@selenium_path ||= find_selenium_path
@@selenium_path
@ -13,8 +17,11 @@ module SeleniumOnRails
File.expand_path(File.dirname(__FILE__) + '/../views/' + view)
end
# Returns the path to the layout template. The path is relative in relation
# to the app/views/ directory since Rails doesn't support absolute paths
# to layout templates.
def layout_path
'/layout.rhtml'
'layout.rhtml'
end
def fixtures_path
@ -32,25 +39,22 @@ module SeleniumOnRails
false
end
private
def find_selenium_path
sel_dirs = SeleniumOnRailsConfig.get :selenium_path do
ds = [File.expand_path(File.join(RAILS_ROOT, 'vendor/selenium')),
File.expand_path(File.join(RAILS_ROOT, 'vendor/selenium-core'))]
gems = Gem.source_index.find_name 'selenium', nil
ds << gems.last.full_gem_path unless gems.empty?
ds
end
private ###############################################
sel_dirs.to_a.each do |seleniumdir|
['', 'core', 'selenium', 'javascript'].each do |subdir|
path = File.join seleniumdir, subdir
return path if File.exist?(File.join(path, 'TestRunner.html'))
end
end
raise 'Could not find Selenium Core installation'
def find_selenium_path
sel_dirs = @config.get :selenium_path do
File.expand_path(File.dirname(__FILE__) + '/../../selenium-core')
end
sel_dirs.to_a.each do |seleniumdir|
['', 'core', 'selenium', 'javascript'].each do |subdir|
path = File.join seleniumdir, subdir
return path if File.exist?(File.join(path, 'TestRunner.html'))
end
end
raise 'Could not find Selenium Core installation'
end
end
end

View file

@ -1,17 +1,20 @@
module SeleniumOnRails::Renderer
include SeleniumOnRails::Paths
include SeleniumHelper
def render_test_case filename
@template.extend SeleniumOnRails::PartialsSupport
@page_title = test_case_name filename
output = render_to_string :file => filename
layout = (output =~ /<html>/i ? false : layout_path)
render :text => output, :layout => layout
headers['Cache-control'] = 'no-cache'
headers['Pragma'] = 'no-cache'
headers['Expires'] = '-1'
end
module SeleniumOnRails::Renderer
include SeleniumOnRails::Paths
def render_test_case filename
@template.extend SeleniumOnRails::PartialsSupport
@page_title = test_case_name filename
output = render_to_string :file => filename, :locals => {"page_title" => @page_title}
layout = (output =~ /<html>/i ? false : layout_path)
render :text => output, :layout => layout
headers['Cache-control'] = 'no-cache'
headers['Pragma'] = 'no-cache'
headers['Expires'] = '-1'
end
def test_case_name filename
File.basename(filename).sub(/\..*/,'').humanize
end
end

View file

@ -13,23 +13,24 @@ ActionView::Template.register_template_handler 'rsel', SeleniumOnRails::RSelenes
class SeleniumOnRails::RSelenese < SeleniumOnRails::TestBuilder
attr_accessor :view
# Create a new RSelenese renderer bound to _view_.
def initialize view
super view
@view = view
end
# Render _template_ using _local_assigns_.
def render template
title = @view.assigns['page_title']
def render template, local_assigns
title = (@view.assigns['page_title'] or local_assigns['page_title'])
table(title) do
test = self #to enable test.command
eval template.source
assign_locals_code = ''
local_assigns.each_key {|key| assign_locals_code << "#{key} = local_assigns[#{key.inspect}];"}
eval assign_locals_code + "\n" + template.source
end
end
def compilable?
false
def self.call(template)
"#{name}.new(self).render(template, local_assigns)"
end
end
end

View file

@ -1,16 +1,18 @@
require 'selenium_on_rails/partials_support'
class SeleniumOnRails::Selenese
end
ActionView::Template.register_template_handler 'sel', SeleniumOnRails::Selenese
class SeleniumOnRails::Selenese
class SeleniumOnRails::Selenese
def initialize view
@view = view
end
def render template
name = @view.assigns['page_title']
lines = template.strip.split "\n"
def render template, local_assigns = {}
name = (@view.assigns['page_title'] or local_assigns['page_title'])
lines = template.source.strip.split "\n"
html = ''
html << extract_comments(lines)
html << extract_commands(lines, name)
@ -19,10 +21,6 @@ class SeleniumOnRails::Selenese
html
end
def compilable?
false
end
private
def next_line lines, expects
while lines.any?
@ -36,6 +34,10 @@ class SeleniumOnRails::Selenese
return l
end
end
def self.call(template)
"#{name}.new(self).render(template, local_assigns)"
end
def extract_comments lines
comments = ''

View file

@ -1,51 +1,56 @@
module SeleniumOnRails::SuiteRenderer
def test_suite_name path
return 'All test cases' if [nil, '/'].include? path_to_relative_url(path)
File.split(path)[-1].humanize
end
def test_suites path
suites = []
parent_path = File.join(File.split(path).slice(0..-2)) #all but last
parent_path = path_to_relative_url parent_path
suites << ['..', parent_path] unless parent_path.nil?
visit_all_tests path, '', Proc.new {|n, p| suites << [n,path_to_relative_url(p)]}, nil
suites
end
def test_cases path
tests = []
visit_all_tests path, '', nil, Proc.new {|n, p| tests << [n,p]}
tests
end
def link_to_test_case suite_name, filename
name = suite_name + test_case_name(filename)
link_to name, :action => :test_file, :testname => path_to_relative_url(filename).sub(/^\//,'')
end
private
def path_to_relative_url path
slt = @controller.selenium_tests_path
return nil unless path.index slt
path.sub slt, ''
end
def visit_all_tests path, suite_name, suite_consumer, test_consumer
dirs = [] #add dirs to an array in order for files to be processed before dirs
Dir.entries(path).sort.each do |e|
next if skip_file?(e) or ['.','..'].include?(e)
filename = File.join path, e
if File.directory? filename
dirs << [filename, "#{suite_name}#{e.humanize}."]
suite_consumer.call("#{suite_name}#{e.humanize}", filename) if suite_consumer
else
test_consumer.call(suite_name, filename) if test_consumer
end
end
#recurse through dirs
dirs.each {|p, n| visit_all_tests p, n, suite_consumer, test_consumer }
end
end
require 'selenium_on_rails'
module SeleniumOnRails
module SuiteRenderer
def test_suite_name path
return 'All test cases' if [nil, '/'].include? path_to_relative_url(path)
File.split(path)[-1].humanize
end
def test_suites path
suites = []
parent_path = File.join(File.split(path).slice(0..-2)) #all but last
parent_path = path_to_relative_url parent_path
suites << ['..', parent_path] unless parent_path.nil?
visit_all_tests path, '', Proc.new {|n, p| suites << [n,path_to_relative_url(p)]}, nil
suites
end
def test_cases path
tests = []
visit_all_tests path, '', nil, Proc.new {|n, p| tests << [n,p]}
tests
end
def link_to_test_case suite_name, filename
name = suite_name + test_case_name(filename)
link_to name, :action => :test_file, :testname => path_to_relative_url(filename).sub(/^\//,'')
end
private ###############################################
def path_to_relative_url path
slt = @controller.selenium_tests_path
return nil unless path.index slt
path.sub slt, ''
end
def visit_all_tests path, suite_name, suite_consumer, test_consumer
dirs = [] #add dirs to an array in order for files to be processed before dirs
Dir.entries(path).sort.each do |e|
next if skip_file?(e) or ['.','..'].include?(e)
filename = File.join path, e
if File.directory? filename
dirs << [filename, "#{suite_name}#{e.humanize}."]
suite_consumer.call("#{suite_name}#{e.humanize}", filename) if suite_consumer
else
test_consumer.call(suite_name, filename) if test_consumer
end
end
#recurse through dirs
dirs.each {|p, n| visit_all_tests p, n, suite_consumer, test_consumer }
end
end
end

View file

@ -1,92 +1,116 @@
# Builds Selenium test table using a high-level Ruby interface. Normally
# invoked through SeleniumOnRails::RSelenese.
#
# See SeleniumOnRails::TestBuilderActions for the available actions and
# SeleniumOnRails::TestBuilderAccessors for the available checks.
#
# For more information on the commands supported by TestBuilder, see the
# Selenium Commands Documentation at
# http://release.openqa.org/selenium-core/nightly/reference.html.
class SeleniumOnRails::TestBuilder
include SeleniumOnRails::TestBuilderActions
include SeleniumOnRails::TestBuilderAccessors
# Convert _str_ to a Selenium command name.
def self.selenize str
str.camelize.gsub(/^[A-Z]/) {|s| s.downcase }
end
# Prepends _pattern_ with 'exact:' if it would be considered containing
# string-match pattern otherwise.
def exactize pattern
pattern.include?(':') ? "exact:#{pattern}" : pattern
end
# Create a new TestBuilder for _view_.
def initialize view
@view = view
@output = ''
@xml = Builder::XmlMarkup.new :indent => 2, :target => @output
end
# Add a new table of tests, and return the HTML.
def table title
@xml.table do
@xml.tr do @xml.th(title, :colspan => 3) end
yield self
end
end
# Add a new test command using _cmd_, _target_ and _value_.
def command cmd, target=nil, value=nil
@xml.tr do
_tdata cmd
_tdata target
_tdata value
end
end
# :nodoc
alias_method :command_verbatim, :command
# Same as _command_ but add _AndWait_ to the name of _cmd_.
def command_and_wait cmd, target=nil, value=nil
command_verbatim cmd.to_s + 'AndWait', target, value
end
# Re routes commands in the provided block to #command_and_wait instead of
# #command.
def make_command_waiting
self.class.send :alias_method, :command, :command_and_wait
yield
self.class.send :alias_method, :command, :command_verbatim
end
protected
# If _url_ is a string, return unchanged. Otherwise, pass it to
# ActionView#UrlHelper#url_for.
def url_arg url
if url.instance_of?(String) then url else exactize(@view.url_for(url)) end
end
# If _arg_ is an array formats _arg_ to a textual representation.
# Otherwise return unchanged.
def collection_arg arg
if arg.is_a? Array
arg.collect {|e| e.gsub(/[\\,]/) {|s| "\\#{s}" } }.join(',')
else
arg
end
end
private
# Output a single TD element.
def _tdata value
if value
@xml.td(value.to_s)
else
@xml.td do @xml.target! << '&nbsp;' end
end
end
end
require 'selenium_on_rails/test_builder_actions'
require 'selenium_on_rails/test_builder_accessors'
# Create test_builder_user_actions.rb to support actions included
# in selenium-core's user-extensions.js
#
# See test_builder_user_actions.rb.example for examples matching
# selenium-core's user-extensions.js.sample
module SeleniumOnRails::TestBuilderUserActions
end
require 'selenium_on_rails/test_builder_user_actions' if File.exist?(File.expand_path(File.join(File.dirname(__FILE__), 'test_builder_user_actions.rb')))
# Create test_builder_user_accessors.rb to support accessors
# included in selenium-core's user-extensions.js
#
# See test_builder_user_accessors.rb.example for examples matching
# selenium-core's user-extensions.js.sample
module SeleniumOnRails::TestBuilderUserAccessors
end
require 'selenium_on_rails/test_builder_user_accessors' if File.exist?(File.expand_path(File.join(File.dirname(__FILE__), 'test_builder_user_accessors.rb')))
# Builds Selenium test table using a high-level Ruby interface. Normally
# invoked through SeleniumOnRails::RSelenese.
#
# See SeleniumOnRails::TestBuilderActions for the available actions and
# SeleniumOnRails::TestBuilderAccessors for the available checks.
#
# For more information on the commands supported by TestBuilder, see the
# Selenium Commands Documentation at
# http://release.openqa.org/selenium-core/nightly/reference.html.
class SeleniumOnRails::TestBuilder
include SeleniumOnRails::TestBuilderActions
include SeleniumOnRails::TestBuilderAccessors
include SeleniumOnRails::TestBuilderUserActions
include SeleniumOnRails::TestBuilderUserAccessors
# Convert _str_ to a Selenium command name.
def self.selenize str
str.camelize.gsub(/^[A-Z]/) {|s| s.downcase }
end
# Prepends _pattern_ with 'exact:' if it would be considered containing
# string-match pattern otherwise.
def exactize pattern
pattern.include?(':') ? "exact:#{pattern}" : pattern
end
# Create a new TestBuilder for _view_.
def initialize view
@view = view
@output = ''
@xml = Builder::XmlMarkup.new :indent => 2, :target => @output
end
# Add a new table of tests, and return the HTML.
def table title
@xml.table do
@xml.tr do @xml.th(title, :colspan => 3) end
yield self
end
end
# Add a new test command using _cmd_, _target_ and _value_.
def command cmd, target=nil, value=nil
@xml.tr do
_tdata cmd
_tdata target
_tdata value
end
end
# :nodoc
alias_method :command_verbatim, :command
# Same as _command_ but add _AndWait_ to the name of _cmd_.
def command_and_wait cmd, target=nil, value=nil
command_verbatim cmd.to_s + 'AndWait', target, value
end
# Re routes commands in the provided block to #command_and_wait instead of
# #command.
def make_command_waiting
self.class.send :alias_method, :command, :command_and_wait
yield
self.class.send :alias_method, :command, :command_verbatim
end
protected
# If _url_ is a string, return unchanged. Otherwise, pass it to
# ActionView#UrlHelper#url_for.
def url_arg url
if url.instance_of?(String) then url else exactize(@view.url_for(url)) end
end
# If _arg_ is an array formats _arg_ to a textual representation.
# Otherwise return unchanged.
def collection_arg arg
if arg.is_a? Array
arg.collect {|e| e.gsub(/[\\,]/) {|s| "\\#{s}" } }.join(',')
else
arg
end
end
private
# Output a single TD element.
def _tdata value
if value
@xml.td(value.to_s)
else
@xml.td do @xml.target! << '&nbsp;' end
end
end
end

View file

@ -1,286 +1,515 @@
# The actions available for SeleniumOnRails::TestBuilder tests.
#
# For each action +foo+ there's also an action +foo_and_wait+.
module SeleniumOnRails::TestBuilderActions
# Tell Selenium on Rails to clear the session and load any fixtures. DO
# NOT CALL THIS AGAINST NON-TEST DATABASES.
# The supported +options+ are <code>:keep_session</code>,
# <code>:fixtures</code> and <code>:clear_tables</code>
# setup
# setup :keep_session
# setup :fixtures => :all
# setup :keep_session, :fixtures => [:foo, :bar]
# setup :clear_tables => [:foo, :bar]
def setup options = {}
options = {options => nil} unless options.is_a? Hash
opts = {:controller => 'selenium', :action => 'setup'}
opts[:keep_session] = true if options.has_key? :keep_session
[:fixtures, :clear_tables].each do |key|
if (f = options[key])
f = [f] unless f.is_a? Array
opts[key] = f.join ','
end
end
open opts
end
# Includes a partial.
# The path is relative to the Selenium tests root. The starting _ and the file
# extension don't have to be specified.
# #include test/selenium/_partial.*
# include_partial 'partial'
# #include test/selenium/suite/_partial.*
# include_partial 'suite/partial'
# #include test/selenium/suite/_partial.* and provide local assigns
# include_partial 'suite/partial', :foo => bar
def include_partial path, local_assigns = {}
partial = @view.render :partial => path, :locals => local_assigns
@output << partial
end
# Clicks on a link, button, checkbox or radio button. If the click action
# causes a new page to load (like a link usually does), call
# +wait_for_page_to_load+.
def click locator
command 'click', locator
end
# Explicitly simulate an event (e.g. <tt>"focus"</tt>, <tt>"blur"</tt>), to
# trigger the corresponding <tt>"on_event_"</tt> handler.
def fire_event locator, event_name
command 'fireEvent', locator, event_name
end
# Simulates a user pressing and releasing a key.
#
# +keycode+ is the numeric keycode of the key to be pressed, normally the
# ASCII value of that key.
def key_press locator, keycode
command 'keyPress', locator, keycode
end
# Simulates a user pressing a key (without releasing it yet).
#
# +keycode+ is the numeric keycode of the key to be pressed, normally the
# ASCII value of that key.
def key_down locator, keycode
command 'keyDown', locator, keycode
end
# Simulates a user releasing a key.
#
# +keycode+ is the numeric keycode of the key to be released, normally the
# ASCII value of that key.
def key_up locator, keycode
command 'keyUp', locator, keycode
end
# Simulates a user hovering a mouse over the specified element.
def mouse_over locator
command 'mouseOver', locator
end
# Simulates a user pressing the mouse button (without releasing it yet) on the
# specified element.
def mouse_down locator
command 'mouseDown', locator
end
# Sets the value of an input field, as though you typed it in.
#
# Can also be used to set the value of combo boxes, check boxes, etc. In these
# cases, +value+ should be the value of the option selected, not the visible
# text.
def type locator, value
command 'type', locator, value
end
# Check a toggle-button (checkbox/radio).
def check locator
command 'check', locator
end
# Uncheck a toggle-button (checkbox/radio).
def uncheck locator
command 'uncheck', locator
end
# Select an option from a drop-down using an option locator.
#
# Option locators provide different ways of specifying options of an HTML
# Select element (e.g. for selecting a specific option, or for asserting that
# the selected option satisfies a specification). There are several forms of
# Select Option Locator.
#
# * label=labelPattern
# matches options based on their labels, i.e. the visible text. (This is the
# default.)
# label=regexp:^[Oo]ther
# * value=valuePattern
# matches options based on their values.
# value=other
# * id=id
# matches options based on their ids.
# id=option1
# * index=index
# matches an option based on its index (offset from zero).
# index=2
#
# If no option locator prefix is provided, the default behaviour is to match
# on label.
def select locator, option_locator
command 'select', locator, option_locator
end
# Add a selection to the set of selected options in a multi-select element
# using an option locator.
#
# See the <tt>#select</tt> command for more information about option locators.
def add_selection locator, option_locator
command 'addSelection', locator, option_locator
end
# Remove a selection from the set of selected options in a multi-select
# element using an option locator.
#
# See the +select+ command for more information about option locators.
def remove_selection locator, option_locator
command 'removeSelection', locator, option_locator
end
# Submit the specified form. This is particularly useful for forms without
# submit buttons, e.g. single-input "Search" forms.
def submit locator
command 'submit', locator
end
# Opens an URL in the test frame. This accepts both relative and absolute
# URLs. The <tt>open</tt> command waits for the page to load before
# proceeding, i.e. you don't have to call +wait_for_page_to_load+.
#
# Note: The URL must be on the same domain as the runner HTML due to security
# restrictions in the browser (Same Origin Policy).
def open url
command 'open', url_arg(url)
end
# Selects a popup window; once a popup window has been selected, all commands
# go to that window. To select the main window again, use +nil+ as the target.
def select_window window_id
command 'selectWindow', window_id||'null'
end
# Waits for a popup window to appear and load up.
#
# The +timeout+ is specified in milliseconds.
def wait_for_popup window_id, timeout
command 'waitForPopUp', window_id||'null', timeout
end
# By default, Selenium's overridden <tt>window.confirm()</tt> function will return
# +true+, as if the user had manually clicked OK. After running this command,
# the next call to <tt>confirm()</tt> will return +false+, as if the user had clicked
# Cancel.
def choose_cancel_on_next_confirmation
command 'chooseCancelOnNextConfirmation'
end
# Instructs Selenium to return the specified answer string in response to the
# next JavaScript prompt (<tt>window.prompt()</tt>).
def answer_on_next_prompt answer
command 'answerOnNextPrompt', answer
end
# Simulates the user clicking the "back" button on their browser.
def go_back
command 'goBack'
end
# Simulates the user clicking the "Refresh" button on their browser.
def refresh
command 'refresh'
end
# Simulates the user clicking the "close" button in the titlebar of a popup
# window or tab.
def close
command 'close'
end
# Writes a message to the status bar and adds a note to the browser-side log.
#
# +context+ is the message sent to the browser.
#
# +log_level_threshold+ can be +nil+, <tt>:debug</tt>, <tt>:info</tt>,
# <tt>:warn</tt> or <tt>:error</tt>.
def set_context context, log_level_threshold = nil
if log_level_threshold
command 'setContext', context, log_level_threshold.to_s
else
command 'setContext', context
end
end
# Runs the specified JavaScript snippet repeatedly until it evaluates to
# +true+. The snippet may have multiple lines, but only the result of the last
# line will be considered.
#
# Note that, by default, the snippet will be run in the runner's test window,
# not in the window of your application. To get the window of your
# application, you can use the JavaScript snippet
# <tt>selenium.browserbot.getCurrentWindow()</tt>, and then run your
# JavaScript in there.
#
# +timeout+ is specified in milliseconds.
def wait_for_condition script, timeout
command 'waitForCondition', script, timeout
end
# Specifies the amount of time that Selenium will wait for actions to
# complete.
#
# Actions that require waiting include +open+ and the <tt>wait_for*</tt>
# actions.
#
# The default timeout is 30 seconds.
#
# +timeout+ is specified in milliseconds.
def set_timeout timeout
command 'setTimeout', timeout
end
# Waits for a new page to load.
#
# You can use this command instead of the +and_wait+ suffixes,
# +click_and_wait+, +select_and_wait+, +type_and_wait+ etc. (which are only
# available in the JS API).
#
# Selenium constantly keeps track of new pages loading, and sets a
# +newPageLoaded+ flag when it first notices a page load. Running any other
# Selenium command after turns the flag to +false+. Hence, if you want to wait
# for a page to load, you must wait immediately after a Selenium command that
# caused a page-load.
#
# +timeout+ is specified in milliseconds.
def wait_for_page_to_load timeout
command 'waitForPageToLoad', timeout
end
private
# Generates the corresponding +_and_wait+ for each action.
def self.generate_and_wait_actions
public_instance_methods.each do |method|
define_method method + '_and_wait' do |*args|
make_command_waiting do
send method, *args
end
end
end
end
generate_and_wait_actions
end
# The actions available for SeleniumOnRails::TestBuilder tests.
#
# For each action +foo+ there's also an action +foo_and_wait+.
module SeleniumOnRails::TestBuilderActions
# Tell Selenium on Rails to clear the session and load any fixtures. DO
# NOT CALL THIS AGAINST NON-TEST DATABASES.
# The supported +options+ are <code>:keep_session</code>,
# <code>:fixtures</code> and <code>:clear_tables</code>
# setup
# setup :keep_session
# setup :fixtures => :all
# setup :keep_session, :fixtures => [:foo, :bar]
# setup :clear_tables => [:foo, :bar]
def setup options = {}
options = {options => nil} unless options.is_a? Hash
opts = {:controller => 'selenium', :action => 'setup'}
opts[:keep_session] = true if options.has_key? :keep_session
[:fixtures, :clear_tables].each do |key|
if (f = options[key])
f = [f] unless f.is_a? Array
opts[key] = f.join ','
end
end
open opts
end
# Includes a partial.
# The path is relative to the Selenium tests root. The starting _ and the file
# extension don't have to be specified.
# #include test/selenium/_partial.*
# include_partial 'partial'
# #include test/selenium/suite/_partial.*
# include_partial 'suite/partial'
# #include test/selenium/suite/_partial.* and provide local assigns
# include_partial 'suite/partial', :foo => bar
def include_partial path, local_assigns = {}
partial = @view.render :partial => path, :locals => local_assigns
@output << partial
end
# Clicks on a link, button, checkbox or radio button. If the click action
# causes a new page to load (like a link usually does), call
# +wait_for_page_to_load+.
def click locator
command 'click', locator
end
# Clicks on a link, button, checkbox or radio button. If the click action causes
# a new page to load (like a link usually does), call wait_for_page_to_load.
def click_at locator, coord_string
command 'clickAt', locator, coord_string
end
# Explicitly simulate an event (e.g. <tt>"focus"</tt>, <tt>"blur"</tt>), to
# trigger the corresponding <tt>"on_event_"</tt> handler.
def fire_event locator, event_name
command 'fireEvent', locator, event_name
end
# Simulates a user pressing and releasing a key.
#
# +keycode+ is the numeric keycode of the key to be pressed, normally the
# ASCII value of that key.
def key_press locator, keycode
command 'keyPress', locator, keycode
end
# Simulates a user pressing a key (without releasing it yet).
#
# +keycode+ is the numeric keycode of the key to be pressed, normally the
# ASCII value of that key.
def key_down locator, keycode
command 'keyDown', locator, keycode
end
# Simulates a user releasing a key.
#
# +keycode+ is the numeric keycode of the key to be released, normally the
# ASCII value of that key.
def key_up locator, keycode
command 'keyUp', locator, keycode
end
# Simulates a user hovering a mouse over the specified element.
def mouse_over locator
command 'mouseOver', locator
end
# Simulates a user pressing the mouse button (without releasing it yet) on the
# specified element.
def mouse_down locator
command 'mouseDown', locator
end
# Sets the value of an input field, as though you typed it in.
#
# Can also be used to set the value of combo boxes, check boxes, etc. In these
# cases, +value+ should be the value of the option selected, not the visible
# text.
def type locator, value
command 'type', locator, value
end
# Check a toggle-button (checkbox/radio).
def check locator
command 'check', locator
end
# Uncheck a toggle-button (checkbox/radio).
def uncheck locator
command 'uncheck', locator
end
# Select an option from a drop-down using an option locator.
#
# Option locators provide different ways of specifying options of an HTML
# Select element (e.g. for selecting a specific option, or for asserting that
# the selected option satisfies a specification). There are several forms of
# Select Option Locator.
#
# * label=labelPattern
# matches options based on their labels, i.e. the visible text. (This is the
# default.)
# label=regexp:^[Oo]ther
# * value=valuePattern
# matches options based on their values.
# value=other
# * id=id
# matches options based on their ids.
# id=option1
# * index=index
# matches an option based on its index (offset from zero).
# index=2
#
# If no option locator prefix is provided, the default behaviour is to match
# on label.
def select locator, option_locator
command 'select', locator, option_locator
end
# Add a selection to the set of selected options in a multi-select element
# using an option locator.
#
# See the <tt>#select</tt> command for more information about option locators.
def add_selection locator, option_locator
command 'addSelection', locator, option_locator
end
# Remove a selection from the set of selected options in a multi-select
# element using an option locator.
#
# See the +select+ command for more information about option locators.
def remove_selection locator, option_locator
command 'removeSelection', locator, option_locator
end
# Submit the specified form. This is particularly useful for forms without
# submit buttons, e.g. single-input "Search" forms.
def submit locator
command 'submit', locator
end
# Opens an URL in the test frame. This accepts both relative and absolute
# URLs. The <tt>open</tt> command waits for the page to load before
# proceeding, i.e. you don't have to call +wait_for_page_to_load+.
#
# Note: The URL must be on the same domain as the runner HTML due to security
# restrictions in the browser (Same Origin Policy).
def open url
command 'open', url_arg(url)
end
# Selects a popup window; once a popup window has been selected, all commands
# go to that window. To select the main window again, use +nil+ as the target.
def select_window window_id
command 'selectWindow', window_id||'null'
end
# Waits for a popup window to appear and load up.
#
# The +timeout+ is specified in milliseconds.
def wait_for_popup window_id, timeout
command 'waitForPopUp', window_id||'null', timeout
end
# By default, Selenium's overridden <tt>window.confirm()</tt> function will return
# +true+, as if the user had manually clicked OK. After running this command,
# the next call to <tt>confirm()</tt> will return +false+, as if the user had clicked
# Cancel.
def choose_cancel_on_next_confirmation
command 'chooseCancelOnNextConfirmation'
end
# Instructs Selenium to return the specified answer string in response to the
# next JavaScript prompt (<tt>window.prompt()</tt>).
def answer_on_next_prompt answer
command 'answerOnNextPrompt', answer
end
# Simulates the user clicking the "back" button on their browser.
def go_back
command 'goBack'
end
# Simulates the user clicking the "Refresh" button on their browser.
def refresh
command 'refresh'
end
# Simulates the user clicking the "close" button in the titlebar of a popup
# window or tab.
def close
command 'close'
end
# Simulates the user pressing the alt key and hold it down until do_alt_up()
# is called or a new page is loaded.
def alt_key_down
command 'altKeyDown'
end
# Simulates the user releasing the alt key.
def alt_key_up
command 'altKeyUp'
end
# Halt the currently running test, and wait for the user to press the Continue
# button. This command is useful for debugging, but be careful when using it,
# because it will force automated tests to hang until a user intervenes manually.
#
# NOTE: <tt>break</tt> is a reserved word in Ruby, so we have to simulate
# Selenium core's <tt>break()</tt> with <tt>brake()</tt>
def brake
command 'break'
end
# Simulates the user pressing the alt key and hold it down until do_control_up()
# is called or a new page is loaded.
def control_key_down
command 'controlKeyDown'
end
# Simulates the user releasing the control key.
def control_key_up
command 'controlKeyUp'
end
# Create a new cookie whose path and domain are same with those of current page
# under test, unless you specified a path for this cookie explicitly.
#
# Arguments:
# * <tt>name_value_pair</tt> - name and value of the cookie in a format "name=value"
# * <tt>options_string</tt> - options for the cookie. Currently supported options
# include 'path' and 'max_age'. The options_string's format is
# <tt>"path=/path/, max_age=60"</tt>. The order of options are irrelevant, the
# unit of the value of 'max_age' is second.
def create_cookie name_value_pair, options_string
command 'createCookie', name_value_pair, options_string
end
# Delete a named cookie with specified path.
def delete_cookie name, path
command 'deleteCookie', name, path
end
# Double clicks on a link, button, checkbox or radio button. If the double click action
# causes a new page to load (like a link usually does), call <tt>wait_for_page_to_load</tt>.
def double_click locator
command 'doubleClick', locator
end
# Doubleclicks on a link, button, checkbox or radio button. If the action causes a new page
# to load (like a link usually does), call <tt>wait_for_page_to_load</tt>.
def double_click_at locator, coord_string
command 'doubleClickAt', locator, coord_string
end
# Drags an element a certain distance and then drops it.
def drag_and_drop locator, movements_string
command 'dragAndDrop', locator, movements_string
end
# Drags an element and drops it on another element.
def drag_and_drop_to_object locator_of_object_to_be_dragged, locator_of_drag_destination_object
command 'dragAndDropToObject', locator_of_object_to_be_dragged, locator_of_drag_destination_object
end
# Prints the specified message into the third table cell in your Selenese
# tables.
# Useful for debugging.
def echo message
command 'echo', message
end
# Briefly changes the backgroundColor of the specified element yellow.
# Useful for debugging.
def highlight locator
command 'highlight', locator
end
# Press the meta key and hold it down until <tt>doMetaUp()</tt> is called or
# a new page is loaded.
def meta_key_down
command 'metaKeyDown'
end
# Release the meta key.
def meta_key_up
command 'metaKeyUp'
end
# Simulates a user pressing the mouse button (without releasing it yet) on the specified
# element.
def mouse_down_at locator, coord_string
command 'mouseDownAt', locator, coord_string
end
# Simulates a user moving the mouse.
def mouse_move locator
command 'mouseMove', locator
end
# Simulates a user moving the mouse relative to the specified element.
def mouse_move_at locator, coord_string
command 'mouseMoveAt', locator, coord_string
end
# Simulates the user moving the mouse off the specified element.
def mouse_out locator
command 'mouseOut', locator
end
# Simulates the user releasing the mouse button on the specified element.
def mouse_up locator
command 'mouseUp', locator
end
# Simulates a user pressing the mouse button (without releasing it yet) on the
# specified element.
def mouse_up_at locator, coord_string
command 'mouseUpAt', locator, coord_string
end
# Opens a popup window (if a window with that ID isn't already open). After opening the
# window, you'll need to select it using the <tt>select_window</tt> command.
#
# This command can also be a useful workaround for bug SEL-339. In some cases, Selenium
# will be unable to intercept a call to window.open (if the call occurs during or before
# the "onLoad" event, for example). In those cases, you can force Selenium to notice the
# open window's name by using the Selenium openWindow command, using an empty (blank) url,
# like this: <tt>open_window("", "myFunnyWindow")</tt>.
def open_window url, window_id
command 'openWindow', url, window_id
end
# Wait for the specified amount of time (in milliseconds).
def pause wait_time
command 'pause', wait_time
end
# Unselects all of the selected options in a multi-select element.
def remove_all_selections locator
command 'removeAllSelections', locator
end
# Selects a frame within the current window. (You may invoke this command multiple times
# to select nested frames.) To select the parent frame, use "relative=parent" as a
# locator; to select the top frame, use "relative=top".
#
# You may also use a DOM expression to identify the frame you want directly, like this:
# <tt>dom=frames["main"].frames["subframe"]</tt>
def select_frame locator
command 'selectFrame', locator
end
# Moves the text cursor to the specified position in the given input element or textarea.
# This method will fail if the specified element isn't an input element or textarea.
def set_cursor_position locator, position
command 'setCursorPosition', locator, position
end
# Configure the number of pixels between "mousemove" events during dragAndDrop commands
# (default=10).
# Setting this value to 0 means that we'll send a "mousemove" event to every single pixel
# in between the start location and the end location; that can be very slow, and may
# cause some browsers to force the JavaScript to timeout.
#
# If the mouse speed is greater than the distance between the two dragged objects, we'll
# just send one "mousemove" at the start location and then one final one at the end location.
def set_mouse_speed pixels
command 'setMouseSpeed', pixels
end
# Press the shift key and hold it down until <tt>doShiftUp()</tt> is called or a new page
# is loaded.
def shift_key_down
command 'shiftKeyDown'
end
# Release the shift key.
def shift_key_up
command 'shiftKeyUp'
end
# This command is a synonym for <tt>store_expression</tt>.
def store expression, variable_name
command 'store', expression, variable_name
end
# Simulates keystroke events on the specified element, as though you typed the value
# key-by-key.
#
# This is a convenience method for calling <tt>key_down</tt>, <tt>key_up</tt>,
# <tt>key_press</tt> for every character in the specified string; this is useful for
# dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.
#
# Unlike the simple "type" command, which forces the specified value into the page directly,
# this command may or may not have any visible effect, even in cases where typing keys would
# normally have a visible effect. For example, if you use "<tt>type_keys</tt>" on a form
# element, you may or may not see the results of what you typed in the field.
#
# In some cases, you may need to use the simple "type" command to set the value of the field
# and then the "<tt>type_keys</tt>" command to send the keystroke events corresponding to
# what you just typed.
def type_keys locator, value
command 'typeKeys', locator, value
end
# Gives focus to a window.
def window_focus window_name
command 'windowFocus', window_name
end
# Resize window to take up the entire screen.
def window_maximize window_name
command 'windowMaximize', window_name
end
# Writes a message to the status bar and adds a note to the browser-side log.
#
# +context+ is the message sent to the browser.
#
# +log_level_threshold+ can be +nil+, <tt>:debug</tt>, <tt>:info</tt>,
# <tt>:warn</tt> or <tt>:error</tt>.
def set_context context, log_level_threshold = nil
if log_level_threshold
command 'setContext', context, log_level_threshold.to_s
else
command 'setContext', context
end
end
# Runs the specified JavaScript snippet repeatedly until it evaluates to
# +true+. The snippet may have multiple lines, but only the result of the last
# line will be considered.
#
# Note that, by default, the snippet will be run in the runner's test window,
# not in the window of your application. To get the window of your
# application, you can use the JavaScript snippet
# <tt>selenium.browserbot.getCurrentWindow()</tt>, and then run your
# JavaScript in there.
#
# +timeout+ is specified in milliseconds.
def wait_for_condition script, timeout
command 'waitForCondition', script, timeout
end
# Specifies the amount of time that Selenium will wait for actions to
# complete.
#
# Actions that require waiting include +open+ and the <tt>wait_for*</tt>
# actions.
#
# The default timeout is 30 seconds.
#
# +timeout+ is specified in milliseconds.
def set_timeout timeout
command 'setTimeout', timeout
end
# Waits for a new page to load.
#
# You can use this command instead of the +and_wait+ suffixes,
# +click_and_wait+, +select_and_wait+, +type_and_wait+ etc. (which are only
# available in the JS API).
#
# Selenium constantly keeps track of new pages loading, and sets a
# +newPageLoaded+ flag when it first notices a page load. Running any other
# Selenium command after turns the flag to +false+. Hence, if you want to wait
# for a page to load, you must wait immediately after a Selenium command that
# caused a page-load.
#
# +timeout+ is specified in milliseconds.
def wait_for_page_to_load timeout
command 'waitForPageToLoad', timeout
end
private
# Generates the corresponding +_and_wait+ for each action.
def self.generate_and_wait_actions
public_instance_methods.each do |method|
define_method method + '_and_wait' do |*args|
make_command_waiting do
send method, *args
end
end
end
end
generate_and_wait_actions
end

View file

@ -0,0 +1,91 @@
# Mirrors the accessors specified in user-extensions.js from the selenium-core
module SeleniumOnRails::TestBuilderUserAccessors
# Return the length of text of a specified element.
#
# Related Assertions, automatically generated:
# * <tt>assert_text_length(locator, variable)</tt>
# * <tt>assert_not_text_length(locator, length)</tt>
# * <tt>verify_text_length(locator, length)</tt>
# * <tt>verify_not_text_length(locator, length)</tt>
# * <tt>wait_for_text_length(locator, length)</tt>
# * <tt>wait_for_not_text_length(locator, length)</tt>
def store_text_length locator, variable_name
command 'storeTextLength', locator, variable_name
end
# Checks if value entered more than once in textbox.
#
# Related Assertions, automatically generated:
# * <tt>assert_not_text_length(locator, text)</tt>
# * <tt>verify_text_length(locator, text)</tt>
# * <tt>verify_not_text_length(locator, text)</tt>
# * <tt>wait_for_text_length(locator, text)</tt>
# * <tt>wait_for_not_text_length(locator, text)</tt>
def assert_value_repeated locator, text
command 'assertValueRepeated', locator, text
end
private
def self.generate_methods
public_instance_methods.each do |method|
case method
when 'store_text_length'
each_assertion method do |assertion_method, command_name|
define_method assertion_method do |arg1, arg2|
command command_name, arg1, arg2
end
end
when 'assert_value_repeated'
each_check method do |check_method, command_name|
define_method check_method do |arg1, arg2|
command command_name, arg1, arg2
end
end
else
raise "Internal error: Don't know how to process user accessor: #{method}"
end
end
end
# Generates all the assertions needed given a +store_method+.
def self.each_assertion store_method
before_negation = nil
after_negation = store_method.split('_')[1..-1] #throw away 'store'
if after_negation.last == 'present'
before_negation, after_negation = after_negation, after_negation.pop
end
['assert', 'verify', ['wait','for']].each do |action|
[nil, 'not'].each do |negation|
name = [action, before_negation, negation, after_negation].flatten.reject{|a|a.nil?}
method_name = name.join '_'
command = name.inject(name.shift.clone) {|n, p| n << p.capitalize}
yield method_name, command
end
end
end
def self.each_check assert_method
before_negation = nil
after_negation = assert_method.split('_')[1..-1] #throw away 'assert'
if after_negation.last == 'present'
before_negation, after_negation = after_negation, after_negation.pop
end
['assert', 'verify', ['wait', 'for']].each do |action|
[nil, 'not'].each do |negation|
unless (action == 'assert' && negation.nil?)
name = [action, before_negation, negation, after_negation].flatten.reject{|a|a.nil?}
method_name = name.join '_'
command = name.inject(name.shift.clone) {|n, p| n << p.capitalize}
yield method_name, command
end
end
end
end
generate_methods
end

View file

@ -0,0 +1,24 @@
# Mirrors the actions specified in user-extensions.js from the selenium-core
module SeleniumOnRails::TestBuilderUserActions
# Types the text twice into a text box.
def type_repeated locator, text
command 'typeRepeated', locator, text
end
private
# Generates the corresponding +_and_wait+ for each action.
def self.generate_and_wait_actions
public_instance_methods.each do |method|
define_method method + '_and_wait' do |*args|
make_command_waiting do
send method, *args
end
end
end
end
generate_and_wait_actions
end

View file

@ -1,22 +1,26 @@
require 'yaml'
class SeleniumOnRailsConfig
@@defaults = {:environments => ['test']}
def self.get var, default = nil
value = configs[var.to_s]
value ||= @@defaults[var]
value ||= default
value ||= yield if block_given?
value
end
private
def self.configs
unless defined? @@configs
file = File.expand_path(File.dirname(__FILE__) + '/../config.yml')
@@configs = File.exist?(file) ? YAML.load_file(file) : {}
end
@@configs
end
end
require 'yaml'
class SeleniumOnRailsConfig
attr_accessor :configs
def initialize
@defaults = {:environments => ['test']}
initialize_configs
end
def get var, default = nil
value = @configs[var.to_s]
value ||= @defaults[var]
value ||= default
value ||= yield if block_given?
value
end
def initialize_configs
@configs = {}
files = [File.expand_path(File.dirname(__FILE__) + '/../config.yml')]
files << File.join(RAILS_ROOT, 'config', 'selenium.yml')
files.each { |file| @configs = YAML.load_file(file) if File.exist?(file) }
end
end

View file

@ -1,18 +1,18 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Selenium on Rails<%= defined?(@page_title) ? ": #{@page_title}" : '' %></title>
</head>
<style type="text/css">
body, html { font-family: Verdana, Arial, sans-serif; }
table { border-collapse: collapse; margin: 10px 0px; }
td, th { border: 2px solid black; }
#notice { text-align: center; color: darkgreen; background-color: lightgreen; padding: 5px 15px; width: 400px; margin-left: auto; margin-right: auto; }
#notice * { text-align: left; }
#usagedescription { margin: 15px 30px; }
</style>
<body>
<%= @content_for_layout %>
</body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Selenium on Rails<%= defined?(@page_title) ? ": #{@page_title}" : '' %></title>
</head>
<style type="text/css">
body, html { font-family: Verdana, Arial, sans-serif; }
table { border-collapse: collapse; margin: 10px 0px; }
td, th { border: 2px solid black; }
#notice { text-align: center; color: darkgreen; background-color: lightgreen; padding: 5px 15px; width: 400px; margin-left: auto; margin-right: auto; }
#notice * { text-align: left; }
#usagedescription { margin: 15px 30px; }
</style>
<body>
<%= @content_for_layout %>
</body>
</html>

View file

@ -1,5 +1,5 @@
<table>
<% @result.each_pair do |key, value| -%>
<tr><td><%= key %></td><td><%= value %></td></tr>
<% end -%>
</table>
<table>
<% @result.each_pair do |key, value| -%>
<tr><td><%= key %></td><td><%= value %></td></tr>
<% end -%>
</table>

View file

@ -0,0 +1,9 @@
module SeleniumHelper
include SeleniumOnRails::SuiteRenderer
include SeleniumOnRails::FixtureLoader
def test_case_name filename
File.basename(filename).sub(/\..*/,'').humanize
end
end

View file

@ -1,67 +1,67 @@
<% @page_title = 'Setup' -%>
<% if defined?(@session_wiped) or @cleared_tables.any? or @loaded_fixtures.any? -%>
<div id="notice">
<% if defined?(@session_wiped) -%>
<p>The session is wiped clean.</p>
<% end-%>
<% if @cleared_tables.any? -%>
<p>The following database tables are cleared:</p>
<ul>
<% for table in @cleared_tables -%>
<li><%= table %></li>
<% end-%>
</ul>
<% end -%>
<% if @loaded_fixtures.any? -%>
<p>The following fixtures are loaded:</p>
<ul>
<% for fixture in @loaded_fixtures -%>
<li><%= fixture %></li>
<% end-%>
</ul>
<% end -%>
</div>
<% end -%>
<div id="usagedescription">
<p>This page can be used to setup your Selenium tests. The following options can be used:</p>
<dl>
<dt><tt>keep_session</tt></dt>
<dd>
Per default the session is reset, so add <tt>keep_session</tt> in order to keep the current session.
<table>
<tr><td>open</td><td><%= url_for %>?keep_session</td><td>&nbsp;</td></tr>
</table>
</dd>
<dt><tt>fixtures</tt></dt>
<dd>
Loads one or many fixtures into the database. <strong>This will destroy the current data you have in your database!</strong> Use <tt>all</tt> as name in order to load all fixtures, or specify which fixtures that should be loaded (delimited by commas).<br />
If a test needs different data than you have in your fixtures, you can add another <em>fixture set</em>. A fixture set is just a sub directory in <tt>/test/fixtures/</tt> where you can add alternate fixtures (e.g. <tt>/test/fixtures/blank/users.yml</tt>).
<table>
<tr><td>open</td><td><%= url_for :fixtures => 'all' %></td><td>&nbsp;</td></tr>
<tr><td>open</td><td><%= url_for :fixtures => 'fixture' %></td><td>&nbsp;</td></tr>
<tr><td>open</td><td><%= url_for :fixtures => 'fixture_one' %>,fixture_two</td><td>&nbsp;</td></tr>
</table>
<b>Available fixtures</b><br />
<% fixtures = available_fixtures -%>
<% for fixture_set in fixtures.keys.sort -%>
In the <%= fixture_set.blank? ? 'default' : "<tt>#{fixture_set}</tt>" %> fixture set:
<ul>
<% fixtures[fixture_set].unshift fixture_set.blank? ? 'all' : "#{fixture_set}/all" -%>
<% for fixture in fixtures[fixture_set] -%>
<li><tt><%= fixture %></tt></li>
<% end -%>
</ul>
<% end -%>
</dd>
<dt><tt>clear_tables</tt></dt>
<dd>
Clears one or many database tables. Another way to do the same thing is to create an empty fixture in a new fixture set (see <tt>fixtures</tt> above).
<table>
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %></td><td>&nbsp;</td></tr>
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %>,outgoing_messages</td><td>&nbsp;</td></tr>
</table>
</dd>
</dl>
</div>
<% @page_title = 'Setup' -%>
<% if defined?(@session_wiped) or @cleared_tables.any? or @loaded_fixtures.any? -%>
<div id="notice">
<% if defined?(@session_wiped) -%>
<p>The session is wiped clean.</p>
<% end-%>
<% if @cleared_tables.any? -%>
<p>The following database tables are cleared:</p>
<ul>
<% for table in @cleared_tables -%>
<li><%= table %></li>
<% end-%>
</ul>
<% end -%>
<% if @loaded_fixtures.any? -%>
<p>The following fixtures are loaded:</p>
<ul>
<% for fixture in @loaded_fixtures -%>
<li><%= fixture %></li>
<% end-%>
</ul>
<% end -%>
</div>
<% end -%>
<div id="usagedescription">
<p>This page can be used to setup your Selenium tests. The following options can be used:</p>
<dl>
<dt><tt>keep_session</tt></dt>
<dd>
Per default the session is reset, so add <tt>keep_session</tt> in order to keep the current session.
<table>
<tr><td>open</td><td><%= url_for %>?keep_session</td><td>&nbsp;</td></tr>
</table>
</dd>
<dt><tt>fixtures</tt></dt>
<dd>
Loads one or many fixtures into the database. <strong>This will destroy the current data you have in your database!</strong> Use <tt>all</tt> as name in order to load all fixtures, or specify which fixtures that should be loaded (delimited by commas).<br />
If a test needs different data than you have in your fixtures, you can add another <em>fixture set</em>. A fixture set is just a sub directory in <tt>/test/fixtures/</tt> where you can add alternate fixtures (e.g. <tt>/test/fixtures/blank/users.yml</tt>).
<table>
<tr><td>open</td><td><%= url_for :fixtures => 'all' %></td><td>&nbsp;</td></tr>
<tr><td>open</td><td><%= url_for :fixtures => 'fixture' %></td><td>&nbsp;</td></tr>
<tr><td>open</td><td><%= url_for :fixtures => 'fixture_one' %>,fixture_two</td><td>&nbsp;</td></tr>
</table>
<b>Available fixtures</b><br />
<% fixtures = available_fixtures -%>
<% for fixture_set in fixtures.keys.sort -%>
In the <%= fixture_set.blank? ? 'default' : "<tt>#{fixture_set}</tt>" %> fixture set:
<ul>
<% fixtures[fixture_set].unshift fixture_set.blank? ? 'all' : "#{fixture_set}/all" -%>
<% for fixture in fixtures[fixture_set] -%>
<li><tt><%= fixture %></tt></li>
<% end -%>
</ul>
<% end -%>
</dd>
<dt><tt>clear_tables</tt></dt>
<dd>
Clears one or many database tables. Another way to do the same thing is to create an empty fixture in a new fixture set (see <tt>fixtures</tt> above).
<table>
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %></td><td>&nbsp;</td></tr>
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %>,outgoing_messages</td><td>&nbsp;</td></tr>
</table>
</dd>
</dl>
</div>

View file

@ -1,26 +1,26 @@
<% @page_title = test_suite_name @suite_path -%>
<% @page_title = test_suite_name @suite_path -%>
<script type="text/javascript">
<!--
function openSuite(selector) {
var suite = selector.options[selector.selectedIndex].value;
if(suite == "header") return;
if(top.location.href != location.href) //inside a frame
top.location = "<%= url_for :action => :support_file %>/TestRunner.html?test=tests" + suite
else
window.location = "<%= url_for :action => :test_file, :testname => '' %>" + suite
function openSuite(selector) {
var suite = selector.options[selector.selectedIndex].value;
if(suite == "header") return;
if(top.location.href != location.href) //inside a frame
top.location = "<%= url_for :action => :support_file %>/TestRunner.html?test=tests" + suite
else
window.location = "<%= url_for :action => :test_file, :testname => '' %>" + suite
}
//-->
</script>
<select onchange="openSuite(this)">
<option value="header">Suites:</option>
<% for name, path in test_suites @suite_path -%>
<option value="<%= path %>"><%= name%></option>
<% end -%>
</select>
<table>
<tr><th><%= @page_title %></th></tr>
<% for name, path in test_cases @suite_path -%>
<tr><td><%= link_to_test_case name, path %></td></tr>
<% end -%>
</script>
<select onchange="openSuite(this)">
<option value="header">Suites:</option>
<% for name, path in test_suites @suite_path -%>
<option value="<%= path %>"><%= name%></option>
<% end -%>
</select>
<table>
<tr><th><%= @page_title %></th></tr>
<% for name, path in test_cases @suite_path -%>
<tr><td><%= link_to_test_case name, path %></td></tr>
<% end -%>
</table>

View file

@ -1,23 +1,24 @@
module ActionController
module Routing #:nodoc:
class RouteSet #:nodoc:
alias_method :draw_without_selenium_routes, :draw
def draw
draw_without_selenium_routes do |map|
map.connect 'selenium/setup',
:controller => 'selenium', :action => 'setup'
map.connect 'selenium/tests/*testname',
:controller => 'selenium', :action => 'test_file'
map.connect 'selenium/postResults',
:controller => 'selenium', :action => 'record'
map.connect 'selenium/postResults/:logFile',
:controller => 'selenium', :action => 'record', :requirements => { :logFile => /.*/ }
map.connect 'selenium/*filename',
:controller => 'selenium', :action => 'support_file'
yield map
end
end
end
end
end
module ActionController
module Routing #:nodoc:
class RouteSet #:nodoc:
alias_method :draw_without_selenium_routes, :draw
def draw
draw_without_selenium_routes do |map|
map.connect 'selenium/setup',
:controller => 'selenium', :action => 'setup'
map.connect 'selenium/tests/*testname',
:controller => 'selenium', :action => 'test_file'
map.connect 'selenium/postResults',
:controller => 'selenium', :action => 'record'
map.connect 'selenium/postResults/:logFile',
:controller => 'selenium', :action => 'record', :requirements => { :logFile => /.*/ }
map.connect 'selenium/*filename',
:controller => 'selenium', :action => 'support_file'
map.connect 'switch_environment',
:controller => 'switch_environment', :action => 'index'
yield map if block_given?
end
end
end
end
end

View file

@ -0,0 +1,8 @@
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
</head>
<body>
<h3>selenium-rc initial page</h3>
</body>
</html>

View file

@ -0,0 +1,8 @@
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
</head>
<body>
<h3>selenium-rc initial page</h3>
</body>
</html>

View file

@ -0,0 +1,109 @@
<html>
<!--
Copyright 2004 ThoughtWorks, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<HTA:APPLICATION ID="SeleniumHTARunner" APPLICATIONNAME="Selenium" >
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Selenium Functional Test Runner</title>
<link rel="stylesheet" type="text/css" href="selenium.css" />
<script language="JavaScript" type="text/javascript" src="jsunit/app/jsUnitCore.js"></script>
<script type="text/javascript" src="scripts/xmlextras.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/htmlutils.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserbot.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/find_matching_child.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-api.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-commandhandlers.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-executionloop.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-remoterunner.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-logging.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-version.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/misc.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/dom.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/xpath.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/user-extensions.js"></script>
<script language="JavaScript" type="text/javascript">
function openDomViewer() {
var autFrame = document.getElementById('myiframe');
var autFrameDocument = getIframeDocument(autFrame);
var domViewer = window.open(getDocumentBase(document) + 'domviewer/domviewer.html');
domViewer.rootDocument = autFrameDocument;
return false;
}
function cleanUp() {
if (LOG != null) {
LOG.close();
}
}
</script>
</head>
<body onLoad="setTimeout(function(){runSeleniumTest();},1000)" onUnload="cleanUp()">
<table border="1" style="height: 100%;">
<tr>
<td width="50%" height="30%">
<table>
<tr>
<td>
<img src="selenium-logo.png">
</td>
<td>
<h1><a href="http://selenium.thoughtworks.com" >Selenium</a> Functional Testing for Web Apps</h1>
Open Source From <a href="http://www.thoughtworks.com">ThoughtWorks, Inc</a> and Friends
<form action="">
<br/>Slow Mode:<INPUT TYPE="CHECKBOX" NAME="FASTMODE" VALUE="YES" onmouseup="slowClicked()">
<fieldset>
<legend>Tools</legend>
<button type="button" id="domViewer1" onclick="openDomViewer();">
View DOM
</button>
<button type="button" onclick="LOG.show();">
Show Log
</button>
</fieldset>
</form>
</td>
</tr>
</table>
<form action="">
<label id="context" name="context"></label>
</form>
</td>
<td width="50%" height="30%">
<b>Last Four Test Commands:</b><br/>
<div id="commandList"></div>
</td>
</tr>
<tr>
<td colspan="2" height="70%">
<iframe name="myiframe" id="myiframe" src="" height="100%" width="100%"></iframe>
</td>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,74 @@
<html>
<head>
<title>Selenium Log Console</title>
<link id="cssLink" rel="stylesheet" href="selenium.css" />
</head>
<body id="logging-console">
<script language="JavaScript">
var logLevels = {
debug: 0,
info: 1,
warn: 2,
error: 3
};
function getThresholdLevel() {
var buttons = document.getElementById('logLevelChooser').level;
for (var i = 0; i < buttons.length; i++) {
if (buttons[i].checked) {
return buttons[i].value;
}
}
}
function setThresholdLevel(logLevel) {
var buttons = document.getElementById('logLevelChooser').level;
for (var i = 0; i < buttons.length; i++) {
if (buttons[i].value==logLevel) {
buttons[i].checked = true;
}
else {
buttons[i].checked = false;
}
}
}
function append(message, logLevel) {
var logLevelThreshold = getThresholdLevel();
if (logLevels[logLevel] < logLevels[logLevelThreshold]) {
return;
}
var log = document.getElementById('log');
var newEntry = document.createElement('li');
newEntry.className = logLevel;
newEntry.appendChild(document.createTextNode(message));
log.appendChild(newEntry);
if (newEntry.scrollIntoView) {
newEntry.scrollIntoView();
}
}
</script>
<div id="banner">
<form id="logLevelChooser">
<input id="level-error" type="radio" name="level"
value="error" /><label for="level-error">Error</label>
<input id="level-warn" type="radio" name="level"
value="warn" /><label for="level-warn">Warn</label>
<input id="level-info" type="radio" name="level"
value="info" /><label for="level-info">Info</label>
<input id="level-debug" type="radio" name="level" checked="yes"
value="debug" /><label for="level-debug">Debug</label>
</form>
<h1>Selenium Log Console</h1>
</div>
<ul id="log"></ul>
</body>
</html>

View file

@ -0,0 +1,123 @@
<html>
<!--
Copyright 2004 ThoughtWorks, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Select a Test Suite</title>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
<script>
function load() {
if (browserVersion.isHTA) {
document.getElementById("save-div").style.display = "inline";
}
}
function autoCheck() {
var auto = document.getElementById("auto");
var autoDiv = document.getElementById("auto-div");
if (auto.checked) {
autoDiv.style.display = "inline";
} else {
autoDiv.style.display = "none";
}
}
function saveCheck() {
var results = document.getElementById("results");
var check = document.getElementById("save").checked;
if (check) {
results.firstChild.nodeValue = "Results file ";
document.getElementById("resultsUrl").value = "results.html";
} else {
results.firstChild.nodeValue = "Results URL ";
document.getElementById("resultsUrl").value = "../postResults";
}
}
function go() {
if (!browserVersion.isHTA) return true;
var inputs = document.getElementsByTagName("input");
var queryString = "";
for (var i = 0; i < inputs.length; i++) {
var elem = inputs[i];
var name = elem.name;
var value = elem.value;
if (elem.type == "checkbox") {
value = elem.checked;
}
queryString += escape(name) + "=" + escape(value);
if (i < (inputs.length - 1)) {
queryString += "&";
}
}
window.parent.selenium = null;
window.parent.htmlTestRunner.controlPanel.queryString = queryString;
window.parent.htmlTestRunner.loadSuiteFrame();
return false;
}
</script>
</head>
<body onload="load()" style="font-size: x-small">
<form id="prompt" target="_top" method="GET" onsubmit="return go();" action="TestRunner.html">
<p>
Test Suite:
<input id="test" name="test" size="30" value="../tests/TestSuite.html"/>
</p>
<p align="center"><input type="submit" value="Go"/></p>
<fieldset>
<legend>Options</legend>
<p>
<input id="multiWindow" type="checkbox" name="multiWindow" onclick="autoCheck();"/> <label
for="multiWindow">AUT in separate window</label>
<p>
<p>
<input id="auto" type="checkbox" name="auto" onclick="autoCheck();"/> <label for="auto">Run
automatically</label>
</p>
<div id="auto-div" style="display: none">
<p>
<input id="close" type="checkbox" name="close"/> <label for="close">Close afterwards </label>
</p>
<div id="save-div" style="display: none">
<br/><label for="save">Save to file </label><input id="save" type="checkbox" name="save"
onclick="saveCheck();"/>
</div>
<p id="results">
Results URL:
<input id="resultsUrl" name="resultsUrl" value="../postResults"/>
</p>
</div>
</fieldset>
</form>
</body>
</html>

View file

@ -0,0 +1,55 @@
<!--
Copyright 2005 ThoughtWorks, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<link rel="stylesheet" type="text/css" href="selenium.css" />
<body>
<table width="100%">
<tr>
<th>&uarr;</th>
<th>&uarr;</th>
<th>&uarr;</th>
</tr>
<tr>
<th width="25%">Test Suite</th>
<th width="50%">Current Test</th>
<th width="25%">Control Panel</th>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td></td>
<td class="selenium splash">
<img src="selenium-logo.png" align="right">
<h1>Selenium</h1>
<h2>by <a href="http://www.thoughtworks.com">ThoughtWorks</a> and friends</h2>
<p>
For more information on Selenium, visit
<pre>
<a href="http://selenium.openqa.org" target="_blank">http://selenium.openqa.org</a>
</pre>
</td>
<tr>
</table>
</body>
</html>

View file

@ -0,0 +1,175 @@
<html>
<head>
<HTA:APPLICATION ID="SeleniumHTARunner" APPLICATIONNAME="Selenium">
<!-- the previous line is only relevant if you rename this
file to "TestRunner.hta" -->
<!-- The copyright notice and other comments have been moved to after the HTA declaration,
to work-around a bug in IE on Win2K whereby the HTA application doesn't function correctly -->
<!--
Copyright 2004 ThoughtWorks, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
<title>Selenium Functional Test Runner</title>
<link rel="stylesheet" type="text/css" href="selenium.css"/>
<script type="text/javascript" src="scripts/narcissus-defs.js"></script>
<script type="text/javascript" src="scripts/narcissus-parse.js"></script>
<script type="text/javascript" src="scripts/narcissus-exec.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/htmlutils.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/scriptaculous/scriptaculous.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/cssQuery/cssQuery-p.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserbot.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/find_matching_child.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-api.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-commandhandlers.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-executionloop.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-testrunner.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-logging.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-version.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/misc.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/dom.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/xpath.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/user-extensions.js"></script>
<script language="JavaScript" type="text/javascript">
function openDomViewer() {
var autFrame = document.getElementById('myiframe');
var autFrameDocument = new SeleniumFrame(autFrame).getDocument();
this.rootDocument = autFrameDocument;
var domViewer = window.open(getDocumentBase(document) + 'domviewer/domviewer.html');
return false;
}
</script>
</head>
<body onLoad="onSeleniumLoad();">
<table class="layout">
<form action="" name="controlPanel">
<!-- Suite, Test, Control Panel -->
<tr class="selenium">
<td width="25%" height="30%">
<iframe name="testSuiteFrame" id="testSuiteFrame" src="./TestPrompt.html" application="yes"></iframe>
</td>
<td width="50%" height="30%">
<iframe name="testFrame" id="testFrame" application="yes"></iframe>
</td>
<td width="25%">
<table class="layout">
<tr class="selenium">
<th width="25%" height="1" class="header">
<h1><a href="http://selenium.thoughtworks.com" title="The Selenium Project">Selenium</a> TestRunner
</h1>
</th>
</tr>
<tr>
<td width="25%" height="30%" id="controlPanel">
<fieldset>
<legend>Execute Tests</legend>
<div id="imageButtonPanel">
<button type="button" id="runSuite" onClick="htmlTestRunner.startTestSuite();"
title="Run All tests">
</button>
<button type="button" id="runSeleniumTest" onClick="htmlTestRunner.runSingleTest();"
title="Run the Selected test">
</button>
<button type="button" id="pauseTest" disabled="disabled"
title="Pause/Continue" class="cssPauseTest">
</button>
<button type="button" id="stepTest" disabled="disabled"
title="Step">
</button>
</div>
<div style="float:left">Fast</div>
<div style="float:right">Slow</div>
<br/>
<div id="speedSlider">
<div id="speedTrack">&nbsp;</div>
<div id="speedHandle">&nbsp;</div>
</div>
<div class="executionOptions">
<input id="highlightOption" type="checkbox" name="highlightOption" value="0"/>
<label for="highlightOption">Highlight elements</label>
</div>
</fieldset>
<table id="stats" align="center">
<tr>
<td colspan="2" align="right">Elapsed:</td>
<td id="elapsedTime" colspan="2">00.00</td>
</tr>
<tr>
<th colspan="2">Tests</th>
<th colspan="2">Commands</th>
</tr>
<tr>
<td class="count" id="testRuns">0</td>
<td>run</td>
<td class="count" id="commandPasses">0</td>
<td>passed</td>
</tr>
<tr>
<td class="count" id="testFailures">0</td>
<td>failed</td>
<td class="count" id="commandFailures">0</td>
<td>failed</td>
</tr>
<tr>
<td colspan="2"></td>
<td class="count" id="commandErrors">0</td>
<td>incomplete</td>
</tr>
</table>
<fieldset>
<legend>Tools</legend>
<button type="button" id="domViewer1" onClick="openDomViewer();">
View DOM
</button>
<button type="button" onClick="LOG.show();">
Show Log
</button>
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<!-- AUT -->
<tr>
<td colspan="3" height="70%">
<iframe name="myiframe" id="myiframe" src="TestRunner-splash.html"></iframe>
</td>
</tr>
</form>
</table>
</body>
</html>

View file

@ -0,0 +1,175 @@
<html>
<head>
<HTA:APPLICATION ID="SeleniumHTARunner" APPLICATIONNAME="Selenium">
<!-- the previous line is only relevant if you rename this
file to "TestRunner.hta" -->
<!-- The copyright notice and other comments have been moved to after the HTA declaration,
to work-around a bug in IE on Win2K whereby the HTA application doesn't function correctly -->
<!--
Copyright 2004 ThoughtWorks, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
<title>Selenium Functional Test Runner</title>
<link rel="stylesheet" type="text/css" href="selenium.css"/>
<script type="text/javascript" src="scripts/narcissus-defs.js"></script>
<script type="text/javascript" src="scripts/narcissus-parse.js"></script>
<script type="text/javascript" src="scripts/narcissus-exec.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/htmlutils.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/scriptaculous/scriptaculous.js"></script>
<script language="JavaScript" type="text/javascript" src="lib/cssQuery/cssQuery-p.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserbot.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/find_matching_child.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-api.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-commandhandlers.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-executionloop.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-testrunner.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-logging.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/selenium-version.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/misc.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/dom.js"></script>
<script language="JavaScript" type="text/javascript" src="xpath/xpath.js"></script>
<script language="JavaScript" type="text/javascript" src="scripts/user-extensions.js"></script>
<script language="JavaScript" type="text/javascript">
function openDomViewer() {
var autFrame = document.getElementById('myiframe');
var autFrameDocument = new SeleniumFrame(autFrame).getDocument();
this.rootDocument = autFrameDocument;
var domViewer = window.open(getDocumentBase(document) + 'domviewer/domviewer.html');
return false;
}
</script>
</head>
<body onLoad="onSeleniumLoad();">
<table class="layout">
<form action="" name="controlPanel">
<!-- Suite, Test, Control Panel -->
<tr class="selenium">
<td width="25%" height="30%">
<iframe name="testSuiteFrame" id="testSuiteFrame" src="./TestPrompt.html" application="yes"></iframe>
</td>
<td width="50%" height="30%">
<iframe name="testFrame" id="testFrame" application="yes"></iframe>
</td>
<td width="25%">
<table class="layout">
<tr class="selenium">
<th width="25%" height="1" class="header">
<h1><a href="http://selenium.thoughtworks.com" title="The Selenium Project">Selenium</a> TestRunner
</h1>
</th>
</tr>
<tr>
<td width="25%" height="30%" id="controlPanel">
<fieldset>
<legend>Execute Tests</legend>
<div id="imageButtonPanel">
<button type="button" id="runSuite" onClick="htmlTestRunner.startTestSuite();"
title="Run All tests">
</button>
<button type="button" id="runSeleniumTest" onClick="htmlTestRunner.runSingleTest();"
title="Run the Selected test">
</button>
<button type="button" id="pauseTest" disabled="disabled"
title="Pause/Continue" class="cssPauseTest">
</button>
<button type="button" id="stepTest" disabled="disabled"
title="Step">
</button>
</div>
<div style="float:left">Fast</div>
<div style="float:right">Slow</div>
<br/>
<div id="speedSlider">
<div id="speedTrack">&nbsp;</div>
<div id="speedHandle">&nbsp;</div>
</div>
<div class="executionOptions">
<input id="highlightOption" type="checkbox" name="highlightOption" value="0"/>
<label for="highlightOption">Highlight elements</label>
</div>
</fieldset>
<table id="stats" align="center">
<tr>
<td colspan="2" align="right">Elapsed:</td>
<td id="elapsedTime" colspan="2">00.00</td>
</tr>
<tr>
<th colspan="2">Tests</th>
<th colspan="2">Commands</th>
</tr>
<tr>
<td class="count" id="testRuns">0</td>
<td>run</td>
<td class="count" id="commandPasses">0</td>
<td>passed</td>
</tr>
<tr>
<td class="count" id="testFailures">0</td>
<td>failed</td>
<td class="count" id="commandFailures">0</td>
<td>failed</td>
</tr>
<tr>
<td colspan="2"></td>
<td class="count" id="commandErrors">0</td>
<td>incomplete</td>
</tr>
</table>
<fieldset>
<legend>Tools</legend>
<button type="button" id="domViewer1" onClick="openDomViewer();">
View DOM
</button>
<button type="button" onClick="LOG.show();">
Show Log
</button>
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<!-- AUT -->
<tr>
<td colspan="3" height="70%">
<iframe name="myiframe" id="myiframe" src="TestRunner-splash.html"></iframe>
</td>
</tr>
</form>
</table>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

View file

@ -0,0 +1,298 @@
/******************************************************************************
* Defines default styles for site pages. *
******************************************************************************/
.hidden {
display: none;
}
img{
display: inline;
border: none;
}
.box{
background: #fcfcfc;
border: 1px solid #000;
border-color: blue;
color: #000000;
margin: 10px auto;
padding: 3px;
vertical-align: bottom;
}
a {
text-decoration: none;
}
body {
background-color: #ffffff;
color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
}
h2 {
font-size: 140%;
}
h3 {
font-size: 120%;
}
h4 {
font-size: 100%;
}
pre {
font-family: Courier New, Courier, monospace;
font-size: 80%;
}
td, th {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
text-align: left;
vertical-align: top;
}
th {
font-weight: bold;
vertical-align: bottom;
}
ul {
list-style-type: square;
}
#demoBox {
border-color: #000000;
border-style: solid;
border-width: 1px;
padding: 8px;
width: 24em;
}
.footer {
margin-bottom: 0px;
text-align: center;
}
/* Boxed table styles */
table.boxed {
border-spacing: 2px;
empty-cells: hide;
}
td.boxed, th.boxed, th.boxedHeader {
background-color: #ffffff;
border-color: #000000;
border-style: solid;
border-width: 1px;
color: #000000;
padding: 2px;
padding-left: 8px;
padding-right: 8px;
}
th.boxed {
background-color: #c0c0c0;
}
th.boxedHeader {
background-color: #808080;
color: #ffffff;
}
a.object {
color: #0000ff;
}
li {
white-space: nowrap;
}
ul {
list-style-type: square;
margin-left: 0px;
padding-left: 1em;
}
.boxlevel1{
background: #FFD700;
}
.boxlevel2{
background: #D2691E;
}
.boxlevel3{
background: #DCDCDC;
}
.boxlevel4{
background: #F5F5F5;
}
.boxlevel5{
background: #BEBEBE;
}
.boxlevel6{
background: #D3D3D3;
}
.boxlevel7{
background: #A9A9A9;
}
.boxlevel8{
background: #191970;
}
.boxlevel9{
background: #000080;
}
.boxlevel10{
background: #6495ED;
}
.boxlevel11{
background: #483D8B;
}
.boxlevel12{
background: #6A5ACD;
}
.boxlevel13{
background: #7B68EE;
}
.boxlevel14{
background: #8470FF;
}
.boxlevel15{
background: #0000CD;
}
.boxlevel16{
background: #4169E1;
}
.boxlevel17{
background: #0000FF;
}
.boxlevel18{
background: #1E90FF;
}
.boxlevel19{
background: #00BFFF;
}
.boxlevel20{
background: #87CEEB;
}
.boxlevel21{
background: #B0C4DE;
}
.boxlevel22{
background: #ADD8E6;
}
.boxlevel23{
background: #00CED1;
}
.boxlevel24{
background: #48D1CC;
}
.boxlevel25{
background: #40E0D0;
}
.boxlevel26{
background: #008B8B;
}
.boxlevel27{
background: #00FFFF;
}
.boxlevel28{
background: #E0FFFF;
}
.boxlevel29{
background: #5F9EA0;
}
.boxlevel30{
background: #66CDAA;
}
.boxlevel31{
background: #7FFFD4;
}
.boxlevel32{
background: #006400;
}
.boxlevel33{
background: #556B2F;
}
.boxlevel34{
background: #8FBC8F;
}
.boxlevel35{
background: #2E8B57;
}
.boxlevel36{
background: #3CB371;
}
.boxlevel37{
background: #20B2AA;
}
.boxlevel38{
background: #00FF7F;
}
.boxlevel39{
background: #7CFC00;
}
.boxlevel40{
background: #90EE90;
}
.boxlevel41{
background: #00FF00;
}
.boxlevel41{
background: #7FFF00;
}
.boxlevel42{
background: #00FA9A;
}
.boxlevel43{
background: #ADFF2F;
}
.boxlevel44{
background: #32CD32;
}

View file

@ -0,0 +1,16 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DOM Viewer</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="domviewer.css"/>
<script type="text/javascript" src="selenium-domviewer.js"></script>
</head>
<body onload="loadDomViewer();">
<h3>DOM Viewer</h3>
<p> This page is generated using JavaScript. If you see this text, your
browser doesn't support JavaScript.</p>
</body>
</html>

View file

@ -0,0 +1,205 @@
var HIDDEN="hidden";
var LEVEL = "level";
var PLUS_SRC="butplus.gif";
var MIN_SRC="butmin.gif";
var newRoot;
var maxColumns=1;
function loadDomViewer() {
// See if the rootDocument variable has been set on this window.
var rootDocument = window.rootDocument;
// If not look to the opener for an explicity rootDocument variable, otherwise, use the opener document
if (!rootDocument && window.opener) {
rootDocument = window.opener.rootDocument || window.opener.document;
}
if (rootDocument) {
document.body.innerHTML = displayDOM(rootDocument);
}
else {
document.body.innerHTML = "<b>Must specify rootDocument for window. This can be done by setting the rootDocument variable on this window, or on the opener window for a popup window.</b>";
}
}
function displayDOM(root){
var str = "";
str+="<table>";
str += treeTraversal(root,0);
// to make table columns work well.
str += "<tr>";
for (var i=0; i < maxColumns; i++) {
str+= "<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
}
str += "</tr>";
str += "</table>";
return str;
}
function checkForChildren(element){
if(!element.hasChildNodes())
return false;
var nodes = element.childNodes;
var size = nodes.length;
var count=0;
for(var i=0; i< size; i++){
var node = nodes.item(i);
//if(node.toString()=="[object Text]"){
//this is equalent to the above
//but will work with more browsers
if(node.nodeType!=1){
count++;
}
}
if(count == size)
return false;
else
return true;
}
function treeTraversal(root, level){
var str = "";
var nodes= null;
var size = null;
//it is supposed to show the last node,
//but the last node is always nodeText type
//and we don't show it
if(!root.hasChildNodes())
return "";//displayNode(root,level,false);
nodes = root.childNodes;
size = nodes.length;
for(var i=0; i< size; i++){
var element = nodes.item(i);
//if the node is textNode, don't display
if(element.nodeType==1){
str+= displayNode(element,level,checkForChildren(element));
str+=treeTraversal(element, level+1);
}
}
return str;
}
function displayNode(element, level, isLink){
nodeContent = getNodeContent(element);
columns = Math.round((nodeContent.length / 12) + 0.5);
if (columns + level > maxColumns) {
maxColumns = columns + level;
}
var str ="<tr class='"+LEVEL+level+"'>";
for (var i=0; i < level; i++)
str+= "<td> </td>";
str+="<td colspan='"+ columns +"' class='box"+" boxlevel"+level+"' >";
if(isLink){
str+='<a onclick="hide(this);return false;" href="javascript:void();">';
str+='<img src="'+MIN_SRC+'" />';
}
str += nodeContent;
if(isLink)
str+="</a></td></tr>";
return str;
}
function getNodeContent(element) {
str = "";
id ="";
if (element.id != null && element.id != "") {
id = " ID(" + element.id +")";
}
name ="";
if (element.name != null && element.name != "") {
name = " NAME(" + element.name + ")";
}
value ="";
if (element.value != null && element.value != "") {
value = " VALUE(" + element.value + ")";
}
href ="";
if (element.href != null && element.href != "") {
href = " HREF(" + element.href + ")";
}
clazz = "";
if (element.className != null && element.className != "") {
clazz = " CLASS(" + element.className + ")";
}
src = "";
if (element.src != null && element.src != "") {
src = " SRC(" + element.src + ")";
}
alt = "";
if (element.alt != null && element.alt != "") {
alt = " ALT(" + element.alt + ")";
}
type = "";
if (element.type != null && element.type != "") {
type = " TYPE(" + element.type + ")";
}
text ="";
if (element.text != null && element.text != "" && element.text != "undefined") {
text = " #TEXT(" + trim(element.text) +")";
}
str+=" <b>"+ element.nodeName + id + alt + type + clazz + name + value + href + src + text + "</b>";
return str;
}
function trim(val) {
val2 = val.substring(0,40) + " ";
var spaceChr = String.fromCharCode(32);
var length = val2.length;
var retVal = "";
var ix = length -1;
while(ix > -1){
if(val2.charAt(ix) == spaceChr) {
} else {
retVal = val2.substring(0, ix +1);
break;
}
ix = ix-1;
}
if (val.length > 40) {
retVal += "...";
}
return retVal;
}
function hide(hlink){
var isHidden = false;
var image = hlink.firstChild;
if(image.src.toString().indexOf(MIN_SRC)!=-1){
image.src=PLUS_SRC;
isHidden=true;
}else{
image.src=MIN_SRC;
}
var rowObj= hlink.parentNode.parentNode;
var rowLevel = parseInt(rowObj.className.substring(LEVEL.length));
var sibling = rowObj.nextSibling;
var siblingLevel = sibling.className.substring(LEVEL.length);
if(siblingLevel.indexOf(HIDDEN)!=-1){
siblingLevel = siblingLevel.substring(0,siblingLevel.length - HIDDEN.length-1);
}
siblingLevel=parseInt(siblingLevel);
while(sibling!=null && rowLevel<siblingLevel){
if(isHidden){
sibling.className += " "+ HIDDEN;
}else if(!isHidden && sibling.className.indexOf(HIDDEN)!=-1){
var str = sibling.className;
sibling.className=str.substring(0, str.length - HIDDEN.length-1);
}
sibling = sibling.nextSibling;
siblingLevel = parseInt(sibling.className.substring(LEVEL.length));
}
}
function LOG(message) {
window.opener.LOG.warn(message);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,142 @@
/*
cssQuery, version 2.0.2 (2005-08-19)
Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
License: http://creativecommons.org/licenses/LGPL/2.1/
*/
cssQuery.addModule("css-level2", function() {
// -----------------------------------------------------------------------
// selectors
// -----------------------------------------------------------------------
// child selector
selectors[">"] = function($results, $from, $tagName, $namespace) {
var $element, i, j;
for (i = 0; i < $from.length; i++) {
var $subset = childElements($from[i]);
for (j = 0; ($element = $subset[j]); j++)
if (compareTagName($element, $tagName, $namespace))
$results.push($element);
}
};
// sibling selector
selectors["+"] = function($results, $from, $tagName, $namespace) {
for (var i = 0; i < $from.length; i++) {
var $element = nextElementSibling($from[i]);
if ($element && compareTagName($element, $tagName, $namespace))
$results.push($element);
}
};
// attribute selector
selectors["@"] = function($results, $from, $attributeSelectorID) {
var $test = attributeSelectors[$attributeSelectorID].test;
var $element, i;
for (i = 0; ($element = $from[i]); i++)
if ($test($element)) $results.push($element);
};
// -----------------------------------------------------------------------
// pseudo-classes
// -----------------------------------------------------------------------
pseudoClasses["first-child"] = function($element) {
return !previousElementSibling($element);
};
pseudoClasses["lang"] = function($element, $code) {
$code = new RegExp("^" + $code, "i");
while ($element && !$element.getAttribute("lang")) $element = $element.parentNode;
return $element && $code.test($element.getAttribute("lang"));
};
// -----------------------------------------------------------------------
// attribute selectors
// -----------------------------------------------------------------------
// constants
AttributeSelector.NS_IE = /\\:/g;
AttributeSelector.PREFIX = "@";
// properties
AttributeSelector.tests = {};
// methods
AttributeSelector.replace = function($match, $attribute, $namespace, $compare, $value) {
var $key = this.PREFIX + $match;
if (!attributeSelectors[$key]) {
$attribute = this.create($attribute, $compare || "", $value || "");
// store the selector
attributeSelectors[$key] = $attribute;
attributeSelectors.push($attribute);
}
return attributeSelectors[$key].id;
};
AttributeSelector.parse = function($selector) {
$selector = $selector.replace(this.NS_IE, "|");
var $match;
while ($match = $selector.match(this.match)) {
var $replace = this.replace($match[0], $match[1], $match[2], $match[3], $match[4]);
$selector = $selector.replace(this.match, $replace);
}
return $selector;
};
AttributeSelector.create = function($propertyName, $test, $value) {
var $attributeSelector = {};
$attributeSelector.id = this.PREFIX + attributeSelectors.length;
$attributeSelector.name = $propertyName;
$test = this.tests[$test];
$test = $test ? $test(this.getAttribute($propertyName), getText($value)) : false;
$attributeSelector.test = new Function("e", "return " + $test);
return $attributeSelector;
};
AttributeSelector.getAttribute = function($name) {
switch ($name.toLowerCase()) {
case "id":
return "e.id";
case "class":
return "e.className";
case "for":
return "e.htmlFor";
case "href":
if (isMSIE) {
// IE always returns the full path not the fragment in the href attribute
// so we RegExp it out of outerHTML. Opera does the same thing but there
// is no way to get the original attribute.
return "String((e.outerHTML.match(/href=\\x22?([^\\s\\x22]*)\\x22?/)||[])[1]||'')";
}
}
return "e.getAttribute('" + $name.replace($NAMESPACE, ":") + "')";
};
// -----------------------------------------------------------------------
// attribute selector tests
// -----------------------------------------------------------------------
AttributeSelector.tests[""] = function($attribute) {
return $attribute;
};
AttributeSelector.tests["="] = function($attribute, $value) {
return $attribute + "==" + Quote.add($value);
};
AttributeSelector.tests["~="] = function($attribute, $value) {
return "/(^| )" + regEscape($value) + "( |$)/.test(" + $attribute + ")";
};
AttributeSelector.tests["|="] = function($attribute, $value) {
return "/^" + regEscape($value) + "(-|$)/.test(" + $attribute + ")";
};
// -----------------------------------------------------------------------
// parsing
// -----------------------------------------------------------------------
// override parseSelector to parse out attribute selectors
var _parseSelector = parseSelector;
parseSelector = function($selector) {
return _parseSelector(AttributeSelector.parse($selector));
};
}); // addModule

View file

@ -0,0 +1,150 @@
/*
cssQuery, version 2.0.2 (2005-08-19)
Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
License: http://creativecommons.org/licenses/LGPL/2.1/
*/
/* Thanks to Bill Edney */
cssQuery.addModule("css-level3", function() {
// -----------------------------------------------------------------------
// selectors
// -----------------------------------------------------------------------
// indirect sibling selector
selectors["~"] = function($results, $from, $tagName, $namespace) {
var $element, i;
for (i = 0; ($element = $from[i]); i++) {
while ($element = nextElementSibling($element)) {
if (compareTagName($element, $tagName, $namespace))
$results.push($element);
}
}
};
// -----------------------------------------------------------------------
// pseudo-classes
// -----------------------------------------------------------------------
// I'm hoping these pseudo-classes are pretty readable. Let me know if
// any need explanation.
pseudoClasses["contains"] = function($element, $text) {
$text = new RegExp(regEscape(getText($text)));
return $text.test(getTextContent($element));
};
pseudoClasses["root"] = function($element) {
return $element == getDocument($element).documentElement;
};
pseudoClasses["empty"] = function($element) {
var $node, i;
for (i = 0; ($node = $element.childNodes[i]); i++) {
if (thisElement($node) || $node.nodeType == 3) return false;
}
return true;
};
pseudoClasses["last-child"] = function($element) {
return !nextElementSibling($element);
};
pseudoClasses["only-child"] = function($element) {
$element = $element.parentNode;
return firstElementChild($element) == lastElementChild($element);
};
pseudoClasses["not"] = function($element, $selector) {
var $negated = cssQuery($selector, getDocument($element));
for (var i = 0; i < $negated.length; i++) {
if ($negated[i] == $element) return false;
}
return true;
};
pseudoClasses["nth-child"] = function($element, $arguments) {
return nthChild($element, $arguments, previousElementSibling);
};
pseudoClasses["nth-last-child"] = function($element, $arguments) {
return nthChild($element, $arguments, nextElementSibling);
};
pseudoClasses["target"] = function($element) {
return $element.id == location.hash.slice(1);
};
// UI element states
pseudoClasses["checked"] = function($element) {
return $element.checked;
};
pseudoClasses["enabled"] = function($element) {
return $element.disabled === false;
};
pseudoClasses["disabled"] = function($element) {
return $element.disabled;
};
pseudoClasses["indeterminate"] = function($element) {
return $element.indeterminate;
};
// -----------------------------------------------------------------------
// attribute selector tests
// -----------------------------------------------------------------------
AttributeSelector.tests["^="] = function($attribute, $value) {
return "/^" + regEscape($value) + "/.test(" + $attribute + ")";
};
AttributeSelector.tests["$="] = function($attribute, $value) {
return "/" + regEscape($value) + "$/.test(" + $attribute + ")";
};
AttributeSelector.tests["*="] = function($attribute, $value) {
return "/" + regEscape($value) + "/.test(" + $attribute + ")";
};
// -----------------------------------------------------------------------
// nth child support (Bill Edney)
// -----------------------------------------------------------------------
function nthChild($element, $arguments, $traverse) {
switch ($arguments) {
case "n": return true;
case "even": $arguments = "2n"; break;
case "odd": $arguments = "2n+1";
}
var $$children = childElements($element.parentNode);
function _checkIndex($index) {
var $index = ($traverse == nextElementSibling) ? $$children.length - $index : $index - 1;
return $$children[$index] == $element;
};
// it was just a number (no "n")
if (!isNaN($arguments)) return _checkIndex($arguments);
$arguments = $arguments.split("n");
var $multiplier = parseInt($arguments[0]);
var $step = parseInt($arguments[1]);
if ((isNaN($multiplier) || $multiplier == 1) && $step == 0) return true;
if ($multiplier == 0 && !isNaN($step)) return _checkIndex($step);
if (isNaN($step)) $step = 0;
var $count = 1;
while ($element = $traverse($element)) $count++;
if (isNaN($multiplier) || $multiplier == 1)
return ($traverse == nextElementSibling) ? ($count <= $step) : ($step >= $count);
return ($count % $multiplier) == $step;
};
}); // addModule

View file

@ -0,0 +1,53 @@
/*
cssQuery, version 2.0.2 (2005-08-19)
Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
License: http://creativecommons.org/licenses/LGPL/2.1/
*/
cssQuery.addModule("css-standard", function() { // override IE optimisation
// cssQuery was originally written as the CSS engine for IE7. It is
// optimised (in terms of size not speed) for IE so this module is
// provided separately to provide cross-browser support.
// -----------------------------------------------------------------------
// browser compatibility
// -----------------------------------------------------------------------
// sniff for Win32 Explorer
isMSIE = eval("false;/*@cc_on@if(@\x5fwin32)isMSIE=true@end@*/");
if (!isMSIE) {
getElementsByTagName = function($element, $tagName, $namespace) {
return $namespace ? $element.getElementsByTagNameNS("*", $tagName) :
$element.getElementsByTagName($tagName);
};
compareNamespace = function($element, $namespace) {
return !$namespace || ($namespace == "*") || ($element.prefix == $namespace);
};
isXML = document.contentType ? function($element) {
return /xml/i.test(getDocument($element).contentType);
} : function($element) {
return getDocument($element).documentElement.tagName != "HTML";
};
getTextContent = function($element) {
// mozilla || opera || other
return $element.textContent || $element.innerText || _getTextContent($element);
};
function _getTextContent($element) {
var $textContent = "", $node, i;
for (i = 0; ($node = $element.childNodes[i]); i++) {
switch ($node.nodeType) {
case 11: // document fragment
case 1: $textContent += _getTextContent($node); break;
case 3: $textContent += $node.nodeValue; break;
}
}
return $textContent;
};
}
}); // addModule

View file

@ -0,0 +1,356 @@
/*
cssQuery, version 2.0.2 (2005-08-19)
Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
License: http://creativecommons.org/licenses/LGPL/2.1/
*/
// the following functions allow querying of the DOM using CSS selectors
var cssQuery = function() {
var version = "2.0.2";
// -----------------------------------------------------------------------
// main query function
// -----------------------------------------------------------------------
var $COMMA = /\s*,\s*/;
var cssQuery = function($selector, $$from) {
try {
var $match = [];
var $useCache = arguments.callee.caching && !$$from;
var $base = ($$from) ? ($$from.constructor == Array) ? $$from : [$$from] : [document];
// process comma separated selectors
var $$selectors = parseSelector($selector).split($COMMA), i;
for (i = 0; i < $$selectors.length; i++) {
// convert the selector to a stream
$selector = _toStream($$selectors[i]);
// faster chop if it starts with id (MSIE only)
if (isMSIE && $selector.slice(0, 3).join("") == " *#") {
$selector = $selector.slice(2);
$$from = _msie_selectById([], $base, $selector[1]);
} else $$from = $base;
// process the stream
var j = 0, $token, $filter, $arguments, $cacheSelector = "";
while (j < $selector.length) {
$token = $selector[j++];
$filter = $selector[j++];
$cacheSelector += $token + $filter;
// some pseudo-classes allow arguments to be passed
// e.g. nth-child(even)
$arguments = "";
if ($selector[j] == "(") {
while ($selector[j++] != ")" && j < $selector.length) {
$arguments += $selector[j];
}
$arguments = $arguments.slice(0, -1);
$cacheSelector += "(" + $arguments + ")";
}
// process a token/filter pair use cached results if possible
$$from = ($useCache && cache[$cacheSelector]) ?
cache[$cacheSelector] : select($$from, $token, $filter, $arguments);
if ($useCache) cache[$cacheSelector] = $$from;
}
$match = $match.concat($$from);
}
delete cssQuery.error;
return $match;
} catch ($error) {
cssQuery.error = $error;
return [];
}};
// -----------------------------------------------------------------------
// public interface
// -----------------------------------------------------------------------
cssQuery.toString = function() {
return "function cssQuery() {\n [version " + version + "]\n}";
};
// caching
var cache = {};
cssQuery.caching = false;
cssQuery.clearCache = function($selector) {
if ($selector) {
$selector = _toStream($selector).join("");
delete cache[$selector];
} else cache = {};
};
// allow extensions
var modules = {};
var loaded = false;
cssQuery.addModule = function($name, $script) {
if (loaded) eval("$script=" + String($script));
modules[$name] = new $script();;
};
// hackery
cssQuery.valueOf = function($code) {
return $code ? eval($code) : this;
};
// -----------------------------------------------------------------------
// declarations
// -----------------------------------------------------------------------
var selectors = {};
var pseudoClasses = {};
// a safari bug means that these have to be declared here
var AttributeSelector = {match: /\[([\w-]+(\|[\w-]+)?)\s*(\W?=)?\s*([^\]]*)\]/};
var attributeSelectors = [];
// -----------------------------------------------------------------------
// selectors
// -----------------------------------------------------------------------
// descendant selector
selectors[" "] = function($results, $from, $tagName, $namespace) {
// loop through current selection
var $element, i, j;
for (i = 0; i < $from.length; i++) {
// get descendants
var $subset = getElementsByTagName($from[i], $tagName, $namespace);
// loop through descendants and add to results selection
for (j = 0; ($element = $subset[j]); j++) {
if (thisElement($element) && compareNamespace($element, $namespace))
$results.push($element);
}
}
};
// ID selector
selectors["#"] = function($results, $from, $id) {
// loop through current selection and check ID
var $element, j;
for (j = 0; ($element = $from[j]); j++) if ($element.id == $id) $results.push($element);
};
// class selector
selectors["."] = function($results, $from, $className) {
// create a RegExp version of the class
$className = new RegExp("(^|\\s)" + $className + "(\\s|$)");
// loop through current selection and check class
var $element, i;
for (i = 0; ($element = $from[i]); i++)
if ($className.test($element.className)) $results.push($element);
};
// pseudo-class selector
selectors[":"] = function($results, $from, $pseudoClass, $arguments) {
// retrieve the cssQuery pseudo-class function
var $test = pseudoClasses[$pseudoClass], $element, i;
// loop through current selection and apply pseudo-class filter
if ($test) for (i = 0; ($element = $from[i]); i++)
// if the cssQuery pseudo-class function returns "true" add the element
if ($test($element, $arguments)) $results.push($element);
};
// -----------------------------------------------------------------------
// pseudo-classes
// -----------------------------------------------------------------------
pseudoClasses["link"] = function($element) {
var $document = getDocument($element);
if ($document.links) for (var i = 0; i < $document.links.length; i++) {
if ($document.links[i] == $element) return true;
}
};
pseudoClasses["visited"] = function($element) {
// can't do this without jiggery-pokery
};
// -----------------------------------------------------------------------
// DOM traversal
// -----------------------------------------------------------------------
// IE5/6 includes comments (LOL) in it's elements collections.
// so we have to check for this. the test is tagName != "!". LOL (again).
var thisElement = function($element) {
return ($element && $element.nodeType == 1 && $element.tagName != "!") ? $element : null;
};
// return the previous element to the supplied element
// previousSibling is not good enough as it might return a text or comment node
var previousElementSibling = function($element) {
while ($element && ($element = $element.previousSibling) && !thisElement($element)) continue;
return $element;
};
// return the next element to the supplied element
var nextElementSibling = function($element) {
while ($element && ($element = $element.nextSibling) && !thisElement($element)) continue;
return $element;
};
// return the first child ELEMENT of an element
// NOT the first child node (though they may be the same thing)
var firstElementChild = function($element) {
return thisElement($element.firstChild) || nextElementSibling($element.firstChild);
};
var lastElementChild = function($element) {
return thisElement($element.lastChild) || previousElementSibling($element.lastChild);
};
// return child elements of an element (not child nodes)
var childElements = function($element) {
var $childElements = [];
$element = firstElementChild($element);
while ($element) {
$childElements.push($element);
$element = nextElementSibling($element);
}
return $childElements;
};
// -----------------------------------------------------------------------
// browser compatibility
// -----------------------------------------------------------------------
// all of the functions in this section can be overwritten. the default
// configuration is for IE. The functions below reflect this. standard
// methods are included in a separate module. It would probably be better
// the other way round of course but this makes it easier to keep IE7 trim.
var isMSIE = true;
var isXML = function($element) {
var $document = getDocument($element);
return (typeof $document.mimeType == "unknown") ?
/\.xml$/i.test($document.URL) :
Boolean($document.mimeType == "XML Document");
};
// return the element's containing document
var getDocument = function($element) {
return $element.ownerDocument || $element.document;
};
var getElementsByTagName = function($element, $tagName) {
return ($tagName == "*" && $element.all) ? $element.all : $element.getElementsByTagName($tagName);
};
var compareTagName = function($element, $tagName, $namespace) {
if ($tagName == "*") return thisElement($element);
if (!compareNamespace($element, $namespace)) return false;
if (!isXML($element)) $tagName = $tagName.toUpperCase();
return $element.tagName == $tagName;
};
var compareNamespace = function($element, $namespace) {
return !$namespace || ($namespace == "*") || ($element.scopeName == $namespace);
};
var getTextContent = function($element) {
return $element.innerText;
};
function _msie_selectById($results, $from, id) {
var $match, i, j;
for (i = 0; i < $from.length; i++) {
if ($match = $from[i].all.item(id)) {
if ($match.id == id) $results.push($match);
else if ($match.length != null) {
for (j = 0; j < $match.length; j++) {
if ($match[j].id == id) $results.push($match[j]);
}
}
}
}
return $results;
};
// for IE5.0
if (![].push) Array.prototype.push = function() {
for (var i = 0; i < arguments.length; i++) {
this[this.length] = arguments[i];
}
return this.length;
};
// -----------------------------------------------------------------------
// query support
// -----------------------------------------------------------------------
// select a set of matching elements.
// "from" is an array of elements.
// "token" is a character representing the type of filter
// e.g. ">" means child selector
// "filter" represents the tag name, id or class name that is being selected
// the function returns an array of matching elements
var $NAMESPACE = /\|/;
function select($$from, $token, $filter, $arguments) {
if ($NAMESPACE.test($filter)) {
$filter = $filter.split($NAMESPACE);
$arguments = $filter[0];
$filter = $filter[1];
}
var $results = [];
if (selectors[$token]) {
selectors[$token]($results, $$from, $filter, $arguments);
}
return $results;
};
// -----------------------------------------------------------------------
// parsing
// -----------------------------------------------------------------------
// convert css selectors to a stream of tokens and filters
// it's not a real stream. it's just an array of strings.
var $STANDARD_SELECT = /^[^\s>+~]/;
var $$STREAM = /[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;
function _toStream($selector) {
if ($STANDARD_SELECT.test($selector)) $selector = " " + $selector;
return $selector.match($$STREAM) || [];
};
var $WHITESPACE = /\s*([\s>+~(),]|^|$)\s*/g;
var $IMPLIED_ALL = /([\s>+~,]|[^(]\+|^)([#.:@])/g;
var parseSelector = function($selector) {
return $selector
// trim whitespace
.replace($WHITESPACE, "$1")
// e.g. ".class1" --> "*.class1"
.replace($IMPLIED_ALL, "$1*$2");
};
var Quote = {
toString: function() {return "'"},
match: /^('[^']*')|("[^"]*")$/,
test: function($string) {
return this.match.test($string);
},
add: function($string) {
return this.test($string) ? $string : this + $string + this;
},
remove: function($string) {
return this.test($string) ? $string.slice(1, -1) : $string;
}
};
var getText = function($text) {
return Quote.remove($text);
};
var $ESCAPE = /([\/()[\]?{}|*+-])/g;
function regEscape($string) {
return $string.replace($ESCAPE, "\\$1");
};
// -----------------------------------------------------------------------
// modules
// -----------------------------------------------------------------------
// -------- >> insert modules here for packaging << -------- \\
loaded = true;
// -----------------------------------------------------------------------
// return the query function
// -----------------------------------------------------------------------
return cssQuery;
}(); // cssQuery

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more