diff --git a/vendor/plugins/selenium-on-rails/CHANGELOG b/vendor/plugins/selenium-on-rails/CHANGELOG new file mode 100644 index 00000000..fa34aaf9 --- /dev/null +++ b/vendor/plugins/selenium-on-rails/CHANGELOG @@ -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, |verify_checked|my_checkbox|true| will be interpreted as |verify_checked|my_checkboxtrue|| so change the test to |verify_checked|my_checkbox|| + +* 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: +* brake (alias for selenium-core's break, a reserved word in Ruby) +* echo, :string +* highlight, :locator + +Keyboard events: +* alt_key_down +* alt_key_up +* control_key_down +* control_key_up +* meta_key_down +* meta_key_up +* shift_key_down +* shift_key_up +* type_keys, :locator, :string + +Mouse events: +* click_at, :locator, :coord_string +* double_click, :locator +* double_click_at, :locator, :coord_string +* drag_and_drop, :locator, :movements_string +* drag_and_drop_to_object, :locator, :locator +* mouse_down_at, :locator, :coord_string +* mouse_move, :locator +* mouse_move_at, :locator, :coord_string +* mouse_out, :locator +* mouse_up, :locator +* mouse_up_at, :locator, :coord_string +* set_mouse_speed, :integer + +Other actions: +* create_cookie, :name_value_pair, :options_string +* delete_cookie, :string, :string +* open_window, :url, :integer +* pause, :timeout +* remove_all_selections, :locator +* select_frame, :locator +* set_cursor_position, :locator, :integer +* store, :script, :variable +* window_focus, :window_name +* window_maximize, :window_name + +Here are the newly supported accessors: + +The following store_* accessors and their associated assert, verify and wait_for brethren are fully supported: +* store_selected_id, :locator, :variable +* store_selected_ids, :locator, :variable +* store_selected_index, :locator, :variable +* store_selected_indexes, :locator, :variable +* store_selected_label, :locator, :variable +* store_selected_labels, :locator, :variable +* store_selected_value, :locator, :variable +* store_selected_values, :locator, :variable +* store_something_selected, :locator, :variable +* store_all_window_ids, :variable +* store_all_window_names, :variable +* store_all_window_titles, :variable +* store_cookie, :variable +* store_log_messages, :variable +* store_mouse_speed, :variable +* store_cursor_position, :locator, :variable +* store_attribute_from_all_windows, :attribute_name, :variable +* store_element_height, :locator, :variable +* store_element_index, :locator, :variable +* store_element_width, :locator, :variable +* store_element_position_left, :locator, :variable +* store_element_position_top, :locator, :variable + +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: +* store_ordered, :locator, :locator, :variable +* store_error_on_next, :string +* store_failure_on_next, :string +* store_whether_this_frame_match_frame_expression, :string, :string, :variable +* store_whether_this_window_match_window_expression, :string, :string, :variable diff --git a/vendor/plugins/selenium-on-rails/README b/vendor/plugins/selenium-on-rails/README index 75a43918..b5fd4cca 100644 --- a/vendor/plugins/selenium-on-rails/README +++ b/vendor/plugins/selenium-on-rails/README @@ -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 /public, they can stay in the Selenium gem or in /vendor/selenium. -2. No need to create suite files, they are generated on the fly -- one suite per directory in /test/selenium (suites can be nested). -3. Instead of writing the test cases in HTML you can use a number of better formats (see Formats). -4. Loading of fixtures and wiping of session (/selenium/setup). - -== Installation - -1. Selenium Core needs to be available. It could either be installed as a gem (gem install selenium) or in /vendor/selenium/. -2. Install Selenium on Rails: script/plugin install http://svn.openqa.org/svn/selenium-on-rails/selenium-on-rails -3. If RedCloth is available the Selenese test cases can use it for better markup. -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: script/generate selenium login -6. Start the server: script/server -e test -7. Point your browser to http://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. - -=== 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 test:acceptance), 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: require 'rbconfig'; include Config; puts CONFIG['sitearchdir'] -3. Create a win32 directory under the directory you got, e.g. c:\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt -4. Rename the .so file to open3.so and put it in the win32 directory. -5. Profit! (unless you get an error when doing require 'win32/open3') - -== 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. - -=== 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 -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 - -== test:acceptance - -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 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. - -== Todo - -=== Standalone mode - -More work is needed on test:acceptance on Windows to be able to start -the server when needed. - -=== user_extension.js - -Selenium has support for user_extension.js 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 -/selenium/setup. 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 you‘re 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 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: 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 don‘t 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 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. 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 don‘t 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 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 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 /public. +2. No need to create suite files, they are generated on the fly -- one suite per directory in /test/selenium (suites can be nested). +3. Instead of writing the test cases in HTML you can use a number of better formats (see Formats). +4. Loading of fixtures and wiping of session (/selenium/setup). + +== 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 you‘re 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 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: 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 you‘re 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 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: 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. + +=== 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 config.yml.example to config/selenium.yml 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 environments, 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 +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. + +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 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. + +=== user_extension.js + +Selenium has support for user_extension.js 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 +lib/test_builder_user_accessors.rb.example and +lib/test_builder_user_actions.rb.example that replicate the sample +extensions in Selenium Core's user-extensions.js.sample + +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 test:acceptance 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 +/selenium/setup. 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/]. diff --git a/vendor/plugins/selenium-on-rails/Rakefile b/vendor/plugins/selenium-on-rails/Rakefile index fbd733d9..a9e0b0b8 100644 --- a/vendor/plugins/selenium-on-rails/Rakefile +++ b/vendor/plugins/selenium-on-rails/Rakefile @@ -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 diff --git a/vendor/plugins/selenium-on-rails/config.yml b/vendor/plugins/selenium-on-rails/config.yml deleted file mode 100644 index 17746296..00000000 --- a/vendor/plugins/selenium-on-rails/config.yml +++ /dev/null @@ -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 diff --git a/vendor/plugins/selenium-on-rails/config.yml.example b/vendor/plugins/selenium-on-rails/config.yml.example index 17746296..5fa56a85 100644 --- a/vendor/plugins/selenium-on-rails/config.yml.example +++ b/vendor/plugins/selenium-on-rails/config.yml.example @@ -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 diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumController.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumController.html index c8bcc34d..0ce92a24 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumController.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumController.html @@ -1,265 +1,265 @@ - - - - - - Class: SeleniumController - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumController
In: - - lib/controllers/selenium_controller.rb - -
-
Parent: - ActionController::Base -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- record   - setup   - support_file   - test_file   -
-
- -
- - - -
-

Included Modules

- -
- SeleniumOnRails::FixtureLoader - SeleniumOnRails::Renderer -
-
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/controllers/selenium_controller.rb, line 50
-50:   def record
-51:     dir = record_table
-52: 
-53:     @result = {'resultDir' => dir}
-54:     for p in ['result', 'numTestFailures', 'numTestPasses', 'numCommandFailures', 'numCommandPasses', 'numCommandErrors', 'totalTime']
-55:       @result[p] = params[p]
-56:     end
-57:     File.open(log_path(params[:logFile] || 'default.yml'), 'w') {|f| YAML.dump(@result, f)}
-58:     
-59:     render :file => view_path('record.rhtml'), :layout => layout_path
-60:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/controllers/selenium_controller.rb, line 7
- 7:   def setup
- 8:     unless params.has_key? :keep_session
- 9:       reset_session
-10:       @session_wiped = true
-11:     end
-12:     @cleared_tables = clear_tables params[:clear_tables].to_s
-13:     @loaded_fixtures = load_fixtures params[:fixtures].to_s
-14:     render :file => view_path('setup.rhtml'), :layout => layout_path
-15:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/controllers/selenium_controller.rb, line 34
-34:   def support_file
-35:     if params[:filename].empty?
-36:       redirect_to :filename => 'TestRunner.html', :test => 'tests'
-37:       return
-38:     end
-39: 
-40:     filename = File.join selenium_path, params[:filename]
-41:     if File.file? filename
-42:       type = WEBrick::HTTPUtils::DefaultMimeTypes[$1.downcase] if filename =~ /\.(\w+)$/
-43:       type ||= 'text/html'
-44:       send_file filename, :type => type, :disposition => 'inline', :stream => false
-45:     else
-46:       render :text => 'Not found', :status => 404
-47:     end
-48:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/controllers/selenium_controller.rb, line 17
-17:   def test_file
-18:     params[:testname] = '' if params[:testname].to_s == 'TestSuite.html'
-19:     filename = File.join selenium_tests_path, params[:testname]
-20:     if File.directory? filename
-21:       @suite_path = filename
-22:       render :file => view_path('test_suite.rhtml'), :layout => layout_path
-23:     elsif File.readable? filename
-24:       render_test_case filename
-25:     else
-26:       if File.directory? selenium_tests_path
-27:         render :text => 'Not found', :status => 404
-28:       else
-29:         render :text => "Did not find the Selenium tests path (#{selenium_tests_path}). Run script/generate selenium", :status => 404
-30:       end
-31:     end
-32:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Class: SeleniumController + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassSeleniumController
In: + + lib/controllers/selenium_controller.rb + +
+
Parent: + ActionController::Base +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ record   + setup   + support_file   + test_file   +
+
+ +
+ + + +
+

Included Modules

+ +
+ SeleniumOnRails::FixtureLoader + SeleniumOnRails::Renderer +
+
+ +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+    # File lib/controllers/selenium_controller.rb, line 50
+50:   def record
+51:     dir = record_table
+52: 
+53:     @result = {'resultDir' => dir}
+54:     for p in ['result', 'numTestFailures', 'numTestPasses', 'numCommandFailures', 'numCommandPasses', 'numCommandErrors', 'totalTime']
+55:       @result[p] = params[p]
+56:     end
+57:     File.open(log_path(params[:logFile] || 'default.yml'), 'w') {|f| YAML.dump(@result, f)}
+58:     
+59:     render :file => view_path('record.rhtml'), :layout => layout_path
+60:   end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/controllers/selenium_controller.rb, line 7
+ 7:   def setup
+ 8:     unless params.has_key? :keep_session
+ 9:       reset_session
+10:       @session_wiped = true
+11:     end
+12:     @cleared_tables = clear_tables params[:clear_tables].to_s
+13:     @loaded_fixtures = load_fixtures params[:fixtures].to_s
+14:     render :file => view_path('setup.rhtml'), :layout => layout_path
+15:   end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/controllers/selenium_controller.rb, line 34
+34:   def support_file
+35:     if params[:filename].empty?
+36:       redirect_to :filename => 'TestRunner.html', :test => 'tests'
+37:       return
+38:     end
+39: 
+40:     filename = File.join selenium_path, params[:filename]
+41:     if File.file? filename
+42:       type = WEBrick::HTTPUtils::DefaultMimeTypes[$1.downcase] if filename =~ /\.(\w+)$/
+43:       type ||= 'text/html'
+44:       send_file filename, :type => type, :disposition => 'inline', :stream => false
+45:     else
+46:       render :text => 'Not found', :status => 404
+47:     end
+48:   end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/controllers/selenium_controller.rb, line 17
+17:   def test_file
+18:     params[:testname] = '' if params[:testname].to_s == 'TestSuite.html'
+19:     filename = File.join selenium_tests_path, params[:testname]
+20:     if File.directory? filename
+21:       @suite_path = filename
+22:       render :file => view_path('test_suite.rhtml'), :layout => layout_path
+23:     elsif File.readable? filename
+24:       render_test_case filename
+25:     else
+26:       if File.directory? selenium_tests_path
+27:         render :text => 'Not found', :status => 404
+28:       else
+29:         render :text => "Did not find the Selenium tests path (#{selenium_tests_path}). Run script/generate selenium", :status => 404
+30:       end
+31:     end
+32:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumHelper.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumHelper.html index 5463a38e..76f3084c 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumHelper.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumHelper.html @@ -1,148 +1,148 @@ - - - - - - Module: SeleniumHelper - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumHelper
In: - - lib/selenium_helper.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- test_case_name   -
-
- -
- - - -
-

Included Modules

- -
- SeleniumOnRails::SuiteRenderer - SeleniumOnRails::FixtureLoader -
-
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_helper.rb, line 5
-5:   def test_case_name filename
-6:     File.basename(filename).sub(/\..*/,'').humanize
-7:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Module: SeleniumHelper + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumHelper
In: + + lib/selenium_helper.rb + +
+
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ test_case_name   +
+
+ +
+ + + +
+

Included Modules

+ +
+ SeleniumOnRails::SuiteRenderer + SeleniumOnRails::FixtureLoader +
+
+ +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+   # File lib/selenium_helper.rb, line 5
+5:   def test_case_name filename
+6:     File.basename(filename).sub(/\..*/,'').humanize
+7:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails.html index 34015fde..ecb45eb3 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails.html @@ -1,124 +1,126 @@ - - - - - - Module: SeleniumOnRails - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails
In: - - lib/selenium_on_rails/paths.rb - -
- - lib/selenium_on_rails.rb - -
-
-
- - -
- - - -
- - - -
- - -
- - - - -
- -
-

Classes and Modules

- - Module SeleniumOnRails::FixtureLoader
-Module SeleniumOnRails::PartialsSupport
-Module SeleniumOnRails::Paths
-Module SeleniumOnRails::Renderer
-Module SeleniumOnRails::SuiteRenderer
-Module SeleniumOnRails::TestBuilderAccessors
-Module SeleniumOnRails::TestBuilderActions
-Class SeleniumOnRails::RSelenese
-Class SeleniumOnRails::Selenese
-Class SeleniumOnRails::TestBuilder
- -
- - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + Module: SeleniumOnRails + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumOnRails
In: + + lib/selenium_on_rails/paths.rb + +
+ + lib/selenium_on_rails.rb + +
+
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ +
+

Classes and Modules

+ + Module SeleniumOnRails::FixtureLoader
+Module SeleniumOnRails::PartialsSupport
+Module SeleniumOnRails::Paths
+Module SeleniumOnRails::Renderer
+Module SeleniumOnRails::SuiteRenderer
+Module SeleniumOnRails::TestBuilderAccessors
+Module SeleniumOnRails::TestBuilderActions
+Module SeleniumOnRails::TestBuilderUserAccessors
+Module SeleniumOnRails::TestBuilderUserActions
+Class SeleniumOnRails::RSelenese
+Class SeleniumOnRails::Selenese
+Class SeleniumOnRails::TestBuilder
+ +
+ + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/FixtureLoader.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/FixtureLoader.html index 866e8904..221ef08c 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/FixtureLoader.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/FixtureLoader.html @@ -1,231 +1,231 @@ - - - - - - Module: SeleniumOnRails::FixtureLoader - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::FixtureLoader
In: - - lib/selenium_on_rails/fixture_loader.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - -
-

Included Modules

- -
- SeleniumOnRails::Paths -
-
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/fixture_loader.rb, line 6
- 6:   def available_fixtures
- 7:     fixtures = {}
- 8:     path = fixtures_path + '/'
- 9:     files = Dir["#{path}**/*.{yml,csv}"]
-10:     files.each do |file|
-11:       rel_path = file.sub(path, '')
-12:       next if skip_file? rel_path
-13:       fixture_set = File.dirname(rel_path)
-14:       fixture_set = '' if fixture_set == '.'
-15:       fixture = rel_path.sub /\.[^.]*$/, ''
-16:       fixtures[fixture_set] ||= []
-17:       fixtures[fixture_set] << fixture
-18:     end
-19:     
-20:     fixtures
-21:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/fixture_loader.rb, line 45
-45:   def clear_tables tables
-46:     table_names = tables.split /\s*,\s*/
-47:     connection = ActiveRecord::Base.connection 
-48:     table_names.each do |table|
-49:       connection.execute "DELETE FROM #{table}" 
-50:     end
-51:     table_names
-52:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/fixture_loader.rb, line 23
-23:   def load_fixtures fixtures_param
-24:     available = nil
-25:     fixtures = fixtures_param.split(/\s*,\s*/).collect do |f|
-26:       fixture_set = File.dirname f
-27:       fixture_set = '' if fixture_set == '.'
-28:       fixture = File.basename f
-29:       if fixture == 'all'
-30:         available ||= available_fixtures
-31:         available[fixture_set]
-32:       else
-33:         f
-34:       end
-35:     end
-36:     fixtures.flatten!
-37:     fixtures.reject! {|f| f.blank? }
-38: 
-39:     if fixtures.any?
-40:       Fixtures.create_fixtures fixtures_path, fixtures
-41:     end
-42:     fixtures
-43:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Module: SeleniumOnRails::FixtureLoader + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumOnRails::FixtureLoader
In: + + lib/selenium_on_rails/fixture_loader.rb + +
+
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ + +
+ +
+ + + +
+

Included Modules

+ +
+ SeleniumOnRails::Paths +
+
+ +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/fixture_loader.rb, line 7
+ 7:   def available_fixtures
+ 8:     fixtures = {}
+ 9:     path = fixtures_path + '/'
+10:     files = Dir["#{path}**/*.{yml,csv}"]
+11:     files.each do |file|
+12:       rel_path = file.sub(path, '')
+13:       next if skip_file? rel_path
+14:       fixture_set = File.dirname(rel_path)
+15:       fixture_set = '' if fixture_set == '.'
+16:       fixture = rel_path.sub /\.[^.]*$/, ''
+17:       fixtures[fixture_set] ||= []
+18:       fixtures[fixture_set] << fixture
+19:     end
+20:     
+21:     fixtures
+22:   end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/fixture_loader.rb, line 46
+46:   def clear_tables tables
+47:     table_names = tables.split /\s*,\s*/
+48:     connection = ActiveRecord::Base.connection 
+49:     table_names.each do |table|
+50:       connection.execute "DELETE FROM #{table}" 
+51:     end
+52:     table_names
+53:   end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/fixture_loader.rb, line 24
+24:   def load_fixtures fixtures_param
+25:     available = nil
+26:     fixtures = fixtures_param.split(/\s*,\s*/).collect do |f|
+27:       fixture_set = File.dirname f
+28:       fixture_set = '' if fixture_set == '.'
+29:       fixture = File.basename f
+30:       if fixture == 'all'
+31:         available ||= available_fixtures
+32:         available[fixture_set]
+33:       else
+34:         f
+35:       end
+36:     end
+37:     fixtures.flatten!
+38:     fixtures.reject! {|f| f.blank? }
+39: 
+40:     if fixtures.any?
+41:       Fixtures.create_fixtures fixtures_path, fixtures
+42:     end
+43:     fixtures
+44:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/PartialsSupport.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/PartialsSupport.html index 77cff331..47e3d2cb 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/PartialsSupport.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/PartialsSupport.html @@ -1,195 +1,195 @@ - - - - - - Module: SeleniumOnRails::PartialsSupport - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::PartialsSupport
In: - - lib/selenium_on_rails/partials_support.rb - -
-
-
- - -
- - - -
- -
-

-Provides partials support to test cases so they can include other partial -test cases. -

-

-The partial’s commands are returned as html table rows. -

- -
- - -
- -
-

Methods

- - -
- -
- - - -
-

Included Modules

- -
- SeleniumOnRails::Paths -
-
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-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. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/partials_support.rb, line 19
-19:   def extract_commands_from_partial partial
-20:     partial = partial.match(/.*<table>.*?<tr>.*?<\/tr>(.*?)<\/table>/im)[1]
-21:     raise "Partial '#{name}' doesn't contain any table" unless partial
-22:     partial
-23:   end
-
-
-
-
- -
- - - - -
-

-Overrides where the partial is searched for, and returns only the command -table rows. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/partials_support.rb, line 9
- 9:   def render_partial partial_path = default_template_name, object = nil, local_assigns = nil, status = nil
-10:     pattern = partial_pattern partial_path
-11:     filename = Dir[pattern].first
-12:     raise "Partial '#{partial_path}' cannot be found! (Looking for file: '#{pattern}')" unless filename
-13:     partial = render :file => filename, :use_full_path => false, :locals => local_assigns
-14:     extract_commands_from_partial partial
-15:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Module: SeleniumOnRails::PartialsSupport + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumOnRails::PartialsSupport
In: + + lib/selenium_on_rails/partials_support.rb + +
+
+
+ + +
+ + + +
+ +
+

+Provides partials support to test cases so they can include other partial +test cases. +

+

+The partial‘s commands are returned as html table rows. +

+ +
+ + +
+ +
+

Methods

+ + +
+ +
+ + + +
+

Included Modules

+ +
+ SeleniumOnRails::Paths +
+
+ +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

+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. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/partials_support.rb, line 19
+19:   def extract_commands_from_partial partial
+20:     partial = partial.match(/.*<table>.*?<tr>.*?<\/tr>(.*?)<\/table>/im)[1]
+21:     raise "Partial '#{name}' doesn't contain any table" unless partial
+22:     partial
+23:   end
+
+
+
+
+ +
+ + + + +
+

+Overrides where the partial is searched for, and returns only the command +table rows. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/partials_support.rb, line 9
+ 9:   def render_partial partial_path = default_template_name, object = nil, local_assigns = nil, status = nil
+10:     pattern = partial_pattern partial_path
+11:     filename = Dir[pattern].first
+12:     raise "Partial '#{partial_path}' cannot be found! (Looking for file: '#{pattern}')" unless filename
+13:     partial = render :file => filename, :use_full_path => false, :locals => local_assigns
+14:     extract_commands_from_partial partial
+15:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Paths.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Paths.html index 1d1db9bb..0b15794a 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Paths.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Paths.html @@ -1,295 +1,295 @@ - - - - - - Module: SeleniumOnRails::Paths - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::Paths
In: - - lib/selenium_on_rails/paths.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 25
-25:     def fixtures_path
-26:       File.expand_path File.join(RAILS_ROOT, 'test/fixtures')
-27:     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. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 19
-19:     def layout_path
-20:       rails_root = Pathname.new File.expand_path(File.join(RAILS_ROOT, 'app/views'))
-21:       view_path = Pathname.new view_path('layout')
-22:       view_path.relative_path_from(rails_root).to_s
-23:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 29
-29:     def log_path log_file
-30:       File.expand_path(File.dirname(__FILE__) + '/../../log/' + log_file)
-31:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/paths.rb, line 3
-3:     def selenium_path
-4:       @@selenium_path ||= find_selenium_path
-5:       @@selenium_path
-6:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 8
- 8:     def selenium_tests_path
- 9:       File.expand_path(File.join(RAILS_ROOT, 'test/selenium'))
-10:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 33
-33:     def skip_file? file
-34:       file.split('/').each do |f|
-35:         return true if f.upcase == 'CVS' or f.starts_with?('.') or f.ends_with?('~') or f.starts_with?('_')
-36:       end
-37:       false
-38:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 12
-12:     def view_path view
-13:       File.expand_path(File.dirname(__FILE__) + '/../views/' + view)
-14:     end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Module: SeleniumOnRails::Paths + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumOnRails::Paths
In: + + lib/selenium_on_rails/paths.rb + +
+
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ + +
+ +
+ + + + +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/paths.rb, line 25
+25:     def fixtures_path
+26:       File.expand_path File.join(RAILS_ROOT, 'test/fixtures')
+27:     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. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/paths.rb, line 19
+19:     def layout_path
+20:       rails_root = Pathname.new File.expand_path(File.join(RAILS_ROOT, 'app/views'))
+21:       view_path = Pathname.new view_path('layout')
+22:       view_path.relative_path_from(rails_root).to_s
+23:     end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/paths.rb, line 29
+29:     def log_path log_file
+30:       File.expand_path(File.dirname(__FILE__) + '/../../log/' + File.basename(log_file))
+31:     end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+   # File lib/selenium_on_rails/paths.rb, line 3
+3:     def selenium_path
+4:       @@selenium_path ||= find_selenium_path
+5:       @@selenium_path
+6:     end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/paths.rb, line 8
+ 8:     def selenium_tests_path
+ 9:       File.expand_path(File.join(RAILS_ROOT, 'test/selenium'))
+10:     end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/paths.rb, line 33
+33:     def skip_file? file
+34:       file.split('/').each do |f|
+35:         return true if f.upcase == 'CVS' or f.starts_with?('.') or f.ends_with?('~') or f.starts_with?('_')
+36:       end
+37:       false
+38:     end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/paths.rb, line 12
+12:     def view_path view
+13:       File.expand_path(File.dirname(__FILE__) + '/../views/' + view)
+14:     end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html index e8346742..b57e9c23 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html @@ -1,219 +1,219 @@ - - - - - - Class: SeleniumOnRails::RSelenese - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumOnRails::RSelenese
In: - - lib/selenium_on_rails/rselenese.rb - -
-
Parent: - - SeleniumOnRails::TestBuilder - -
-
- - -
- - - -
- -
-

-Renders Selenium test templates in a fashion analogous to rxml and -rjs templates. -

-
-  setup
-  open :controller => 'customer', :action => 'list'
-  assert_title 'Customers'
-
-

-See SeleniumOnRails::TestBuilder for a list -of available commands. -

- -
- - -
- -
-

Methods

- -
- new   - render   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - -
view [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

-Create a new RSelenese renderer bound to -view. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/rselenese.rb, line 17
+
+
+
+
+
+  Class: SeleniumOnRails::RSelenese
+  
+  
+  
+  
+
+
+
+
+
+
+    
+ + + + + + + + + + + + + + +
ClassSeleniumOnRails::RSelenese
In: + + lib/selenium_on_rails/rselenese.rb + +
+
Parent: + + SeleniumOnRails::TestBuilder + +
+
+ + +
+ + + +
+ +
+

+Renders Selenium test templates in a fashion analogous to rxml and +rjs templates. +

+
+  setup
+  open :controller => 'customer', :action => 'list'
+  assert_title 'Customers'
+
+

+See SeleniumOnRails::TestBuilder for a list +of available commands. +

+ +
+ + +
+ +
+

Methods

+ +
+ new   + render   +
+
+ +
+ + + + +
+ + + + + +
+

Attributes

+ +
+ + + + + + +
view [RW] 
+
+
+ + + + +
+

Public Class methods

+ +
+ + + + +
+

+Create a new RSelenese renderer bound to view. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/rselenese.rb, line 17
 17:   def initialize view
 18:     super view
 19:     @view = view
-20:   end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Render template using local_assigns. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/rselenese.rb, line 23
+20:   end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

+Render template using local_assigns. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/rselenese.rb, line 23
 23:   def render template, local_assigns
 24:     title = (@view.assigns['page_title'] or local_assigns['page_title'])
 25:     table(title) do
-26:       test = self #to enable test.command
+26:       test = self #to enable test.command

 27: 
 28:       assign_locals_code = ''
 29:       local_assigns.each_key {|key| assign_locals_code << "#{key} = local_assigns[#{key.inspect}];"}
 30: 
 31:       eval assign_locals_code + "\n" + template
 32:     end
-33:   end
-
-
-
-
- - -
- - -
- - - - - +33: end +
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Renderer.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Renderer.html index 593ef6bd..0f79b2e0 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Renderer.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Renderer.html @@ -1,156 +1,156 @@ - - - - - - Module: SeleniumOnRails::Renderer - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::Renderer
In: - - lib/selenium_on_rails/renderer.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - -
-

Included Modules

- -
- SeleniumOnRails::Paths - SeleniumHelper -
-
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/renderer.rb, line 5
- 5:   def render_test_case filename
- 6:     @template.extend SeleniumOnRails::PartialsSupport
- 7:     @page_title = test_case_name filename
- 8:     output = render_to_string :file => filename
- 9:     layout = (output =~ /<html>/i ? false : layout_path)
-10:     render :text => output, :layout => layout
-11: 
-12:     headers['Cache-control'] = 'no-cache'
-13:     headers['Pragma'] = 'no-cache'
-14:     headers['Expires'] = '-1'
-15:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Module: SeleniumOnRails::Renderer + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumOnRails::Renderer
In: + + lib/selenium_on_rails/renderer.rb + +
+
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ + +
+ +
+ + + +
+

Included Modules

+ +
+ SeleniumOnRails::Paths + SeleniumHelper +
+
+ +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/renderer.rb, line 5
+ 5:   def render_test_case filename
+ 6:     @template.extend SeleniumOnRails::PartialsSupport
+ 7:     @page_title = test_case_name filename
+ 8:     output = render_to_string :file => filename
+ 9:     layout = (output =~ /<html>/i ? false : layout_path)
+10:     render :text => output, :layout => layout
+11: 
+12:     headers['Cache-control'] = 'no-cache'
+13:     headers['Pragma'] = 'no-cache'
+14:     headers['Expires'] = '-1'
+15:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Selenese.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Selenese.html index 1c51f5cf..83fea27d 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Selenese.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Selenese.html @@ -1,179 +1,179 @@ - - - - - - Class: SeleniumOnRails::Selenese - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumOnRails::Selenese
In: - - lib/selenium_on_rails/selenese.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   - render   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/selenese.rb, line 7
-7:   def initialize view
-8:     @view = view
-9:   end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/selenese.rb, line 11
-11:   def render template, local_assigns
-12:     name = (@view.assigns['page_title'] or local_assigns['page_title'])
-13:     lines = template.strip.split "\n"
-14:     html = ''
-15:     html << extract_comments(lines)
-16:     html << extract_commands(lines, name)
-17:     html << extract_comments(lines)
-18:     raise 'You cannot have comments in the middle of commands!' if next_line lines, :any
-19:     html
-20:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Class: SeleniumOnRails::Selenese + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassSeleniumOnRails::Selenese
In: + + lib/selenium_on_rails/selenese.rb + +
+
Parent: + Object +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ new   + render   +
+
+ +
+ + + + +
+ + + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+   # File lib/selenium_on_rails/selenese.rb, line 7
+7:   def initialize view
+8:     @view = view
+9:   end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/selenese.rb, line 11
+11:   def render template, local_assigns
+12:     name = (@view.assigns['page_title'] or local_assigns['page_title'])
+13:     lines = template.strip.split "\n"
+14:     html = ''
+15:     html << extract_comments(lines)
+16:     html << extract_commands(lines, name)
+17:     html << extract_comments(lines)
+18:     raise 'You cannot have comments in the middle of commands!' if next_line lines, :any
+19:     html
+20:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/SuiteRenderer.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/SuiteRenderer.html index 4c0dc0d6..a2d00bad 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/SuiteRenderer.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/SuiteRenderer.html @@ -1,223 +1,223 @@ - - - - - - Module: SeleniumOnRails::SuiteRenderer - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::SuiteRenderer
In: - - lib/selenium_on_rails/suite_renderer.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/suite_renderer.rb, line 24
+
+
+
+
+
+  Module: SeleniumOnRails::SuiteRenderer
+  
+  
+  
+  
+
+
+
+
+
+
+    
+ + + + + + + + + + +
ModuleSeleniumOnRails::SuiteRenderer
In: + + lib/selenium_on_rails/suite_renderer.rb + +
+
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ + +
+ +
+ + + + +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/suite_renderer.rb, line 24
 24:   def link_to_test_case suite_name, filename
 25:     name = suite_name + test_case_name(filename)
 26:     link_to name, :action => :test_file, :testname => path_to_relative_url(filename).sub(/^\//,'')
-27:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/suite_renderer.rb, line 18
+27:   end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/suite_renderer.rb, line 18
 18:   def test_cases path
 19:     tests = []
 20:     visit_all_tests path, '', nil, Proc.new {|n, p| tests << [n,p]}
 21:     tests
-22:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/suite_renderer.rb, line 2
+22:   end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+   # File lib/selenium_on_rails/suite_renderer.rb, line 2
 2:   def test_suite_name path
 3:     return 'All test cases' if [nil, '/'].include? path_to_relative_url(path)
 4:     File.split(path)[-1].humanize
-5:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/suite_renderer.rb, line 7
+5:   end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails/suite_renderer.rb, line 7
  7:   def test_suites path
  8:     suites = []
  9: 
-10:     parent_path = File.join(File.split(path).slice(0..-2)) #all but last
+10:     parent_path = File.join(File.split(path).slice(0..-2)) #all but last

 11:     parent_path = path_to_relative_url parent_path
 12:     suites << ['..', parent_path] unless parent_path.nil?
 13: 
 14:     visit_all_tests path, '', Proc.new {|n, p| suites << [n,path_to_relative_url(p)]}, nil
 15:     suites
-16:   end
-
-
-
-
- - -
- - -
- - - - - +16: end +
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html index 91529e68..0c327fac 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html @@ -1,372 +1,441 @@ - - - - - - Class: SeleniumOnRails::TestBuilder - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumOnRails::TestBuilder
In: - - lib/selenium_on_rails/test_builder.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-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 release.openqa.org/selenium-core/nightly/reference.html. -

- -
- - -
- -
-

Methods

- -
- command   - command_and_wait   - command_verbatim   - exactize   - make_command_waiting   - new   - selenize   - table   -
-
- -
- - - -
-

Included Modules

- -
- SeleniumOnRails::TestBuilderActions - SeleniumOnRails::TestBuilderAccessors -
-
- -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Create a new TestBuilder for view. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 26
-26:   def initialize view
-27:     @view = view
-28:     @output = ''
-29:     @xml = Builder::XmlMarkup.new :indent => 2, :target => @output
-30:   end
-
-
-
-
- -
- - - - -
-

-Convert str to a Selenium command name. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 15
-15:   def self.selenize str
-16:     str.camelize.gsub(/^[A-Z]/) {|s| s.downcase }
-17:   end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Add a new test command using cmd, target and -value. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 41
-41:   def command cmd, target=nil, value=nil
-42:     @xml.tr do
-43:       _tdata cmd
-44:       _tdata target
-45:       _tdata value
-46:     end
-47:   end
-
-
-
-
- -
- - - - -
-

-Same as command but add AndWait to the name of -cmd. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 52
-52:   def command_and_wait cmd, target=nil, value=nil
-53:     command_verbatim cmd.to_s + 'AndWait', target, value
-54:   end
-
-
-
-
- -
- - -
- command_verbatim(cmd, target=nil, value=nil) -
- -
-

-Alias for command -

-
-
- -
- - - - -
-

-Prepends pattern with ‘exact:’ if it would be -considered containing string-match pattern otherwise. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 21
-21:   def exactize pattern
-22:     pattern.include?(':') ? "exact:#{pattern}" : pattern
-23:   end
-
-
-
-
- -
- - - - -
-

-Re routes commands in the provided block to command_and_wait instead of command. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 58
-58:   def make_command_waiting
-59:     self.class.send :alias_method, :command, :command_and_wait
-60:     yield
-61:     self.class.send :alias_method, :command, :command_verbatim 
-62:   end
-
-
-
-
- -
- - - - -
-

-Add a new table of tests, and return the HTML. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 33
-33:   def table title
-34:     @xml.table do
-35:       @xml.tr do @xml.th(title, :colspan => 3) end
-36:       yield self
-37:     end
-38:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Class: SeleniumOnRails::TestBuilder + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassSeleniumOnRails::TestBuilder
In: + + lib/selenium_on_rails/test_builder.rb + +
+
Parent: + Object +
+
+ + +
+ + + +
+ +
+

+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 release.openqa.org/selenium-core/nightly/reference.html. +

+ +
+ + +
+ +
+

Methods

+ +
+ collection_arg   + command   + command_and_wait   + command_verbatim   + exactize   + make_command_waiting   + new   + selenize   + table   + url_arg   +
+
+ +
+ + + +
+

Included Modules

+ +
+ SeleniumOnRails::TestBuilderActions + SeleniumOnRails::TestBuilderAccessors + SeleniumOnRails::TestBuilderUserActions + SeleniumOnRails::TestBuilderUserAccessors +
+
+ +
+ + + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

+Create a new TestBuilder for view. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder.rb, line 47
+47:   def initialize view
+48:     @view = view
+49:     @output = ''
+50:     @xml = Builder::XmlMarkup.new :indent => 2, :target => @output
+51:   end
+
+
+
+
+ +
+ + + + +
+

+Convert str to a Selenium command name. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder.rb, line 36
+36:   def self.selenize str
+37:     str.camelize.gsub(/^[A-Z]/) {|s| s.downcase }
+38:   end
+
+
+
+
+ +

Public Instance methods

+ +
+ + + + +
+

+Add a new test command using cmd, +target and value. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder.rb, line 62
+62:   def command cmd, target=nil, value=nil
+63:     @xml.tr do
+64:       _tdata cmd
+65:       _tdata target
+66:       _tdata value
+67:     end
+68:   end
+
+
+
+
+ +
+ + + + +
+

+Same as command but add +AndWait to the name of cmd. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder.rb, line 73
+73:   def command_and_wait cmd, target=nil, value=nil
+74:     command_verbatim cmd.to_s + 'AndWait', target, value
+75:   end
+
+
+
+
+ +
+ + +
+ command_verbatim(cmd, target=nil, value=nil) +
+ +
+

+Alias for command +

+
+
+ +
+ + + + +
+

+Prepends pattern with ‘exact:’ if it would be +considered containing string-match pattern otherwise. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder.rb, line 42
+42:   def exactize pattern
+43:     pattern.include?(':') ? "exact:#{pattern}" : pattern
+44:   end
+
+
+
+
+ +
+ + + + +
+

+Re routes commands in the provided block to command_and_wait instead of command. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder.rb, line 79
+79:   def make_command_waiting
+80:     self.class.send :alias_method, :command, :command_and_wait
+81:     yield
+82:     self.class.send :alias_method, :command, :command_verbatim 
+83:   end
+
+
+
+
+ +
+ + + + +
+

+Add a new table of tests, and return the HTML. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder.rb, line 54
+54:   def table title
+55:     @xml.table do
+56:       @xml.tr do @xml.th(title, :colspan => 3) end
+57:       yield self
+58:     end
+59:   end
+
+
+
+
+ +

Protected Instance methods

+ +
+ + + + +
+

+If arg is an array formats arg to a textual +representation. Otherwise return unchanged. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder.rb, line 95
+ 95:   def collection_arg arg
+ 96:     if arg.is_a? Array
+ 97:       arg.collect {|e| e.gsub(/[\\,]/) {|s| "\\#{s}" } }.join(',')
+ 98:     else
+ 99:       arg
+100:     end
+101:   end
+
+
+
+
+ +
+ + + + +
+

+If url is a string, return unchanged. Otherwise, pass it to +ActionView#UrlHelper#url_for. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder.rb, line 89
+89:   def url_arg url
+90:     if url.instance_of?(String) then url else exactize(@view.url_for(url)) end
+91:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderAccessors.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderAccessors.html index a81378eb..6c948282 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderAccessors.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderAccessors.html @@ -1,1672 +1,3098 @@ - - - - - - Module: SeleniumOnRails::TestBuilderAccessors - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::TestBuilderAccessors
In: - - lib/selenium_on_rails/test_builder_accessors.rb - -
-
-
- - -
- - - -
- -
-

-The accessors available for SeleniumOnRails::TestBuilder tests. -

-

-For each store_foo there’s assert_foo, -assert_not_foo, verify_foo, verify_not_foo, -wait_for_foo, wait_for_not_foo. -

- -
- - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Gets the absolute URL of the current page. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_absolute_location(pattern) - -
  • -
  • assert_not_absolute_location(pattern) - -
  • -
  • verify_absolute_location_present(pattern) - -
  • -
  • verify_not_absolute_location(pattern) - -
  • -
  • wait_for_absolute_location(pattern) - -
  • -
  • wait_for_not_absolute_location(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 129
-129:   def store_absolute_location variable_name
-130:     command 'storeAbsoluteLocation', variable_name
-131:   end
-
-
-
-
- -
- - - - -
-

-Retrieves the message of a JavaScript alert generated during the previous -action, or fail if there were no alerts. -

-

-Getting an alert has the same effect as manually clicking OK. If an alert -is generated but you do not get/verify it, the next Selenium action will -fail. -

-

-NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert -dialog. -

-

-NOTE: Selenium does NOT support JavaScript alerts that are generated in a -page’s onload() event handler. In this case a visible dialog -WILL be generated and Selenium will hang until someone manually clicks OK. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_alert(pattern) - -
  • -
  • assert_not_alert(pattern) - -
  • -
  • verify_alert_present(pattern) - -
  • -
  • verify_not_alert(pattern) - -
  • -
  • wait_for_alert(pattern) - -
  • -
  • wait_for_not_alert(pattern) - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 66
-66:   def store_alert variable_name
-67:     command 'storeAlert', variable_name
-68:   end
-
-
-
-
- -
- - - - -
-

-Has an alert occurred? -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_alert_present - -
  • -
  • assert_alert_not_present - -
  • -
  • verify_alert_present - -
  • -
  • verify_alert_not_present - -
  • -
  • wait_for_alert_present - -
  • -
  • wait_for_alert_not_present - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 15
-15:   def store_alert_present variable_name
-16:     command 'storeAlertPresent', variable_name
-17:   end
-
-
-
-
- -
- - - - -
-

-Returns the IDs of all buttons on the page. -

-

-If a given button has no ID, it will appear as "" in this array. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_all_buttons ['but1', 'but2']
- assert_all_buttons 'but?,but?*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_all_buttons(pattern) - -
  • -
  • assert_not_all_buttons(pattern) - -
  • -
  • verify_all_buttons(pattern) - -
  • -
  • verify_not_all_buttons(pattern) - -
  • -
  • wait_for_all_buttons(pattern) - -
  • -
  • wait_for_not_all_buttons(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 400
-400:   def store_all_buttons variable_name
-401:     command 'storeAllButtons', variable_name
-402:   end
-
-
-
-
- -
- - - - -
-

-Returns the IDs of all input fields on the page. -

-

-If a given field has no ID, it will appear as "" in this array. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_all_fields ['field1', 'field2']
- assert_all_fields 'field?,field?*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_all_fields(pattern) - -
  • -
  • assert_not_all_fields(pattern) - -
  • -
  • verify_all_fields(pattern) - -
  • -
  • verify_not_all_fields(pattern) - -
  • -
  • wait_for_all_fields(pattern) - -
  • -
  • wait_for_not_all_fields(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 440
-440:   def store_all_fields variable_name
-441:     command 'storeAllFields', variable_name
-442:   end
-
-
-
-
- -
- - - - -
-

-Returns the IDs of all links on the page. -

-

-If a given link has no ID, it will appear as "" in this array. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_all_links ['link1', 'link2']
- assert_all_links 'link?,link?*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_all_links(pattern) - -
  • -
  • assert_not_all_links(pattern) - -
  • -
  • verify_all_links(pattern) - -
  • -
  • verify_not_all_links(pattern) - -
  • -
  • wait_for_all_links(pattern) - -
  • -
  • wait_for_not_all_links(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 420
-420:   def store_all_links variable_name
-421:     command 'storeAllLinks', variable_name
-422:   end
-
-
-
-
- -
- - - - -
-

-Gets the value of an element attribute. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_attribute(locator, attribute_name, pattern) - -
  • -
  • assert_not_attribute(locator, attribute_name, pattern) - -
  • -
  • verify_attribute_present(locator, attribute_name, pattern) - -
  • -
  • verify_not_attribute(locator, attribute_name, pattern) - -
  • -
  • wait_for_attribute(locator, attribute_name, pattern) - -
  • -
  • wait_for_not_attribute(locator, attribute_name, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 322
-322:   def store_attribute locator, attribute_name, variable_name
-323:     command 'storeAttribute', "#{locator}@#{attribute_name}", variable_name
-324:   end
-
-
-
-
- -
- - - - -
-

-Gets the entire text of the page. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_body_text(pattern) - -
  • -
  • assert_not_body_text(pattern) - -
  • -
  • verify_body_text_present(pattern) - -
  • -
  • verify_not_body_text(pattern) - -
  • -
  • wait_for_body_text(pattern) - -
  • -
  • wait_for_not_body_text(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 169
-169:   def store_body_text variable_name
-170:     command 'storeBodyText', variable_name
-171:   end
-
-
-
-
- -
- - - - -
-

-Gets whether a toggle-button (checkbox/radio) is checked. Fails if the -specified element doesn’t exist or isn’t a toggle-button. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_checked(locator, pattern) - -
  • -
  • assert_not_checked(locator, pattern) - -
  • -
  • verify_checked_present(locator, pattern) - -
  • -
  • verify_not_checked(locator, pattern) - -
  • -
  • wait_for_checked(locator, pattern) - -
  • -
  • wait_for_not_checked(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 239
-239:   def store_checked locator, variable_name
-240:     command 'storeChecked', locator, variable_name
-241:   end
-
-
-
-
- -
- - - - -
-

-Retrieves the message of a JavaScript confirmation dialog generated during -the previous action. -

-

-By default, the confirm function will return true, having the same -effect as manually clicking OK. This can be changed by prior execution of -the choose_cancel_on_next_confirmation command. If a confirmation -is generated but you do not get/verify it, the next Selenium action will -fail. -

-

-NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible -dialog. -

-

-NOTE: Selenium does NOT support JavaScript confirmations that are generated -in a page’s onload() event handler. In this case a visible -dialog WILL be generated and Selenium will hang until you manually click -OK. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_confirmation(pattern) - -
  • -
  • assert_not_confirmation(pattern) - -
  • -
  • verify_confirmation_present(pattern) - -
  • -
  • verify_not_confirmation(pattern) - -
  • -
  • wait_for_confirmation(pattern) - -
  • -
  • wait_for_not_confirmation(pattern) - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 92
-92:   def store_confirmation variable_name
-93:     command 'storeConfirmation', variable_name
-94:   end
-
-
-
-
- -
- - - - -
-

-Has confirm() been called? -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_confirmation_present - -
  • -
  • assert_confirmation_not_present - -
  • -
  • verify_confirmation_present - -
  • -
  • verify_confirmation_not_present - -
  • -
  • wait_for_confirmation_present - -
  • -
  • wait_for_confirmation_not_present - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 41
-41:   def store_confirmation_present variable_name
-42:     command 'storeConfirmationPresent', variable_name
-43:   end
-
-
-
-
- -
- - - - -
-

-Determines whether the specified input element is editable, i.e. -hasn’t been disabled. This method will fail if the specified element -isn’t an input element. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_editable(locator) - -
  • -
  • assert_not_editable(locator) - -
  • -
  • verify_editable(locator) - -
  • -
  • verify_not_editable(locator) - -
  • -
  • wait_for_editable(locator) - -
  • -
  • wait_for_not_editable(locator) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 380
-380:   def store_editable locator, variable_name
-381:     command 'storeEditable', locator, variable_name
-382:   end
-
-
-
-
- -
- - - - -
-

-Verifies that the specified element is somewhere on the page. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_element_present(locator) - -
  • -
  • assert_element_not_present(locator) - -
  • -
  • verify_element_present(locator) - -
  • -
  • verify_element_not_present(locator) - -
  • -
  • wait_for_element_present(locator) - -
  • -
  • wait_for_element_not_present(locator) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 349
-349:   def store_element_present locator, variable_name
-350:     command 'storeElementPresent', locator, variable_name
-351:   end
-
-
-
-
- -
- - - - -
-

-Gets the result of evaluating the specified JavaScript snippet. The snippet -may have multiple lines, but only the result of the last line will be -returned. -

-

-Note that, by default, the snippet will run in the context of the -"selenium" object itself, so this will refer to the -Selenium object, and window will refer to the top-level runner -test window, not the window of your application. -

-

-If you need a reference to the window of your application, you can refer to -this.browserbot.getCurrentWindow() and if you need to use a -locator to refer to a single element in your application page, you can use -this.page().findElement("foo") where -"foo" is your locator. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_eval(script, pattern) - -
  • -
  • assert_not_eval(script, pattern) - -
  • -
  • verify_eval_present(script, pattern) - -
  • -
  • verify_not_eval(script, pattern) - -
  • -
  • wait_for_eval(script, pattern) - -
  • -
  • wait_for_not_eval(script, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 225
-225:   def store_eval script, variable_name
-226:     command 'storeEval', script, variable_name
-227:   end
-
-
-
-
- -
- - - - -
-

-Returns the specified expression. -

-

-This is useful because of JavaScript preprocessing. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_expression(expression, pattern) - -
  • -
  • assert_not_expression(expression, pattern) - -
  • -
  • verify_expression(expression, pattern) - -
  • -
  • verify_not_expression(expression, pattern) - -
  • -
  • wait_for_expression(expression, pattern) - -
  • -
  • wait_for_not_expression(expression, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 468
-468:   def store_expression expression, variable_name
-469:     command 'storeExpression', expression, variable_name
-470:   end
-
-
-
-
- -
- - - - -
-

-Returns the entire HTML source between the opening and closing -"html" tags. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_html_source(pattern) - -
  • -
  • assert_not_html_source(pattern) - -
  • -
  • verify_html_source(pattern) - -
  • -
  • verify_not_html_source(pattern) - -
  • -
  • wait_for_html_source(pattern) - -
  • -
  • wait_for_not_html_source(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 453
-453:   def store_html_source variable_name
-454:     command 'storeHtmlSource', variable_name
-455:   end
-
-
-
-
- -
- - - - -
-

-Verify the location of the current page ends with the expected location. If -an URL querystring is provided, this is checked as well. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_location(pattern) - -
  • -
  • assert_not_location(pattern) - -
  • -
  • verify_location_present(pattern) - -
  • -
  • verify_not_location(pattern) - -
  • -
  • wait_for_location(pattern) - -
  • -
  • wait_for_not_location(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 143
-143:   def store_location expected_location, variable_name
-144:     command 'storeLocation', expected_location, variable_name
-145:   end
-
-
-
-
- -
- - - - -
-

-Retrieves the message of a JavaScript question prompt dialog generated -during the previous action. -

-

-Successful handling of the prompt requires prior execution of the -answer_on_next_prompt command. If a prompt is generated but you do -not get/verify it, the next Selenium action will fail. -

-

-NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog. -

-

-NOTE: Selenium does NOT support JavaScript prompts that are generated in a -page’s onload() event handler. In this case a visible dialog -WILL be generated and Selenium will hang until someone manually clicks OK. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_prompt(pattern) - -
  • -
  • assert_not_prompt(pattern) - -
  • -
  • verify_prompt_present(pattern) - -
  • -
  • verify_not_prompt(pattern) - -
  • -
  • wait_for_prompt(pattern) - -
  • -
  • wait_for_not_prompt(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 116
-116:   def store_prompt variable_name
-117:     command 'storePrompt', variable_name
-118:   end
-
-
-
-
- -
- - - - -
-

-Has a prompt occurred? -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_prompt_present - -
  • -
  • assert_prompt_not_present - -
  • -
  • verify_prompt_present - -
  • -
  • verify_prompt_not_present - -
  • -
  • wait_for_prompt_present - -
  • -
  • wait_for_prompt_not_present - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 28
-28:   def store_prompt_present variable_name
-29:     command 'storePromptPresent', variable_name
-30:   end
-
-
-
-
- -
- - - - -
-

-Gets all option labels in the specified select drop-down. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_select_options 'fruits', ['apple', 'pear']
- assert_select_options 'fruits', 'a*,p*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_select_options(locator, pattern) - -
  • -
  • assert_not_select_options(locator, pattern) - -
  • -
  • verify_select_options_present(locator, pattern) - -
  • -
  • verify_not_select_options(locator, pattern) - -
  • -
  • wait_for_select_options(locator, pattern) - -
  • -
  • wait_for_not_select_options(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 309
-309:   def store_select_options locator, variable_name
-310:     command 'storeSelectOptions', locator, variable_name
-311:   end
-
-
-
-
- -
- - - - -
-

-Verifies that the selected option of a drop-down satisfies the -option_locator. -

-

-option_locator is typically just an option label (e.g. "John -Smith"). -

-

-See the select command for more information about option locators. -

-

-NOTE: store_selected is -currently not supported by Selenium Core. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_selected(locator, option_locator) - -
  • -
  • assert_not_selected(locator, option_locator) - -
  • -
  • verify_selected_present(locator, option_locator) - -
  • -
  • verify_not_selected(locator, option_locator) - -
  • -
  • wait_for_selected(locator, option_locator) - -
  • -
  • wait_for_not_selected(locator, option_locator) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 272
-272:   def store_selected locator, option_locator, variable_name
-273:     raise 'Not supported in Selenium Core at the moment'
-274:   end
-
-
-
-
- -
- - - - -
-

-Gets all option labels for selected options in the specified select or -multi-select element. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_selected_options 'fruits', ['apple', 'pear']
- assert_selected_options 'fruits', 'a*,p*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_selected_options(locator, pattern) - -
  • -
  • assert_not_selected_options(locator, pattern) - -
  • -
  • verify_selected_options_present(locator, pattern) - -
  • -
  • verify_not_selected_options(locator, pattern) - -
  • -
  • wait_for_selected_options(locator, pattern) - -
  • -
  • wait_for_not_selected_options(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 291
-291:   def store_selected_options locator, variable_name
-292:     command 'storeSelectedOptions', locator, variable_name
-293:   end
-
-
-
-
- -
- - - - -
-

-Gets the text from a cell of a table. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_table(locator, row, column, pattern) - -
  • -
  • assert_not_table(locator, row, column, pattern) - -
  • -
  • verify_table_present(locator, row, column, pattern) - -
  • -
  • verify_not_table(locator, row, column, pattern) - -
  • -
  • wait_for_table(locator, row, column, pattern) - -
  • -
  • wait_for_not_table(locator, row, column, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 252
-252:   def store_table locator, row, column, variable_name
-253:     command 'storeTable', "#{locator}.#{row}.#{column}", variable_name
-254:   end
-
-
-
-
- -
- - - - -
-

-Gets the text of an element. This works for any element that contains text. -This command uses either the textContent (Mozilla-like browsers) -or the innerText (IE-like browsers) of the element, which is the -rendered text shown to the user. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_text(locator, pattern) - -
  • -
  • assert_not_text(locator, pattern) - -
  • -
  • verify_text_present(locator, pattern) - -
  • -
  • verify_not_text(locator, pattern) - -
  • -
  • wait_for_text(locator, pattern) - -
  • -
  • wait_for_not_text(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 200
-200:   def store_text locator, variable_name
-201:     command 'storeText', locator, variable_name
-202:   end
-
-
-
-
- -
- - - - -
-

-Verifies that the specified text pattern appears somewhere on the rendered -page shown to the user. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_text_present(pattern) - -
  • -
  • assert_text_not_present(pattern) - -
  • -
  • verify_text_present(pattern) - -
  • -
  • verify_text_not_present(pattern) - -
  • -
  • wait_for_text_present(pattern) - -
  • -
  • wait_for_text_not_present(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 336
-336:   def store_text_present pattern, variable_name
-337:     command 'storeTextPresent', pattern, variable_name
-338:   end
-
-
-
-
- -
- - - - -
-

-Gets the title of the current page. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_title(pattern) - -
  • -
  • assert_not_title(pattern) - -
  • -
  • verify_title_present(pattern) - -
  • -
  • verify_not_title(pattern) - -
  • -
  • wait_for_title(pattern) - -
  • -
  • wait_for_not_title(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 156
-156:   def store_title variable_name
-157:     command 'storeTitle', variable_name
-158:   end
-
-
-
-
- -
- - - - -
-

-Gets the (whitespace-trimmed) value of an input field (or anything else -with a value parameter). For checkbox/radio elements, the value will be -"on" or "off" depending on whether the element is -checked or not. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_value(locator, pattern) - -
  • -
  • assert_not_value(locator, pattern) - -
  • -
  • verify_value_present(locator, pattern) - -
  • -
  • verify_not_value(locator, pattern) - -
  • -
  • wait_for_value(locator, pattern) - -
  • -
  • wait_for_not_value(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 184
-184:   def store_value locator, variable_name
-185:     command 'storeValue', locator, variable_name
-186:   end
-
-
-
-
- -
- - - - -
-

-Determines if the specified element is visible. An element can be rendered -invisible by setting the CSS "visibility" property to -"hidden", or the "display" property to -"none", either for the element itself or one if its ancestors. -This method will fail if the element is not present. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_visible(locator) - -
  • -
  • assert_not_visible(locator) - -
  • -
  • verify_visible(locator) - -
  • -
  • verify_not_visible(locator) - -
  • -
  • wait_for_visible(locator) - -
  • -
  • wait_for_not_visible(locator) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 365
-365:   def store_visible locator, variable_name
-366:     command 'storeVisible', locator, variable_name
-367:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Module: SeleniumOnRails::TestBuilderAccessors + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumOnRails::TestBuilderAccessors
In: + + lib/selenium_on_rails/test_builder_accessors.rb + +
+
+
+ + +
+ + + +
+ +
+

+The accessors available for SeleniumOnRails::TestBuilder tests. +

+

+For each store_foo there‘s assert_foo, +assert_not_foo, verify_foo, verify_not_foo, +wait_for_foo, wait_for_not_foo. +

+ +
+ + +
+ +
+

Methods

+ + +
+ +
+ + + + +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

+Gets the absolute URL of the current page. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_absolute_location(pattern) + +
  • +
  • assert_not_absolute_location(pattern) + +
  • +
  • verify_absolute_location_present(pattern) + +
  • +
  • verify_not_absolute_location(pattern) + +
  • +
  • wait_for_absolute_location(pattern) + +
  • +
  • wait_for_not_absolute_location(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 246
+246:   def store_absolute_location variable_name
+247:     command 'storeAbsoluteLocation', variable_name
+248:   end
+
+
+
+
+ +
+ + + + +
+

+Retrieves the message of a JavaScript alert generated during the previous +action, or fail if there were no alerts. +

+

+Getting an alert has the same effect as manually clicking OK. If an alert +is generated but you do not get/verify it, the next Selenium action will +fail. +

+

+NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert +dialog. +

+

+NOTE: Selenium does NOT support JavaScript alerts that are generated in a +page‘s onload() event handler. In this case a visible dialog +WILL be generated and Selenium will hang until someone manually clicks OK. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_alert(pattern) + +
  • +
  • assert_not_alert(pattern) + +
  • +
  • verify_alert_present(pattern) + +
  • +
  • verify_not_alert(pattern) + +
  • +
  • wait_for_alert(pattern) + +
  • +
  • wait_for_not_alert(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 183
+183:   def store_alert variable_name
+184:     command 'storeAlert', variable_name
+185:   end
+
+
+
+
+ +
+ + + + +
+

+Has an alert occurred? +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_alert_present + +
  • +
  • assert_alert_not_present + +
  • +
  • verify_alert_present + +
  • +
  • verify_alert_not_present + +
  • +
  • wait_for_alert_present + +
  • +
  • wait_for_alert_not_present + +
  • +
+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_accessors.rb, line 89
+89:   def store_alert_present variable_name
+90:     command 'storeAlertPresent', variable_name
+91:   end
+
+
+
+
+ +
+ + + + +
+

+Returns the IDs of all buttons on the page. +

+

+If a given button has no ID, it will appear as "" in this array. +

+

+The pattern for the automatically generated assertions can either +take an array or a pattern. +

+
+ assert_all_buttons ['but1', 'but2']
+ assert_all_buttons 'but?,but?*'
+
+

+Related Assertions, automatically generated: +

+
    +
  • assert_all_buttons(pattern) + +
  • +
  • assert_not_all_buttons(pattern) + +
  • +
  • verify_all_buttons(pattern) + +
  • +
  • verify_not_all_buttons(pattern) + +
  • +
  • wait_for_all_buttons(pattern) + +
  • +
  • wait_for_not_all_buttons(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 754
+754:   def store_all_buttons variable_name
+755:     command 'storeAllButtons', variable_name
+756:   end
+
+
+
+
+ +
+ + + + +
+

+Returns the IDs of all input fields on the page. +

+

+If a given field has no ID, it will appear as "" in this array. +

+

+The pattern for the automatically generated assertions can either +take an array or a pattern. +

+
+ assert_all_fields ['field1', 'field2']
+ assert_all_fields 'field?,field?*'
+
+

+Related Assertions, automatically generated: +

+
    +
  • assert_all_fields(pattern) + +
  • +
  • assert_not_all_fields(pattern) + +
  • +
  • verify_all_fields(pattern) + +
  • +
  • verify_not_all_fields(pattern) + +
  • +
  • wait_for_all_fields(pattern) + +
  • +
  • wait_for_not_all_fields(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 794
+794:   def store_all_fields variable_name
+795:     command 'storeAllFields', variable_name
+796:   end
+
+
+
+
+ +
+ + + + +
+

+Returns the IDs of all links on the page. +

+

+If a given link has no ID, it will appear as "" in this array. +

+

+The pattern for the automatically generated assertions can either +take an array or a pattern. +

+
+ assert_all_links ['link1', 'link2']
+ assert_all_links 'link?,link?*'
+
+

+Related Assertions, automatically generated: +

+
    +
  • assert_all_links(pattern) + +
  • +
  • assert_not_all_links(pattern) + +
  • +
  • verify_all_links(pattern) + +
  • +
  • verify_not_all_links(pattern) + +
  • +
  • wait_for_all_links(pattern) + +
  • +
  • wait_for_not_all_links(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 774
+774:   def store_all_links variable_name
+775:     command 'storeAllLinks', variable_name
+776:   end
+
+
+
+
+ +
+ + + + +
+

+Returns the IDs of all windows that the browser knows about. +

+

+Related Assertions, automatically generated: +

+
    +
  • assertAllWindowIds(pattern) + +
  • +
  • assertNotAllWindowIds(pattern) + +
  • +
  • verifyAllWindowIds(pattern) + +
  • +
  • verifyNotAllWindowIds(pattern) + +
  • +
  • waitForAllWindowIds(pattern) + +
  • +
  • waitForNotAllWindowIds(pattern) + +
  • +
+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_accessors.rb, line 50
+50:   def store_all_window_ids variable_name
+51:     command 'storeAllWindowIds', variable_name
+52:   end
+
+
+
+
+ +
+ + + + +
+

+Returns the names of all windows that the browser knows about. +

+

+Related Assertions, automatically generated: +

+
    +
  • assertAllWindowNames(pattern) + +
  • +
  • assertNotAllWindowNames(pattern) + +
  • +
  • verifyAllWindowNames(pattern) + +
  • +
  • verifyNotAllWindowNames(pattern) + +
  • +
  • waitForAllWindowNames(pattern) + +
  • +
  • waitForNotAllWindowNames(pattern) + +
  • +
+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_accessors.rb, line 63
+63:   def store_all_window_names variable_name
+64:     command 'storeAllWindowNames', variable_name
+65:   end
+
+
+
+
+ +
+ + + + +
+

+Returns the titles of all windows that the browser knows about. +

+

+Related Assertions, automatically generated: +

+
    +
  • assertAllWindowTitles(pattern) + +
  • +
  • assertNotAllWindowTitles(pattern) + +
  • +
  • verifyAllWindowTitles(pattern) + +
  • +
  • verifyNotAllWindowTitles(pattern) + +
  • +
  • waitForAllWindowTitles(pattern) + +
  • +
  • waitForNotAllWindowTitles(pattern) + +
  • +
+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_accessors.rb, line 76
+76:   def store_all_window_titles variable_name
+77:     command 'storeAllWindowTitles', variable_name
+78:   end
+
+
+
+
+ +
+ + + + +
+

+Gets the value of an element attribute. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_attribute(locator, attribute_name, pattern) + +
  • +
  • assert_not_attribute(locator, attribute_name, pattern) + +
  • +
  • verify_attribute_present(locator, attribute_name, pattern) + +
  • +
  • verify_not_attribute(locator, attribute_name, pattern) + +
  • +
  • wait_for_attribute(locator, attribute_name, pattern) + +
  • +
  • wait_for_not_attribute(locator, attribute_name, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 577
+577:   def store_attribute locator, attribute_name, variable_name
+578:     command 'storeAttribute', "#{locator}@#{attribute_name}", variable_name
+579:   end
+
+
+
+
+ +
+ + + + +
+

+Returns every instance of some attribute from all known windows. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_attribute_from_all_windows(attribute_name, pattern) + +
  • +
  • assert_not_attribute_from_all_windows(attribute_name, pattern) + +
  • +
  • verify_attribute_from_all_windows(attribute_name, pattern) + +
  • +
  • verify_not_attribute_from_all_windows(attribute_name, pattern) + +
  • +
  • wait_for_attribute_from_all_windows(attribute_name, pattern) + +
  • +
  • wait_for_not_attribute_from_all_windows(attribute_name, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 102
+102:   def store_attribute_from_all_windows attribute_name, variable_name
+103:     command 'storeAttributeFromAllWindows', attribute_name, variable_name
+104:   end
+
+
+
+
+ +
+ + + + +
+

+Gets the entire text of the page. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_body_text(pattern) + +
  • +
  • assert_not_body_text(pattern) + +
  • +
  • verify_body_text_present(pattern) + +
  • +
  • verify_not_body_text(pattern) + +
  • +
  • wait_for_body_text(pattern) + +
  • +
  • wait_for_not_body_text(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 300
+300:   def store_body_text variable_name
+301:     command 'storeBodyText', variable_name
+302:   end
+
+
+
+
+ +
+ + + + +
+

+Gets whether a toggle-button (checkbox/radio) is checked. Fails if the +specified element doesn‘t exist or isn‘t a toggle-button. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_checked(locator) + +
  • +
  • assert_not_checked(locator) + +
  • +
  • verify_checked_present(locator) + +
  • +
  • verify_not_checked(locator) + +
  • +
  • wait_for_checked(locator) + +
  • +
  • wait_for_not_checked(locator) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 370
+370:   def store_checked locator, variable_name
+371:     command 'storeChecked', locator, variable_name
+372:   end
+
+
+
+
+ +
+ + + + +
+

+Retrieves the message of a JavaScript confirmation dialog generated during +the previous action. +

+

+By default, the confirm function will return true, having the same +effect as manually clicking OK. This can be changed by prior execution of +the choose_cancel_on_next_confirmation command. If a confirmation +is generated but you do not get/verify it, the next Selenium action will +fail. +

+

+NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible +dialog. +

+

+NOTE: Selenium does NOT support JavaScript confirmations that are generated +in a page‘s onload() event handler. In this case a visible +dialog WILL be generated and Selenium will hang until you manually click +OK. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_confirmation(pattern) + +
  • +
  • assert_not_confirmation(pattern) + +
  • +
  • verify_confirmation_present(pattern) + +
  • +
  • verify_not_confirmation(pattern) + +
  • +
  • wait_for_confirmation(pattern) + +
  • +
  • wait_for_not_confirmation(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 209
+209:   def store_confirmation variable_name
+210:     command 'storeConfirmation', variable_name
+211:   end
+
+
+
+
+ +
+ + + + +
+

+Has confirm() been called? +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_confirmation_present + +
  • +
  • assert_confirmation_not_present + +
  • +
  • verify_confirmation_present + +
  • +
  • verify_confirmation_not_present + +
  • +
  • wait_for_confirmation_present + +
  • +
  • wait_for_confirmation_not_present + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 128
+128:   def store_confirmation_present variable_name
+129:     command 'storeConfirmationPresent', variable_name
+130:   end
+
+
+
+
+ +
+ + + + +
+

+Return all cookies of the current page under test. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_cookie(pattern) + +
  • +
  • assert_not_cookie(pattern) + +
  • +
  • verify_cookie(pattern) + +
  • +
  • verify_not_cookie(pattern) + +
  • +
  • wait_for_cookie(pattern) + +
  • +
  • wait_for_not_cookie(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 141
+141:   def store_cookie variable_name
+142:     command 'storeCookie', variable_name
+143:   end
+
+
+
+
+ +
+ + + + +
+

+Retrieves the text cursor position in the given input element or textarea; +beware, this may not work perfectly on all browsers. +

+

+This method will fail if the specified element isn‘t an input element +or textarea, or there is no cursor in the element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_cursor_position(locator, pattern) + +
  • +
  • assert_not_cursor_position(locator, pattern) + +
  • +
  • verify_cursor_position(locator, pattern) + +
  • +
  • verify_not_cursor_position(locator, pattern) + +
  • +
  • wait_for_cursor_position(locator, pattern) + +
  • +
  • wait_for_not_cursor_position(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 158
+158:   def store_cursor_position locator, variable_name
+159:     command 'storeCursorPosition', locator, variable_name
+160:   end
+
+
+
+
+ +
+ + + + +
+

+Determines whether the specified input element is editable, i.e. +hasn‘t been disabled. This method will fail if the specified element +isn‘t an input element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_editable(locator) + +
  • +
  • assert_not_editable(locator) + +
  • +
  • verify_editable(locator) + +
  • +
  • verify_not_editable(locator) + +
  • +
  • wait_for_editable(locator) + +
  • +
  • wait_for_not_editable(locator) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 734
+734:   def store_editable locator, variable_name
+735:     command 'storeEditable', locator, variable_name
+736:   end
+
+
+
+
+ +
+ + + + +
+

+Retrieves the height of an element. This method will fail if the element is +not present. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_element_height(locator, pattern) + +
  • +
  • assert_not_element_height(locator, pattern) + +
  • +
  • verify_element_height(locator, pattern) + +
  • +
  • verify_not_element_height(locator, pattern) + +
  • +
  • wait_for_element_height(locator, pattern) + +
  • +
  • wait_for_not_element_height(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 650
+650:   def store_element_height locator, variable_name
+651:     command 'storeElementHeight', locator, variable_name
+652:   end
+
+
+
+
+ +
+ + + + +
+

+Get the relative index of an element to its parent (starting from 0). The +comment node and empty text node will be ignored. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_element_index(locator, pattern) + +
  • +
  • assert_not_element_index(locator, pattern) + +
  • +
  • verify_element_index(locator, pattern) + +
  • +
  • verify_not_element_index(locator, pattern) + +
  • +
  • wait_for_element_index(locator, pattern) + +
  • +
  • wait_for_not_element_index(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 664
+664:   def store_element_index locator, variable_name
+665:     command 'storeElementIndex', locator, variable_name
+666:   end
+
+
+
+
+ +
+ + + + +
+

+Retrieves the horizontal position of an element. This method will fail if +the element is not present. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_element_position_left(locator, pattern) + +
  • +
  • assert_not_element_position_left(locator, pattern) + +
  • +
  • verify_element_position_left(locator, pattern) + +
  • +
  • verify_not_element_position_left(locator, pattern) + +
  • +
  • wait_for_element_position_left(locator, pattern) + +
  • +
  • wait_for_not_element_position_left(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 692
+692:   def store_element_position_left locator, variable_name
+693:     command 'storeElementPositionLeft', locator, variable_name
+694:   end
+
+
+
+
+ +
+ + + + +
+

+Retrieves the vertical position of an element. This method will fail if the +element is not present. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_element_position_top(locator, pattern) + +
  • +
  • assert_not_element_position_top(locator, pattern) + +
  • +
  • verify_element_position_top(locator, pattern) + +
  • +
  • verify_not_element_position_top(locator, pattern) + +
  • +
  • wait_for_element_position_top(locator, pattern) + +
  • +
  • wait_for_not_element_position_top(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 706
+706:   def store_element_position_top locator, variable_name
+707:     command 'storeElementPositionTop', locator, variable_name
+708:   end
+
+
+
+
+ +
+ + + + +
+

+Verifies that the specified element is somewhere on the page. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_element_present(locator) + +
  • +
  • assert_element_not_present(locator) + +
  • +
  • verify_element_present(locator) + +
  • +
  • verify_element_not_present(locator) + +
  • +
  • wait_for_element_present(locator) + +
  • +
  • wait_for_element_not_present(locator) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 620
+620:   def store_element_present locator, variable_name
+621:     command 'storeElementPresent', locator, variable_name
+622:   end
+
+
+
+
+ +
+ + + + +
+

+Retrieves the width of an element. This method will fail if the element is +not present. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_element_width(locator, pattern) + +
  • +
  • assert_not_element_width(locator, pattern) + +
  • +
  • verify_element_width(locator, pattern) + +
  • +
  • verify_not_element_width(locator, pattern) + +
  • +
  • wait_for_element_width(locator, pattern) + +
  • +
  • wait_for_not_element_width(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 678
+678:   def store_element_width locator, variable_name
+679:     command 'storeElementWidth', locator, variable_name
+680:   end
+
+
+
+
+ +
+ + + + +
+

+Tell Selenium to expect an error on the next command execution. +

+

+NOTE: store_error_on_next is +currently not supported by Selenium Core and is only added to here as a +shortcut for generating the related assertions. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_error_on_next(message) + +
  • +
  • assert_not_error_on_next(message) + +
  • +
  • verify_error_on_next(message) + +
  • +
  • verify_not_error_on_next(message) + +
  • +
  • wait_for_error_on_next(message) + +
  • +
  • wait_for_not_error_on_next(message) + +
  • +
+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_accessors.rb, line 20
+20:   def store_error_on_next message
+21:     raise 'Not supported in Selenium Core at the moment'
+22:   end
+
+
+
+
+ +
+ + + + +
+

+Gets the result of evaluating the specified JavaScript snippet. The snippet +may have multiple lines, but only the result of the last line will be +returned. +

+

+Note that, by default, the snippet will run in the context of the +"selenium" object itself, so this will refer to the +Selenium object, and window will refer to the top-level runner +test window, not the window of your application. +

+

+If you need a reference to the window of your application, you can refer to +this.browserbot.getCurrentWindow() and if you need to use a +locator to refer to a single element in your application page, you can use +this.page().findElement("foo") where +"foo" is your locator. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_eval(script, pattern) + +
  • +
  • assert_not_eval(script, pattern) + +
  • +
  • verify_eval_present(script, pattern) + +
  • +
  • verify_not_eval(script, pattern) + +
  • +
  • wait_for_eval(script, pattern) + +
  • +
  • wait_for_not_eval(script, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 356
+356:   def store_eval script, variable_name
+357:     command 'storeEval', script, variable_name
+358:   end
+
+
+
+
+ +
+ + + + +
+

+Returns the specified expression. +

+

+This is useful because of JavaScript preprocessing. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_expression(expression, pattern) + +
  • +
  • assert_not_expression(expression, pattern) + +
  • +
  • verify_expression(expression, pattern) + +
  • +
  • verify_not_expression(expression, pattern) + +
  • +
  • wait_for_expression(expression, pattern) + +
  • +
  • wait_for_not_expression(expression, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 822
+822:   def store_expression expression, variable_name
+823:     command 'storeExpression', expression, variable_name
+824:   end
+
+
+
+
+ +
+ + + + +
+

+Tell Selenium to expect a failure on the next command execution. +

+

+NOTE: store_failure_on_next is +currently not supported by Selenium Core and is only added to here as a +shortcut for generating the related assertions. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_failure_on_next(message) + +
  • +
  • assert_not_failure_on_next(message) + +
  • +
  • verify_failure_on_next(message) + +
  • +
  • verify_not_failure_on_next(message) + +
  • +
  • wait_for_failure_on_next(message) + +
  • +
  • wait_for_not_failure_on_next(message) + +
  • +
+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_accessors.rb, line 37
+37:   def store_failure_on_next message
+38:     raise 'Not supported in Selenium Core at the moment'
+39:   end
+
+
+
+
+ +
+ + + + +
+

+Returns the entire HTML source between the opening and closing +"html" tags. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_html_source(pattern) + +
  • +
  • assert_not_html_source(pattern) + +
  • +
  • verify_html_source(pattern) + +
  • +
  • verify_not_html_source(pattern) + +
  • +
  • wait_for_html_source(pattern) + +
  • +
  • wait_for_not_html_source(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 807
+807:   def store_html_source variable_name
+808:     command 'storeHtmlSource', variable_name
+809:   end
+
+
+
+
+ +
+ + + + +
+

+Verify the location of the current page ends with the expected location. If +an URL querystring is provided, this is checked as well. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_location(pattern) + +
  • +
  • assert_not_location(pattern) + +
  • +
  • verify_location_present(pattern) + +
  • +
  • verify_not_location(pattern) + +
  • +
  • wait_for_location(pattern) + +
  • +
  • wait_for_not_location(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 260
+260:   def store_location expected_location, variable_name
+261:     command 'storeLocation', expected_location, variable_name
+262:   end
+
+
+
+
+ +
+ + + + +
+

+Return the contents of the log. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_log_messages(pattern) + +
  • +
  • assert_not_log_messages(pattern) + +
  • +
  • verify_log_messages(pattern) + +
  • +
  • verify_not_log_messages(pattern) + +
  • +
  • wait_for_log_messages(pattern) + +
  • +
  • wait_for_not_log_messages(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 719
+719:   def store_log_messages variable_name
+720:     command 'storeLogMessages', variable_name
+721:   end
+
+
+
+
+ +
+ + + + +
+

+Returns the number of pixels between "mousemove" events during +drag_and_drop commands (default=10). +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_mouse_speed(pattern) + +
  • +
  • assert_not_mouse_speed(pattern) + +
  • +
  • verify_mouse_speed(pattern) + +
  • +
  • verify_not_mouse_speed(pattern) + +
  • +
  • wait_for_mouse_speed(pattern) + +
  • +
  • wait_for_not_mouse_speed(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 274
+274:   def store_mouse_speed variable_name
+275:     command 'storeMouseSpeed', variable_name
+276:   end
+
+
+
+
+ +
+ + + + +
+

+Check if these two elements have same parent and are ordered. Two same +elements will not be considered ordered. +

+

+NOTE: store_ordered is +currently not supported by Selenium Core. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_ordered(locator_1, locator_2) + +
  • +
  • assert_not_ordered(locator_1, locator_2) + +
  • +
  • verify_ordered(locator_1, locator_2) + +
  • +
  • verify_not_ordered(locator_1, locator_2) + +
  • +
  • wait_for_ordered(locator_1, locator_2) + +
  • +
  • wait_for_not_ordered(locator_1, locator_2) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 593
+593:   def store_ordered locator_1, locator_2, variable_name
+594:     raise 'Not supported in Selenium Core at the moment'
+595:   end
+
+
+
+
+ +
+ + + + +
+

+Retrieves the message of a JavaScript question prompt dialog generated +during the previous action. +

+

+Successful handling of the prompt requires prior execution of the +answer_on_next_prompt command. If a prompt is generated but you do +not get/verify it, the next Selenium action will fail. +

+

+NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog. +

+

+NOTE: Selenium does NOT support JavaScript prompts that are generated in a +page‘s onload() event handler. In this case a visible dialog +WILL be generated and Selenium will hang until someone manually clicks OK. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_prompt(pattern) + +
  • +
  • assert_not_prompt(pattern) + +
  • +
  • verify_prompt_present(pattern) + +
  • +
  • verify_not_prompt(pattern) + +
  • +
  • wait_for_prompt(pattern) + +
  • +
  • wait_for_not_prompt(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 233
+233:   def store_prompt variable_name
+234:     command 'storePrompt', variable_name
+235:   end
+
+
+
+
+ +
+ + + + +
+

+Has a prompt occurred? +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_prompt_present + +
  • +
  • assert_prompt_not_present + +
  • +
  • verify_prompt_present + +
  • +
  • verify_prompt_not_present + +
  • +
  • wait_for_prompt_present + +
  • +
  • wait_for_prompt_not_present + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 115
+115:   def store_prompt_present variable_name
+116:     command 'storePromptPresent', variable_name
+117:   end
+
+
+
+
+ +
+ + + + +
+

+Gets all option labels in the specified select drop-down. +

+

+The pattern for the automatically generated assertions can either +take an array or a pattern. +

+
+ assert_select_options 'fruits', ['apple', 'pear']
+ assert_select_options 'fruits', 'a*,p*'
+
+

+Related Assertions, automatically generated: +

+
    +
  • assert_select_options(locator, pattern) + +
  • +
  • assert_not_select_options(locator, pattern) + +
  • +
  • verify_select_options_present(locator, pattern) + +
  • +
  • verify_not_select_options(locator, pattern) + +
  • +
  • wait_for_select_options(locator, pattern) + +
  • +
  • wait_for_not_select_options(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 564
+564:   def store_select_options locator, variable_name
+565:     command 'storeSelectOptions', locator, variable_name
+566:   end
+
+
+
+
+ +
+ + + + +
+

+Verifies that the selected option of a drop-down satisfies the +option_locator. +

+

+option_locator is typically just an option label (e.g. "John +Smith"). +

+

+See the select command for more information about option locators. +

+

+NOTE: store_selected is +currently not supported by Selenium Core. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected(locator, option_locator) + +
  • +
  • assert_not_selected(locator, option_locator) + +
  • +
  • verify_selected_present(locator, option_locator) + +
  • +
  • verify_not_selected(locator, option_locator) + +
  • +
  • wait_for_selected(locator, option_locator) + +
  • +
  • wait_for_not_selected(locator, option_locator) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 403
+403:   def store_selected locator, option_locator, variable_name
+404:     raise 'Not supported in Selenium Core at the moment'
+405:   end
+
+
+
+
+ +
+ + + + +
+

+Gets option element ID for selected option in the specified select element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected_id(select_locator, pattern) + +
  • +
  • assert_not_selected_id(select_locator, pattern) + +
  • +
  • verify_selected_id(select_locator, pattern) + +
  • +
  • verify_not_selected_id(select_locator, pattern) + +
  • +
  • wait_for_selected_id(select_locator, pattern) + +
  • +
  • wait_for_not_selected_id(select_locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 416
+416:   def store_selected_id select_locator, variable_name
+417:     command 'storeSelectedId', select_locator, variable_name
+418:   end
+
+
+
+
+ +
+ + + + +
+

+Gets all option element IDs for selected options in the specified select or +multi-select element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected_ids(select_locator, pattern) + +
  • +
  • assert_not_selected_ids(select_locator, pattern) + +
  • +
  • verify_selected_ids(select_locator, pattern) + +
  • +
  • verify_not_selected_ids(select_locator, pattern) + +
  • +
  • wait_for_selected_ids(select_locator, pattern) + +
  • +
  • wait_for_not_selected_ids(select_locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 430
+430:   def store_selected_ids select_locator, variable_name
+431:     command 'storeSelectedIds', select_locator, variable_name
+432:   end
+
+
+
+
+ +
+ + + + +
+

+Gets option index (option number, starting at 0) for selected option in the +specified select element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected_index(select_locator, pattern) + +
  • +
  • assert_not_selected_index(select_locator, pattern) + +
  • +
  • verify_selected_index(select_locator, pattern) + +
  • +
  • verify_not_selected_index(select_locator, pattern) + +
  • +
  • wait_for_selected_index(select_locator, pattern) + +
  • +
  • wait_for_not_selected_index(select_locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 444
+444:   def store_selected_index select_locator, variable_name
+445:     command 'storeSelectedIndex', select_locator, variable_name
+446:   end
+
+
+
+
+ +
+ + + + +
+

+Gets all option indexes (option number, starting at 0) for selected options +in the specified select or multi-select element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected_indexes(select_locator, pattern) + +
  • +
  • assert_not_selected_indexes(select_locator, pattern) + +
  • +
  • verify_selected_indexes(select_locator, pattern) + +
  • +
  • verify_not_selected_indexes(select_locator, pattern) + +
  • +
  • wait_for_selected_indexes(select_locator, pattern) + +
  • +
  • wait_for_not_selected_indexes(select_locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 458
+458:   def store_selected_indexes select_locator, variable_name
+459:     command 'storeSelectedIndexes', select_locator, variable_name
+460:   end
+
+
+
+
+ +
+ + + + +
+

+Gets option label (visible text) for selected option in the specified +select element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected_label(select_locator, pattern) + +
  • +
  • assert_not_selected_label(select_locator, pattern) + +
  • +
  • verify_selected_label(select_locator, pattern) + +
  • +
  • verify_not_selected_label(select_locator, pattern) + +
  • +
  • wait_for_selected_label(select_locator, pattern) + +
  • +
  • wait_for_not_selected_label(select_locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 472
+472:   def store_selected_label select_locator, variable_name
+473:     command 'storeSelectedLabel', select_locator, variable_name
+474:   end
+
+
+
+
+ +
+ + + + +
+

+Gets all option labels (visible text) for selected options in the specified +select or multi-select element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected_labels(select_locator, pattern) + +
  • +
  • assert_not_selected_labels(select_locator, pattern) + +
  • +
  • verify_selected_labels(select_locator, pattern) + +
  • +
  • verify_not_selected_labels(select_locator, pattern) + +
  • +
  • wait_for_selected_labels(select_locator, pattern) + +
  • +
  • wait_for_not_selected_labels(select_locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 486
+486:   def store_selected_labels select_locator, variable_name
+487:     command 'storeSelectedLabels', select_locator, variable_name
+488:   end
+
+
+
+
+ +
+ + + + +
+

+Gets all option labels for selected options in the specified select or +multi-select element. +

+

+The pattern for the automatically generated assertions can either +take an array or a pattern. +

+
+ assert_selected_options 'fruits', ['apple', 'pear']
+ assert_selected_options 'fruits', 'a*,p*'
+
+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected_options(locator, pattern) + +
  • +
  • assert_not_selected_options(locator, pattern) + +
  • +
  • verify_selected_options_present(locator, pattern) + +
  • +
  • verify_not_selected_options(locator, pattern) + +
  • +
  • wait_for_selected_options(locator, pattern) + +
  • +
  • wait_for_not_selected_options(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 546
+546:   def store_selected_options locator, variable_name
+547:     command 'storeSelectedOptions', locator, variable_name
+548:   end
+
+
+
+
+ +
+ + + + +
+

+Gets option value (value attribute) for selected option in the specified +select element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected_value(select_locator, pattern) + +
  • +
  • assert_not_selected_value(select_locator, pattern) + +
  • +
  • verify_selected_value(select_locator, pattern) + +
  • +
  • verify_not_selected_value(select_locator, pattern) + +
  • +
  • wait_for_selected_value(select_locator, pattern) + +
  • +
  • wait_for_not_selected_value(select_locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 500
+500:   def store_selected_value select_locator, variable_name
+501:     command 'storeSelectedValue', select_locator, variable_name
+502:   end
+
+
+
+
+ +
+ + + + +
+

+Gets all option values (value attribute) for selected options in the +specified select or multi-select element. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_selected_values(select_locator, pattern) + +
  • +
  • assert_not_selected_values(select_locator, pattern) + +
  • +
  • verify_selected_values(select_locator, pattern) + +
  • +
  • verify_not_selected_values(select_locator, pattern) + +
  • +
  • wait_for_selected_values(select_locator, pattern) + +
  • +
  • wait_for_not_selected_values(select_locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 514
+514:   def store_selected_values select_locator, variable_name
+515:     command 'storeSelectedValues', select_locator, variable_name
+516:   end
+
+
+
+
+ +
+ + + + +
+

+Determines whether some option in a drop-down menu is selected. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_something_selected(select_locator) + +
  • +
  • assert_not_something_selected(select_locator) + +
  • +
  • verify_something_selected(select_locator) + +
  • +
  • verify_not_something_selected(select_locator) + +
  • +
  • wait_for_something_selected(select_locator) + +
  • +
  • wait_for_not_something_selected(select_locator) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 527
+527:   def store_something_selected select_locator, variable_name
+528:     command 'storeSomethingSelected', select_locator, variable_name
+529:   end
+
+
+
+
+ +
+ + + + +
+

+Gets the text from a cell of a table. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_table(locator, row, column, pattern) + +
  • +
  • assert_not_table(locator, row, column, pattern) + +
  • +
  • verify_table_present(locator, row, column, pattern) + +
  • +
  • verify_not_table(locator, row, column, pattern) + +
  • +
  • wait_for_table(locator, row, column, pattern) + +
  • +
  • wait_for_not_table(locator, row, column, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 383
+383:   def store_table locator, row, column, variable_name
+384:     command 'storeTable', "#{locator}.#{row}.#{column}", variable_name
+385:   end
+
+
+
+
+ +
+ + + + +
+

+Gets the text of an element. This works for any element that contains text. +This command uses either the textContent (Mozilla-like browsers) +or the innerText (IE-like browsers) of the element, which is the +rendered text shown to the user. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_text(locator, pattern) + +
  • +
  • assert_not_text(locator, pattern) + +
  • +
  • verify_text_present(locator, pattern) + +
  • +
  • verify_not_text(locator, pattern) + +
  • +
  • wait_for_text(locator, pattern) + +
  • +
  • wait_for_not_text(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 331
+331:   def store_text locator, variable_name
+332:     command 'storeText', locator, variable_name
+333:   end
+
+
+
+
+ +
+ + + + +
+

+Verifies that the specified text pattern appears somewhere on the rendered +page shown to the user. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_text_present(pattern) + +
  • +
  • assert_text_not_present(pattern) + +
  • +
  • verify_text_present(pattern) + +
  • +
  • verify_text_not_present(pattern) + +
  • +
  • wait_for_text_present(pattern) + +
  • +
  • wait_for_text_not_present(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 607
+607:   def store_text_present pattern, variable_name
+608:     command 'storeTextPresent', pattern, variable_name
+609:   end
+
+
+
+
+ +
+ + + + +
+

+Gets the title of the current page. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_title(pattern) + +
  • +
  • assert_not_title(pattern) + +
  • +
  • verify_title_present(pattern) + +
  • +
  • verify_not_title(pattern) + +
  • +
  • wait_for_title(pattern) + +
  • +
  • wait_for_not_title(pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 287
+287:   def store_title variable_name
+288:     command 'storeTitle', variable_name
+289:   end
+
+
+
+
+ +
+ + + + +
+

+Gets the (whitespace-trimmed) value of an input field (or anything else +with a value parameter). For checkbox/radio elements, the value will be +"on" or "off" depending on whether the element is +checked or not. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_value(locator, pattern) + +
  • +
  • assert_not_value(locator, pattern) + +
  • +
  • verify_value_present(locator, pattern) + +
  • +
  • verify_not_value(locator, pattern) + +
  • +
  • wait_for_value(locator, pattern) + +
  • +
  • wait_for_not_value(locator, pattern) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 315
+315:   def store_value locator, variable_name
+316:     command 'storeValue', locator, variable_name
+317:   end
+
+
+
+
+ +
+ + + + +
+

+Determines if the specified element is visible. An element can be rendered +invisible by setting the CSS "visibility" property to +"hidden", or the "display" property to +"none", either for the element itself or one if its ancestors. +This method will fail if the element is not present. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_visible(locator) + +
  • +
  • assert_not_visible(locator) + +
  • +
  • verify_visible(locator) + +
  • +
  • verify_not_visible(locator) + +
  • +
  • wait_for_visible(locator) + +
  • +
  • wait_for_not_visible(locator) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 636
+636:   def store_visible locator, variable_name
+637:     command 'storeVisible', locator, variable_name
+638:   end
+
+
+
+
+ +
+ + + + +
+

+Determine whether current/locator identify the frame containing this +running code. +

+

+This is useful in proxy injection mode, where this code runs in every +browser frame and window, and sometimes the selenium server needs to +identify the "current" frame. In this case, when the test calls +select_frame, this routine is called for each frame to figure out which one +has been selected. The selected frame will return true, while all others +will return false. +

+

+NOTE: store_whether_this_frame_match_frame_expression +is currently not supported by Selenium Core. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_whether_this_frame_match_frame_expression(current_frame_string, +target) + +
  • +
  • assert_not_whether_this_frame_match_frame_expression(current_frame_string, +target) + +
  • +
  • verify_whether_this_frame_match_frame_expression(current_frame_string, +target) + +
  • +
  • verify_not_whether_this_frame_match_frame_expression(current_frame_string, +target) + +
  • +
  • wait_for_whether_this_frame_match_frame_expression(current_frame_string, +target) + +
  • +
  • wait_for_not_whether_this_frame_match_frame_expression(current_frame_string, +target) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 846
+846:   def store_whether_this_frame_match_frame_expression current_frame_string, target, variable_name
+847:     raise 'Not supported in Selenium Core at the moment'
+848:   end
+
+
+
+
+ +
+ + + + +
+

+Determine whether current_window_string plus target identify the window +containing this running code. +

+

+This is useful in proxy injection mode, where this code runs in every +browser frame and window, and sometimes the selenium server needs to +identify the "current" window. In this case, when the test calls +select_window, this routine is called for each window to figure out which +one has been selected. The selected window will return true, while all +others will return false. +

+

+NOTE: store_whether_this_window_match_window_expression +is currently not supported by Selenium Core. +

+

+Related Assertions, automatically generated: +

+
    +
  • assert_whether_this_window_match_window_expression(current_window_string, +target) + +
  • +
  • assert_not_whether_this_window_match_window_expression(current_window_string, +target) + +
  • +
  • verify_whether_this_window_match_window_expression(current_window_string, +target) + +
  • +
  • verify_not_whether_this_window_match_window_expression(current_window_string, +target) + +
  • +
  • wait_for_whether_this_window_match_window_expression(current_window_string, +target) + +
  • +
  • wait_for_not_whether_this_window_match_window_expression(current_window_string, +target) + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_accessors.rb, line 869
+869:   def store_whether_this_window_match_window_expression current_window_string, target, variable_name
+870:     raise 'Not supported in Selenium Core at the moment'
+871:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderActions.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderActions.html index f9d605f0..ca560c1f 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderActions.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderActions.html @@ -1,1050 +1,2080 @@ - - - - - - Module: SeleniumOnRails::TestBuilderActions - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::TestBuilderActions
In: - - lib/selenium_on_rails/test_builder_actions.rb - -
-
-
- - -
- - - -
- -
-

-The actions available for SeleniumOnRails::TestBuilder tests. -

-

-For each action foo there’s also an action -foo_and_wait. -

- -
- - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Add a selection to the set of selected options in a multi-select element -using an option locator. -

-

-See the select -command for more information about option locators. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 142
-142:   def add_selection locator, option_locator
-143:     command 'addSelection', locator, option_locator
-144:   end
-
-
-
-
- -
- - - - -
-

-Instructs Selenium to return the specified answer string in response to the -next JavaScript prompt (window.prompt()). -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 193
-193:   def answer_on_next_prompt answer
-194:     command 'answerOnNextPrompt', answer
-195:   end
-
-
-
-
- -
- - - - -
-

-Check a toggle-button (checkbox/radio). -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 102
-102:   def check locator
-103:     command 'check', locator
-104:   end
-
-
-
-
- -
- - - - -
-

-By default, Selenium’s overridden window.confirm() function -will return true, as if the user had manually clicked OK. After -running this command, the next call to confirm() will return -false, as if the user had clicked Cancel. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 187
-187:   def choose_cancel_on_next_confirmation
-188:     command 'chooseCancelOnNextConfirmation'
-189:   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. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 47
-47:   def click locator
-48:     command 'click', locator
-49:   end
-
-
-
-
- -
- - - - -
-

-Simulates the user clicking the "close" button in the titlebar of -a popup window or tab. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 209
-209:   def close
-210:     command 'close'
-211:   end
-
-
-
-
- -
- - - - -
-

-Explicitly simulate an event (e.g. "focus", -"blur"), to trigger the corresponding -"on_event_" handler. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 53
-53:   def fire_event locator, event_name
-54:     command 'fireEvent', locator, event_name
-55:   end
-
-
-
-
- -
- - - - -
-

-Simulates the user clicking the "back" button on their browser. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 198
-198:   def go_back
-199:     command 'goBack'
-200:   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
-
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 39
-39:   def include_partial path, local_assigns = {}
-40:     partial = @view.render :partial => path, :locals => local_assigns
-41:     @output << partial
-42:   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. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 69
-69:   def key_down locator, keycode
-70:     command 'keyDown', locator, keycode
-71:   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. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 61
-61:   def key_press locator, keycode
-62:     command 'keyPress', locator, keycode
-63:   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. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 77
-77:   def key_up locator, keycode
-78:     command 'keyUp', locator, keycode
-79:   end
-
-
-
-
- -
- - - - -
-

-Simulates a user pressing the mouse button (without releasing it yet) on -the specified element. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 88
-88:   def mouse_down locator
-89:     command 'mouseDown', locator
-90:   end
-
-
-
-
- -
- - - - -
-

-Simulates a user hovering a mouse over the specified element. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 82
-82:   def mouse_over locator
-83:     command 'mouseOver', locator
-84:   end
-
-
-
-
- -
- - - - -
-

-Opens an URL in the test frame. This accepts both relative and absolute -URLs. The open 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). -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 166
-166:   def open url
-167:     command 'open', url_arg(url)
-168:   end
-
-
-
-
- -
- - - - -
-

-Simulates the user clicking the "Refresh" button on their -browser. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 203
-203:   def refresh
-204:     command 'refresh'
-205:   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. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 150
-150:   def remove_selection locator, option_locator
-151:     command 'removeSelection', locator, option_locator
-152:   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. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 134
-134:   def select locator, option_locator
-135:     command 'select', locator, option_locator
-136:   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. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 172
-172:   def select_window window_id
-173:     command 'selectWindow', window_id||'null'
-174:   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, :debug, -:info, :warn or :error. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 219
-219:   def set_context context, log_level_threshold = nil
-220:     if log_level_threshold
-221:       command 'setContext', context, log_level_threshold.to_s
-222:     else
-223:       command 'setContext', context
-224:     end
-225:   end
-
-
-
-
- -
- - - - -
-

-Specifies the amount of time that Selenium will wait for actions to -complete. -

-

-Actions that require waiting include open and the -wait_for* actions. -

-

-The default timeout is 30 seconds. -

-

-timeout is specified in milliseconds. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 251
-251:   def set_timeout timeout
-252:     command 'setTimeout', timeout
-253:   end
-
-
-
-
- -
- - - - -
-

-Tell Selenium on Rails to clear the session and load any fixtures. DO NOT -CALL THIS AGAINST NON-TEST DATABASES. The supported options are -:keep_session, :fixtures and :clear_tables -

-
-  setup
-  setup :keep_session
-  setup :fixtures => :all
-  setup :keep_session, :fixtures => [:foo, :bar]
-  setup :clear_tables => [:foo, :bar]
-
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 14
-14:   def setup options = {}
-15:     options = {options => nil} unless options.is_a? Hash
-16: 
-17:     opts = {:controller => 'selenium', :action => 'setup'}
-18:     opts[:keep_session] = true if options.has_key? :keep_session
-19: 
-20:     [:fixtures, :clear_tables].each do |key|
-21:       if (f = options[key])
-22:         f = [f] unless f.is_a? Array
-23:         opts[key] = f.join ','
-24:       end
-25:     end
-26: 
-27:     open opts
-28:   end
-
-
-
-
- -
- - - - -
-

-Submit the specified form. This is particularly useful for forms without -submit buttons, e.g. single-input "Search" forms. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 156
-156:   def submit locator
-157:     command 'submit', locator
-158:   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. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 97
-97:   def type locator, value
-98:     command 'type', locator, value
-99:   end
-
-
-
-
- -
- - - - -
-

-Uncheck a toggle-button (checkbox/radio). -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 107
-107:   def uncheck locator
-108:     command 'uncheck', locator
-109:   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 -selenium.browserbot.getCurrentWindow(), and then run your -JavaScript in there. -

-

-timeout is specified in milliseconds. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 238
-238:   def wait_for_condition script, timeout
-239:     command 'waitForCondition', script, timeout
-240:   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. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 268
-268:   def wait_for_page_to_load timeout
-269:     command 'waitForPageToLoad', timeout
-270:   end
-
-
-
-
- -
- - - - -
-

-Waits for a popup window to appear and load up. -

-

-The timeout is specified in milliseconds. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 179
-179:   def wait_for_popup window_id, timeout
-180:     command 'waitForPopUp', window_id||'null', timeout
-181:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Module: SeleniumOnRails::TestBuilderActions + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumOnRails::TestBuilderActions
In: + + lib/selenium_on_rails/test_builder_actions.rb + +
+
+
+ + +
+ + + +
+ +
+

+The actions available for SeleniumOnRails::TestBuilder tests. +

+

+For each action foo there‘s also an action +foo_and_wait. +

+ +
+ + +
+ +
+

Methods

+ + +
+ +
+ + + + +
+ + + + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

+Add a selection to the set of selected options in a multi-select element using an option +locator. +

+

+See the select +command for more information about option locators. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 148
+148:   def add_selection locator, option_locator
+149:     command 'addSelection', locator, option_locator
+150:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates the user pressing the alt key and hold it down until do_alt_up() +is called or a new page is loaded. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 221
+221:   def alt_key_down
+222:     command 'altKeyDown'
+223:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates the user releasing the alt key. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 226
+226:   def alt_key_up
+227:     command 'altKeyUp'
+228:   end
+
+
+
+
+ +
+ + + + +
+

+Instructs Selenium to return the specified answer string in response to the +next JavaScript prompt (window.prompt()). +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 199
+199:   def answer_on_next_prompt answer
+200:     command 'answerOnNextPrompt', answer
+201:   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: break is a reserved word in Ruby, so we have to simulate +Selenium core‘s break() with brake() +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 236
+236:   def brake
+237:     command 'break'
+238:   end
+
+
+
+
+ +
+ + + + +
+

+Check a toggle-button (checkbox/radio). +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 108
+108:   def check locator
+109:     command 'check', locator
+110:   end
+
+
+
+
+ +
+ + + + +
+

+By default, Selenium‘s overridden window.confirm() function +will return true, as if the user had manually clicked OK. After +running this command, the next call to confirm() will return +false, as if the user had clicked Cancel. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 193
+193:   def choose_cancel_on_next_confirmation
+194:     command 'chooseCancelOnNextConfirmation'
+195:   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. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 47
+47:   def click locator
+48:     command 'click', locator
+49:   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. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 53
+53:   def click_at locator, coord_string
+54:     command 'clickAt', locator, coord_string
+55:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates the user clicking the "close" button in the +titlebar of a popup window or tab. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 215
+215:   def close
+216:     command 'close'
+217:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates the user pressing the alt key and hold it down until +do_control_up() is called or a new page is loaded. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 242
+242:   def control_key_down
+243:     command 'controlKeyDown'
+244:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates the user releasing the control key. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 247
+247:   def control_key_up
+248:     command 'controlKeyUp'
+249:   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: +

+
    +
  • name_value_pair - name and value of the cookie in a format +"name=value" + +
  • +
  • options_string - options for the cookie. Currently supported +options include ‘path’ and ‘max_age’. The +options_string‘s format is "path=/path/, +max_age=60". The order of options are irrelevant, the unit of the +value of ‘max_age’ is second. + +
  • +
+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 260
+260:   def create_cookie name_value_pair, options_string
+261:     command 'createCookie', name_value_pair, options_string
+262:   end
+
+
+
+
+ +
+ + + + +
+

+Delete a named cookie with specified path. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 265
+265:   def delete_cookie name, path
+266:     command 'deleteCookie', name, path
+267:   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 wait_for_page_to_load. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 271
+271:   def double_click locator
+272:     command 'doubleClick', locator
+273:   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 wait_for_page_to_load. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 277
+277:   def double_click_at locator, coord_string
+278:     command 'doubleClickAt', locator, coord_string
+279:   end
+
+
+
+
+ +
+ + + + +
+

+Drags an element a certain distance and then drops it. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 282
+282:   def drag_and_drop locator, movements_string
+283:     command 'dragAndDrop', locator, movements_string
+284:   end
+
+
+
+
+ +
+ + + + +
+

+Drags an element and drops it on another element. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 287
+287:   def drag_and_drop_to_object locator_of_object_to_be_dragged, locator_of_drag_destination_object
+288:     command 'dragAndDropToObject', locator_of_object_to_be_dragged, locator_of_drag_destination_object
+289:   end
+
+
+
+
+ +
+ + + + +
+

+Prints the specified message into the third table cell in your Selenese tables. Useful for debugging. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 294
+294:   def echo message
+295:     command 'echo', message
+296:   end
+
+
+
+
+ +
+ + + + +
+

+Explicitly simulate an event (e.g. "focus", +"blur"), to trigger the corresponding +"on_event_" handler. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 59
+59:   def fire_event locator, event_name
+60:     command 'fireEvent', locator, event_name
+61:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates the user clicking the "back" button on their browser. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 204
+204:   def go_back
+205:     command 'goBack'
+206:   end
+
+
+
+
+ +
+ + + + +
+

+Briefly changes the backgroundColor of the specified element yellow. Useful +for debugging. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 300
+300:   def highlight locator
+301:     command 'highlight', locator
+302:   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
+
+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 39
+39:   def include_partial path, local_assigns = {}
+40:     partial = @view.render :partial => path, :locals => local_assigns
+41:     @output << partial
+42:   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. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 75
+75:   def key_down locator, keycode
+76:     command 'keyDown', locator, keycode
+77:   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. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 67
+67:   def key_press locator, keycode
+68:     command 'keyPress', locator, keycode
+69:   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. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 83
+83:   def key_up locator, keycode
+84:     command 'keyUp', locator, keycode
+85:   end
+
+
+
+
+ +
+ + + + +
+

+Press the meta key and hold it down until doMetaUp() is called or +a new page is loaded. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 306
+306:   def meta_key_down
+307:     command 'metaKeyDown'
+308:   end
+
+
+
+
+ +
+ + + + +
+

+Release the meta key. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 311
+311:   def meta_key_up
+312:     command 'metaKeyUp'
+313:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates a user pressing the mouse button (without releasing it yet) on +the specified element. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 94
+94:   def mouse_down locator
+95:     command 'mouseDown', locator
+96:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates a user pressing the mouse button (without releasing it yet) on +the specified element. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 317
+317:   def mouse_down_at locator, coord_string
+318:     command 'mouseDownAt', locator, coord_string
+319:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates a user moving the mouse. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 322
+322:   def mouse_move locator
+323:     command 'mouseMove', locator
+324:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates a user moving the mouse relative to the specified element. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 327
+327:   def mouse_move_at locator, coord_string
+328:     command 'mouseMoveAt', locator, coord_string
+329:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates the user moving the mouse off the specified element. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 332
+332:   def mouse_out locator
+333:     command 'mouseOut', locator
+334:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates a user hovering a mouse over the specified element. +

+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 88
+88:   def mouse_over locator
+89:     command 'mouseOver', locator
+90:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates the user releasing the mouse button on the specified element. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 337
+337:   def mouse_up locator
+338:     command 'mouseUp', locator
+339:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates a user pressing the mouse button (without releasing it yet) on +the specified element. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 343
+343:   def mouse_up_at locator, coord_string
+344:     command 'mouseUpAt', locator, coord_string
+345:   end
+
+
+
+
+ +
+ + + + +
+

+Opens an URL in the test frame. This accepts both relative and absolute +URLs. The open +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). +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 172
+172:   def open url
+173:     command 'open', url_arg(url)
+174:   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 select_window 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: open_window("", +"myFunnyWindow"). +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 355
+355:   def open_window url, window_id
+356:     command 'openWindow', url, window_id
+357:   end
+
+
+
+
+ +
+ + + + +
+

+Wait for the specified amount of time (in milliseconds). +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 360
+360:   def pause wait_time
+361:     command 'pause', wait_time
+362:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates the user clicking the "Refresh" button on their +browser. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 209
+209:   def refresh
+210:     command 'refresh'
+211:   end
+
+
+
+
+ +
+ + + + +
+

+Unselects all of the selected options in a multi-select element. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 365
+365:   def remove_all_selections locator
+366:     command 'removeAllSelections', locator
+367:   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. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 156
+156:   def remove_selection locator, option_locator
+157:     command 'removeSelection', locator, option_locator
+158:   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. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 140
+140:   def select locator, option_locator
+141:     command 'select', locator, option_locator
+142:   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: dom=frames["main"].frames +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 375
+375:   def select_frame locator
+376:     command 'selectFrame', locator
+377:   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. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 178
+178:   def select_window window_id
+179:     command 'selectWindow', window_id||'null'
+180:   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, :debug, +:info, :warn or :error. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 448
+448:   def set_context context, log_level_threshold = nil
+449:     if log_level_threshold
+450:       command 'setContext', context, log_level_threshold.to_s
+451:     else
+452:       command 'setContext', context
+453:     end
+454:   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. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 381
+381:   def set_cursor_position locator, position
+382:     command 'setCursorPosition', locator, position
+383:   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. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 393
+393:   def set_mouse_speed pixels
+394:     command 'setMouseSpeed', pixels
+395:   end
+
+
+
+
+ +
+ + + + +
+

+Specifies the amount of time that Selenium will wait for actions to +complete. +

+

+Actions that require waiting include open and the +wait_for* actions. +

+

+The default timeout is 30 seconds. +

+

+timeout is specified in milliseconds. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 480
+480:   def set_timeout timeout
+481:     command 'setTimeout', timeout
+482:   end
+
+
+
+
+ +
+ + + + +
+

+Tell Selenium on Rails to clear the session and load any fixtures. DO NOT +CALL THIS AGAINST NON-TEST DATABASES. The supported options are +:keep_session, :fixtures and :clear_tables +

+
+  setup
+  setup :keep_session
+  setup :fixtures => :all
+  setup :keep_session, :fixtures => [:foo, :bar]
+  setup :clear_tables => [:foo, :bar]
+
+

[Source]

+
+
+    # File lib/selenium_on_rails/test_builder_actions.rb, line 14
+14:   def setup options = {}
+15:     options = {options => nil} unless options.is_a? Hash
+16: 
+17:     opts = {:controller => 'selenium', :action => 'setup'}
+18:     opts[:keep_session] = true if options.has_key? :keep_session
+19: 
+20:     [:fixtures, :clear_tables].each do |key|
+21:       if (f = options[key])
+22:         f = [f] unless f.is_a? Array
+23:         opts[key] = f.join ','
+24:       end
+25:     end
+26: 
+27:     open opts
+28:   end
+
+
+
+
+ +
+ + + + +
+

+Press the shift key and hold it down until doShiftUp() is called +or a new page is loaded. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 399
+399:   def shift_key_down
+400:     command 'shiftKeyDown'
+401:   end
+
+
+
+
+ +
+ + + + +
+

+Release the shift key. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 404
+404:   def shift_key_up
+405:     command 'shiftKeyUp'
+406:   end
+
+
+
+
+ +
+ + + + +
+

+This command is a synonym for store_expression. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 409
+409:   def store expression, variable_name
+410:     command 'store', expression, variable_name
+411:   end
+
+
+
+
+ +
+ + + + +
+

+Submit the specified form. This is particularly useful for forms without submit buttons, e.g. +single-input "Search" forms. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 162
+162:   def submit locator
+163:     command 'submit', locator
+164:   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. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 103
+103:   def type locator, value
+104:     command 'type', locator, value
+105:   end
+
+
+
+
+ +
+ + + + +
+

+Simulates keystroke events on the specified element, as though you typed +the value key-by-key. +

+

+This is a convenience method for calling key_down, key_up, key_press 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 "type_keys" 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 "type_keys" command to +send the keystroke events corresponding to what you just typed. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 428
+428:   def type_keys locator, value
+429:     command 'typeKeys', locator, value
+430:   end
+
+
+
+
+ +
+ + + + +
+

+Uncheck a toggle-button (checkbox/radio). +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 113
+113:   def uncheck locator
+114:     command 'uncheck', locator
+115:   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 +selenium.browserbot.getCurrentWindow(), and then run your +JavaScript in there. +

+

+timeout is specified in milliseconds. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 467
+467:   def wait_for_condition script, timeout
+468:     command 'waitForCondition', script, timeout
+469:   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. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 497
+497:   def wait_for_page_to_load timeout
+498:     command 'waitForPageToLoad', timeout
+499:   end
+
+
+
+
+ +
+ + + + +
+

+Waits for a popup window to appear and load up. +

+

+The timeout is specified in milliseconds. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 185
+185:   def wait_for_popup window_id, timeout
+186:     command 'waitForPopUp', window_id||'null', timeout
+187:   end
+
+
+
+
+ +
+ + + + +
+

+Gives focus to a window. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 433
+433:   def window_focus window_name
+434:     command 'windowFocus', window_name
+435:   end
+
+
+
+
+ +
+ + + + +
+

+Resize window to take up the entire screen. +

+

[Source]

+
+
+     # File lib/selenium_on_rails/test_builder_actions.rb, line 438
+438:   def window_maximize window_name
+439:     command 'windowMaximize', window_name
+440:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserAccessors.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserAccessors.html new file mode 100644 index 00000000..8b2d19aa --- /dev/null +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserAccessors.html @@ -0,0 +1,116 @@ + + + + + + Module: SeleniumOnRails::TestBuilderUserAccessors + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumOnRails::TestBuilderUserAccessors
In: + + lib/selenium_on_rails/test_builder.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 +

+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserActions.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserActions.html new file mode 100644 index 00000000..b163ba01 --- /dev/null +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserActions.html @@ -0,0 +1,116 @@ + + + + + + Module: SeleniumOnRails::TestBuilderUserActions + + + + + + + + + + +
+ + + + + + + + + + +
ModuleSeleniumOnRails::TestBuilderUserActions
In: + + lib/selenium_on_rails/test_builder.rb + +
+
+
+ + +
+ + + +
+ +
+

+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 +

+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRailsConfig.html b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRailsConfig.html index 960d3b15..04f8f8e5 100644 --- a/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRailsConfig.html +++ b/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRailsConfig.html @@ -1,150 +1,150 @@ - - - - - - Class: SeleniumOnRailsConfig - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumOnRailsConfig
In: - - lib/selenium_on_rails_config.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- get   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails_config.rb, line 5
- 5:   def self.get var, default = nil
- 6:     value = configs[var.to_s]
- 7:     value ||= @@defaults[var]
- 8:     value ||= default
- 9:     value ||= yield if block_given?
-10:     value
-11:   end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + Class: SeleniumOnRailsConfig + + + + + + + + + + +
+ + + + + + + + + + + + + + +
ClassSeleniumOnRailsConfig
In: + + lib/selenium_on_rails_config.rb + +
+
Parent: + Object +
+
+ + +
+ + + +
+ + + +
+ +
+

Methods

+ +
+ get   +
+
+ +
+ + + + +
+ + + + + + + + + +
+

Public Class methods

+ +
+ + + + +
+

[Source]

+
+
+    # File lib/selenium_on_rails_config.rb, line 5
+ 5:   def self.get var, default = nil
+ 6:     value = configs[var.to_s]
+ 7:     value ||= @@defaults[var]
+ 8:     value ||= default
+ 9:     value ||= yield if block_given?
+10:     value
+11:   end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/CHANGELOG.html b/vendor/plugins/selenium-on-rails/doc/files/CHANGELOG.html new file mode 100644 index 00000000..e367af7f --- /dev/null +++ b/vendor/plugins/selenium-on-rails/doc/files/CHANGELOG.html @@ -0,0 +1,422 @@ + + + + + + File: CHANGELOG + + + + + + + + + + +
+

CHANGELOG

+ + + + + + + + + +
Path:CHANGELOG +
Last Update:Sat Feb 03 23:49:15 +0100 2007
+
+ + +
+ + + +
+ +
+

REVISION 38

+

change made by Flanagan

+
    +
  • SOR-13 Corrected an +omission of require statements. + +
  • +
+

REVISION 37

+

change made by Flanagan

+
    +
  • Undone an unwanted commit of modified Rakefile. + +
  • +
+

REVISION 36

+

change made by Flanagan

+
    +
  • SOR-13 Added +(experimental) support for user-extensions.js. + +
  • +
+

REVISION 35

+

all changes made by Jonas

+
    +
  • 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

+

all changes made by Flanagan

+
    +
  • 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, |verify_checked|my_checkbox|true| will be interpreted +as |verify_checked|my_checkboxtrue|| so change the test to +|verify_checked|my_checkbox|| +

+
    +
  • SOR-9 Added Mac OS X +browsers to config.yml.example + +
  • +
  • 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: +

+
    +
  • brake (alias for selenium-core‘s break, a reserved word in +Ruby) + +
  • +
  • echo, :string + +
  • +
  • highlight, :locator + +
  • +
+

+Keyboard events: +

+
    +
  • alt_key_down + +
  • +
  • alt_key_up + +
  • +
  • control_key_down + +
  • +
  • control_key_up + +
  • +
  • meta_key_down + +
  • +
  • meta_key_up + +
  • +
  • shift_key_down + +
  • +
  • shift_key_up + +
  • +
  • type_keys, :locator, :string + +
  • +
+

+Mouse events: +

+
    +
  • click_at, :locator, :coord_string + +
  • +
  • double_click, :locator + +
  • +
  • double_click_at, :locator, :coord_string + +
  • +
  • drag_and_drop, :locator, :movements_string + +
  • +
  • drag_and_drop_to_object, :locator, :locator + +
  • +
  • mouse_down_at, :locator, :coord_string + +
  • +
  • mouse_move, :locator + +
  • +
  • mouse_move_at, :locator, :coord_string + +
  • +
  • mouse_out, :locator + +
  • +
  • mouse_up, :locator + +
  • +
  • mouse_up_at, :locator, :coord_string + +
  • +
  • set_mouse_speed, :integer + +
  • +
+

+Other actions: +

+
    +
  • create_cookie, :name_value_pair, :options_string + +
  • +
  • delete_cookie, :string, :string + +
  • +
  • open_window, :url, :integer + +
  • +
  • pause, :timeout + +
  • +
  • remove_all_selections, :locator + +
  • +
  • select_frame, :locator + +
  • +
  • set_cursor_position, :locator, :integer + +
  • +
  • store, :script, :variable + +
  • +
  • window_focus, :window_name + +
  • +
  • window_maximize, :window_name + +
  • +
+

+Here are the newly supported accessors: +

+

+The following store_* accessors and their associated assert, verify and +wait_for brethren are fully supported: +

+
    +
  • store_selected_id, :locator, :variable + +
  • +
  • store_selected_ids, :locator, :variable + +
  • +
  • store_selected_index, :locator, :variable + +
  • +
  • store_selected_indexes, :locator, :variable + +
  • +
  • store_selected_label, :locator, :variable + +
  • +
  • store_selected_labels, :locator, :variable + +
  • +
  • store_selected_value, :locator, :variable + +
  • +
  • store_selected_values, :locator, :variable + +
  • +
  • store_something_selected, :locator, :variable + +
  • +
  • store_all_window_ids, :variable + +
  • +
  • store_all_window_names, :variable + +
  • +
  • store_all_window_titles, :variable + +
  • +
  • store_cookie, :variable + +
  • +
  • store_log_messages, :variable + +
  • +
  • store_mouse_speed, :variable + +
  • +
  • store_cursor_position, :locator, :variable + +
  • +
  • store_attribute_from_all_windows, :attribute_name, :variable + +
  • +
  • store_element_height, :locator, :variable + +
  • +
  • store_element_index, :locator, :variable + +
  • +
  • store_element_width, :locator, :variable + +
  • +
  • store_element_position_left, :locator, :variable + +
  • +
  • store_element_position_top, :locator, :variable + +
  • +
+

+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: +

+
    +
  • store_ordered, :locator, :locator, :variable + +
  • +
  • store_error_on_next, :string + +
  • +
  • store_failure_on_next, :string + +
  • +
  • store_whether_this_frame_match_frame_expression, :string, :string, +:variable + +
  • +
  • store_whether_this_window_match_window_expression, :string, :string, +:variable + +
  • +
+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/README.html b/vendor/plugins/selenium-on-rails/doc/files/README.html index 77e99926..eb1945e1 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/README.html +++ b/vendor/plugins/selenium-on-rails/doc/files/README.html @@ -1,388 +1,372 @@ - - - - - - File: README - - - - - - - - - - -
-

README

- - - - - - - - - -
Path:README -
Last Update:Fri Dec 08 00:50:30 GMT Standard Time 2006
-
- - -
- - - -
- -
-

Selenium on Rails

-

Overview

-

-Selenium on Rails provides an easy way to test Rails application with Selenium Core. -

-

-This plugin does four things: -

-
    -
  1. The Selenium Core files don’t have to pollute /public, they -can stay in the Selenium gem or in /vendor/selenium. - -
  2. -
  3. No need to create suite files, they are generated on the fly — one -suite per directory in /test/selenium (suites can be nested). - -
  4. -
  5. Instead of writing the test cases in HTML you can use a number of better -formats (see Formats). - -
  6. -
  7. Loading of fixtures and wiping of session (/selenium/setup). - -
  8. -
-

Installation

-
    -
  1. Selenium Core needs to be available. It could either be installed as a gem -(gem install selenium) or in /vendor/selenium/. - -
  2. -
  3. Install Selenium on Rails: script/plugin install http://svn.openqa.org/svn/selenium-on-rails/selenium-on-rails/ - -
  4. -
  5. If RedCloth is available the Selenese test cases can use it for better -markup. - -
  6. -
  7. 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.) - -
  8. -
  9. Create a test case: script/generate selenium login - -
  10. -
  11. Start the server: script/server -e test - -
  12. -
  13. Point your browser to http://localhost:3000/selenium - -
  14. -
  15. 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. - -
  16. -
-

win32-open3

-

-win32-open3 is -needed if you’re on Windows and want to run your tests as a Rake task -(see test:acceptance), 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 -at the time of this writing. - -
  2. -
  3. Open up irb and run this snippet: require ‘rbconfig’; -include Config; puts CONFIG[‘sitearchdir’] - -
  4. -
  5. Create a win32 directory under the directory you got, e.g. -c:\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt - -
  6. -
  7. Rename the .so file to open3.so and put it in the win32 -directory. - -
  8. -
  9. Profit! (unless you get an error when doing require -‘win32/open3‘) - -
  10. -
-

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. -

-

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 which has support 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 -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
-
-

test:acceptance

-

-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 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. -

-

Todo

-

Standalone mode

-

-More work is needed on test:acceptance on Windows to be able to -start the server when needed. -

-

user_extension.js

-

-Selenium has support for user_extension.js 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 -/selenium/setup. 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 does such a good -job and has support for -the Selenese format. -

-

Credits

- -

Information

-

-For more information, check out the website. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - - + + + + + + File: README + + + + + + + + + + +
+

README

+ + + + + + + + + +
Path:README +
Last Update:Sat Feb 03 22:54:11 +0100 2007
+
+ + +
+ + + +
+ +
+

Selenium on Rails

+

Overview

+

+Selenium on Rails provides an easy way to test Rails application with SeleniumCore. +

+

+This plugin does four things: +

+
    +
  1. The Selenium Core files don‘t have to pollute /public. + +
  2. +
  3. No need to create suite files, they are generated on the fly — one +suite per directory in /test/selenium (suites can be nested). + +
  4. +
  5. Instead of writing the test cases in HTML you can use a number of better +formats (see Formats). + +
  6. +
  7. Loading of fixtures and wiping of session (/selenium/setup). + +
  8. +
+

Installation

+
    +
  1. Install Selenium on Rails: script/plugin install svn.openqa.org/svn/selenium-on-rails/selenium-on-rails + +
  2. +
  3. If you‘re on Windows, gem install win32-open3 + +
  4. +
  5. If the RedCloth gem is available the Selenese test cases can use it for +better markup. + +
  6. +
  7. 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.) + +
  8. +
  9. Create a test case: script/generate selenium login + +
  10. +
  11. Start the server: script/server -e test + +
  12. +
  13. Point your browser to localhost:3000/selenium + +
  14. +
  15. 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. + +
  16. +
+

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. +

+

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 which has support 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 +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 don‘t 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. +

+

+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 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. +

+

user_extension.js

+

+Selenium has support for user_extension.js 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 +lib/test_builder_user_accessors.rb.example and +lib/test_builder_user_actions.rb.example that replicate the sample +extensions in Selenium Core‘s user-extensions.js.sample +

+

+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 test:acceptance 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 +/selenium/setup. 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 does such a good +job and has support for +the Selenese format. +

+

Credits

+ +

Information

+

+For more information, check out the website. +

+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/controllers/selenium_controller_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/controllers/selenium_controller_rb.html index 6e2ec72f..c2048237 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/controllers/selenium_controller_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/controllers/selenium_controller_rb.html @@ -1,108 +1,108 @@ - - - - - - File: selenium_controller.rb - - - - - - - - - - -
-

selenium_controller.rb

- - - - - - - - - -
Path:lib/controllers/selenium_controller.rb -
Last Update:Fri Dec 08 00:52:51 GMT Standard Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- webrick/httputils   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: selenium_controller.rb + + + + + + + + + + +
+

selenium_controller.rb

+ + + + + + + + + +
Path:lib/controllers/selenium_controller.rb +
Last Update:Sat Feb 03 22:54:05 +0100 2007
+
+ + +
+ + + +
+ + +
+

Required files

+ +
+ webrick/httputils   +
+
+ +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_helper_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_helper_rb.html index ff03a2c4..b3e1c97e 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_helper_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_helper_rb.html @@ -1,101 +1,101 @@ - - - - - - File: selenium_helper.rb - - - - - - - - - - -
-

selenium_helper.rb

- - - - - - - - - -
Path:lib/selenium_helper.rb -
Last Update:Sun Feb 05 01:02:10 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: selenium_helper.rb + + + + + + + + + + +
+

selenium_helper.rb

+ + + + + + + + + +
Path:lib/selenium_helper.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/acceptance_test_runner_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/acceptance_test_runner_rb.html index 50258cfe..46a8c324 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/acceptance_test_runner_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/acceptance_test_runner_rb.html @@ -1,207 +1,222 @@ - - - - - - File: acceptance_test_runner.rb - - - - - - - - - - -
-

acceptance_test_runner.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/acceptance_test_runner.rb -
Last Update:Fri Dec 08 00:16:44 GMT Standard Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- net/http   - tempfile   -
-
- -
- -
-

Methods

- -
- c   - c_b   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BROWSERS=c :browsers, {}
REUSE_EXISTING_SERVER=c :reuse_existing_server, true
START_SERVER=c :start_server, false
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
SERVER_COMMAND=c_b :server_command do server_path = File.expand_path(File.dirname(__FILE__) + '/../../../../../script/server')
-
-
- - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/acceptance_test_runner.rb, line 7
-7: def c(var, default = nil) SeleniumOnRailsConfig.get var, default end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/acceptance_test_runner.rb, line 8
-8: def c_b(var, default = nil) SeleniumOnRailsConfig.get(var, default) { yield } end
-
-
-
-
- - -
- - -
- - -
-

[Validate]

-
- - + + + + + + File: acceptance_test_runner.rb + + + + + + + + + + +
+

acceptance_test_runner.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/acceptance_test_runner.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ + +
+

Required files

+ +
+ net/http   + tempfile   +
+
+ +
+ +
+

Methods

+ +
+ c   + c_b   +
+
+ +
+ + + + +
+ + +
+

Constants

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BROWSERS=c :browsers, {}
REUSE_EXISTING_SERVER=c :reuse_existing_server, true
START_SERVER=c :start_server, false
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')
+
+
+ + + + + + + +
+

Public Instance methods

+ +
+ + + + +
+

[Source]

+
+
+   # File lib/selenium_on_rails/acceptance_test_runner.rb, line 7
+7: def c(var, default = nil) SeleniumOnRailsConfig.get var, default end
+
+
+
+
+ +
+ + + + +
+

[Source]

+
+
+   # File lib/selenium_on_rails/acceptance_test_runner.rb, line 8
+8: def c_b(var, default = nil) SeleniumOnRailsConfig.get(var, default) { yield } end
+
+
+
+
+ + +
+ + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/fixture_loader_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/fixture_loader_rb.html index 5ef627b1..8c2157ee 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/fixture_loader_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/fixture_loader_rb.html @@ -1,108 +1,109 @@ - - - - - - File: fixture_loader.rb - - - - - - - - - - -
-

fixture_loader.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/fixture_loader.rb -
Last Update:Sun Feb 05 00:59:28 W. Europe Standard Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- active_record/fixtures   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: fixture_loader.rb + + + + + + + + + + +
+

fixture_loader.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/fixture_loader.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ + +
+

Required files

+ +
+ test/unit   + active_record/fixtures   +
+
+ +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/partials_support_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/partials_support_rb.html index 93c43ec6..4b981a54 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/partials_support_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/partials_support_rb.html @@ -1,111 +1,111 @@ - - - - - - File: partials_support.rb - - - - - - - - - - -
-

partials_support.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/partials_support.rb -
Last Update:Tue May 02 00:43:37 W. Europe Daylight Time 2006
-
- - -
- - - -
- -
-

-Provides partials support to test cases so they can include other partial -test cases. -

-

-The partial’s commands are returned as html table rows. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: partials_support.rb + + + + + + + + + + +
+

partials_support.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/partials_support.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ +
+

+Provides partials support to test cases so they can include other partial +test cases. +

+

+The partial‘s commands are returned as html table rows. +

+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/paths_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/paths_rb.html index d1a48f63..5e688d5b 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/paths_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/paths_rb.html @@ -1,101 +1,101 @@ - - - - - - File: paths.rb - - - - - - - - - - -
-

paths.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/paths.rb -
Last Update:Sun Feb 05 00:59:28 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: paths.rb + + + + + + + + + + +
+

paths.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/paths.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/renderer_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/renderer_rb.html index cc9595fc..0774a973 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/renderer_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/renderer_rb.html @@ -1,101 +1,101 @@ - - - - - - File: renderer.rb - - - - - - - - - - -
-

renderer.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/renderer.rb -
Last Update:Sun Feb 05 00:59:29 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: renderer.rb + + + + + + + + + + +
+

renderer.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/renderer.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/rselenese_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/rselenese_rb.html index 3e73734e..38ccc73b 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/rselenese_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/rselenese_rb.html @@ -1,118 +1,118 @@ - - - - - - File: rselenese.rb - - - - - - - - - - -
-

rselenese.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/rselenese.rb -
Last Update:Sun Feb 19 12:59:40 W. Europe Standard Time 2006
-
- - -
- - - -
- -
-

-Renders Selenium test templates in a fashion analogous to rxml and -rjs templates. -

-
-  setup
-  open :controller => 'customer', :action => 'list'
-  assert_title 'Customers'
-
-

-See SeleniumOnRails::TestBuilder -for a list of available commands. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: rselenese.rb + + + + + + + + + + +
+

rselenese.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/rselenese.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ +
+

+Renders Selenium test templates in a fashion analogous to rxml and +rjs templates. +

+
+  setup
+  open :controller => 'customer', :action => 'list'
+  assert_title 'Customers'
+
+

+See SeleniumOnRails::TestBuilder +for a list of available commands. +

+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/selenese_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/selenese_rb.html index 2e40de16..1f40e1c4 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/selenese_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/selenese_rb.html @@ -1,101 +1,101 @@ - - - - - - File: selenese.rb - - - - - - - - - - -
-

selenese.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/selenese.rb -
Last Update:Sun Feb 05 00:56:55 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: selenese.rb + + + + + + + + + + +
+

selenese.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/selenese.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/suite_renderer_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/suite_renderer_rb.html index 25a9037d..4ec5b7e0 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/suite_renderer_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/suite_renderer_rb.html @@ -1,101 +1,101 @@ - - - - - - File: suite_renderer.rb - - - - - - - - - - -
-

suite_renderer.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/suite_renderer.rb -
Last Update:Sun Feb 05 04:12:56 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: suite_renderer.rb + + + + + + + + + + +
+

suite_renderer.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/suite_renderer.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ + + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html index 8aca17f2..c375cd5e 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html @@ -1,114 +1,114 @@ - - - - - - File: test_builder_accessors.rb - - - - - - - - - - -
-

test_builder_accessors.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/test_builder_accessors.rb -
Last Update:Tue Jun 06 03:01:29 W. Europe Daylight Time 2006
-
- - -
- - - -
- -
-

-The accessors available for SeleniumOnRails::TestBuilder -tests. -

-

-For each store_foo there’s assert_foo, -assert_not_foo, verify_foo, verify_not_foo, -wait_for_foo, wait_for_not_foo. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: test_builder_accessors.rb + + + + + + + + + + +
+

test_builder_accessors.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/test_builder_accessors.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ +
+

+The accessors available for SeleniumOnRails::TestBuilder +tests. +

+

+For each store_foo there‘s assert_foo, +assert_not_foo, verify_foo, verify_not_foo, +wait_for_foo, wait_for_not_foo. +

+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_actions_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_actions_rb.html index 343a10e5..2896def6 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_actions_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_actions_rb.html @@ -1,113 +1,113 @@ - - - - - - File: test_builder_actions.rb - - - - - - - - - - -
-

test_builder_actions.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/test_builder_actions.rb -
Last Update:Tue Jun 06 03:12:04 W. Europe Daylight Time 2006
-
- - -
- - - -
- -
-

-The actions available for SeleniumOnRails::TestBuilder -tests. -

-

-For each action foo there’s also an action -foo_and_wait. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: test_builder_actions.rb + + + + + + + + + + +
+

test_builder_actions.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/test_builder_actions.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ +
+

+The actions available for SeleniumOnRails::TestBuilder +tests. +

+

+For each action foo there‘s also an action +foo_and_wait. +

+ +
+ + +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_rb.html index 9bdc7e5a..4c5a5962 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_rb.html @@ -1,121 +1,120 @@ - - - - - - File: test_builder.rb - - - - - - - - - - -
-

test_builder.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/test_builder.rb -
Last Update:Tue Jun 06 02:47:24 W. Europe Daylight Time 2006
-
- - -
- - - -
- -
-

-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 release.openqa.org/selenium-core/nightly/reference.html. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: test_builder.rb + + + + + + + + + + +
+

test_builder.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails/test_builder.rb +
Last Update:Sat Feb 03 23:42:13 +0100 2007
+
+ + +
+ + + +
+ +
+

+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 +

+ +
+ +
+

Required files

+ +
+ selenium_on_rails/test_builder_user_actions   + selenium_on_rails/test_builder_user_accessors   +
+
+ +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_config_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_config_rb.html index 26a16055..042a702b 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_config_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_config_rb.html @@ -1,108 +1,108 @@ - - - - - - File: selenium_on_rails_config.rb - - - - - - - - - - -
-

selenium_on_rails_config.rb

- - - - - - - - - -
Path:lib/selenium_on_rails_config.rb -
Last Update:Mon Feb 20 21:58:17 W. Europe Standard Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- yaml   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: selenium_on_rails_config.rb + + + + + + + + + + +
+

selenium_on_rails_config.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails_config.rb +
Last Update:Sat Feb 03 22:54:06 +0100 2007
+
+ + +
+ + + +
+ + +
+

Required files

+ +
+ yaml   +
+
+ +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_rb.html b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_rb.html index aad82ae8..5d664b29 100644 --- a/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_rb.html +++ b/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_rb.html @@ -1,115 +1,115 @@ - - - - - - File: selenium_on_rails.rb - - - - - - - - - - -
-

selenium_on_rails.rb

- - - - - - - - - -
Path:lib/selenium_on_rails.rb -
Last Update:Thu May 04 01:18:20 W. Europe Daylight Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- selenium_on_rails/selenese   - selenium_on_rails/test_builder   - selenium_on_rails/rselenese   - selenium_on_rails/suite_renderer   - selenium_on_rails/paths   - selenium_on_rails/fixture_loader   - selenium_on_rails/partials_support   - selenium_on_rails/renderer   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - -
-

[Validate]

-
- - + + + + + + File: selenium_on_rails.rb + + + + + + + + + + +
+

selenium_on_rails.rb

+ + + + + + + + + +
Path:lib/selenium_on_rails.rb +
Last Update:Sat Feb 03 23:38:50 +0100 2007
+
+ + +
+ + + +
+ + +
+

Required files

+ +
+ selenium_on_rails/selenese   + selenium_on_rails/test_builder   + selenium_on_rails/rselenese   + selenium_on_rails/suite_renderer   + selenium_on_rails/paths   + selenium_on_rails/fixture_loader   + selenium_on_rails/partials_support   + selenium_on_rails/renderer   +
+
+ +
+ + +
+ + + + +
+ + + + + + + + + + + +
+ + +
+

[Validate]

+
+ + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/fr_class_index.html b/vendor/plugins/selenium-on-rails/doc/fr_class_index.html index 9e823f53..9109fec5 100644 --- a/vendor/plugins/selenium-on-rails/doc/fr_class_index.html +++ b/vendor/plugins/selenium-on-rails/doc/fr_class_index.html @@ -1,40 +1,42 @@ - - - - - - - - Classes - - - - - -
-

Classes

-
- SeleniumController
- SeleniumHelper
- SeleniumOnRails
- SeleniumOnRails::FixtureLoader
- SeleniumOnRails::PartialsSupport
- SeleniumOnRails::Paths
- SeleniumOnRails::RSelenese
- SeleniumOnRails::Renderer
- SeleniumOnRails::Selenese
- SeleniumOnRails::SuiteRenderer
- SeleniumOnRails::TestBuilder
- SeleniumOnRails::TestBuilderAccessors
- SeleniumOnRails::TestBuilderActions
- SeleniumOnRailsConfig
-
-
- + + + + + + + + Classes + + + + + +
+

Classes

+
+ SeleniumController
+ SeleniumHelper
+ SeleniumOnRails
+ SeleniumOnRails::FixtureLoader
+ SeleniumOnRails::PartialsSupport
+ SeleniumOnRails::Paths
+ SeleniumOnRails::RSelenese
+ SeleniumOnRails::Renderer
+ SeleniumOnRails::Selenese
+ SeleniumOnRails::SuiteRenderer
+ SeleniumOnRails::TestBuilder
+ SeleniumOnRails::TestBuilderAccessors
+ SeleniumOnRails::TestBuilderActions
+ SeleniumOnRails::TestBuilderUserAccessors
+ SeleniumOnRails::TestBuilderUserActions
+ SeleniumOnRailsConfig
+
+
+ \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/fr_file_index.html b/vendor/plugins/selenium-on-rails/doc/fr_file_index.html index 765c4f3c..06a0126b 100644 --- a/vendor/plugins/selenium-on-rails/doc/fr_file_index.html +++ b/vendor/plugins/selenium-on-rails/doc/fr_file_index.html @@ -1,42 +1,43 @@ - - - - - - - - Files - - - - - -
-

Files

-
- README
- lib/controllers/selenium_controller.rb
- lib/selenium_helper.rb
- lib/selenium_on_rails.rb
- lib/selenium_on_rails/acceptance_test_runner.rb
- lib/selenium_on_rails/fixture_loader.rb
- lib/selenium_on_rails/partials_support.rb
- lib/selenium_on_rails/paths.rb
- lib/selenium_on_rails/renderer.rb
- lib/selenium_on_rails/rselenese.rb
- lib/selenium_on_rails/selenese.rb
- lib/selenium_on_rails/suite_renderer.rb
- lib/selenium_on_rails/test_builder.rb
- lib/selenium_on_rails/test_builder_accessors.rb
- lib/selenium_on_rails/test_builder_actions.rb
- lib/selenium_on_rails_config.rb
-
-
- + + + + + + + + Files + + + + + +
+

Files

+
+ CHANGELOG
+ README
+ lib/controllers/selenium_controller.rb
+ lib/selenium_helper.rb
+ lib/selenium_on_rails.rb
+ lib/selenium_on_rails/acceptance_test_runner.rb
+ lib/selenium_on_rails/fixture_loader.rb
+ lib/selenium_on_rails/partials_support.rb
+ lib/selenium_on_rails/paths.rb
+ lib/selenium_on_rails/renderer.rb
+ lib/selenium_on_rails/rselenese.rb
+ lib/selenium_on_rails/selenese.rb
+ lib/selenium_on_rails/suite_renderer.rb
+ lib/selenium_on_rails/test_builder.rb
+ lib/selenium_on_rails/test_builder_accessors.rb
+ lib/selenium_on_rails/test_builder_actions.rb
+ lib/selenium_on_rails_config.rb
+
+
+ \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/fr_method_index.html b/vendor/plugins/selenium-on-rails/doc/fr_method_index.html index 1a25e630..6ea4dace 100644 --- a/vendor/plugins/selenium-on-rails/doc/fr_method_index.html +++ b/vendor/plugins/selenium-on-rails/doc/fr_method_index.html @@ -1,119 +1,182 @@ - - - - - - - - Methods - - - - - -
-

Methods

-
- add_selection (SeleniumOnRails::TestBuilderActions)
- answer_on_next_prompt (SeleniumOnRails::TestBuilderActions)
- available_fixtures (SeleniumOnRails::FixtureLoader)
- c (lib/selenium_on_rails/acceptance_test_runner.rb)
- c_b (lib/selenium_on_rails/acceptance_test_runner.rb)
- check (SeleniumOnRails::TestBuilderActions)
- choose_cancel_on_next_confirmation (SeleniumOnRails::TestBuilderActions)
- clear_tables (SeleniumOnRails::FixtureLoader)
- click (SeleniumOnRails::TestBuilderActions)
- close (SeleniumOnRails::TestBuilderActions)
- command (SeleniumOnRails::TestBuilder)
- command_and_wait (SeleniumOnRails::TestBuilder)
- command_verbatim (SeleniumOnRails::TestBuilder)
- exactize (SeleniumOnRails::TestBuilder)
- extract_commands_from_partial (SeleniumOnRails::PartialsSupport)
- fire_event (SeleniumOnRails::TestBuilderActions)
- fixtures_path (SeleniumOnRails::Paths)
- get (SeleniumOnRailsConfig)
- go_back (SeleniumOnRails::TestBuilderActions)
- include_partial (SeleniumOnRails::TestBuilderActions)
- key_down (SeleniumOnRails::TestBuilderActions)
- key_press (SeleniumOnRails::TestBuilderActions)
- key_up (SeleniumOnRails::TestBuilderActions)
- layout_path (SeleniumOnRails::Paths)
- link_to_test_case (SeleniumOnRails::SuiteRenderer)
- load_fixtures (SeleniumOnRails::FixtureLoader)
- log_path (SeleniumOnRails::Paths)
- make_command_waiting (SeleniumOnRails::TestBuilder)
- mouse_down (SeleniumOnRails::TestBuilderActions)
- mouse_over (SeleniumOnRails::TestBuilderActions)
- new (SeleniumOnRails::Selenese)
- new (SeleniumOnRails::TestBuilder)
- new (SeleniumOnRails::RSelenese)
- open (SeleniumOnRails::TestBuilderActions)
- record (SeleniumController)
- refresh (SeleniumOnRails::TestBuilderActions)
- remove_selection (SeleniumOnRails::TestBuilderActions)
- render (SeleniumOnRails::Selenese)
- render (SeleniumOnRails::RSelenese)
- render_partial (SeleniumOnRails::PartialsSupport)
- render_test_case (SeleniumOnRails::Renderer)
- select (SeleniumOnRails::TestBuilderActions)
- select_window (SeleniumOnRails::TestBuilderActions)
- selenium_path (SeleniumOnRails::Paths)
- selenium_tests_path (SeleniumOnRails::Paths)
- selenize (SeleniumOnRails::TestBuilder)
- set_context (SeleniumOnRails::TestBuilderActions)
- set_timeout (SeleniumOnRails::TestBuilderActions)
- setup (SeleniumController)
- setup (SeleniumOnRails::TestBuilderActions)
- skip_file? (SeleniumOnRails::Paths)
- store_absolute_location (SeleniumOnRails::TestBuilderAccessors)
- store_alert (SeleniumOnRails::TestBuilderAccessors)
- store_alert_present (SeleniumOnRails::TestBuilderAccessors)
- store_all_buttons (SeleniumOnRails::TestBuilderAccessors)
- store_all_fields (SeleniumOnRails::TestBuilderAccessors)
- store_all_links (SeleniumOnRails::TestBuilderAccessors)
- store_attribute (SeleniumOnRails::TestBuilderAccessors)
- store_body_text (SeleniumOnRails::TestBuilderAccessors)
- store_checked (SeleniumOnRails::TestBuilderAccessors)
- store_confirmation (SeleniumOnRails::TestBuilderAccessors)
- store_confirmation_present (SeleniumOnRails::TestBuilderAccessors)
- store_editable (SeleniumOnRails::TestBuilderAccessors)
- store_element_present (SeleniumOnRails::TestBuilderAccessors)
- store_eval (SeleniumOnRails::TestBuilderAccessors)
- store_expression (SeleniumOnRails::TestBuilderAccessors)
- store_html_source (SeleniumOnRails::TestBuilderAccessors)
- store_location (SeleniumOnRails::TestBuilderAccessors)
- store_prompt (SeleniumOnRails::TestBuilderAccessors)
- store_prompt_present (SeleniumOnRails::TestBuilderAccessors)
- store_select_options (SeleniumOnRails::TestBuilderAccessors)
- store_selected (SeleniumOnRails::TestBuilderAccessors)
- store_selected_options (SeleniumOnRails::TestBuilderAccessors)
- store_table (SeleniumOnRails::TestBuilderAccessors)
- store_text (SeleniumOnRails::TestBuilderAccessors)
- store_text_present (SeleniumOnRails::TestBuilderAccessors)
- store_title (SeleniumOnRails::TestBuilderAccessors)
- store_value (SeleniumOnRails::TestBuilderAccessors)
- store_visible (SeleniumOnRails::TestBuilderAccessors)
- submit (SeleniumOnRails::TestBuilderActions)
- support_file (SeleniumController)
- table (SeleniumOnRails::TestBuilder)
- test_case_name (SeleniumHelper)
- test_cases (SeleniumOnRails::SuiteRenderer)
- test_file (SeleniumController)
- test_suite_name (SeleniumOnRails::SuiteRenderer)
- test_suites (SeleniumOnRails::SuiteRenderer)
- type (SeleniumOnRails::TestBuilderActions)
- uncheck (SeleniumOnRails::TestBuilderActions)
- view_path (SeleniumOnRails::Paths)
- wait_for_condition (SeleniumOnRails::TestBuilderActions)
- wait_for_page_to_load (SeleniumOnRails::TestBuilderActions)
- wait_for_popup (SeleniumOnRails::TestBuilderActions)
-
-
- + + + + + + + + Methods + + + + + +
+

Methods

+
+ add_selection (SeleniumOnRails::TestBuilderActions)
+ alt_key_down (SeleniumOnRails::TestBuilderActions)
+ alt_key_up (SeleniumOnRails::TestBuilderActions)
+ answer_on_next_prompt (SeleniumOnRails::TestBuilderActions)
+ available_fixtures (SeleniumOnRails::FixtureLoader)
+ brake (SeleniumOnRails::TestBuilderActions)
+ c (lib/selenium_on_rails/acceptance_test_runner.rb)
+ c_b (lib/selenium_on_rails/acceptance_test_runner.rb)
+ check (SeleniumOnRails::TestBuilderActions)
+ choose_cancel_on_next_confirmation (SeleniumOnRails::TestBuilderActions)
+ clear_tables (SeleniumOnRails::FixtureLoader)
+ click (SeleniumOnRails::TestBuilderActions)
+ click_at (SeleniumOnRails::TestBuilderActions)
+ close (SeleniumOnRails::TestBuilderActions)
+ collection_arg (SeleniumOnRails::TestBuilder)
+ command (SeleniumOnRails::TestBuilder)
+ command_and_wait (SeleniumOnRails::TestBuilder)
+ command_verbatim (SeleniumOnRails::TestBuilder)
+ control_key_down (SeleniumOnRails::TestBuilderActions)
+ control_key_up (SeleniumOnRails::TestBuilderActions)
+ create_cookie (SeleniumOnRails::TestBuilderActions)
+ delete_cookie (SeleniumOnRails::TestBuilderActions)
+ double_click (SeleniumOnRails::TestBuilderActions)
+ double_click_at (SeleniumOnRails::TestBuilderActions)
+ drag_and_drop (SeleniumOnRails::TestBuilderActions)
+ drag_and_drop_to_object (SeleniumOnRails::TestBuilderActions)
+ echo (SeleniumOnRails::TestBuilderActions)
+ exactize (SeleniumOnRails::TestBuilder)
+ extract_commands_from_partial (SeleniumOnRails::PartialsSupport)
+ fire_event (SeleniumOnRails::TestBuilderActions)
+ fixtures_path (SeleniumOnRails::Paths)
+ get (SeleniumOnRailsConfig)
+ go_back (SeleniumOnRails::TestBuilderActions)
+ highlight (SeleniumOnRails::TestBuilderActions)
+ include_partial (SeleniumOnRails::TestBuilderActions)
+ key_down (SeleniumOnRails::TestBuilderActions)
+ key_press (SeleniumOnRails::TestBuilderActions)
+ key_up (SeleniumOnRails::TestBuilderActions)
+ layout_path (SeleniumOnRails::Paths)
+ link_to_test_case (SeleniumOnRails::SuiteRenderer)
+ load_fixtures (SeleniumOnRails::FixtureLoader)
+ log_path (SeleniumOnRails::Paths)
+ make_command_waiting (SeleniumOnRails::TestBuilder)
+ meta_key_down (SeleniumOnRails::TestBuilderActions)
+ meta_key_up (SeleniumOnRails::TestBuilderActions)
+ mouse_down (SeleniumOnRails::TestBuilderActions)
+ mouse_down_at (SeleniumOnRails::TestBuilderActions)
+ mouse_move (SeleniumOnRails::TestBuilderActions)
+ mouse_move_at (SeleniumOnRails::TestBuilderActions)
+ mouse_out (SeleniumOnRails::TestBuilderActions)
+ mouse_over (SeleniumOnRails::TestBuilderActions)
+ mouse_up (SeleniumOnRails::TestBuilderActions)
+ mouse_up_at (SeleniumOnRails::TestBuilderActions)
+ new (SeleniumOnRails::TestBuilder)
+ new (SeleniumOnRails::RSelenese)
+ new (SeleniumOnRails::Selenese)
+ open (SeleniumOnRails::TestBuilderActions)
+ open_window (SeleniumOnRails::TestBuilderActions)
+ pause (SeleniumOnRails::TestBuilderActions)
+ record (SeleniumController)
+ refresh (SeleniumOnRails::TestBuilderActions)
+ remove_all_selections (SeleniumOnRails::TestBuilderActions)
+ remove_selection (SeleniumOnRails::TestBuilderActions)
+ render (SeleniumOnRails::RSelenese)
+ render (SeleniumOnRails::Selenese)
+ render_partial (SeleniumOnRails::PartialsSupport)
+ render_test_case (SeleniumOnRails::Renderer)
+ select (SeleniumOnRails::TestBuilderActions)
+ select_frame (SeleniumOnRails::TestBuilderActions)
+ select_window (SeleniumOnRails::TestBuilderActions)
+ selenium_path (SeleniumOnRails::Paths)
+ selenium_tests_path (SeleniumOnRails::Paths)
+ selenize (SeleniumOnRails::TestBuilder)
+ set_context (SeleniumOnRails::TestBuilderActions)
+ set_cursor_position (SeleniumOnRails::TestBuilderActions)
+ set_mouse_speed (SeleniumOnRails::TestBuilderActions)
+ set_timeout (SeleniumOnRails::TestBuilderActions)
+ setup (SeleniumOnRails::TestBuilderActions)
+ setup (SeleniumController)
+ shift_key_down (SeleniumOnRails::TestBuilderActions)
+ shift_key_up (SeleniumOnRails::TestBuilderActions)
+ skip_file? (SeleniumOnRails::Paths)
+ store (SeleniumOnRails::TestBuilderActions)
+ store_absolute_location (SeleniumOnRails::TestBuilderAccessors)
+ store_alert (SeleniumOnRails::TestBuilderAccessors)
+ store_alert_present (SeleniumOnRails::TestBuilderAccessors)
+ store_all_buttons (SeleniumOnRails::TestBuilderAccessors)
+ store_all_fields (SeleniumOnRails::TestBuilderAccessors)
+ store_all_links (SeleniumOnRails::TestBuilderAccessors)
+ store_all_window_ids (SeleniumOnRails::TestBuilderAccessors)
+ store_all_window_names (SeleniumOnRails::TestBuilderAccessors)
+ store_all_window_titles (SeleniumOnRails::TestBuilderAccessors)
+ store_attribute (SeleniumOnRails::TestBuilderAccessors)
+ store_attribute_from_all_windows (SeleniumOnRails::TestBuilderAccessors)
+ store_body_text (SeleniumOnRails::TestBuilderAccessors)
+ store_checked (SeleniumOnRails::TestBuilderAccessors)
+ store_confirmation (SeleniumOnRails::TestBuilderAccessors)
+ store_confirmation_present (SeleniumOnRails::TestBuilderAccessors)
+ store_cookie (SeleniumOnRails::TestBuilderAccessors)
+ store_cursor_position (SeleniumOnRails::TestBuilderAccessors)
+ store_editable (SeleniumOnRails::TestBuilderAccessors)
+ store_element_height (SeleniumOnRails::TestBuilderAccessors)
+ store_element_index (SeleniumOnRails::TestBuilderAccessors)
+ store_element_position_left (SeleniumOnRails::TestBuilderAccessors)
+ store_element_position_top (SeleniumOnRails::TestBuilderAccessors)
+ store_element_present (SeleniumOnRails::TestBuilderAccessors)
+ store_element_width (SeleniumOnRails::TestBuilderAccessors)
+ store_error_on_next (SeleniumOnRails::TestBuilderAccessors)
+ store_eval (SeleniumOnRails::TestBuilderAccessors)
+ store_expression (SeleniumOnRails::TestBuilderAccessors)
+ store_failure_on_next (SeleniumOnRails::TestBuilderAccessors)
+ store_html_source (SeleniumOnRails::TestBuilderAccessors)
+ store_location (SeleniumOnRails::TestBuilderAccessors)
+ store_log_messages (SeleniumOnRails::TestBuilderAccessors)
+ store_mouse_speed (SeleniumOnRails::TestBuilderAccessors)
+ store_ordered (SeleniumOnRails::TestBuilderAccessors)
+ store_prompt (SeleniumOnRails::TestBuilderAccessors)
+ store_prompt_present (SeleniumOnRails::TestBuilderAccessors)
+ store_select_options (SeleniumOnRails::TestBuilderAccessors)
+ store_selected (SeleniumOnRails::TestBuilderAccessors)
+ store_selected_id (SeleniumOnRails::TestBuilderAccessors)
+ store_selected_ids (SeleniumOnRails::TestBuilderAccessors)
+ store_selected_index (SeleniumOnRails::TestBuilderAccessors)
+ store_selected_indexes (SeleniumOnRails::TestBuilderAccessors)
+ store_selected_label (SeleniumOnRails::TestBuilderAccessors)
+ store_selected_labels (SeleniumOnRails::TestBuilderAccessors)
+ store_selected_options (SeleniumOnRails::TestBuilderAccessors)
+ store_selected_value (SeleniumOnRails::TestBuilderAccessors)
+ store_selected_values (SeleniumOnRails::TestBuilderAccessors)
+ store_something_selected (SeleniumOnRails::TestBuilderAccessors)
+ store_table (SeleniumOnRails::TestBuilderAccessors)
+ store_text (SeleniumOnRails::TestBuilderAccessors)
+ store_text_present (SeleniumOnRails::TestBuilderAccessors)
+ store_title (SeleniumOnRails::TestBuilderAccessors)
+ store_value (SeleniumOnRails::TestBuilderAccessors)
+ store_visible (SeleniumOnRails::TestBuilderAccessors)
+ store_whether_this_frame_match_frame_expression (SeleniumOnRails::TestBuilderAccessors)
+ store_whether_this_window_match_window_expression (SeleniumOnRails::TestBuilderAccessors)
+ submit (SeleniumOnRails::TestBuilderActions)
+ support_file (SeleniumController)
+ table (SeleniumOnRails::TestBuilder)
+ test_case_name (SeleniumHelper)
+ test_cases (SeleniumOnRails::SuiteRenderer)
+ test_file (SeleniumController)
+ test_suite_name (SeleniumOnRails::SuiteRenderer)
+ test_suites (SeleniumOnRails::SuiteRenderer)
+ type (SeleniumOnRails::TestBuilderActions)
+ type_keys (SeleniumOnRails::TestBuilderActions)
+ uncheck (SeleniumOnRails::TestBuilderActions)
+ url_arg (SeleniumOnRails::TestBuilder)
+ view_path (SeleniumOnRails::Paths)
+ wait_for_condition (SeleniumOnRails::TestBuilderActions)
+ wait_for_page_to_load (SeleniumOnRails::TestBuilderActions)
+ wait_for_popup (SeleniumOnRails::TestBuilderActions)
+ window_focus (SeleniumOnRails::TestBuilderActions)
+ window_maximize (SeleniumOnRails::TestBuilderActions)
+
+
+ \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/index.html b/vendor/plugins/selenium-on-rails/doc/index.html index d7f62a7d..4baa4f94 100644 --- a/vendor/plugins/selenium-on-rails/doc/index.html +++ b/vendor/plugins/selenium-on-rails/doc/index.html @@ -1,24 +1,24 @@ - - - - - - - SeleniumOnRails - - - - - - - - - - + + + + + + + SeleniumOnRails + + + + + + + + + + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/doc/rdoc-style.css b/vendor/plugins/selenium-on-rails/doc/rdoc-style.css index fbf7326a..44c7b3d1 100644 --- a/vendor/plugins/selenium-on-rails/doc/rdoc-style.css +++ b/vendor/plugins/selenium-on-rails/doc/rdoc-style.css @@ -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; } \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/generators/selenium/templates/rhtml.rhtml b/vendor/plugins/selenium-on-rails/generators/selenium/templates/rhtml.rhtml index c6c4c441..f7b40244 100644 --- a/vendor/plugins/selenium-on-rails/generators/selenium/templates/rhtml.rhtml +++ b/vendor/plugins/selenium-on-rails/generators/selenium/templates/rhtml.rhtml @@ -1,16 +1,16 @@ -

It's often a good idea to start the test with opening /selenium/setup (see <%%= link_to 'here', :controller => 'selenium', :action => 'setup' %> for more info).

- - - - -<%% for page in ['/', '/home'] -%> - - -<%% end -%> -
<%%= @page_title %>
open/selenium/setup 
open<%%= page %> 
assertTitleHome 
- -

More information about the commands is available here.

- -

You can write comments above and below the commands, but you can only have one set of commands, i.e. one table, per test.

- -

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 opening /selenium/setup (see <%%= link_to 'here', :controller => 'selenium', :action => 'setup' %> for more info).

+ + + + +<%% for page in ['/', '/home'] -%> + + +<%% end -%> +
<%%= @page_title %>
open/selenium/setup 
open<%%= page %> 
assertTitleHome 
+ +

More information about the commands is available here.

+ +

You can write comments above and below the commands, but you can only have one set of commands, i.e. one table, per test.

+ +

Point the browser to <%= testcase_link %> to see how this test is rendered, or to <%= suite_link %> to run the suite.

diff --git a/vendor/plugins/selenium-on-rails/generators/selenium/templates/rselenese.rhtml b/vendor/plugins/selenium-on-rails/generators/selenium/templates/rselenese.rhtml index 419eb368..72cbc9f3 100644 --- a/vendor/plugins/selenium-on-rails/generators/selenium/templates/rselenese.rhtml +++ b/vendor/plugins/selenium-on-rails/generators/selenium/templates/rselenese.rhtml @@ -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. diff --git a/vendor/plugins/selenium-on-rails/generators/selenium/templates/selenese.rhtml b/vendor/plugins/selenium-on-rails/generators/selenium/templates/selenese.rhtml index f4ccb8a9..23c43458 100644 --- a/vendor/plugins/selenium-on-rails/generators/selenium/templates/selenese.rhtml +++ b/vendor/plugins/selenium-on-rails/generators/selenium/templates/selenese.rhtml @@ -1,11 +1,11 @@ -It's often a good idea to start the test with opening /selenium/setup (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 /selenium/setup (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. diff --git a/vendor/plugins/selenium-on-rails/init.rb b/vendor/plugins/selenium-on-rails/init.rb index 47ed22b9..9d355a4a 100644 --- a/vendor/plugins/selenium-on-rails/init.rb +++ b/vendor/plugins/selenium-on-rails/init.rb @@ -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 diff --git a/vendor/plugins/selenium-on-rails/lib/controllers/selenium_controller.rb b/vendor/plugins/selenium-on-rails/lib/controllers/selenium_controller.rb index e2c08984..710c70f3 100644 --- a/vendor/plugins/selenium-on-rails/lib/controllers/selenium_controller.rb +++ b/vendor/plugins/selenium-on-rails/lib/controllers/selenium_controller.rb @@ -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 < -Selenium Test Result - - - - - -EOS - end - html_header = < - - - - -EOS - html_footer = "\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 "" - end - File.open("#{cur_result_dir}/suite.html", "wb") do |f| - suite = params[:suite] - suite.sub!(/^.*(])/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 < +Selenium Test Result + + + + + +EOS + end + html_header = < + + + + +EOS + html_footer = "\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 "" + end + File.open("#{cur_result_dir}/suite.html", "wb") do |f| + suite = params[:suite] + suite.sub!(/^.*(])/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 \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/switch_environment/switch_environment_controller.rb b/vendor/plugins/selenium-on-rails/lib/controllers/switch_environment_controller.rb similarity index 92% rename from vendor/plugins/selenium-on-rails/switch_environment/switch_environment_controller.rb rename to vendor/plugins/selenium-on-rails/lib/controllers/switch_environment_controller.rb index 51c1ca23..648bee42 100644 --- a/vendor/plugins/selenium-on-rails/switch_environment/switch_environment_controller.rb +++ b/vendor/plugins/selenium-on-rails/lib/controllers/switch_environment_controller.rb @@ -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 => < - Selenium on Rails is only activated for <%= SeleniumOnRailsConfig.get(:environments).join ', ' %> - environment<%= SeleniumOnRailsConfig.get(:environments).size > 1 ? 's' : '' %> (you're running - <%= RAILS_ENV %>). -

-

- Start your server in a different environment or see <%= readme_path %> - for information regarding how to change this behavior. -

-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 => < + Selenium on Rails is only activated for <%= SeleniumOnRailsConfig.new.get(:environments).join ', ' %> + environment<%= SeleniumOnRailsConfig.get(:environments).size > 1 ? 's' : '' %> (you're running + <%= RAILS_ENV %>). +

+

+ Start your server in a different environment or see <%= readme_path %> + for information regarding how to change this behavior. +

+END + end end \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_helper.rb b/vendor/plugins/selenium-on-rails/lib/selenium_helper.rb index 4e178536..1a66da7d 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_helper.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_helper.rb @@ -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 diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails.rb index 365d0034..6b91847b 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails.rb @@ -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' diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/acceptance_test_runner.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/acceptance_test_runner.rb index 9f1d106b..a1130589 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/acceptance_test_runner.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/acceptance_test_runner.rb @@ -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 - 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 + f.close + + super "#{command.split.first} #{f.path}" + end + +end + diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/fixture_loader.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/fixture_loader.rb index c4d513cc..32f39f81 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/fixture_loader.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/fixture_loader.rb @@ -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 diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/partials_support.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/partials_support.rb index 4374c4e9..cf6c86d3 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/partials_support.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/partials_support.rb @@ -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(/.*.*?.*?<\/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(/.*
.*?.*?<\/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 \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/paths.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/paths.rb index 4d8ecb22..39b52bed 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/paths.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/paths.rb @@ -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 diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/renderer.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/renderer.rb index f49f3162..05b2e43a 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/renderer.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/renderer.rb @@ -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 =~ //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 =~ //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 \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/rselenese.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/rselenese.rb index 67ee911a..c744582d 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/rselenese.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/rselenese.rb @@ -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 \ No newline at end of file +end diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/selenese.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/selenese.rb index afad3f29..fa3d8762 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/selenese.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/selenese.rb @@ -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 = '' diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/suite_renderer.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/suite_renderer.rb index 10f87771..bff2b399 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/suite_renderer.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/suite_renderer.rb @@ -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 diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder.rb index c2a33078..3b0b7ed8 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder.rb @@ -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! << ' ' 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! << ' ' end + end + end +end diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_accessors.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_accessors.rb index 6c892770..a16ee4fa 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_accessors.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_accessors.rb @@ -1,575 +1,1002 @@ -# The accessors available for SeleniumOnRails::TestBuilder tests. -# -# For each +store_foo+ there's +assert_foo+, +assert_not_foo+, +verify_foo+, -# +verify_not_foo+, +wait_for_foo+, +wait_for_not_foo+. -module SeleniumOnRails::TestBuilderAccessors - # Has an alert occurred? - # - # Related Assertions, automatically generated: - # * +assert_alert_present+ - # * +assert_alert_not_present+ - # * +verify_alert_present+ - # * +verify_alert_not_present+ - # * +wait_for_alert_present+ - # * +wait_for_alert_not_present+ - def store_alert_present variable_name - command 'storeAlertPresent', variable_name - end - - # Has a prompt occurred? - # - # Related Assertions, automatically generated: - # * +assert_prompt_present+ - # * +assert_prompt_not_present+ - # * +verify_prompt_present+ - # * +verify_prompt_not_present+ - # * +wait_for_prompt_present+ - # * +wait_for_prompt_not_present+ - def store_prompt_present variable_name - command 'storePromptPresent', variable_name - end - - # Has confirm() been called? - # - # Related Assertions, automatically generated: - # * +assert_confirmation_present+ - # * +assert_confirmation_not_present+ - # * +verify_confirmation_present+ - # * +verify_confirmation_not_present+ - # * +wait_for_confirmation_present+ - # * +wait_for_confirmation_not_present+ - def store_confirmation_present variable_name - command 'storeConfirmationPresent', variable_name - end - - # Retrieves the message of a JavaScript alert generated during the previous - # action, or fail if there were no alerts. - # - # Getting an alert has the same effect as manually clicking OK. If an alert - # is generated but you do not get/verify it, the next Selenium action will - # fail. - # - # NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert - # dialog. - # - # NOTE: Selenium does NOT support JavaScript alerts that are generated in a - # page's onload() event handler. In this case a visible dialog WILL be - # generated and Selenium will hang until someone manually clicks OK. - # - # Related Assertions, automatically generated: - # * assert_alert(pattern) - # * assert_not_alert(pattern) - # * verify_alert_present(pattern) - # * verify_not_alert(pattern) - # * wait_for_alert(pattern) - # * wait_for_not_alert(pattern) - def store_alert variable_name - command 'storeAlert', variable_name - end - - # Retrieves the message of a JavaScript confirmation dialog generated during - # the previous action. - # - # By default, the confirm function will return +true+, having the same effect - # as manually clicking OK. This can be changed by prior execution of the - # +choose_cancel_on_next_confirmation+ command. If a confirmation is - # generated but you do not get/verify it, the next Selenium action will fail. - # - # NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible - # dialog. - # - # NOTE: Selenium does NOT support JavaScript confirmations that are generated - # in a page's onload() event handler. In this case a visible dialog WILL be - # generated and Selenium will hang until you manually click OK. - # - # Related Assertions, automatically generated: - # * assert_confirmation(pattern) - # * assert_not_confirmation(pattern) - # * verify_confirmation_present(pattern) - # * verify_not_confirmation(pattern) - # * wait_for_confirmation(pattern) - # * wait_for_not_confirmation(pattern) - def store_confirmation variable_name - command 'storeConfirmation', variable_name - end - - # Retrieves the message of a JavaScript question prompt dialog generated - # during the previous action. - # - # Successful handling of the prompt requires prior execution of the - # +answer_on_next_prompt+ command. If a prompt is generated but you do not - # get/verify it, the next Selenium action will fail. - # - # NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog. - # - # NOTE: Selenium does NOT support JavaScript prompts that are generated in a - # page's onload() event handler. In this case a visible dialog WILL be - # generated and Selenium will hang until someone manually clicks OK. - # - # Related Assertions, automatically generated: - # * assert_prompt(pattern) - # * assert_not_prompt(pattern) - # * verify_prompt_present(pattern) - # * verify_not_prompt(pattern) - # * wait_for_prompt(pattern) - # * wait_for_not_prompt(pattern) - def store_prompt variable_name - command 'storePrompt', variable_name - end - - # Gets the absolute URL of the current page. - # - # Related Assertions, automatically generated: - # * assert_absolute_location(pattern) - # * assert_not_absolute_location(pattern) - # * verify_absolute_location_present(pattern) - # * verify_not_absolute_location(pattern) - # * wait_for_absolute_location(pattern) - # * wait_for_not_absolute_location(pattern) - def store_absolute_location variable_name - command 'storeAbsoluteLocation', variable_name - end - - # Verify the location of the current page ends with the expected location. - # If an URL querystring is provided, this is checked as well. - # - # Related Assertions, automatically generated: - # * assert_location(pattern) - # * assert_not_location(pattern) - # * verify_location_present(pattern) - # * verify_not_location(pattern) - # * wait_for_location(pattern) - # * wait_for_not_location(pattern) - def store_location expected_location, variable_name - command 'storeLocation', expected_location, variable_name - end - - # Gets the title of the current page. - # - # Related Assertions, automatically generated: - # * assert_title(pattern) - # * assert_not_title(pattern) - # * verify_title_present(pattern) - # * verify_not_title(pattern) - # * wait_for_title(pattern) - # * wait_for_not_title(pattern) - def store_title variable_name - command 'storeTitle', variable_name - end - - # Gets the entire text of the page. - # - # Related Assertions, automatically generated: - # * assert_body_text(pattern) - # * assert_not_body_text(pattern) - # * verify_body_text_present(pattern) - # * verify_not_body_text(pattern) - # * wait_for_body_text(pattern) - # * wait_for_not_body_text(pattern) - def store_body_text variable_name - command 'storeBodyText', variable_name - end - - # Gets the (whitespace-trimmed) value of an input field (or anything else - # with a value parameter). For checkbox/radio elements, the value will be - # "on" or "off" depending on whether the element is checked or not. - # - # Related Assertions, automatically generated: - # * assert_value(locator, pattern) - # * assert_not_value(locator, pattern) - # * verify_value_present(locator, pattern) - # * verify_not_value(locator, pattern) - # * wait_for_value(locator, pattern) - # * wait_for_not_value(locator, pattern) - def store_value locator, variable_name - command 'storeValue', locator, variable_name - end - - # Gets the text of an element. This works for any element that contains text. - # This command uses either the +textContent+ (Mozilla-like browsers) or the - # +innerText+ (IE-like browsers) of the element, which is the rendered text - # shown to the user. - # - # Related Assertions, automatically generated: - # * assert_text(locator, pattern) - # * assert_not_text(locator, pattern) - # * verify_text_present(locator, pattern) - # * verify_not_text(locator, pattern) - # * wait_for_text(locator, pattern) - # * wait_for_not_text(locator, pattern) - def store_text locator, variable_name - command 'storeText', locator, variable_name - end - - # Gets the result of evaluating the specified JavaScript snippet. The snippet - # may have multiple lines, but only the result of the last line will be - # returned. - # - # Note that, by default, the snippet will run in the context of the - # "selenium" object itself, so +this+ will refer to the Selenium object, and - # +window+ will refer to the top-level runner test window, not the window of - # your application. - # - # If you need a reference to the window of your application, you can refer to - # this.browserbot.getCurrentWindow() and if you need to use a locator to - # refer to a single element in your application page, you can use - # this.page().findElement("foo") where "foo" is your locator. - # - # Related Assertions, automatically generated: - # * assert_eval(script, pattern) - # * assert_not_eval(script, pattern) - # * verify_eval_present(script, pattern) - # * verify_not_eval(script, pattern) - # * wait_for_eval(script, pattern) - # * wait_for_not_eval(script, pattern) - def store_eval script, variable_name - command 'storeEval', script, variable_name - end - - # Gets whether a toggle-button (checkbox/radio) is checked. Fails if the - # specified element doesn't exist or isn't a toggle-button. - # - # Related Assertions, automatically generated: - # * assert_checked(locator, pattern) - # * assert_not_checked(locator, pattern) - # * verify_checked_present(locator, pattern) - # * verify_not_checked(locator, pattern) - # * wait_for_checked(locator, pattern) - # * wait_for_not_checked(locator, pattern) - def store_checked locator, variable_name - command 'storeChecked', locator, variable_name - end - - # Gets the text from a cell of a table. - # - # Related Assertions, automatically generated: - # * assert_table(locator, row, column, pattern) - # * assert_not_table(locator, row, column, pattern) - # * verify_table_present(locator, row, column, pattern) - # * verify_not_table(locator, row, column, pattern) - # * wait_for_table(locator, row, column, pattern) - # * wait_for_not_table(locator, row, column, pattern) - def store_table locator, row, column, variable_name - command 'storeTable', "#{locator}.#{row}.#{column}", variable_name - end - - # Verifies that the selected option of a drop-down satisfies the - # +option_locator+. - # - # +option_locator+ is typically just an option label (e.g. "John Smith"). - # - # See the +select+ command for more information about option locators. - # - # NOTE: +store_selected+ is currently not supported by Selenium Core. - # - # Related Assertions, automatically generated: - # * assert_selected(locator, option_locator) - # * assert_not_selected(locator, option_locator) - # * verify_selected_present(locator, option_locator) - # * verify_not_selected(locator, option_locator) - # * wait_for_selected(locator, option_locator) - # * wait_for_not_selected(locator, option_locator) - def store_selected locator, option_locator, variable_name - raise 'Not supported in Selenium Core at the moment' - end - - # Gets all option labels for selected options in the specified select or - # multi-select element. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_selected_options 'fruits', ['apple', 'pear'] - # assert_selected_options 'fruits', 'a*,p*' - # - # Related Assertions, automatically generated: - # * assert_selected_options(locator, pattern) - # * assert_not_selected_options(locator, pattern) - # * verify_selected_options_present(locator, pattern) - # * verify_not_selected_options(locator, pattern) - # * wait_for_selected_options(locator, pattern) - # * wait_for_not_selected_options(locator, pattern) - def store_selected_options locator, variable_name - command 'storeSelectedOptions', locator, variable_name - end - - # Gets all option labels in the specified select drop-down. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_select_options 'fruits', ['apple', 'pear'] - # assert_select_options 'fruits', 'a*,p*' - # - # Related Assertions, automatically generated: - # * assert_select_options(locator, pattern) - # * assert_not_select_options(locator, pattern) - # * verify_select_options_present(locator, pattern) - # * verify_not_select_options(locator, pattern) - # * wait_for_select_options(locator, pattern) - # * wait_for_not_select_options(locator, pattern) - def store_select_options locator, variable_name - command 'storeSelectOptions', locator, variable_name - end - - # Gets the value of an element attribute. - # - # Related Assertions, automatically generated: - # * assert_attribute(locator, attribute_name, pattern) - # * assert_not_attribute(locator, attribute_name, pattern) - # * verify_attribute_present(locator, attribute_name, pattern) - # * verify_not_attribute(locator, attribute_name, pattern) - # * wait_for_attribute(locator, attribute_name, pattern) - # * wait_for_not_attribute(locator, attribute_name, pattern) - def store_attribute locator, attribute_name, variable_name - command 'storeAttribute', "#{locator}@#{attribute_name}", variable_name - end - - # Verifies that the specified text pattern appears somewhere on the rendered - # page shown to the user. - # - # Related Assertions, automatically generated: - # * assert_text_present(pattern) - # * assert_text_not_present(pattern) - # * verify_text_present(pattern) - # * verify_text_not_present(pattern) - # * wait_for_text_present(pattern) - # * wait_for_text_not_present(pattern) - def store_text_present pattern, variable_name - command 'storeTextPresent', pattern, variable_name - end - - # Verifies that the specified element is somewhere on the page. - # - # Related Assertions, automatically generated: - # * assert_element_present(locator) - # * assert_element_not_present(locator) - # * verify_element_present(locator) - # * verify_element_not_present(locator) - # * wait_for_element_present(locator) - # * wait_for_element_not_present(locator) - def store_element_present locator, variable_name - command 'storeElementPresent', locator, variable_name - end - - # Determines if the specified element is visible. An element can be rendered - # invisible by setting the CSS "visibility" property to "hidden", or the - # "display" property to "none", either for the element itself or one if its - # ancestors. This method will fail if the element is not present. - # - # Related Assertions, automatically generated: - # * assert_visible(locator) - # * assert_not_visible(locator) - # * verify_visible(locator) - # * verify_not_visible(locator) - # * wait_for_visible(locator) - # * wait_for_not_visible(locator) - def store_visible locator, variable_name - command 'storeVisible', locator, variable_name - end - - # Determines whether the specified input element is editable, i.e. hasn't - # been disabled. This method will fail if the specified element isn't an - # input element. - # - # Related Assertions, automatically generated: - # * assert_editable(locator) - # * assert_not_editable(locator) - # * verify_editable(locator) - # * verify_not_editable(locator) - # * wait_for_editable(locator) - # * wait_for_not_editable(locator) - def store_editable locator, variable_name - command 'storeEditable', locator, variable_name - end - - # Returns the IDs of all buttons on the page. - # - # If a given button has no ID, it will appear as "" in this array. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_all_buttons ['but1', 'but2'] - # assert_all_buttons 'but?,but?*' - # - # Related Assertions, automatically generated: - # * assert_all_buttons(pattern) - # * assert_not_all_buttons(pattern) - # * verify_all_buttons(pattern) - # * verify_not_all_buttons(pattern) - # * wait_for_all_buttons(pattern) - # * wait_for_not_all_buttons(pattern) - def store_all_buttons variable_name - command 'storeAllButtons', variable_name - end - - # Returns the IDs of all links on the page. - # - # If a given link has no ID, it will appear as "" in this array. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_all_links ['link1', 'link2'] - # assert_all_links 'link?,link?*' - # - # Related Assertions, automatically generated: - # * assert_all_links(pattern) - # * assert_not_all_links(pattern) - # * verify_all_links(pattern) - # * verify_not_all_links(pattern) - # * wait_for_all_links(pattern) - # * wait_for_not_all_links(pattern) - def store_all_links variable_name - command 'storeAllLinks', variable_name - end - - # Returns the IDs of all input fields on the page. - # - # If a given field has no ID, it will appear as "" in this array. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_all_fields ['field1', 'field2'] - # assert_all_fields 'field?,field?*' - # - # Related Assertions, automatically generated: - # * assert_all_fields(pattern) - # * assert_not_all_fields(pattern) - # * verify_all_fields(pattern) - # * verify_not_all_fields(pattern) - # * wait_for_all_fields(pattern) - # * wait_for_not_all_fields(pattern) - def store_all_fields variable_name - command 'storeAllFields', variable_name - end - - # Returns the entire HTML source between the opening and closing "html" tags. - # - # Related Assertions, automatically generated: - # * assert_html_source(pattern) - # * assert_not_html_source(pattern) - # * verify_html_source(pattern) - # * verify_not_html_source(pattern) - # * wait_for_html_source(pattern) - # * wait_for_not_html_source(pattern) - def store_html_source variable_name - command 'storeHtmlSource', variable_name - end - - # Returns the specified expression. - # - # This is useful because of JavaScript preprocessing. - # - # Related Assertions, automatically generated: - # * assert_expression(expression, pattern) - # * assert_not_expression(expression, pattern) - # * verify_expression(expression, pattern) - # * verify_not_expression(expression, pattern) - # * wait_for_expression(expression, pattern) - # * wait_for_not_expression(expression, pattern) - def store_expression expression, variable_name - command 'storeExpression', expression, variable_name - end - -private - # Generates all assertions for the accessors. - def self.generate_methods - public_instance_methods.each do |method| - case method - when 'store_alert_present', - 'store_prompt_present', - 'store_confirmation_present' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do - command command_name - end - end - when 'store_alert', - 'store_confirmation', - 'store_prompt', - 'store_title', - 'store_body_text', - 'store_text_present', - 'store_element_present', - 'store_visible', - 'store_editable', - 'store_html_source' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |pattern| - command command_name, pattern - end - end - when 'store_value', - 'store_text', - 'store_eval', - 'store_checked', - 'store_selected', - 'store_expression' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |arg1, arg2| - command command_name, arg1, arg2 - end - end - when 'store_all_buttons', - 'store_all_links', - 'store_all_fields' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |pattern| - command command_name, collection_arg(pattern) - end - end - when 'store_select_options', - 'store_selected_options' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |locator, pattern| - command command_name, locator, collection_arg(pattern) - end - end - when 'store_attribute' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |locator, attribute_name, pattern| - command command_name, "#{locator}@#{attribute_name}", pattern - end - end - when 'store_table' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |locator, row, column, pattern| - command command_name, "#{locator}.#{row}.#{column}", pattern - end - end - when 'store_absolute_location', - 'store_location' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |pattern| - if method == 'store_absolute_location' and pattern.is_a? Hash - pattern[:only_path] = false - end - - command command_name, url_arg(pattern) - end - end - when /^store_/ - raise 'internal error' - 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 - - generate_methods -end - +# The accessors available for SeleniumOnRails::TestBuilder tests. +# +# For each +store_foo+ there's +assert_foo+, +assert_not_foo+, +verify_foo+, +# +verify_not_foo+, +wait_for_foo+, +wait_for_not_foo+. +module SeleniumOnRails::TestBuilderAccessors + + # Tell Selenium to expect an error on the next command execution. + # + # NOTE: store_error_on_next is currently not supported by + # Selenium Core and is only added to here as a shortcut for + # generating the related assertions. + # + # Related Assertions, automatically generated: + # * assert_error_on_next(message) + # * assert_not_error_on_next(message) + # * verify_error_on_next(message) + # * verify_not_error_on_next(message) + # * wait_for_error_on_next(message) + # * wait_for_not_error_on_next(message) + def store_error_on_next message + raise 'Not supported in Selenium Core at the moment' + end + + # Tell Selenium to expect a failure on the next command execution. + # + # NOTE: store_failure_on_next is currently not supported by + # Selenium Core and is only added to here as a shortcut for + # generating the related assertions. + # + # Related Assertions, automatically generated: + # * assert_failure_on_next(message) + # * assert_not_failure_on_next(message) + # * verify_failure_on_next(message) + # * verify_not_failure_on_next(message) + # * wait_for_failure_on_next(message) + # * wait_for_not_failure_on_next(message) + def store_failure_on_next message + raise 'Not supported in Selenium Core at the moment' + end + + # Returns the IDs of all windows that the browser knows about. + # + # Related Assertions, automatically generated: + # * assertAllWindowIds(pattern) + # * assertNotAllWindowIds(pattern) + # * verifyAllWindowIds(pattern) + # * verifyNotAllWindowIds(pattern) + # * waitForAllWindowIds(pattern) + # * waitForNotAllWindowIds(pattern) + def store_all_window_ids variable_name + command 'storeAllWindowIds', variable_name + end + + # Returns the names of all windows that the browser knows about. + # + # Related Assertions, automatically generated: + # * assertAllWindowNames(pattern) + # * assertNotAllWindowNames(pattern) + # * verifyAllWindowNames(pattern) + # * verifyNotAllWindowNames(pattern) + # * waitForAllWindowNames(pattern) + # * waitForNotAllWindowNames(pattern) + def store_all_window_names variable_name + command 'storeAllWindowNames', variable_name + end + + # Returns the titles of all windows that the browser knows about. + # + # Related Assertions, automatically generated: + # * assertAllWindowTitles(pattern) + # * assertNotAllWindowTitles(pattern) + # * verifyAllWindowTitles(pattern) + # * verifyNotAllWindowTitles(pattern) + # * waitForAllWindowTitles(pattern) + # * waitForNotAllWindowTitles(pattern) + def store_all_window_titles variable_name + command 'storeAllWindowTitles', variable_name + end + + # Has an alert occurred? + # + # Related Assertions, automatically generated: + # * assert_alert_present + # * assert_alert_not_present + # * verify_alert_present + # * verify_alert_not_present + # * wait_for_alert_present + # * wait_for_alert_not_present + def store_alert_present variable_name + command 'storeAlertPresent', variable_name + end + + # Returns every instance of some attribute from all known windows. + # + # Related Assertions, automatically generated: + # * assert_attribute_from_all_windows(attribute_name, pattern) + # * assert_not_attribute_from_all_windows(attribute_name, pattern) + # * verify_attribute_from_all_windows(attribute_name, pattern) + # * verify_not_attribute_from_all_windows(attribute_name, pattern) + # * wait_for_attribute_from_all_windows(attribute_name, pattern) + # * wait_for_not_attribute_from_all_windows(attribute_name, pattern) + def store_attribute_from_all_windows attribute_name, variable_name + command 'storeAttributeFromAllWindows', attribute_name, variable_name + end + + # Has a prompt occurred? + # + # Related Assertions, automatically generated: + # * assert_prompt_present + # * assert_prompt_not_present + # * verify_prompt_present + # * verify_prompt_not_present + # * wait_for_prompt_present + # * wait_for_prompt_not_present + def store_prompt_present variable_name + command 'storePromptPresent', variable_name + end + + # Has confirm() been called? + # + # Related Assertions, automatically generated: + # * assert_confirmation_present + # * assert_confirmation_not_present + # * verify_confirmation_present + # * verify_confirmation_not_present + # * wait_for_confirmation_present + # * wait_for_confirmation_not_present + def store_confirmation_present variable_name + command 'storeConfirmationPresent', variable_name + end + + # Return all cookies of the current page under test. + # + # Related Assertions, automatically generated: + # * assert_cookie(pattern) + # * assert_not_cookie(pattern) + # * verify_cookie(pattern) + # * verify_not_cookie(pattern) + # * wait_for_cookie(pattern) + # * wait_for_not_cookie(pattern) + def store_cookie variable_name + command 'storeCookie', variable_name + end + + # Retrieves the text cursor position in the given input element or + # textarea; beware, this may not work perfectly on all browsers. + # + # This method will fail if the specified element isn't an input element + # or textarea, or there is no cursor in the element. + # + # Related Assertions, automatically generated: + # * assert_cursor_position(locator, pattern) + # * assert_not_cursor_position(locator, pattern) + # * verify_cursor_position(locator, pattern) + # * verify_not_cursor_position(locator, pattern) + # * wait_for_cursor_position(locator, pattern) + # * wait_for_not_cursor_position(locator, pattern) + def store_cursor_position locator, variable_name + command 'storeCursorPosition', locator, variable_name + end + + # Retrieves the message of a JavaScript alert generated during the previous + # action, or fail if there were no alerts. + # + # Getting an alert has the same effect as manually clicking OK. If an alert + # is generated but you do not get/verify it, the next Selenium action will + # fail. + # + # NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert + # dialog. + # + # NOTE: Selenium does NOT support JavaScript alerts that are generated in a + # page's onload() event handler. In this case a visible dialog WILL be + # generated and Selenium will hang until someone manually clicks OK. + # + # Related Assertions, automatically generated: + # * assert_alert(pattern) + # * assert_not_alert(pattern) + # * verify_alert_present(pattern) + # * verify_not_alert(pattern) + # * wait_for_alert(pattern) + # * wait_for_not_alert(pattern) + def store_alert variable_name + command 'storeAlert', variable_name + end + + # Retrieves the message of a JavaScript confirmation dialog generated during + # the previous action. + # + # By default, the confirm function will return +true+, having the same effect + # as manually clicking OK. This can be changed by prior execution of the + # +choose_cancel_on_next_confirmation+ command. If a confirmation is + # generated but you do not get/verify it, the next Selenium action will fail. + # + # NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible + # dialog. + # + # NOTE: Selenium does NOT support JavaScript confirmations that are generated + # in a page's onload() event handler. In this case a visible dialog WILL be + # generated and Selenium will hang until you manually click OK. + # + # Related Assertions, automatically generated: + # * assert_confirmation(pattern) + # * assert_not_confirmation(pattern) + # * verify_confirmation_present(pattern) + # * verify_not_confirmation(pattern) + # * wait_for_confirmation(pattern) + # * wait_for_not_confirmation(pattern) + def store_confirmation variable_name + command 'storeConfirmation', variable_name + end + + # Retrieves the message of a JavaScript question prompt dialog generated + # during the previous action. + # + # Successful handling of the prompt requires prior execution of the + # +answer_on_next_prompt+ command. If a prompt is generated but you do not + # get/verify it, the next Selenium action will fail. + # + # NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog. + # + # NOTE: Selenium does NOT support JavaScript prompts that are generated in a + # page's onload() event handler. In this case a visible dialog WILL be + # generated and Selenium will hang until someone manually clicks OK. + # + # Related Assertions, automatically generated: + # * assert_prompt(pattern) + # * assert_not_prompt(pattern) + # * verify_prompt_present(pattern) + # * verify_not_prompt(pattern) + # * wait_for_prompt(pattern) + # * wait_for_not_prompt(pattern) + def store_prompt variable_name + command 'storePrompt', variable_name + end + + # Gets the absolute URL of the current page. + # + # Related Assertions, automatically generated: + # * assert_absolute_location(pattern) + # * assert_not_absolute_location(pattern) + # * verify_absolute_location_present(pattern) + # * verify_not_absolute_location(pattern) + # * wait_for_absolute_location(pattern) + # * wait_for_not_absolute_location(pattern) + def store_absolute_location variable_name + command 'storeAbsoluteLocation', variable_name + end + + # Verify the location of the current page ends with the expected location. + # If an URL querystring is provided, this is checked as well. + # + # Related Assertions, automatically generated: + # * assert_location(pattern) + # * assert_not_location(pattern) + # * verify_location_present(pattern) + # * verify_not_location(pattern) + # * wait_for_location(pattern) + # * wait_for_not_location(pattern) + def store_location expected_location, variable_name + command 'storeLocation', expected_location, variable_name + end + + # Returns the number of pixels between "mousemove" events during + # drag_and_drop commands (default=10). + # + # Related Assertions, automatically generated: + # * assert_mouse_speed(pattern) + # * assert_not_mouse_speed(pattern) + # * verify_mouse_speed(pattern) + # * verify_not_mouse_speed(pattern) + # * wait_for_mouse_speed(pattern) + # * wait_for_not_mouse_speed(pattern) + def store_mouse_speed variable_name + command 'storeMouseSpeed', variable_name + end + + # Gets the title of the current page. + # + # Related Assertions, automatically generated: + # * assert_title(pattern) + # * assert_not_title(pattern) + # * verify_title_present(pattern) + # * verify_not_title(pattern) + # * wait_for_title(pattern) + # * wait_for_not_title(pattern) + def store_title variable_name + command 'storeTitle', variable_name + end + + # Gets the entire text of the page. + # + # Related Assertions, automatically generated: + # * assert_body_text(pattern) + # * assert_not_body_text(pattern) + # * verify_body_text_present(pattern) + # * verify_not_body_text(pattern) + # * wait_for_body_text(pattern) + # * wait_for_not_body_text(pattern) + def store_body_text variable_name + command 'storeBodyText', variable_name + end + + # Gets the (whitespace-trimmed) value of an input field (or anything else + # with a value parameter). For checkbox/radio elements, the value will be + # "on" or "off" depending on whether the element is checked or not. + # + # Related Assertions, automatically generated: + # * assert_value(locator, pattern) + # * assert_not_value(locator, pattern) + # * verify_value_present(locator, pattern) + # * verify_not_value(locator, pattern) + # * wait_for_value(locator, pattern) + # * wait_for_not_value(locator, pattern) + def store_value locator, variable_name + command 'storeValue', locator, variable_name + end + + # Gets the text of an element. This works for any element that contains text. + # This command uses either the +textContent+ (Mozilla-like browsers) or the + # +innerText+ (IE-like browsers) of the element, which is the rendered text + # shown to the user. + # + # Related Assertions, automatically generated: + # * assert_text(locator, pattern) + # * assert_not_text(locator, pattern) + # * verify_text_present(locator, pattern) + # * verify_not_text(locator, pattern) + # * wait_for_text(locator, pattern) + # * wait_for_not_text(locator, pattern) + def store_text locator, variable_name + command 'storeText', locator, variable_name + end + + # Gets the result of evaluating the specified JavaScript snippet. The snippet + # may have multiple lines, but only the result of the last line will be + # returned. + # + # Note that, by default, the snippet will run in the context of the + # "selenium" object itself, so +this+ will refer to the Selenium object, and + # +window+ will refer to the top-level runner test window, not the window of + # your application. + # + # If you need a reference to the window of your application, you can refer to + # this.browserbot.getCurrentWindow() and if you need to use a locator to + # refer to a single element in your application page, you can use + # this.page().findElement("foo") where "foo" is your locator. + # + # Related Assertions, automatically generated: + # * assert_eval(script, pattern) + # * assert_not_eval(script, pattern) + # * verify_eval_present(script, pattern) + # * verify_not_eval(script, pattern) + # * wait_for_eval(script, pattern) + # * wait_for_not_eval(script, pattern) + def store_eval script, variable_name + command 'storeEval', script, variable_name + end + + # Gets whether a toggle-button (checkbox/radio) is checked. Fails if the + # specified element doesn't exist or isn't a toggle-button. + # + # Related Assertions, automatically generated: + # * assert_checked(locator) + # * assert_not_checked(locator) + # * verify_checked_present(locator) + # * verify_not_checked(locator) + # * wait_for_checked(locator) + # * wait_for_not_checked(locator) + def store_checked locator, variable_name + command 'storeChecked', locator, variable_name + end + + # Gets the text from a cell of a table. + # + # Related Assertions, automatically generated: + # * assert_table(locator, row, column, pattern) + # * assert_not_table(locator, row, column, pattern) + # * verify_table_present(locator, row, column, pattern) + # * verify_not_table(locator, row, column, pattern) + # * wait_for_table(locator, row, column, pattern) + # * wait_for_not_table(locator, row, column, pattern) + def store_table locator, row, column, variable_name + command 'storeTable', "#{locator}.#{row}.#{column}", variable_name + end + + # Verifies that the selected option of a drop-down satisfies the + # option_locator. + # + # option_locator is typically just an option label (e.g. "John Smith"). + # + # See the select command for more information about option locators. + # + # NOTE: store_selected is currently not supported by Selenium Core. + # + # Related Assertions, automatically generated: + # * assert_selected(locator, option_locator) + # * assert_not_selected(locator, option_locator) + # * verify_selected_present(locator, option_locator) + # * verify_not_selected(locator, option_locator) + # * wait_for_selected(locator, option_locator) + # * wait_for_not_selected(locator, option_locator) + def store_selected locator, option_locator, variable_name + raise 'Not supported in Selenium Core at the moment' + end + + # Gets option element ID for selected option in the specified select element. + # + # Related Assertions, automatically generated: + # * assert_selected_id(select_locator, pattern) + # * assert_not_selected_id(select_locator, pattern) + # * verify_selected_id(select_locator, pattern) + # * verify_not_selected_id(select_locator, pattern) + # * wait_for_selected_id(select_locator, pattern) + # * wait_for_not_selected_id(select_locator, pattern) + def store_selected_id select_locator, variable_name + command 'storeSelectedId', select_locator, variable_name + end + + # Gets all option element IDs for selected options in the specified select + # or multi-select element. + # + # Related Assertions, automatically generated: + # * assert_selected_ids(select_locator, pattern) + # * assert_not_selected_ids(select_locator, pattern) + # * verify_selected_ids(select_locator, pattern) + # * verify_not_selected_ids(select_locator, pattern) + # * wait_for_selected_ids(select_locator, pattern) + # * wait_for_not_selected_ids(select_locator, pattern) + def store_selected_ids select_locator, variable_name + command 'storeSelectedIds', select_locator, variable_name + end + + # Gets option index (option number, starting at 0) for selected option in the + # specified select element. + # + # Related Assertions, automatically generated: + # * assert_selected_index(select_locator, pattern) + # * assert_not_selected_index(select_locator, pattern) + # * verify_selected_index(select_locator, pattern) + # * verify_not_selected_index(select_locator, pattern) + # * wait_for_selected_index(select_locator, pattern) + # * wait_for_not_selected_index(select_locator, pattern) + def store_selected_index select_locator, variable_name + command 'storeSelectedIndex', select_locator, variable_name + end + + # Gets all option indexes (option number, starting at 0) for selected options + # in the specified select or multi-select element. + # + # Related Assertions, automatically generated: + # * assert_selected_indexes(select_locator, pattern) + # * assert_not_selected_indexes(select_locator, pattern) + # * verify_selected_indexes(select_locator, pattern) + # * verify_not_selected_indexes(select_locator, pattern) + # * wait_for_selected_indexes(select_locator, pattern) + # * wait_for_not_selected_indexes(select_locator, pattern) + def store_selected_indexes select_locator, variable_name + command 'storeSelectedIndexes', select_locator, variable_name + end + + # Gets option label (visible text) for selected option in the specified select + # element. + # + # Related Assertions, automatically generated: + # * assert_selected_label(select_locator, pattern) + # * assert_not_selected_label(select_locator, pattern) + # * verify_selected_label(select_locator, pattern) + # * verify_not_selected_label(select_locator, pattern) + # * wait_for_selected_label(select_locator, pattern) + # * wait_for_not_selected_label(select_locator, pattern) + def store_selected_label select_locator, variable_name + command 'storeSelectedLabel', select_locator, variable_name + end + + # Gets all option labels (visible text) for selected options in the specified + # select or multi-select element. + # + # Related Assertions, automatically generated: + # * assert_selected_labels(select_locator, pattern) + # * assert_not_selected_labels(select_locator, pattern) + # * verify_selected_labels(select_locator, pattern) + # * verify_not_selected_labels(select_locator, pattern) + # * wait_for_selected_labels(select_locator, pattern) + # * wait_for_not_selected_labels(select_locator, pattern) + def store_selected_labels select_locator, variable_name + command 'storeSelectedLabels', select_locator, variable_name + end + + # Gets option value (value attribute) for selected option in the specified + # select element. + # + # Related Assertions, automatically generated: + # * assert_selected_value(select_locator, pattern) + # * assert_not_selected_value(select_locator, pattern) + # * verify_selected_value(select_locator, pattern) + # * verify_not_selected_value(select_locator, pattern) + # * wait_for_selected_value(select_locator, pattern) + # * wait_for_not_selected_value(select_locator, pattern) + def store_selected_value select_locator, variable_name + command 'storeSelectedValue', select_locator, variable_name + end + + # Gets all option values (value attribute) for selected options in the specified + # select or multi-select element. + # + # Related Assertions, automatically generated: + # * assert_selected_values(select_locator, pattern) + # * assert_not_selected_values(select_locator, pattern) + # * verify_selected_values(select_locator, pattern) + # * verify_not_selected_values(select_locator, pattern) + # * wait_for_selected_values(select_locator, pattern) + # * wait_for_not_selected_values(select_locator, pattern) + def store_selected_values select_locator, variable_name + command 'storeSelectedValues', select_locator, variable_name + end + + # Determines whether some option in a drop-down menu is selected. + # + # Related Assertions, automatically generated: + # * assert_something_selected(select_locator) + # * assert_not_something_selected(select_locator) + # * verify_something_selected(select_locator) + # * verify_not_something_selected(select_locator) + # * wait_for_something_selected(select_locator) + # * wait_for_not_something_selected(select_locator) + def store_something_selected select_locator, variable_name + command 'storeSomethingSelected', select_locator, variable_name + end + + # Gets all option labels for selected options in the specified select or + # multi-select element. + # + # The +pattern+ for the automatically generated assertions can either take an + # array or a pattern. + # assert_selected_options 'fruits', ['apple', 'pear'] + # assert_selected_options 'fruits', 'a*,p*' + # + # Related Assertions, automatically generated: + # * assert_selected_options(locator, pattern) + # * assert_not_selected_options(locator, pattern) + # * verify_selected_options_present(locator, pattern) + # * verify_not_selected_options(locator, pattern) + # * wait_for_selected_options(locator, pattern) + # * wait_for_not_selected_options(locator, pattern) + def store_selected_options locator, variable_name + command 'storeSelectedOptions', locator, variable_name + end + + # Gets all option labels in the specified select drop-down. + # + # The +pattern+ for the automatically generated assertions can either take an + # array or a pattern. + # assert_select_options 'fruits', ['apple', 'pear'] + # assert_select_options 'fruits', 'a*,p*' + # + # Related Assertions, automatically generated: + # * assert_select_options(locator, pattern) + # * assert_not_select_options(locator, pattern) + # * verify_select_options_present(locator, pattern) + # * verify_not_select_options(locator, pattern) + # * wait_for_select_options(locator, pattern) + # * wait_for_not_select_options(locator, pattern) + def store_select_options locator, variable_name + command 'storeSelectOptions', locator, variable_name + end + + # Gets the value of an element attribute. + # + # Related Assertions, automatically generated: + # * assert_attribute(locator, attribute_name, pattern) + # * assert_not_attribute(locator, attribute_name, pattern) + # * verify_attribute_present(locator, attribute_name, pattern) + # * verify_not_attribute(locator, attribute_name, pattern) + # * wait_for_attribute(locator, attribute_name, pattern) + # * wait_for_not_attribute(locator, attribute_name, pattern) + def store_attribute locator, attribute_name, variable_name + command 'storeAttribute', "#{locator}@#{attribute_name}", variable_name + end + + # Check if these two elements have same parent and are ordered. Two + # same elements will not be considered ordered. + # + # NOTE: store_ordered is currently not supported by Selenium Core. + # + # Related Assertions, automatically generated: + # * assert_ordered(locator_1, locator_2) + # * assert_not_ordered(locator_1, locator_2) + # * verify_ordered(locator_1, locator_2) + # * verify_not_ordered(locator_1, locator_2) + # * wait_for_ordered(locator_1, locator_2) + # * wait_for_not_ordered(locator_1, locator_2) + def store_ordered locator_1, locator_2, variable_name + raise 'Not supported in Selenium Core at the moment' + end + + # Verifies that the specified text pattern appears somewhere on the rendered + # page shown to the user. + # + # Related Assertions, automatically generated: + # * assert_text_present(pattern) + # * assert_text_not_present(pattern) + # * verify_text_present(pattern) + # * verify_text_not_present(pattern) + # * wait_for_text_present(pattern) + # * wait_for_text_not_present(pattern) + def store_text_present pattern, variable_name + command 'storeTextPresent', pattern, variable_name + end + + # Verifies that the specified element is somewhere on the page. + # + # Related Assertions, automatically generated: + # * assert_element_present(locator) + # * assert_element_not_present(locator) + # * verify_element_present(locator) + # * verify_element_not_present(locator) + # * wait_for_element_present(locator) + # * wait_for_element_not_present(locator) + def store_element_present locator, variable_name + command 'storeElementPresent', locator, variable_name + end + + # Determines if the specified element is visible. An element can be rendered + # invisible by setting the CSS "visibility" property to "hidden", or the + # "display" property to "none", either for the element itself or one if its + # ancestors. This method will fail if the element is not present. + # + # Related Assertions, automatically generated: + # * assert_visible(locator) + # * assert_not_visible(locator) + # * verify_visible(locator) + # * verify_not_visible(locator) + # * wait_for_visible(locator) + # * wait_for_not_visible(locator) + def store_visible locator, variable_name + command 'storeVisible', locator, variable_name + end + + # Retrieves the height of an element. This method will fail if the element + # is not present. + # + # Related Assertions, automatically generated: + # * assert_element_height(locator, pattern) + # * assert_not_element_height(locator, pattern) + # * verify_element_height(locator, pattern) + # * verify_not_element_height(locator, pattern) + # * wait_for_element_height(locator, pattern) + # * wait_for_not_element_height(locator, pattern) + def store_element_height locator, variable_name + command 'storeElementHeight', locator, variable_name + end + + # Get the relative index of an element to its parent (starting from 0). + # The comment node and empty text node will be ignored. + # + # Related Assertions, automatically generated: + # * assert_element_index(locator, pattern) + # * assert_not_element_index(locator, pattern) + # * verify_element_index(locator, pattern) + # * verify_not_element_index(locator, pattern) + # * wait_for_element_index(locator, pattern) + # * wait_for_not_element_index(locator, pattern) + def store_element_index locator, variable_name + command 'storeElementIndex', locator, variable_name + end + + # Retrieves the width of an element. This method will fail if the element + # is not present. + # + # Related Assertions, automatically generated: + # * assert_element_width(locator, pattern) + # * assert_not_element_width(locator, pattern) + # * verify_element_width(locator, pattern) + # * verify_not_element_width(locator, pattern) + # * wait_for_element_width(locator, pattern) + # * wait_for_not_element_width(locator, pattern) + def store_element_width locator, variable_name + command 'storeElementWidth', locator, variable_name + end + + # Retrieves the horizontal position of an element. This method will fail + # if the element is not present. + # + # Related Assertions, automatically generated: + # * assert_element_position_left(locator, pattern) + # * assert_not_element_position_left(locator, pattern) + # * verify_element_position_left(locator, pattern) + # * verify_not_element_position_left(locator, pattern) + # * wait_for_element_position_left(locator, pattern) + # * wait_for_not_element_position_left(locator, pattern) + def store_element_position_left locator, variable_name + command 'storeElementPositionLeft', locator, variable_name + end + + # Retrieves the vertical position of an element. This method will fail + # if the element is not present. + # + # Related Assertions, automatically generated: + # * assert_element_position_top(locator, pattern) + # * assert_not_element_position_top(locator, pattern) + # * verify_element_position_top(locator, pattern) + # * verify_not_element_position_top(locator, pattern) + # * wait_for_element_position_top(locator, pattern) + # * wait_for_not_element_position_top(locator, pattern) + def store_element_position_top locator, variable_name + command 'storeElementPositionTop', locator, variable_name + end + + # Return the contents of the log. + # + # Related Assertions, automatically generated: + # * assert_log_messages(pattern) + # * assert_not_log_messages(pattern) + # * verify_log_messages(pattern) + # * verify_not_log_messages(pattern) + # * wait_for_log_messages(pattern) + # * wait_for_not_log_messages(pattern) + def store_log_messages variable_name + command 'storeLogMessages', variable_name + end + + # Determines whether the specified input element is editable, i.e. hasn't + # been disabled. This method will fail if the specified element isn't an + # input element. + # + # Related Assertions, automatically generated: + # * assert_editable(locator) + # * assert_not_editable(locator) + # * verify_editable(locator) + # * verify_not_editable(locator) + # * wait_for_editable(locator) + # * wait_for_not_editable(locator) + def store_editable locator, variable_name + command 'storeEditable', locator, variable_name + end + + # Returns the IDs of all buttons on the page. + # + # If a given button has no ID, it will appear as "" in this array. + # + # The +pattern+ for the automatically generated assertions can either take an + # array or a pattern. + # assert_all_buttons ['but1', 'but2'] + # assert_all_buttons 'but?,but?*' + # + # Related Assertions, automatically generated: + # * assert_all_buttons(pattern) + # * assert_not_all_buttons(pattern) + # * verify_all_buttons(pattern) + # * verify_not_all_buttons(pattern) + # * wait_for_all_buttons(pattern) + # * wait_for_not_all_buttons(pattern) + def store_all_buttons variable_name + command 'storeAllButtons', variable_name + end + + # Returns the IDs of all links on the page. + # + # If a given link has no ID, it will appear as "" in this array. + # + # The +pattern+ for the automatically generated assertions can either take an + # array or a pattern. + # assert_all_links ['link1', 'link2'] + # assert_all_links 'link?,link?*' + # + # Related Assertions, automatically generated: + # * assert_all_links(pattern) + # * assert_not_all_links(pattern) + # * verify_all_links(pattern) + # * verify_not_all_links(pattern) + # * wait_for_all_links(pattern) + # * wait_for_not_all_links(pattern) + def store_all_links variable_name + command 'storeAllLinks', variable_name + end + + # Returns the IDs of all input fields on the page. + # + # If a given field has no ID, it will appear as "" in this array. + # + # The +pattern+ for the automatically generated assertions can either take an + # array or a pattern. + # assert_all_fields ['field1', 'field2'] + # assert_all_fields 'field?,field?*' + # + # Related Assertions, automatically generated: + # * assert_all_fields(pattern) + # * assert_not_all_fields(pattern) + # * verify_all_fields(pattern) + # * verify_not_all_fields(pattern) + # * wait_for_all_fields(pattern) + # * wait_for_not_all_fields(pattern) + def store_all_fields variable_name + command 'storeAllFields', variable_name + end + + # Returns the entire HTML source between the opening and closing "html" tags. + # + # Related Assertions, automatically generated: + # * assert_html_source(pattern) + # * assert_not_html_source(pattern) + # * verify_html_source(pattern) + # * verify_not_html_source(pattern) + # * wait_for_html_source(pattern) + # * wait_for_not_html_source(pattern) + def store_html_source variable_name + command 'storeHtmlSource', variable_name + end + + # Returns the specified expression. + # + # This is useful because of JavaScript preprocessing. + # + # Related Assertions, automatically generated: + # * assert_expression(expression, pattern) + # * assert_not_expression(expression, pattern) + # * verify_expression(expression, pattern) + # * verify_not_expression(expression, pattern) + # * wait_for_expression(expression, pattern) + # * wait_for_not_expression(expression, pattern) + def store_expression expression, variable_name + command 'storeExpression', expression, variable_name + end + + # Determine whether current/locator identify the frame containing this + # running code. + # + # This is useful in proxy injection mode, where this code runs in every + # browser frame and window, and sometimes the selenium server needs to + # identify the "current" frame. In this case, when the test calls select_frame, + # this routine is called for each frame to figure out which one has been + # selected. The selected frame will return true, while all others will return + # false. + # + # NOTE: store_whether_this_frame_match_frame_expression is currently + # not supported by Selenium Core. + # + # Related Assertions, automatically generated: + # * assert_whether_this_frame_match_frame_expression(current_frame_string, target) + # * assert_not_whether_this_frame_match_frame_expression(current_frame_string, target) + # * verify_whether_this_frame_match_frame_expression(current_frame_string, target) + # * verify_not_whether_this_frame_match_frame_expression(current_frame_string, target) + # * wait_for_whether_this_frame_match_frame_expression(current_frame_string, target) + # * wait_for_not_whether_this_frame_match_frame_expression(current_frame_string, target) + def store_whether_this_frame_match_frame_expression current_frame_string, target, variable_name + raise 'Not supported in Selenium Core at the moment' + end + + # Determine whether current_window_string plus target identify the window + # containing this running code. + # + # This is useful in proxy injection mode, where this code runs in every browser + # frame and window, and sometimes the selenium server needs to identify the + # "current" window. In this case, when the test calls select_window, this routine + # is called for each window to figure out which one has been selected. The selected + # window will return true, while all others will return false. + # + # NOTE: store_whether_this_window_match_window_expression is currently + # not supported by Selenium Core. + # + # Related Assertions, automatically generated: + # * assert_whether_this_window_match_window_expression(current_window_string, target) + # * assert_not_whether_this_window_match_window_expression(current_window_string, target) + # * verify_whether_this_window_match_window_expression(current_window_string, target) + # * verify_not_whether_this_window_match_window_expression(current_window_string, target) + # * wait_for_whether_this_window_match_window_expression(current_window_string, target) + # * wait_for_not_whether_this_window_match_window_expression(current_window_string, target) + def store_whether_this_window_match_window_expression current_window_string, target, variable_name + raise 'Not supported in Selenium Core at the moment' + end + +private + # Generates all assertions for the accessors. + def self.generate_methods + public_instance_methods.each do |method| + case method + when 'store_alert_present', + 'store_prompt_present', + 'store_confirmation_present' + each_assertion method do |assertion_method, command_name| + define_method assertion_method do + command command_name + end + end + when 'store_error_on_next', + 'store_failure_on_next', + 'store_alert', + 'store_all_window_ids', + 'store_all_window_names', + 'store_all_window_titles', + 'store_confirmation', + 'store_cookie', + 'store_log_messages', + 'store_mouse_speed', + 'store_prompt', + 'store_title', + 'store_body_text', + 'store_text_present', + 'store_element_present', + 'store_visible', + 'store_editable', + 'store_html_source', + 'store_checked', + 'store_something_selected' + each_assertion method do |assertion_method, command_name| + define_method assertion_method do |pattern| + command command_name, pattern + end + end + when 'store_attribute_from_all_windows', + 'store_value', + 'store_text', + 'store_eval', + 'store_cursor_position', + 'store_selected', + 'store_selected_id', + 'store_selected_ids', + 'store_selected_index', + 'store_selected_indexes', + 'store_selected_label', + 'store_selected_labels', + 'store_selected_value', + 'store_selected_values', + 'store_element_height', + 'store_element_index', + 'store_element_width', + 'store_element_position_left', + 'store_element_position_top', + 'store_expression', + 'store_ordered', + 'store_whether_this_frame_match_frame_expression', + 'store_whether_this_window_match_window_expression' + each_assertion method do |assertion_method, command_name| + define_method assertion_method do |arg1, arg2| + command command_name, arg1, arg2 + end + end + when 'store_all_buttons', + 'store_all_links', + 'store_all_fields' + each_assertion method do |assertion_method, command_name| + define_method assertion_method do |pattern| + command command_name, collection_arg(pattern) + end + end + when 'store_select_options', + 'store_selected_options' + each_assertion method do |assertion_method, command_name| + define_method assertion_method do |locator, pattern| + command command_name, locator, collection_arg(pattern) + end + end + when 'store_attribute' + each_assertion method do |assertion_method, command_name| + define_method assertion_method do |locator, attribute_name, pattern| + command command_name, "#{locator}@#{attribute_name}", pattern + end + end + when 'store_table' + each_assertion method do |assertion_method, command_name| + define_method assertion_method do |locator, row, column, pattern| + command command_name, "#{locator}.#{row}.#{column}", pattern + end + end + when 'store_absolute_location', + 'store_location' + each_assertion method do |assertion_method, command_name| + define_method assertion_method do |pattern| + if method == 'store_absolute_location' and pattern.is_a? Hash + pattern[:only_path] = false + end + + command command_name, url_arg(pattern) + end + end + when /^store_/ + raise 'internal error' + 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 + + generate_methods +end diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_actions.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_actions.rb index 65c272d1..480aefd6 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_actions.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_actions.rb @@ -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 :keep_session, - # :fixtures and :clear_tables - # 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. "focus", "blur"), to - # trigger the corresponding "on_event_" 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 #select 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 open 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 window.confirm() function will return - # +true+, as if the user had manually clicked OK. After running this command, - # the next call to confirm() 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 (window.prompt()). - 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+, :debug, :info, - # :warn or :error. - 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 - # selenium.browserbot.getCurrentWindow(), 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 wait_for* - # 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 :keep_session, + # :fixtures and :clear_tables + # 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. "focus", "blur"), to + # trigger the corresponding "on_event_" 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 #select 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 open 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 window.confirm() function will return + # +true+, as if the user had manually clicked OK. After running this command, + # the next call to confirm() 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 (window.prompt()). + 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: break is a reserved word in Ruby, so we have to simulate + # Selenium core's break() with brake() + 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: + # * name_value_pair - name and value of the cookie in a format "name=value" + # * options_string - options for the cookie. Currently supported options + # include 'path' and 'max_age'. The options_string's format is + # "path=/path/, max_age=60". 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 wait_for_page_to_load. + 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 wait_for_page_to_load. + 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 doMetaUp() 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 select_window 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: open_window("", "myFunnyWindow"). + 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: + # dom=frames["main"].frames["subframe"] + 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 doShiftUp() 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 store_expression. + 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 key_down, key_up, + # key_press 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 "type_keys" 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 "type_keys" 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+, :debug, :info, + # :warn or :error. + 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 + # selenium.browserbot.getCurrentWindow(), 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 wait_for* + # 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 + diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_accessors.rb.example b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_accessors.rb.example new file mode 100644 index 00000000..8f5d01fd --- /dev/null +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_accessors.rb.example @@ -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: + # * assert_text_length(locator, variable) + # * assert_not_text_length(locator, length) + # * verify_text_length(locator, length) + # * verify_not_text_length(locator, length) + # * wait_for_text_length(locator, length) + # * wait_for_not_text_length(locator, length) + 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: + # * assert_not_text_length(locator, text) + # * verify_text_length(locator, text) + # * verify_not_text_length(locator, text) + # * wait_for_text_length(locator, text) + # * wait_for_not_text_length(locator, text) + 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 \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_actions.rb.example b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_actions.rb.example new file mode 100644 index 00000000..7a775fdd --- /dev/null +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_actions.rb.example @@ -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 \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb index 0cdcb50d..660c0610 100644 --- a/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb +++ b/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb @@ -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 \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/lib/views/layout.rhtml b/vendor/plugins/selenium-on-rails/lib/views/layouts/layout.rhtml similarity index 97% rename from vendor/plugins/selenium-on-rails/lib/views/layout.rhtml rename to vendor/plugins/selenium-on-rails/lib/views/layouts/layout.rhtml index 16f827fd..84722786 100644 --- a/vendor/plugins/selenium-on-rails/lib/views/layout.rhtml +++ b/vendor/plugins/selenium-on-rails/lib/views/layouts/layout.rhtml @@ -1,18 +1,18 @@ - - - - Selenium on Rails<%= defined?(@page_title) ? ": #{@page_title}" : '' %> - - - -<%= @content_for_layout %> - + + + + Selenium on Rails<%= defined?(@page_title) ? ": #{@page_title}" : '' %> + + + +<%= @content_for_layout %> + \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/lib/views/record.rhtml b/vendor/plugins/selenium-on-rails/lib/views/record.rhtml index 65687553..a3ffa020 100644 --- a/vendor/plugins/selenium-on-rails/lib/views/record.rhtml +++ b/vendor/plugins/selenium-on-rails/lib/views/record.rhtml @@ -1,5 +1,5 @@ -
-<% @result.each_pair do |key, value| -%> - -<% end -%> -
<%= key %><%= value %>
+ +<% @result.each_pair do |key, value| -%> + +<% end -%> +
<%= key %><%= value %>
diff --git a/vendor/plugins/selenium-on-rails/lib/views/selenium_helper.rb b/vendor/plugins/selenium-on-rails/lib/views/selenium_helper.rb new file mode 100644 index 00000000..76aa216e --- /dev/null +++ b/vendor/plugins/selenium-on-rails/lib/views/selenium_helper.rb @@ -0,0 +1,9 @@ +module SeleniumHelper + include SeleniumOnRails::SuiteRenderer + include SeleniumOnRails::FixtureLoader + + def test_case_name filename + File.basename(filename).sub(/\..*/,'').humanize + end + +end diff --git a/vendor/plugins/selenium-on-rails/lib/views/setup.rhtml b/vendor/plugins/selenium-on-rails/lib/views/setup.rhtml index 4091124b..a67e67f9 100644 --- a/vendor/plugins/selenium-on-rails/lib/views/setup.rhtml +++ b/vendor/plugins/selenium-on-rails/lib/views/setup.rhtml @@ -1,67 +1,67 @@ -<% @page_title = 'Setup' -%> -<% if defined?(@session_wiped) or @cleared_tables.any? or @loaded_fixtures.any? -%> -
- <% if defined?(@session_wiped) -%> -

The session is wiped clean.

- <% end-%> - <% if @cleared_tables.any? -%> -

The following database tables are cleared:

-
    - <% for table in @cleared_tables -%> -
  • <%= table %>
  • - <% end-%> -
- <% end -%> - <% if @loaded_fixtures.any? -%> -

The following fixtures are loaded:

-
    - <% for fixture in @loaded_fixtures -%> -
  • <%= fixture %>
  • - <% end-%> -
- <% end -%> -
-<% end -%> - -
-

This page can be used to setup your Selenium tests. The following options can be used:

-
-
keep_session
-
- Per default the session is reset, so add keep_session in order to keep the current session. - - -
open<%= url_for %>?keep_session 
-
-
fixtures
-
- Loads one or many fixtures into the database. This will destroy the current data you have in your database! Use all as name in order to load all fixtures, or specify which fixtures that should be loaded (delimited by commas).
- If a test needs different data than you have in your fixtures, you can add another fixture set. A fixture set is just a sub directory in /test/fixtures/ where you can add alternate fixtures (e.g. /test/fixtures/blank/users.yml). - - - - -
open<%= url_for :fixtures => 'all' %> 
open<%= url_for :fixtures => 'fixture' %> 
open<%= url_for :fixtures => 'fixture_one' %>,fixture_two 
- Available fixtures
- <% fixtures = available_fixtures -%> - <% for fixture_set in fixtures.keys.sort -%> - In the <%= fixture_set.blank? ? 'default' : "#{fixture_set}" %> fixture set: -
    - <% fixtures[fixture_set].unshift fixture_set.blank? ? 'all' : "#{fixture_set}/all" -%> - <% for fixture in fixtures[fixture_set] -%> -
  • <%= fixture %>
  • - <% end -%> -
- <% end -%> -
-
clear_tables
-
- 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 fixtures above). - - - -
open<%= url_for :clear_tables => 'sessions' %> 
open<%= url_for :clear_tables => 'sessions' %>,outgoing_messages 
-
-
- -
+<% @page_title = 'Setup' -%> +<% if defined?(@session_wiped) or @cleared_tables.any? or @loaded_fixtures.any? -%> +
+ <% if defined?(@session_wiped) -%> +

The session is wiped clean.

+ <% end-%> + <% if @cleared_tables.any? -%> +

The following database tables are cleared:

+
    + <% for table in @cleared_tables -%> +
  • <%= table %>
  • + <% end-%> +
+ <% end -%> + <% if @loaded_fixtures.any? -%> +

The following fixtures are loaded:

+
    + <% for fixture in @loaded_fixtures -%> +
  • <%= fixture %>
  • + <% end-%> +
+ <% end -%> +
+<% end -%> + +
+

This page can be used to setup your Selenium tests. The following options can be used:

+
+
keep_session
+
+ Per default the session is reset, so add keep_session in order to keep the current session. + + +
open<%= url_for %>?keep_session 
+
+
fixtures
+
+ Loads one or many fixtures into the database. This will destroy the current data you have in your database! Use all as name in order to load all fixtures, or specify which fixtures that should be loaded (delimited by commas).
+ If a test needs different data than you have in your fixtures, you can add another fixture set. A fixture set is just a sub directory in /test/fixtures/ where you can add alternate fixtures (e.g. /test/fixtures/blank/users.yml). + + + + +
open<%= url_for :fixtures => 'all' %> 
open<%= url_for :fixtures => 'fixture' %> 
open<%= url_for :fixtures => 'fixture_one' %>,fixture_two 
+ Available fixtures
+ <% fixtures = available_fixtures -%> + <% for fixture_set in fixtures.keys.sort -%> + In the <%= fixture_set.blank? ? 'default' : "#{fixture_set}" %> fixture set: +
    + <% fixtures[fixture_set].unshift fixture_set.blank? ? 'all' : "#{fixture_set}/all" -%> + <% for fixture in fixtures[fixture_set] -%> +
  • <%= fixture %>
  • + <% end -%> +
+ <% end -%> +
+
clear_tables
+
+ 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 fixtures above). + + + +
open<%= url_for :clear_tables => 'sessions' %> 
open<%= url_for :clear_tables => 'sessions' %>,outgoing_messages 
+
+
+ +
diff --git a/vendor/plugins/selenium-on-rails/lib/views/test_suite.rhtml b/vendor/plugins/selenium-on-rails/lib/views/test_suite.rhtml index 5973fc97..2494a4ea 100644 --- a/vendor/plugins/selenium-on-rails/lib/views/test_suite.rhtml +++ b/vendor/plugins/selenium-on-rails/lib/views/test_suite.rhtml @@ -1,26 +1,26 @@ -<% @page_title = test_suite_name @suite_path -%> +<% @page_title = test_suite_name @suite_path -%> - - - - -<% for name, path in test_cases @suite_path -%> - -<% end -%> + + + +
<%= @page_title %>
<%= link_to_test_case name, path %>
+ +<% for name, path in test_cases @suite_path -%> + +<% end -%>
<%= @page_title %>
<%= link_to_test_case name, path %>
\ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/routes.rb b/vendor/plugins/selenium-on-rails/routes.rb index 40985dcd..5472f2e0 100644 --- a/vendor/plugins/selenium-on-rails/routes.rb +++ b/vendor/plugins/selenium-on-rails/routes.rb @@ -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 diff --git a/vendor/selenium/Blank.html b/vendor/plugins/selenium-on-rails/selenium-core/Blank.html similarity index 95% rename from vendor/selenium/Blank.html rename to vendor/plugins/selenium-on-rails/selenium-core/Blank.html index cb4432c0..8bd0fb64 100644 --- a/vendor/selenium/Blank.html +++ b/vendor/plugins/selenium-on-rails/selenium-core/Blank.html @@ -1,8 +1,8 @@ - - - - - -

selenium-rc initial page

- - + + + + + +

selenium-rc initial page

+ + diff --git a/vendor/selenium/InjectedRemoteRunner.html b/vendor/plugins/selenium-on-rails/selenium-core/InjectedRemoteRunner.html similarity index 95% rename from vendor/selenium/InjectedRemoteRunner.html rename to vendor/plugins/selenium-on-rails/selenium-core/InjectedRemoteRunner.html index cb4432c0..8bd0fb64 100644 --- a/vendor/selenium/InjectedRemoteRunner.html +++ b/vendor/plugins/selenium-on-rails/selenium-core/InjectedRemoteRunner.html @@ -1,8 +1,8 @@ - - - - - -

selenium-rc initial page

- - + + + + + +

selenium-rc initial page

+ + diff --git a/vendor/selenium/RemoteRunner.html b/vendor/plugins/selenium-on-rails/selenium-core/RemoteRunner.html similarity index 100% rename from vendor/selenium/RemoteRunner.html rename to vendor/plugins/selenium-on-rails/selenium-core/RemoteRunner.html diff --git a/vendor/selenium/SeleniumLog.html b/vendor/plugins/selenium-on-rails/selenium-core/SeleniumLog.html similarity index 100% rename from vendor/selenium/SeleniumLog.html rename to vendor/plugins/selenium-on-rails/selenium-core/SeleniumLog.html diff --git a/vendor/selenium/TestPrompt.html b/vendor/plugins/selenium-on-rails/selenium-core/TestPrompt.html similarity index 97% rename from vendor/selenium/TestPrompt.html rename to vendor/plugins/selenium-on-rails/selenium-core/TestPrompt.html index 58ba1cb0..d9d53b91 100644 --- a/vendor/selenium/TestPrompt.html +++ b/vendor/plugins/selenium-on-rails/selenium-core/TestPrompt.html @@ -1,123 +1,123 @@ - - - - - - Select a Test Suite - - - - - -
- -

- Test Suite: - -

- -

- -
- Options - -

- - -

- -

- -

- - -
- - -
- + + + + + + Select a Test Suite + + + + + +
+ +

+ Test Suite: + +

+ +

+ +
+ Options + +

+ + +

+ +

+ +

+ + +
+ + +
+ \ No newline at end of file diff --git a/vendor/selenium/TestRunner-splash.html b/vendor/plugins/selenium-on-rails/selenium-core/TestRunner-splash.html similarity index 95% rename from vendor/selenium/TestRunner-splash.html rename to vendor/plugins/selenium-on-rails/selenium-core/TestRunner-splash.html index da2acdce..032c36ec 100644 --- a/vendor/selenium/TestRunner-splash.html +++ b/vendor/plugins/selenium-on-rails/selenium-core/TestRunner-splash.html @@ -1,55 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - -
Test SuiteCurrent TestControl Panel
 
- - - -

Selenium

-

by ThoughtWorks and friends

- -

-For more information on Selenium, visit - -

-    http://selenium.openqa.org
-
- -
- - + + + + + + + + + + + + + + + + + + + + + + + + +
Test SuiteCurrent TestControl Panel
 
+ + + +

Selenium

+

by ThoughtWorks and friends

+ +

+For more information on Selenium, visit + +

+    http://selenium.openqa.org
+
+ +
+ + diff --git a/vendor/selenium/TestRunner.hta b/vendor/plugins/selenium-on-rails/selenium-core/TestRunner.hta similarity index 100% rename from vendor/selenium/TestRunner.hta rename to vendor/plugins/selenium-on-rails/selenium-core/TestRunner.hta diff --git a/vendor/selenium/TestRunner.html b/vendor/plugins/selenium-on-rails/selenium-core/TestRunner.html similarity index 100% rename from vendor/selenium/TestRunner.html rename to vendor/plugins/selenium-on-rails/selenium-core/TestRunner.html diff --git a/vendor/selenium/domviewer/butmin.gif b/vendor/plugins/selenium-on-rails/selenium-core/domviewer/butmin.gif similarity index 100% rename from vendor/selenium/domviewer/butmin.gif rename to vendor/plugins/selenium-on-rails/selenium-core/domviewer/butmin.gif diff --git a/vendor/selenium/domviewer/butplus.gif b/vendor/plugins/selenium-on-rails/selenium-core/domviewer/butplus.gif similarity index 100% rename from vendor/selenium/domviewer/butplus.gif rename to vendor/plugins/selenium-on-rails/selenium-core/domviewer/butplus.gif diff --git a/vendor/selenium/domviewer/domviewer.css b/vendor/plugins/selenium-on-rails/selenium-core/domviewer/domviewer.css similarity index 91% rename from vendor/selenium/domviewer/domviewer.css rename to vendor/plugins/selenium-on-rails/selenium-core/domviewer/domviewer.css index b64b2435..bc2547ac 100644 --- a/vendor/selenium/domviewer/domviewer.css +++ b/vendor/plugins/selenium-on-rails/selenium-core/domviewer/domviewer.css @@ -1,298 +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; +/****************************************************************************** +* 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; } \ No newline at end of file diff --git a/vendor/selenium/domviewer/domviewer.html b/vendor/plugins/selenium-on-rails/selenium-core/domviewer/domviewer.html similarity index 100% rename from vendor/selenium/domviewer/domviewer.html rename to vendor/plugins/selenium-on-rails/selenium-core/domviewer/domviewer.html diff --git a/vendor/selenium/domviewer/selenium-domviewer.js b/vendor/plugins/selenium-on-rails/selenium-core/domviewer/selenium-domviewer.js similarity index 100% rename from vendor/selenium/domviewer/selenium-domviewer.js rename to vendor/plugins/selenium-on-rails/selenium-core/domviewer/selenium-domviewer.js diff --git a/vendor/selenium/icons/all.png b/vendor/plugins/selenium-on-rails/selenium-core/icons/all.png similarity index 100% rename from vendor/selenium/icons/all.png rename to vendor/plugins/selenium-on-rails/selenium-core/icons/all.png diff --git a/vendor/selenium/icons/continue.png b/vendor/plugins/selenium-on-rails/selenium-core/icons/continue.png similarity index 100% rename from vendor/selenium/icons/continue.png rename to vendor/plugins/selenium-on-rails/selenium-core/icons/continue.png diff --git a/vendor/selenium/icons/continue_disabled.png b/vendor/plugins/selenium-on-rails/selenium-core/icons/continue_disabled.png similarity index 100% rename from vendor/selenium/icons/continue_disabled.png rename to vendor/plugins/selenium-on-rails/selenium-core/icons/continue_disabled.png diff --git a/vendor/selenium/icons/pause.png b/vendor/plugins/selenium-on-rails/selenium-core/icons/pause.png similarity index 100% rename from vendor/selenium/icons/pause.png rename to vendor/plugins/selenium-on-rails/selenium-core/icons/pause.png diff --git a/vendor/selenium/icons/pause_disabled.png b/vendor/plugins/selenium-on-rails/selenium-core/icons/pause_disabled.png similarity index 100% rename from vendor/selenium/icons/pause_disabled.png rename to vendor/plugins/selenium-on-rails/selenium-core/icons/pause_disabled.png diff --git a/vendor/selenium/icons/selected.png b/vendor/plugins/selenium-on-rails/selenium-core/icons/selected.png similarity index 100% rename from vendor/selenium/icons/selected.png rename to vendor/plugins/selenium-on-rails/selenium-core/icons/selected.png diff --git a/vendor/selenium/icons/step.png b/vendor/plugins/selenium-on-rails/selenium-core/icons/step.png similarity index 100% rename from vendor/selenium/icons/step.png rename to vendor/plugins/selenium-on-rails/selenium-core/icons/step.png diff --git a/vendor/selenium/icons/step_disabled.png b/vendor/plugins/selenium-on-rails/selenium-core/icons/step_disabled.png similarity index 100% rename from vendor/selenium/icons/step_disabled.png rename to vendor/plugins/selenium-on-rails/selenium-core/icons/step_disabled.png diff --git a/vendor/selenium/iedoc-core.xml b/vendor/plugins/selenium-on-rails/selenium-core/iedoc-core.xml similarity index 100% rename from vendor/selenium/iedoc-core.xml rename to vendor/plugins/selenium-on-rails/selenium-core/iedoc-core.xml diff --git a/vendor/selenium/iedoc.xml b/vendor/plugins/selenium-on-rails/selenium-core/iedoc.xml similarity index 100% rename from vendor/selenium/iedoc.xml rename to vendor/plugins/selenium-on-rails/selenium-core/iedoc.xml diff --git a/vendor/selenium/lib/cssQuery/cssQuery-p.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/cssQuery-p.js similarity index 99% rename from vendor/selenium/lib/cssQuery/cssQuery-p.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/cssQuery-p.js index 4a7eb88a..00e43a42 100644 --- a/vendor/selenium/lib/cssQuery/cssQuery-p.js +++ b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/cssQuery-p.js @@ -1,6 +1,6 @@ -/* - 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/ -*/ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 x=6(){7 1D="2.0.2";7 C=/\\s*,\\s*/;7 x=6(s,A){33{7 m=[];7 u=1z.32.2c&&!A;7 b=(A)?(A.31==22)?A:[A]:[1g];7 1E=18(s).1l(C),i;9(i=0;i<1E.y;i++){s=1y(1E[i]);8(U&&s.Z(0,3).2b("")==" *#"){s=s.Z(2);A=24([],b,s[1])}1A A=b;7 j=0,t,f,a,c="";H(j+~]/;7 20=/[\\s#.:>+~()@]|[^\\s#.:>+~()@]+/g;6 1y(s){8(S.l(s))s=" "+s;5 s.P(20)||[]};7 W=/\\s*([\\s>+~(),]|^|$)\\s*/g;7 I=/([\\s>+~,]|[^(]\\+|^)([#.:@])/g;7 18=6(s){5 s.O(W,"$1").O(I,"$1*$2")};7 1u={1Z:6(){5"\'"},P:/^(\'[^\']*\')|("[^"]*")$/,l:6(s){5 o.P.l(s)},1S:6(s){5 o.l(s)?s:o+s+o},1Y:6(s){5 o.l(s)?s.Z(1,-1):s}};7 1s=6(t){5 1u.1Y(t)};7 E=/([\\/()[\\]?{}|*+-])/g;6 R(s){5 s.O(E,"\\\\$1")};x.15("1j-2H",6(){D[">"]=6(r,f,t,n){7 e,i,j;9(i=0;i=c);5(c%m)==s}});x.15("1j-2m",6(){U=1i("L;/*@2l@8(@\\2k)U=K@2j@*/");8(!U){X=6(e,t,n){5 n?e.2i("*",t):e.X(t)};14=6(e,n){5!n||(n=="*")||(e.2h==n)};1h=1g.1I?6(e){5/1J/i.l(Q(e).1I)}:6(e){5 Q(e).1H.1f!="2g"};1e=6(e){5 e.2f||e.1G||1b(e)};6 1b(e){7 t="",n,i;9(i=0;(n=e.1F[i]);i++){1d(n.1c){F 11:F 1:t+=1b(n);1a;F 3:t+=n.2e;1a}}5 t}}});19=K;5 x}();',62,190,'|||||return|function|var|if|for||||||||pseudoClasses||||test|||this||AttributeSelector|||||||cssQuery|length|push|fr|id||selectors||case|nextElementSibling|while||tests|true|false|thisElement||replace|match|getDocument|regEscape||attributeSelectors|isMSIE|cache||getElementsByTagName|isNaN|slice|child||new|getAttribute|compareNamespace|addModule|previousElementSibling|compareTagName|parseSelector|loaded|break|_0|nodeType|switch|getTextContent|tagName|document|isXML|eval|css|_1|split|ch|parentNode|childElements|nthChild|disabled|firstElementChild|getText|RegExp|Quote|x22|PREFIX|lang|_2|arguments|else|all|links|version|se|childNodes|innerText|documentElement|contentType|xml|parseInt|indeterminate|checked|last|nth|lastElementChild|parse|_3|add|href|String|className|create|NS_IE|remove|toString|ST|select|Array|null|_4|mimeType|lastChild|firstChild|continue|modules|delete|join|caching|error|nodeValue|textContent|HTML|prefix|getElementsByTagNameNS|end|x5fwin32|cc_on|standard||odd|even|enabled|hash|location|target|not|only|empty|root|contains|level3|outerHTML|htmlFor|class|toLowerCase|Function|name|first|level2|prototype|item|scopeName|toUpperCase|ownerDocument|Document|XML|Boolean|URL|unknown|typeof|nextSibling|previousSibling|visited|link|valueOf|clearCache|catch|concat|constructor|callee|try'.split('|'),0,{})) +/* + 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/ +*/ +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 x=6(){7 1D="2.0.2";7 C=/\\s*,\\s*/;7 x=6(s,A){33{7 m=[];7 u=1z.32.2c&&!A;7 b=(A)?(A.31==22)?A:[A]:[1g];7 1E=18(s).1l(C),i;9(i=0;i<1E.y;i++){s=1y(1E[i]);8(U&&s.Z(0,3).2b("")==" *#"){s=s.Z(2);A=24([],b,s[1])}1A A=b;7 j=0,t,f,a,c="";H(j+~]/;7 20=/[\\s#.:>+~()@]|[^\\s#.:>+~()@]+/g;6 1y(s){8(S.l(s))s=" "+s;5 s.P(20)||[]};7 W=/\\s*([\\s>+~(),]|^|$)\\s*/g;7 I=/([\\s>+~,]|[^(]\\+|^)([#.:@])/g;7 18=6(s){5 s.O(W,"$1").O(I,"$1*$2")};7 1u={1Z:6(){5"\'"},P:/^(\'[^\']*\')|("[^"]*")$/,l:6(s){5 o.P.l(s)},1S:6(s){5 o.l(s)?s:o+s+o},1Y:6(s){5 o.l(s)?s.Z(1,-1):s}};7 1s=6(t){5 1u.1Y(t)};7 E=/([\\/()[\\]?{}|*+-])/g;6 R(s){5 s.O(E,"\\\\$1")};x.15("1j-2H",6(){D[">"]=6(r,f,t,n){7 e,i,j;9(i=0;i=c);5(c%m)==s}});x.15("1j-2m",6(){U=1i("L;/*@2l@8(@\\2k)U=K@2j@*/");8(!U){X=6(e,t,n){5 n?e.2i("*",t):e.X(t)};14=6(e,n){5!n||(n=="*")||(e.2h==n)};1h=1g.1I?6(e){5/1J/i.l(Q(e).1I)}:6(e){5 Q(e).1H.1f!="2g"};1e=6(e){5 e.2f||e.1G||1b(e)};6 1b(e){7 t="",n,i;9(i=0;(n=e.1F[i]);i++){1d(n.1c){F 11:F 1:t+=1b(n);1a;F 3:t+=n.2e;1a}}5 t}}});19=K;5 x}();',62,190,'|||||return|function|var|if|for||||||||pseudoClasses||||test|||this||AttributeSelector|||||||cssQuery|length|push|fr|id||selectors||case|nextElementSibling|while||tests|true|false|thisElement||replace|match|getDocument|regEscape||attributeSelectors|isMSIE|cache||getElementsByTagName|isNaN|slice|child||new|getAttribute|compareNamespace|addModule|previousElementSibling|compareTagName|parseSelector|loaded|break|_0|nodeType|switch|getTextContent|tagName|document|isXML|eval|css|_1|split|ch|parentNode|childElements|nthChild|disabled|firstElementChild|getText|RegExp|Quote|x22|PREFIX|lang|_2|arguments|else|all|links|version|se|childNodes|innerText|documentElement|contentType|xml|parseInt|indeterminate|checked|last|nth|lastElementChild|parse|_3|add|href|String|className|create|NS_IE|remove|toString|ST|select|Array|null|_4|mimeType|lastChild|firstChild|continue|modules|delete|join|caching|error|nodeValue|textContent|HTML|prefix|getElementsByTagNameNS|end|x5fwin32|cc_on|standard||odd|even|enabled|hash|location|target|not|only|empty|root|contains|level3|outerHTML|htmlFor|class|toLowerCase|Function|name|first|level2|prototype|item|scopeName|toUpperCase|ownerDocument|Document|XML|Boolean|URL|unknown|typeof|nextSibling|previousSibling|visited|link|valueOf|clearCache|catch|concat|constructor|callee|try'.split('|'),0,{})) diff --git a/vendor/selenium/lib/cssQuery/src/cssQuery-level2.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level2.js similarity index 97% rename from vendor/selenium/lib/cssQuery/src/cssQuery-level2.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level2.js index 02dd0e5f..2987b15b 100644 --- a/vendor/selenium/lib/cssQuery/src/cssQuery-level2.js +++ b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level2.js @@ -1,142 +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 +/* + 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 diff --git a/vendor/selenium/lib/cssQuery/src/cssQuery-level3.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level3.js similarity index 96% rename from vendor/selenium/lib/cssQuery/src/cssQuery-level3.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level3.js index 11d19664..4dce4651 100644 --- a/vendor/selenium/lib/cssQuery/src/cssQuery-level3.js +++ b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level3.js @@ -1,150 +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 +/* + 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 diff --git a/vendor/selenium/lib/cssQuery/src/cssQuery-standard.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-standard.js similarity index 97% rename from vendor/selenium/lib/cssQuery/src/cssQuery-standard.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-standard.js index 77314b86..309184d5 100644 --- a/vendor/selenium/lib/cssQuery/src/cssQuery-standard.js +++ b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-standard.js @@ -1,53 +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 +/* + 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 diff --git a/vendor/selenium/lib/cssQuery/src/cssQuery.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery.js similarity index 97% rename from vendor/selenium/lib/cssQuery/src/cssQuery.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery.js index 1fcab4a1..7a6efee8 100644 --- a/vendor/selenium/lib/cssQuery/src/cssQuery.js +++ b/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery.js @@ -1,356 +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 +/* + 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 diff --git a/vendor/selenium/lib/prototype.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/prototype.js similarity index 100% rename from vendor/selenium/lib/prototype.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/prototype.js diff --git a/vendor/selenium/lib/scriptaculous/builder.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/builder.js similarity index 100% rename from vendor/selenium/lib/scriptaculous/builder.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/builder.js diff --git a/vendor/selenium/lib/scriptaculous/controls.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/controls.js similarity index 100% rename from vendor/selenium/lib/scriptaculous/controls.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/controls.js diff --git a/vendor/selenium/lib/scriptaculous/dragdrop.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/dragdrop.js similarity index 100% rename from vendor/selenium/lib/scriptaculous/dragdrop.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/dragdrop.js diff --git a/vendor/selenium/lib/scriptaculous/effects.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/effects.js similarity index 100% rename from vendor/selenium/lib/scriptaculous/effects.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/effects.js diff --git a/vendor/selenium/lib/scriptaculous/scriptaculous.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/scriptaculous.js similarity index 100% rename from vendor/selenium/lib/scriptaculous/scriptaculous.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/scriptaculous.js diff --git a/vendor/selenium/lib/scriptaculous/slider.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/slider.js similarity index 100% rename from vendor/selenium/lib/scriptaculous/slider.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/slider.js diff --git a/vendor/selenium/lib/scriptaculous/unittest.js b/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/unittest.js similarity index 100% rename from vendor/selenium/lib/scriptaculous/unittest.js rename to vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/unittest.js diff --git a/vendor/selenium/scripts/find_matching_child.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/find_matching_child.js similarity index 100% rename from vendor/selenium/scripts/find_matching_child.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/find_matching_child.js diff --git a/vendor/selenium/scripts/htmlutils.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/htmlutils.js similarity index 100% rename from vendor/selenium/scripts/htmlutils.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/htmlutils.js diff --git a/vendor/selenium/scripts/injection.html b/vendor/plugins/selenium-on-rails/selenium-core/scripts/injection.html similarity index 100% rename from vendor/selenium/scripts/injection.html rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/injection.html diff --git a/vendor/selenium/scripts/injection_iframe.html b/vendor/plugins/selenium-on-rails/selenium-core/scripts/injection_iframe.html similarity index 100% rename from vendor/selenium/scripts/injection_iframe.html rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/injection_iframe.html diff --git a/vendor/selenium/scripts/js2html.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/js2html.js similarity index 100% rename from vendor/selenium/scripts/js2html.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/js2html.js diff --git a/vendor/selenium/scripts/narcissus-defs.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/narcissus-defs.js similarity index 100% rename from vendor/selenium/scripts/narcissus-defs.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/narcissus-defs.js diff --git a/vendor/selenium/scripts/narcissus-exec.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/narcissus-exec.js similarity index 100% rename from vendor/selenium/scripts/narcissus-exec.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/narcissus-exec.js diff --git a/vendor/selenium/scripts/narcissus-parse.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/narcissus-parse.js similarity index 100% rename from vendor/selenium/scripts/narcissus-parse.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/narcissus-parse.js diff --git a/vendor/selenium/scripts/se2html.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/se2html.js similarity index 100% rename from vendor/selenium/scripts/se2html.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/se2html.js diff --git a/vendor/selenium/scripts/selenium-api.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-api.js similarity index 100% rename from vendor/selenium/scripts/selenium-api.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-api.js diff --git a/vendor/selenium/scripts/selenium-browserbot.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-browserbot.js similarity index 100% rename from vendor/selenium/scripts/selenium-browserbot.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-browserbot.js diff --git a/vendor/selenium/scripts/selenium-browserdetect.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-browserdetect.js similarity index 100% rename from vendor/selenium/scripts/selenium-browserdetect.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-browserdetect.js diff --git a/vendor/selenium/scripts/selenium-commandhandlers.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-commandhandlers.js similarity index 100% rename from vendor/selenium/scripts/selenium-commandhandlers.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-commandhandlers.js diff --git a/vendor/selenium/scripts/selenium-executionloop.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-executionloop.js similarity index 100% rename from vendor/selenium/scripts/selenium-executionloop.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-executionloop.js diff --git a/vendor/selenium/scripts/selenium-logging.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-logging.js similarity index 100% rename from vendor/selenium/scripts/selenium-logging.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-logging.js diff --git a/vendor/selenium/scripts/selenium-remoterunner.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-remoterunner.js similarity index 100% rename from vendor/selenium/scripts/selenium-remoterunner.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-remoterunner.js diff --git a/vendor/selenium/scripts/selenium-testrunner.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-testrunner.js similarity index 100% rename from vendor/selenium/scripts/selenium-testrunner.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-testrunner.js diff --git a/vendor/selenium/scripts/selenium-version.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-version.js similarity index 100% rename from vendor/selenium/scripts/selenium-version.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-version.js diff --git a/vendor/selenium/scripts/user-extensions.js.sample b/vendor/plugins/selenium-on-rails/selenium-core/scripts/user-extensions.js.sample similarity index 100% rename from vendor/selenium/scripts/user-extensions.js.sample rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/user-extensions.js.sample diff --git a/vendor/selenium/scripts/xmlextras.js b/vendor/plugins/selenium-on-rails/selenium-core/scripts/xmlextras.js similarity index 100% rename from vendor/selenium/scripts/xmlextras.js rename to vendor/plugins/selenium-on-rails/selenium-core/scripts/xmlextras.js diff --git a/vendor/selenium/selenium-logo.png b/vendor/plugins/selenium-on-rails/selenium-core/selenium-logo.png similarity index 100% rename from vendor/selenium/selenium-logo.png rename to vendor/plugins/selenium-on-rails/selenium-core/selenium-logo.png diff --git a/vendor/selenium/selenium-test.css b/vendor/plugins/selenium-on-rails/selenium-core/selenium-test.css similarity index 100% rename from vendor/selenium/selenium-test.css rename to vendor/plugins/selenium-on-rails/selenium-core/selenium-test.css diff --git a/vendor/selenium/selenium.css b/vendor/plugins/selenium-on-rails/selenium-core/selenium.css similarity index 100% rename from vendor/selenium/selenium.css rename to vendor/plugins/selenium-on-rails/selenium-core/selenium.css diff --git a/vendor/selenium/xpath/dom.js b/vendor/plugins/selenium-on-rails/selenium-core/xpath/dom.js similarity index 100% rename from vendor/selenium/xpath/dom.js rename to vendor/plugins/selenium-on-rails/selenium-core/xpath/dom.js diff --git a/vendor/selenium/xpath/misc.js b/vendor/plugins/selenium-on-rails/selenium-core/xpath/misc.js similarity index 100% rename from vendor/selenium/xpath/misc.js rename to vendor/plugins/selenium-on-rails/selenium-core/xpath/misc.js diff --git a/vendor/selenium/xpath/xpath.js b/vendor/plugins/selenium-on-rails/selenium-core/xpath/xpath.js similarity index 100% rename from vendor/selenium/xpath/xpath.js rename to vendor/plugins/selenium-on-rails/selenium-core/xpath/xpath.js diff --git a/vendor/plugins/selenium-on-rails/switch_environment/init.rb b/vendor/plugins/selenium-on-rails/switch_environment/init.rb deleted file mode 100644 index 687cb995..00000000 --- a/vendor/plugins/selenium-on-rails/switch_environment/init.rb +++ /dev/null @@ -1,20 +0,0 @@ -#make sure the controller is accessible -$LOAD_PATH << File.dirname(__FILE__) -require 'switch_environment_controller' - -#hijack /selenium -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/*filename', - :controller => 'switch_environment', :action => 'index' - - yield map - end - end - end - end -end diff --git a/vendor/plugins/selenium-on-rails/tasks/test_acceptance.rake b/vendor/plugins/selenium-on-rails/tasks/test_acceptance.rake index a9598ca6..a29f8cf1 100644 --- a/vendor/plugins/selenium-on-rails/tasks/test_acceptance.rake +++ b/vendor/plugins/selenium-on-rails/tasks/test_acceptance.rake @@ -1,8 +1,8 @@ -task :test_acceptance => 'test:acceptance' -namespace :test do - desc 'Run Selenium tests in all browsers' - task :acceptance do - require File.dirname(__FILE__) + '/../lib/selenium_on_rails/acceptance_test_runner' - SeleniumOnRails::AcceptanceTestRunner.new.run - end -end +task :test_acceptance => 'test:acceptance' +namespace :test do + desc 'Run Selenium tests in all browsers' + task :acceptance do + require File.dirname(__FILE__) + '/../lib/selenium_on_rails/acceptance_test_runner' + SeleniumOnRails::AcceptanceTestRunner.new.run + end +end diff --git a/vendor/plugins/selenium-on-rails/test/renderer_test.rb b/vendor/plugins/selenium-on-rails/test/renderer_test.rb index 189094a5..2b676aa2 100644 --- a/vendor/plugins/selenium-on-rails/test/renderer_test.rb +++ b/vendor/plugins/selenium-on-rails/test/renderer_test.rb @@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/test_helper' class RendererTest < Test::Unit::TestCase def setup @controller = SeleniumController.new + ActionController::Routing::Routes.draw @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new @controller.layout_override =< 'html.html' #initialize the controller - assert_equal 'http://test.host/selenium/tests/suite/test_case.sel', + assert_equal 'http://test.host/selenium/tests/suite%2Ftest_case.sel', @controller.url_for(:controller => 'selenium', :action => 'test_file', :testname => 'suite/test_case.sel') end @@ -53,6 +54,7 @@ END def test_selenese get :test_file, :testname => 'selenese.sel' + assert_headers expected =<test layout @@ -81,7 +83,7 @@ END open/selenium/setup?keep_session=true  open/selenium/setup?fixtures=all  open/selenium/setup?fixtures=foo%2Cbar  - open/selenium/setup?fixtures=all&amp;clear_tables=foo%2Cbar  + open/selenium/setup?clear_tables=foo%2Cbar&amp;fixtures=all  assertAbsoluteLocationexact:http://test.host/selenium/setup  assertTitleselenium  assertTitlePartial from RSelenese  diff --git a/vendor/plugins/selenium-on-rails/test/rselenese_test.rb b/vendor/plugins/selenium-on-rails/test/rselenese_test.rb index b85ed581..3dfb71fb 100644 --- a/vendor/plugins/selenium-on-rails/test/rselenese_test.rb +++ b/vendor/plugins/selenium-on-rails/test/rselenese_test.rb @@ -1,403 +1,693 @@ -require File.dirname(__FILE__) + '/test_helper' - -class RSeleneseTest < Test::Unit::TestCase - include ERB::Util - - def rselenese name, input, partial = nil, type = nil - view = TestView.new - view.override_partial partial, type do - view.assigns['page_title'] = name - view.render_template 'rsel', input - end - end - - def assert_rselenese expected, name, input, partial = nil, type = nil - assert_text_equal(expected, rselenese(name, input, partial, type)) - end - - def test_empty - expected = < -Empty - -END - input = '' - assert_rselenese expected, 'Empty', input - end - - def assert_generates_command expected, name, *args - expected = expected.map {|v| h(v) } - expected << ' ' while expected.length < 3 - expected = expected.map {|v| "#{v}" }.join - expected_html = < -Selenese Commands -#{expected} - -END - args_str = args.map {|a| a.inspect }.join(',') - input = "#{name}(#{args_str})" - assert_rselenese expected_html, 'Selenese Commands', input - end - - def test_element_locators - assert_generates_command %w{click aCheckbox}, :click, 'aCheckbox' - assert_generates_command %w{click document.foo}, :click, 'document.foo' - assert_generates_command %w{click //a}, :click, '//a' - end - - def test_collection_arguments - assert_generates_command ['assertAllLinks', 'link1,link2,link3'], :assert_all_links, ['link1', 'link2','link3'] - assert_generates_command ['assertAllLinks', 'link?,link?,link?'], :assert_all_links, 'link?,link?,link?' - end - - ARG_VALUE_MAP = { - # We can't test url_for style arguments here, because we don't have - # a valid controller to interpret them. See RendererTest. - :url => '/relative/url', - :string => '1234', - :pattern => 'glob:J* Smith', # Also: many other formats. - :variable => 'varname', - :locator => 'foo', - :script => 'script', - :locator_and_attribute_name => [['foo', 'attribute'], 'foo@attribute'], - :table_locator => [['table', 2, 4], 'table.2.4'], - :coll_pattern => [[['a', "b\\", 'c,']], "a,b\\\\,c\\,"], - :event_name => 'eventName', - :keycode => 123, - :option_locator => 'label=hello', - :window_id => [[nil], 'null'], - :timeout => 123, - :log_level => :debug - } - - # Call _command_ with _args_ and make sure it produces a good table. - # If the input command doesn't 'selenize' cleanly (e.g. if the input command - # is :do_foo and the expected result is +dofoo+ and not +doFoo+) +command+ - # can be specified as an array (e.g. +[:input_command, 'expectedResult']). - def assert_command_works command, *args - expected_values = args.inject([]) do |c, arg| - v = ARG_VALUE_MAP[arg] - if v.is_a? Array - c << v[1] - else - c << v - end - end - input_values = args.inject([]) do |c, arg| - v = ARG_VALUE_MAP[arg] - if v.is_a? Array - c.concat v[0] - else - c << v - end - end - input_name, expected_name = (command.is_a?(Array) ? command : [command, SeleniumOnRails::TestBuilder.selenize(command.to_s)]) - assert_generates_command [expected_name]+expected_values, input_name.to_s, *input_values - end - - def test_action_commands - assert_command_works :click, :locator - assert_command_works :click_and_wait, :locator - assert_command_works :fire_event, :locator, :event_name - assert_command_works :fire_event_and_wait, :locator, :event_name - assert_command_works :key_press, :locator, :keycode - assert_command_works :key_press_and_wait, :locator, :keycode - assert_command_works :key_down, :locator, :keycode - assert_command_works :key_down_and_wait, :locator, :keycode - assert_command_works :key_up, :locator, :keycode - assert_command_works :key_up_and_wait, :locator, :keycode - assert_command_works :mouse_over, :locator - assert_command_works :mouse_over_and_wait, :locator - assert_command_works :mouse_down, :locator - assert_command_works :mouse_down_and_wait, :locator - assert_command_works :type, :locator, :string - assert_command_works :type_and_wait, :locator, :string - assert_command_works :check, :locator - assert_command_works :check_and_wait, :locator - assert_command_works :uncheck, :locator - assert_command_works :uncheck_and_wait, :locator - assert_command_works :select, :locator, :option_locator - assert_command_works :select_and_wait, :locator, :option_locator - assert_command_works :add_selection, :locator, :option_locator - assert_command_works :add_selection_and_wait, :locator, :option_locator - assert_command_works :remove_selection, :locator, :option_locator - assert_command_works :remove_selection_and_wait, :locator, :option_locator - assert_command_works :submit, :locator - assert_command_works :open, :url - assert_command_works :select_window, :window_id - assert_command_works [:wait_for_popup, 'waitForPopUp'], :window_id, :timeout - assert_command_works :choose_cancel_on_next_confirmation - assert_command_works :choose_cancel_on_next_confirmation_and_wait - assert_command_works :answer_on_next_prompt, :string - assert_command_works :answer_on_next_prompt_and_wait, :string - assert_command_works :go_back - assert_command_works :refresh - assert_command_works :close - assert_command_works :set_context, :string - assert_command_works :set_context, :string, :log_level - assert_command_works :wait_for_condition, :script, :timeout - assert_command_works :set_timeout, :timeout - assert_command_works :wait_for_page_to_load, :timeout - end - - def test_accessor_commands - assert_command_works :store_alert_present, :variable - assert_command_works :assert_alert_present - assert_command_works :assert_alert_not_present - assert_command_works :verify_alert_present - assert_command_works :verify_alert_not_present - assert_command_works :wait_for_alert_present - assert_command_works :wait_for_alert_not_present - - assert_command_works :store_prompt_present, :variable - assert_command_works :assert_prompt_present - assert_command_works :assert_prompt_not_present - assert_command_works :verify_prompt_present - assert_command_works :verify_prompt_not_present - assert_command_works :wait_for_prompt_present - assert_command_works :wait_for_prompt_not_present - - assert_command_works :store_confirmation_present, :variable - assert_command_works :assert_confirmation_present - assert_command_works :assert_confirmation_not_present - assert_command_works :verify_confirmation_present - assert_command_works :verify_confirmation_not_present - assert_command_works :wait_for_confirmation_present - assert_command_works :wait_for_confirmation_not_present - - assert_command_works :store_alert, :variable - assert_command_works :assert_alert, :pattern - assert_command_works :assert_not_alert, :pattern - assert_command_works :verify_alert, :pattern - assert_command_works :verify_not_alert, :pattern - assert_command_works :wait_for_alert, :pattern - assert_command_works :wait_for_not_alert, :pattern - - assert_command_works :store_confirmation, :variable - assert_command_works :assert_confirmation, :pattern - assert_command_works :assert_not_confirmation, :pattern - assert_command_works :verify_confirmation, :pattern - assert_command_works :verify_not_confirmation, :pattern - assert_command_works :wait_for_confirmation, :pattern - assert_command_works :wait_for_not_confirmation, :pattern - - assert_command_works :store_prompt, :variable - assert_command_works :assert_prompt, :pattern - assert_command_works :assert_not_prompt, :pattern - assert_command_works :verify_prompt, :pattern - assert_command_works :verify_not_prompt, :pattern - assert_command_works :wait_for_prompt, :pattern - assert_command_works :wait_for_not_prompt, :pattern - - assert_command_works :store_absolute_location, :variable - assert_command_works :assert_absolute_location, :url - assert_command_works :assert_not_absolute_location, :url - assert_command_works :verify_absolute_location, :url - assert_command_works :verify_not_absolute_location, :url - assert_command_works :wait_for_absolute_location, :url - assert_command_works :wait_for_not_absolute_location, :url - - assert_command_works :store_location, :pattern, :variable - assert_command_works :assert_location, :url - assert_command_works :assert_not_location, :url - assert_command_works :verify_location, :url - assert_command_works :verify_not_location, :url - assert_command_works :wait_for_location, :url - assert_command_works :wait_for_not_location, :url - - assert_command_works :store_title, :variable - assert_command_works :assert_title, :pattern - assert_command_works :assert_not_title, :pattern - assert_command_works :verify_title, :pattern - assert_command_works :verify_not_title, :pattern - assert_command_works :wait_for_title, :pattern - assert_command_works :wait_for_not_title, :pattern - - assert_command_works :store_body_text, :variable - assert_command_works :assert_body_text, :pattern - assert_command_works :assert_not_body_text, :pattern - assert_command_works :verify_body_text, :pattern - assert_command_works :verify_not_body_text, :pattern - assert_command_works :wait_for_body_text, :pattern - assert_command_works :wait_for_not_body_text, :pattern - - assert_command_works :store_value, :locator, :variable - assert_command_works :assert_value, :locator, :pattern - assert_command_works :assert_not_value, :locator, :pattern - assert_command_works :verify_value, :locator, :pattern - assert_command_works :verify_not_value, :locator, :pattern - assert_command_works :wait_for_value, :locator, :pattern - assert_command_works :wait_for_not_value, :locator, :pattern - - assert_command_works :store_text, :locator, :variable - assert_command_works :assert_text, :locator, :pattern - assert_command_works :assert_not_text, :locator, :pattern - assert_command_works :verify_text, :locator, :pattern - assert_command_works :verify_not_text, :locator, :pattern - assert_command_works :wait_for_text, :locator, :pattern - assert_command_works :wait_for_not_text, :locator, :pattern - - assert_command_works :store_eval, :script, :variable - assert_command_works :assert_eval, :script, :pattern - assert_command_works :assert_not_eval, :script, :pattern - assert_command_works :verify_eval, :script, :pattern - assert_command_works :verify_not_eval, :script, :pattern - assert_command_works :wait_for_eval, :script, :pattern - assert_command_works :wait_for_not_eval, :script, :pattern - - assert_command_works :store_checked, :locator, :variable - assert_command_works :assert_checked, :locator, :pattern - assert_command_works :assert_not_checked, :locator, :pattern - assert_command_works :verify_checked, :locator, :pattern - assert_command_works :verify_not_checked, :locator, :pattern - assert_command_works :wait_for_checked, :locator, :pattern - assert_command_works :wait_for_not_checked, :locator, :pattern - - assert_command_works :store_table, :table_locator, :variable - assert_command_works :assert_table, :table_locator, :pattern - assert_command_works :assert_not_table, :table_locator, :pattern - assert_command_works :verify_table, :table_locator, :pattern - assert_command_works :verify_not_table, :table_locator, :pattern - assert_command_works :wait_for_table, :table_locator, :pattern - assert_command_works :wait_for_not_table, :table_locator, :pattern - - assert_raise RuntimeError do - assert_command_works :store_selected, :locator, :option_locator, :variable - end - assert_command_works :assert_selected, :locator, :option_locator - assert_command_works :assert_not_selected, :locator, :option_locator - assert_command_works :verify_selected, :locator, :option_locator - assert_command_works :verify_not_selected, :locator, :option_locator - assert_command_works :wait_for_selected, :locator, :option_locator - assert_command_works :wait_for_not_selected, :locator, :option_locator - - assert_command_works :store_selected_options, :locator, :variable - assert_command_works :assert_selected_options, :locator, :coll_pattern - assert_command_works :assert_not_selected_options, :locator, :coll_pattern - assert_command_works :verify_selected_options, :locator, :coll_pattern - assert_command_works :verify_not_selected_options, :locator, :coll_pattern - assert_command_works :wait_for_selected_options, :locator, :coll_pattern - assert_command_works :wait_for_not_selected_options, :locator, :coll_pattern - - assert_command_works :store_select_options, :locator, :variable - assert_command_works :assert_select_options, :locator, :coll_pattern - assert_command_works :assert_not_select_options, :locator, :coll_pattern - assert_command_works :verify_select_options, :locator, :coll_pattern - assert_command_works :verify_not_select_options, :locator, :coll_pattern - assert_command_works :wait_for_select_options, :locator, :coll_pattern - assert_command_works :wait_for_not_select_options, :locator, :coll_pattern - - assert_command_works :store_attribute, :locator_and_attribute_name, :variable - assert_command_works :assert_attribute, :locator_and_attribute_name, :pattern - assert_command_works :assert_not_attribute, :locator_and_attribute_name, :pattern - assert_command_works :verify_attribute, :locator_and_attribute_name, :pattern - assert_command_works :verify_not_attribute, :locator_and_attribute_name, :pattern - assert_command_works :wait_for_attribute, :locator_and_attribute_name, :pattern - assert_command_works :wait_for_not_attribute, :locator_and_attribute_name, :pattern - - assert_command_works :store_text_present, :pattern, :variable - assert_command_works :assert_text_present, :pattern - assert_command_works :assert_text_not_present, :pattern - assert_command_works :verify_text_present, :pattern - assert_command_works :verify_text_not_present, :pattern - assert_command_works :wait_for_text_present, :pattern - assert_command_works :wait_for_text_not_present, :pattern - - assert_command_works :store_element_present, :locator, :variable - assert_command_works :assert_element_present, :locator - assert_command_works :assert_element_not_present, :locator - assert_command_works :verify_element_present, :locator - assert_command_works :verify_element_not_present, :locator - assert_command_works :wait_for_element_present, :locator - assert_command_works :wait_for_element_not_present, :locator - - assert_command_works :store_visible, :locator, :variable - assert_command_works :assert_visible, :locator - assert_command_works :assert_not_visible, :locator - assert_command_works :verify_visible, :locator - assert_command_works :verify_not_visible, :locator - assert_command_works :wait_for_visible, :locator - assert_command_works :wait_for_not_visible, :locator - - assert_command_works :store_editable, :locator, :variable - assert_command_works :assert_editable, :locator - assert_command_works :assert_not_editable, :locator - assert_command_works :verify_editable, :locator - assert_command_works :verify_not_editable, :locator - assert_command_works :wait_for_editable, :locator - assert_command_works :wait_for_not_editable, :locator - - assert_command_works :store_all_buttons, :variable - assert_command_works :assert_all_buttons, :coll_pattern - assert_command_works :assert_not_all_buttons, :coll_pattern - assert_command_works :verify_all_buttons, :coll_pattern - assert_command_works :verify_not_all_buttons, :coll_pattern - assert_command_works :wait_for_all_buttons, :coll_pattern - assert_command_works :wait_for_not_all_buttons, :coll_pattern - - assert_command_works :store_all_links, :variable - assert_command_works :assert_all_links, :coll_pattern - assert_command_works :assert_not_all_links, :coll_pattern - assert_command_works :verify_all_links, :coll_pattern - assert_command_works :verify_not_all_links, :coll_pattern - assert_command_works :wait_for_all_links, :coll_pattern - assert_command_works :wait_for_not_all_links, :coll_pattern - - assert_command_works :store_all_fields, :variable - assert_command_works :assert_all_fields, :coll_pattern - assert_command_works :assert_not_all_fields, :coll_pattern - assert_command_works :verify_all_fields, :coll_pattern - assert_command_works :verify_not_all_fields, :coll_pattern - assert_command_works :wait_for_all_fields, :coll_pattern - assert_command_works :wait_for_not_all_fields, :coll_pattern - - assert_command_works :store_html_source, :variable - assert_command_works :assert_html_source, :pattern - assert_command_works :assert_not_html_source, :pattern - assert_command_works :verify_html_source, :pattern - assert_command_works :verify_not_html_source, :pattern - assert_command_works :wait_for_html_source, :pattern - assert_command_works :wait_for_not_html_source, :pattern - - assert_command_works :store_expression, :script, :variable - assert_command_works :assert_expression, :script, :pattern - assert_command_works :assert_not_expression, :script, :pattern - assert_command_works :verify_expression, :script, :pattern - assert_command_works :verify_not_expression, :script, :pattern - assert_command_works :wait_for_expression, :script, :pattern - assert_command_works :wait_for_not_expression, :script, :pattern - end - - def test_partial_support - expected = < -Partial support -typepartialRSelenese partial - -END - input = "include_partial 'override'" - partial = "type 'partial', 'RSelenese partial'" - assert_rselenese expected, 'Partial support', input, partial, 'rsel' - end - - def test_partial_support_with_local_assigns - expected = < -Partial support with local variables -typepartialRSelenese partial -typelocalpar -typelocaltial - -END_EXPECTED - input = "include_partial 'override', :locator => 'local', :input => ['par', 'tial']" - partial = < page_title} + end + + def create_rsel_file_from(input, name) + File.open(test_path_for(name), 'w+') { |index_file| index_file << input } + end + + def test_path_for(name) + "#{File.expand_path(File.dirname(__FILE__) + "/../test_data")}/#{name}" + end + + def assert_rselenese expected, name, input + assert_text_equal expected, render_rselenese(name, input) + end + + def test_empty + expected = < +Empty + +END + input = '' + assert_rselenese expected, 'Empty', input + end + + def assert_generates_command expected, name, *args + expected = expected.map {|v| h(v) } + expected << ' ' while expected.length < 3 + expected = expected.map {|v| "#{v}" }.join + expected_html = < +Selenese Commands +#{expected} + +END + args_str = args.map {|a| a.inspect }.join(',') + input = "#{name}(#{args_str})" + assert_rselenese expected_html, 'Selenese Commands', input + end + + def test_element_locators + assert_generates_command %w{click aCheckbox}, :click, 'aCheckbox' + assert_generates_command %w{click document.foo}, :click, 'document.foo' + # assert_generates_command %w{click //a}, :click, '//a' + end + + def test_collection_arguments + # assert_generates_command ['assertAllLinks', 'link1,link2,link3'], :assert_all_links, ['link1', 'link2','link3'] + # assert_generates_command ['assertAllLinks', 'link?,link?,link?'], :assert_all_links, 'link?,link?,link?' + end + + ARG_VALUE_MAP = { + # We can't test url_for style arguments here, because we don't have + # a valid controller to interpret them. See RendererTest. + :url => '/relative/url', + :string => '1234', + :pattern => 'glob:J* Smith', # Also: many other formats. + :dimension => '10', + :variable => 'varname', + :locator => 'foo', + :coord_string => '10,20', + :movements_string => '+70,-300', + :script => 'script', + :attribute_name => 'attribute', + :locator_and_attribute_name => [['foo', 'attribute'], 'foo@attribute'], + :table_locator => [['table', 2, 4], 'table.2.4'], + :coll_pattern => [[['a', "b\\", 'c,']], "a,b\\\\,c\\,"], + :event_name => 'eventName', + :keycode => 123, + :option_locator => 'label=hello', + :window_id => [[nil], 'null'], + :window_name => 'myWindow', + :timeout => 123, + :integer => 1, + :log_level => :debug, + :name_value_pair => 'name=value', + :options_string => 'path=/path/, max_age=60' + } + + # Call _command_ with _args_ and make sure it produces a good table. + # If the input command doesn't 'selenize' cleanly (e.g. if the input command + # is :do_foo and the expected result is +dofoo+ and not +doFoo+) +command+ + # can be specified as an array (e.g. +[:input_command, 'expectedResult']+). + def assert_command_works command, *args + expected_values = args.inject([]) do |c, arg| + v = ARG_VALUE_MAP[arg] + if v.is_a? Array + c << v[1] + else + c << v + end + end + input_values = args.inject([]) do |c, arg| + v = ARG_VALUE_MAP[arg] + if v.is_a? Array + c.concat v[0] + else + c << v + end + end + input_name, expected_name = (command.is_a?(Array) ? command : [command, SeleniumOnRails::TestBuilder.selenize(command.to_s)]) + assert_generates_command [expected_name]+expected_values, input_name.to_s, *input_values + end + + def test_action_commands + assert_command_works [:brake, 'break'] + assert_command_works :create_cookie, :name_value_pair, :options_string + assert_command_works :delete_cookie, :string, :string + assert_command_works :double_click, :locator + assert_command_works :double_click_at, :locator, :coord_string + assert_command_works :drag_and_drop, :locator, :movements_string + assert_command_works :drag_and_drop_to_object, :locator, :locator + assert_command_works :echo, :string + assert_command_works :highlight, :locator + assert_command_works :meta_key_down + assert_command_works :meta_key_up + assert_command_works :mouse_down_at, :locator, :coord_string + assert_command_works :mouse_move, :locator + assert_command_works :mouse_move_at, :locator, :coord_string + assert_command_works :mouse_out, :locator + assert_command_works :mouse_up, :locator + assert_command_works :mouse_up_at, :locator, :coord_string + assert_command_works :open_window, :url, :integer + assert_command_works :pause, :timeout + assert_command_works :remove_all_selections, :locator + assert_command_works :select_frame, :locator + assert_command_works :set_cursor_position, :locator, :integer + assert_command_works :set_mouse_speed, :integer + assert_command_works :shift_key_down + assert_command_works :shift_key_up + assert_command_works :store, :script, :variable + assert_command_works :type_keys, :locator, :string + assert_command_works :window_focus, :window_name + assert_command_works :window_maximize, :window_name + assert_command_works :click, :locator + assert_command_works :click_and_wait, :locator + assert_command_works :click_at, :locator, :coord_string + assert_command_works :fire_event, :locator, :event_name + assert_command_works :fire_event_and_wait, :locator, :event_name + assert_command_works :key_press, :locator, :keycode + assert_command_works :key_press_and_wait, :locator, :keycode + assert_command_works :key_down, :locator, :keycode + assert_command_works :key_down_and_wait, :locator, :keycode + assert_command_works :key_up, :locator, :keycode + assert_command_works :key_up_and_wait, :locator, :keycode + assert_command_works :alt_key_down + assert_command_works :alt_key_up + assert_command_works :control_key_down + assert_command_works :control_key_up + assert_command_works :mouse_over, :locator + assert_command_works :mouse_over_and_wait, :locator + assert_command_works :mouse_down, :locator + assert_command_works :mouse_down_and_wait, :locator + assert_command_works :type, :locator, :string + assert_command_works :type_and_wait, :locator, :string + assert_command_works :check, :locator + assert_command_works :check_and_wait, :locator + assert_command_works :uncheck, :locator + assert_command_works :uncheck_and_wait, :locator + assert_command_works :select, :locator, :option_locator + assert_command_works :select_and_wait, :locator, :option_locator + assert_command_works :add_selection, :locator, :option_locator + assert_command_works :add_selection_and_wait, :locator, :option_locator + assert_command_works :remove_selection, :locator, :option_locator + assert_command_works :remove_selection_and_wait, :locator, :option_locator + assert_command_works :submit, :locator + assert_command_works :open, :url + assert_command_works :select_window, :window_id + assert_command_works [:wait_for_popup, 'waitForPopUp'], :window_id, :timeout + assert_command_works :choose_cancel_on_next_confirmation + assert_command_works :choose_cancel_on_next_confirmation_and_wait + assert_command_works :answer_on_next_prompt, :string + assert_command_works :answer_on_next_prompt_and_wait, :string + assert_command_works :go_back + assert_command_works :refresh + assert_command_works :close + assert_command_works :set_context, :string + assert_command_works :set_context, :string, :log_level + assert_command_works :wait_for_condition, :script, :timeout + assert_command_works :set_timeout, :timeout + assert_command_works :wait_for_page_to_load, :timeout + end + + # This is bad. They can be their own tests. + def test_accessor_commands + assert_command_works :store_alert_present, :variable + assert_command_works :assert_alert_present + assert_command_works :assert_alert_not_present + assert_command_works :verify_alert_present + assert_command_works :verify_alert_not_present + assert_command_works :wait_for_alert_present + assert_command_works :wait_for_alert_not_present + + assert_command_works :store_prompt_present, :variable + assert_command_works :assert_prompt_present + assert_command_works :assert_prompt_not_present + assert_command_works :verify_prompt_present + assert_command_works :verify_prompt_not_present + assert_command_works :wait_for_prompt_present + assert_command_works :wait_for_prompt_not_present + + assert_command_works :store_confirmation_present, :variable + assert_command_works :assert_confirmation_present + assert_command_works :assert_confirmation_not_present + assert_command_works :verify_confirmation_present + assert_command_works :verify_confirmation_not_present + assert_command_works :wait_for_confirmation_present + assert_command_works :wait_for_confirmation_not_present + + assert_command_works :store_alert, :variable + assert_command_works :assert_alert, :pattern + assert_command_works :assert_not_alert, :pattern + assert_command_works :verify_alert, :pattern + assert_command_works :verify_not_alert, :pattern + assert_command_works :wait_for_alert, :pattern + assert_command_works :wait_for_not_alert, :pattern + + assert_command_works :store_confirmation, :variable + assert_command_works :assert_confirmation, :pattern + assert_command_works :assert_not_confirmation, :pattern + assert_command_works :verify_confirmation, :pattern + assert_command_works :verify_not_confirmation, :pattern + assert_command_works :wait_for_confirmation, :pattern + assert_command_works :wait_for_not_confirmation, :pattern + + assert_command_works :store_prompt, :variable + assert_command_works :assert_prompt, :pattern + assert_command_works :assert_not_prompt, :pattern + assert_command_works :verify_prompt, :pattern + assert_command_works :verify_not_prompt, :pattern + assert_command_works :wait_for_prompt, :pattern + assert_command_works :wait_for_not_prompt, :pattern + + assert_command_works :store_absolute_location, :variable + assert_command_works :assert_absolute_location, :url + assert_command_works :assert_not_absolute_location, :url + assert_command_works :verify_absolute_location, :url + assert_command_works :verify_not_absolute_location, :url + assert_command_works :wait_for_absolute_location, :url + assert_command_works :wait_for_not_absolute_location, :url + + assert_command_works :store_location, :pattern, :variable + assert_command_works :assert_location, :url + assert_command_works :assert_not_location, :url + assert_command_works :verify_location, :url + assert_command_works :verify_not_location, :url + assert_command_works :wait_for_location, :url + assert_command_works :wait_for_not_location, :url + + assert_command_works :store_title, :variable + assert_command_works :assert_title, :pattern + assert_command_works :assert_not_title, :pattern + assert_command_works :verify_title, :pattern + assert_command_works :verify_not_title, :pattern + assert_command_works :wait_for_title, :pattern + assert_command_works :wait_for_not_title, :pattern + + assert_command_works :store_body_text, :variable + assert_command_works :assert_body_text, :pattern + assert_command_works :assert_not_body_text, :pattern + assert_command_works :verify_body_text, :pattern + assert_command_works :verify_not_body_text, :pattern + assert_command_works :wait_for_body_text, :pattern + assert_command_works :wait_for_not_body_text, :pattern + + assert_command_works :store_value, :locator, :variable + assert_command_works :assert_value, :locator, :pattern + assert_command_works :assert_not_value, :locator, :pattern + assert_command_works :verify_value, :locator, :pattern + assert_command_works :verify_not_value, :locator, :pattern + assert_command_works :wait_for_value, :locator, :pattern + assert_command_works :wait_for_not_value, :locator, :pattern + + assert_command_works :store_text, :locator, :variable + assert_command_works :assert_text, :locator, :pattern + assert_command_works :assert_not_text, :locator, :pattern + assert_command_works :verify_text, :locator, :pattern + assert_command_works :verify_not_text, :locator, :pattern + assert_command_works :wait_for_text, :locator, :pattern + assert_command_works :wait_for_not_text, :locator, :pattern + + assert_command_works :store_eval, :script, :variable + assert_command_works :assert_eval, :script, :pattern + assert_command_works :assert_not_eval, :script, :pattern + assert_command_works :verify_eval, :script, :pattern + assert_command_works :verify_not_eval, :script, :pattern + assert_command_works :wait_for_eval, :script, :pattern + assert_command_works :wait_for_not_eval, :script, :pattern + + assert_command_works :store_checked, :locator, :variable + assert_command_works :assert_checked, :locator + assert_command_works :assert_not_checked, :locator + assert_command_works :verify_checked, :locator + assert_command_works :verify_not_checked, :locator + assert_command_works :wait_for_checked, :locator + assert_command_works :wait_for_not_checked, :locator + + assert_command_works :store_table, :table_locator, :variable + assert_command_works :assert_table, :table_locator, :pattern + assert_command_works :assert_not_table, :table_locator, :pattern + assert_command_works :verify_table, :table_locator, :pattern + assert_command_works :verify_not_table, :table_locator, :pattern + assert_command_works :wait_for_table, :table_locator, :pattern + assert_command_works :wait_for_not_table, :table_locator, :pattern + + assert_raise RuntimeError do + assert_command_works :store_selected, :locator, :option_locator, :variable + end + assert_command_works :assert_selected, :locator, :option_locator + assert_command_works :assert_not_selected, :locator, :option_locator + assert_command_works :verify_selected, :locator, :option_locator + assert_command_works :verify_not_selected, :locator, :option_locator + assert_command_works :wait_for_selected, :locator, :option_locator + assert_command_works :wait_for_not_selected, :locator, :option_locator + + assert_command_works :store_selected_id, :locator, :variable + assert_command_works :assert_selected_id, :locator, :pattern + assert_command_works :assert_not_selected_id, :locator, :pattern + assert_command_works :verify_selected_id, :locator, :pattern + assert_command_works :verify_not_selected_id, :locator, :pattern + assert_command_works :wait_for_selected_id, :locator, :pattern + assert_command_works :wait_for_not_selected_id, :locator, :pattern + + assert_command_works :store_selected_ids, :locator, :variable + assert_command_works :assert_selected_ids, :locator, :pattern + assert_command_works :assert_not_selected_ids, :locator, :pattern + assert_command_works :verify_selected_ids, :locator, :pattern + assert_command_works :verify_not_selected_ids, :locator, :pattern + assert_command_works :wait_for_selected_ids, :locator, :pattern + assert_command_works :wait_for_not_selected_ids, :locator, :pattern + + assert_command_works :store_selected_index, :locator, :variable + assert_command_works :assert_selected_index, :locator, :pattern + assert_command_works :assert_not_selected_index, :locator, :pattern + assert_command_works :verify_selected_index, :locator, :pattern + assert_command_works :verify_not_selected_index, :locator, :pattern + assert_command_works :wait_for_selected_index, :locator, :pattern + assert_command_works :wait_for_not_selected_index, :locator, :pattern + + assert_command_works :store_selected_indexes, :locator, :variable + assert_command_works :assert_selected_indexes, :locator, :pattern + assert_command_works :assert_not_selected_indexes, :locator, :pattern + assert_command_works :verify_selected_indexes, :locator, :pattern + assert_command_works :verify_not_selected_indexes, :locator, :pattern + assert_command_works :wait_for_selected_indexes, :locator, :pattern + assert_command_works :wait_for_not_selected_indexes, :locator, :pattern + + assert_command_works :store_selected_label, :locator, :variable + assert_command_works :assert_selected_label, :locator, :pattern + assert_command_works :assert_not_selected_label, :locator, :pattern + assert_command_works :verify_selected_label, :locator, :pattern + assert_command_works :verify_not_selected_label, :locator, :pattern + assert_command_works :wait_for_selected_label, :locator, :pattern + assert_command_works :wait_for_not_selected_label, :locator, :pattern + + assert_command_works :store_selected_labels, :locator, :variable + assert_command_works :assert_selected_labels, :locator, :pattern + assert_command_works :assert_not_selected_labels, :locator, :pattern + assert_command_works :verify_selected_labels, :locator, :pattern + assert_command_works :verify_not_selected_labels, :locator, :pattern + assert_command_works :wait_for_selected_labels, :locator, :pattern + assert_command_works :wait_for_not_selected_labels, :locator, :pattern + + assert_command_works :store_selected_value, :locator, :variable + assert_command_works :assert_selected_value, :locator, :pattern + assert_command_works :assert_not_selected_value, :locator, :pattern + assert_command_works :verify_selected_value, :locator, :pattern + assert_command_works :verify_not_selected_value, :locator, :pattern + assert_command_works :wait_for_selected_value, :locator, :pattern + assert_command_works :wait_for_not_selected_value, :locator, :pattern + + assert_command_works :store_selected_values, :locator, :variable + assert_command_works :assert_selected_values, :locator, :pattern + assert_command_works :assert_not_selected_values, :locator, :pattern + assert_command_works :verify_selected_values, :locator, :pattern + assert_command_works :verify_not_selected_values, :locator, :pattern + assert_command_works :wait_for_selected_values, :locator, :pattern + assert_command_works :wait_for_not_selected_values, :locator, :pattern + + assert_command_works :store_something_selected, :locator, :variable + assert_command_works :assert_something_selected, :locator + assert_command_works :assert_not_something_selected, :locator + assert_command_works :verify_something_selected, :locator + assert_command_works :verify_not_something_selected, :locator + assert_command_works :wait_for_something_selected, :locator + assert_command_works :wait_for_not_something_selected, :locator + + assert_command_works :store_selected_options, :locator, :variable + assert_command_works :assert_selected_options, :locator, :coll_pattern + assert_command_works :assert_not_selected_options, :locator, :coll_pattern + assert_command_works :verify_selected_options, :locator, :coll_pattern + assert_command_works :verify_not_selected_options, :locator, :coll_pattern + assert_command_works :wait_for_selected_options, :locator, :coll_pattern + assert_command_works :wait_for_not_selected_options, :locator, :coll_pattern + + assert_command_works :store_select_options, :locator, :variable + assert_command_works :assert_select_options, :locator, :coll_pattern + assert_command_works :assert_not_select_options, :locator, :coll_pattern + assert_command_works :verify_select_options, :locator, :coll_pattern + assert_command_works :verify_not_select_options, :locator, :coll_pattern + assert_command_works :wait_for_select_options, :locator, :coll_pattern + assert_command_works :wait_for_not_select_options, :locator, :coll_pattern + + assert_command_works :store_attribute, :locator_and_attribute_name, :variable + assert_command_works :assert_attribute, :locator_and_attribute_name, :pattern + assert_command_works :assert_not_attribute, :locator_and_attribute_name, :pattern + assert_command_works :verify_attribute, :locator_and_attribute_name, :pattern + assert_command_works :verify_not_attribute, :locator_and_attribute_name, :pattern + assert_command_works :wait_for_attribute, :locator_and_attribute_name, :pattern + assert_command_works :wait_for_not_attribute, :locator_and_attribute_name, :pattern + + assert_raise RuntimeError do + assert_command_works :store_ordered, :locator, :locator, :variable + end + assert_command_works :assert_ordered, :locator, :locator + assert_command_works :assert_not_ordered, :locator, :locator + assert_command_works :verify_ordered, :locator, :locator + assert_command_works :verify_not_ordered, :locator, :locator + assert_command_works :wait_for_ordered, :locator, :locator + assert_command_works :wait_for_not_ordered, :locator, :locator + + assert_command_works :store_text_present, :pattern, :variable + assert_command_works :assert_text_present, :pattern + assert_command_works :assert_text_not_present, :pattern + assert_command_works :verify_text_present, :pattern + assert_command_works :verify_text_not_present, :pattern + assert_command_works :wait_for_text_present, :pattern + assert_command_works :wait_for_text_not_present, :pattern + + assert_command_works :store_element_present, :locator, :variable + assert_command_works :assert_element_present, :locator + assert_command_works :assert_element_not_present, :locator + assert_command_works :verify_element_present, :locator + assert_command_works :verify_element_not_present, :locator + assert_command_works :wait_for_element_present, :locator + assert_command_works :wait_for_element_not_present, :locator + + assert_command_works :store_visible, :locator, :variable + assert_command_works :assert_visible, :locator + assert_command_works :assert_not_visible, :locator + assert_command_works :verify_visible, :locator + assert_command_works :verify_not_visible, :locator + assert_command_works :wait_for_visible, :locator + assert_command_works :wait_for_not_visible, :locator + + assert_raise RuntimeError do + assert_command_works :store_error_on_next, :string + end + assert_command_works :assert_error_on_next, :string + assert_command_works :assert_not_error_on_next, :string + assert_command_works :verify_error_on_next, :string + assert_command_works :verify_not_error_on_next, :string + assert_command_works :wait_for_error_on_next, :string + assert_command_works :wait_for_not_error_on_next, :string + + assert_raise RuntimeError do + assert_command_works :store_failure_on_next, :string + end + assert_command_works :assert_failure_on_next, :string + assert_command_works :assert_not_failure_on_next, :string + assert_command_works :verify_failure_on_next, :string + assert_command_works :verify_not_failure_on_next, :string + assert_command_works :wait_for_failure_on_next, :string + assert_command_works :wait_for_not_failure_on_next, :string + + assert_command_works :store_all_window_ids, :variable + assert_command_works :assert_all_window_ids, :pattern + assert_command_works :assert_not_all_window_ids, :pattern + assert_command_works :verify_all_window_ids, :pattern + assert_command_works :verify_not_all_window_ids, :pattern + assert_command_works :wait_for_all_window_ids, :pattern + assert_command_works :wait_for_not_all_window_ids, :pattern + + assert_command_works :store_all_window_names, :variable + assert_command_works :assert_all_window_names, :pattern + assert_command_works :assert_not_all_window_names, :pattern + assert_command_works :verify_all_window_names, :pattern + assert_command_works :verify_not_all_window_names, :pattern + assert_command_works :wait_for_all_window_names, :pattern + assert_command_works :wait_for_not_all_window_names, :pattern + + assert_command_works :store_all_window_titles, :variable + assert_command_works :assert_all_window_titles, :pattern + assert_command_works :assert_not_all_window_titles, :pattern + assert_command_works :verify_all_window_titles, :pattern + assert_command_works :verify_not_all_window_titles, :pattern + assert_command_works :wait_for_all_window_titles, :pattern + assert_command_works :wait_for_not_all_window_titles, :pattern + + assert_command_works :store_cookie, :variable + assert_command_works :assert_cookie, :pattern + assert_command_works :assert_not_cookie, :pattern + assert_command_works :verify_cookie, :pattern + assert_command_works :verify_not_cookie, :pattern + assert_command_works :wait_for_cookie, :pattern + assert_command_works :wait_for_not_cookie, :pattern + + assert_command_works :store_log_messages, :variable + assert_command_works :assert_log_messages, :pattern + assert_command_works :assert_not_log_messages, :pattern + assert_command_works :verify_log_messages, :pattern + assert_command_works :verify_not_log_messages, :pattern + assert_command_works :wait_for_log_messages, :pattern + assert_command_works :wait_for_not_log_messages, :pattern + + assert_command_works :store_mouse_speed, :variable + assert_command_works :assert_mouse_speed, :pattern + assert_command_works :assert_not_mouse_speed, :pattern + assert_command_works :verify_mouse_speed, :pattern + assert_command_works :verify_not_mouse_speed, :pattern + assert_command_works :wait_for_mouse_speed, :pattern + assert_command_works :wait_for_not_mouse_speed, :pattern + + assert_command_works :store_cursor_position, :locator, :variable + assert_command_works :assert_cursor_position, :locator, :pattern + assert_command_works :assert_not_cursor_position, :locator, :pattern + assert_command_works :verify_cursor_position, :locator, :pattern + assert_command_works :verify_not_cursor_position, :locator, :pattern + assert_command_works :wait_for_cursor_position, :locator, :pattern + assert_command_works :wait_for_not_cursor_position, :locator, :pattern + + assert_command_works :store_attribute_from_all_windows, :attribute_name, :variable + assert_command_works :assert_attribute_from_all_windows, :attribute_name, :pattern + assert_command_works :assert_not_attribute_from_all_windows, :attribute_name, :pattern + assert_command_works :verify_attribute_from_all_windows, :attribute_name, :pattern + assert_command_works :verify_not_attribute_from_all_windows, :attribute_name, :pattern + assert_command_works :wait_for_attribute_from_all_windows, :attribute_name, :pattern + assert_command_works :wait_for_not_attribute_from_all_windows, :attribute_name, :pattern + + assert_command_works :store_element_height, :locator, :variable + assert_command_works :assert_element_height, :locator, :dimension + assert_command_works :assert_not_element_height, :locator, :dimension + assert_command_works :verify_element_height, :locator, :dimension + assert_command_works :verify_not_element_height, :locator, :dimension + assert_command_works :wait_for_element_height, :locator, :dimension + assert_command_works :wait_for_not_element_height, :locator, :dimension + + assert_command_works :store_element_index, :locator, :variable + assert_command_works :assert_element_index, :locator, :pattern + assert_command_works :assert_not_element_index, :locator, :pattern + assert_command_works :verify_element_index, :locator, :pattern + assert_command_works :verify_not_element_index, :locator, :pattern + assert_command_works :wait_for_element_index, :locator, :pattern + assert_command_works :wait_for_not_element_index, :locator, :pattern + + assert_command_works :store_element_width, :locator, :variable + assert_command_works :assert_element_width, :locator, :dimension + assert_command_works :assert_not_element_width, :locator, :dimension + assert_command_works :verify_element_width, :locator, :dimension + assert_command_works :verify_not_element_width, :locator, :dimension + assert_command_works :wait_for_element_width, :locator, :dimension + assert_command_works :wait_for_not_element_width, :locator, :dimension + + assert_command_works :store_element_position_left, :locator, :variable + assert_command_works :assert_element_position_left, :locator, :dimension + assert_command_works :assert_not_element_position_left, :locator, :dimension + assert_command_works :verify_element_position_left, :locator, :dimension + assert_command_works :verify_not_element_position_left, :locator, :dimension + assert_command_works :wait_for_element_position_left, :locator, :dimension + assert_command_works :wait_for_not_element_position_left, :locator, :dimension + + assert_command_works :store_element_position_top, :locator, :variable + assert_command_works :assert_element_position_top, :locator, :dimension + assert_command_works :assert_not_element_position_top, :locator, :dimension + assert_command_works :verify_element_position_top, :locator, :dimension + assert_command_works :verify_not_element_position_top, :locator, :dimension + assert_command_works :wait_for_element_position_top, :locator, :dimension + assert_command_works :wait_for_not_element_position_top, :locator, :dimension + + assert_command_works :store_editable, :locator, :variable + assert_command_works :assert_editable, :locator + assert_command_works :assert_not_editable, :locator + assert_command_works :verify_editable, :locator + assert_command_works :verify_not_editable, :locator + assert_command_works :wait_for_editable, :locator + assert_command_works :wait_for_not_editable, :locator + + assert_command_works :store_all_buttons, :variable + assert_command_works :assert_all_buttons, :coll_pattern + assert_command_works :assert_not_all_buttons, :coll_pattern + assert_command_works :verify_all_buttons, :coll_pattern + assert_command_works :verify_not_all_buttons, :coll_pattern + assert_command_works :wait_for_all_buttons, :coll_pattern + assert_command_works :wait_for_not_all_buttons, :coll_pattern + + assert_command_works :store_all_links, :variable + assert_command_works :assert_all_links, :coll_pattern + assert_command_works :assert_not_all_links, :coll_pattern + assert_command_works :verify_all_links, :coll_pattern + assert_command_works :verify_not_all_links, :coll_pattern + assert_command_works :wait_for_all_links, :coll_pattern + assert_command_works :wait_for_not_all_links, :coll_pattern + + assert_command_works :store_all_fields, :variable + assert_command_works :assert_all_fields, :coll_pattern + assert_command_works :assert_not_all_fields, :coll_pattern + assert_command_works :verify_all_fields, :coll_pattern + assert_command_works :verify_not_all_fields, :coll_pattern + assert_command_works :wait_for_all_fields, :coll_pattern + assert_command_works :wait_for_not_all_fields, :coll_pattern + + assert_command_works :store_html_source, :variable + assert_command_works :assert_html_source, :pattern + assert_command_works :assert_not_html_source, :pattern + assert_command_works :verify_html_source, :pattern + assert_command_works :verify_not_html_source, :pattern + assert_command_works :wait_for_html_source, :pattern + assert_command_works :wait_for_not_html_source, :pattern + + assert_command_works :store_expression, :script, :variable + assert_command_works :assert_expression, :script, :pattern + assert_command_works :assert_not_expression, :script, :pattern + assert_command_works :verify_expression, :script, :pattern + assert_command_works :verify_not_expression, :script, :pattern + assert_command_works :wait_for_expression, :script, :pattern + assert_command_works :wait_for_not_expression, :script, :pattern + + assert_raise RuntimeError do + assert_command_works :store_whether_this_frame_match_frame_expression, :string, :string, :variable + end + assert_command_works :assert_whether_this_frame_match_frame_expression, :string, :string + assert_command_works :assert_not_whether_this_frame_match_frame_expression, :string, :string + assert_command_works :verify_whether_this_frame_match_frame_expression, :string, :string + assert_command_works :verify_not_whether_this_frame_match_frame_expression, :string, :string + assert_command_works :wait_for_whether_this_frame_match_frame_expression, :string, :string + assert_command_works :wait_for_not_whether_this_frame_match_frame_expression, :string, :string + + assert_raise RuntimeError do + assert_command_works :store_whether_this_window_match_window_expression, :string, :string, :variable + end + assert_command_works :assert_whether_this_window_match_window_expression, :string, :string + assert_command_works :assert_not_whether_this_window_match_window_expression, :string, :string + assert_command_works :verify_whether_this_window_match_window_expression, :string, :string + assert_command_works :verify_not_whether_this_window_match_window_expression, :string, :string + assert_command_works :wait_for_whether_this_window_match_window_expression, :string, :string + assert_command_works :wait_for_not_whether_this_window_match_window_expression, :string, :string + end + + def test_partial_support + expected = < +Partial support +typepartialRSelenese partial + +END + input = "include_partial 'override'" + partial = "type 'partial', 'RSelenese partial'" + + create_rsel_file_from(partial, "_override.rsel") + + assert_rselenese expected, 'Partial support', input + + File.delete(test_path_for("_override.rsel")) + end + + def test_partial_support_with_local_assigns + expected = < +Partial support with local variables +typepartialRSelenese partial +typelocalpar +typelocaltial + +END_EXPECTED + input = "include_partial 'override', :locator => 'local', :input => ['par', 'tial']" + partial = < page_title} end + def create_sel_file_from(input, name) + File.open(test_path_for(name), 'w+') { |index_file| index_file << input } + end + + def test_path_for(name) + "#{File.expand_path(File.dirname(__FILE__) + "/../test_data")}/#{name}" + end + + def assert_selenese expected, name, input + assert_text_equal expected, render_selenese(name, input) + end + def test_empty - expected = < Empty @@ -23,9 +34,9 @@ END input = '' assert_selenese expected, 'Empty', '' end - + def test_one_line - expected = < One line open/  @@ -34,29 +45,29 @@ END input = '|open|/|' assert_selenese expected, 'One line', input end - + def test_comments_only - expected = <Comment 1

-

Comment 2

+

Comment 2

Only comments
END input = < Only commands goBack   @@ -69,15 +80,15 @@ END |goBack | |open| /foo | - | fireEvent | textField | focus | +| fireEvent | textField | focus | END assert_selenese expected, 'Only commands', input end - + def test_commands_and_comments - expected = < Commands and comments goBack   @@ -86,7 +97,7 @@ END

Comment 1

-

Comment 2

+

Comment 2

END input = <Comment 1

- - -

Comment 2

+ +

Comment 2

@@ -114,7 +124,6 @@ END
Comments and commands
goBack  
END input = <Comment 1

- - -

Comment 2

+

Comment 2

@@ -139,24 +146,20 @@ END
Comments, commands and comments
goBack  

Comment 3

END + input = < HTML escaping typenameField<>& @@ -165,7 +168,7 @@ END input = '|type|nameField|<>&|' assert_selenese expected, 'HTML escaping', input end - + def test_partial_support expected = < @@ -175,9 +178,13 @@ END END input = '|includePartial|override|' partial = '|type|partial|Selenese partial|' - assert_selenese expected, 'Partial support', input, partial, 'sel' + create_sel_file_from(partial, "_override.sel") + + assert_selenese(expected, 'Partial support', input) + + File.delete(test_path_for("_override.sel")) end - + def test_partial_support_with_local_assigns expected = < @@ -186,10 +193,12 @@ END typeassignsa=a b c d,b=,c_123ABC=hello END_EXPECTED + input = <whatever typeassigns @@ -199,15 +208,20 @@ c_123ABC=<%= c_123ABC if defined? c_123ABC%> END_PARTIAL - assert_selenese expected, 'Partial support with local assigns', input, partial, 'rhtml' - end + + create_sel_file_from(partial, "_override.html") + assert_selenese(expected, 'Partial support with local assigns', input) + + File.delete(test_path_for("_override.html")) + end + def test_raised_when_more_than_three_columns assert_raise RuntimeError, 'There might only be a maximum of three cells!' do - selenese 'name', '|col1|col2|col3|col4|' + render_selenese 'name', '|col1|col2|col3|col4|' end end - + def test_raised_when_more_than_one_set_of_commands assert_raise RuntimeError, 'You cannot have comments in the middle of commands!' do input = < - - - - -
Foo
Bar
-EOS - post :record, :suite => suite, - "testTable.1" => "
", - "testTable.2" => "
" - cur_result_dir = File.join(@result_dir, "default") - assert File.directory?(cur_result_dir) - assert_equal ["blank.html", "index.html", "suite.html", "test1.html", "test2.html"], - Dir.glob("#{cur_result_dir}/*.html").map{|path| File.basename(path)}.sort - expected = < - - - - - - - -
Foo
Bar
- -EOS - assert_equal expected, File.read("#{cur_result_dir}/suite.html") - end -end +require File.dirname(__FILE__) + '/test_helper' +require 'mocha' + +class SeleniumControllerTest < Test::Unit::TestCase + + def setup + @controller = SeleniumController.new + ActionController::Routing::Routes.draw + SeleniumController.any_instance.stubs(:layout_path).returns(false) + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + @result_dir = File.join(File.dirname(__FILE__), "..", "test_result") + + @suite = < + + + + +
Foo
Bar
+EOS + end + + def teardown + FileUtils.rm_rf @result_dir + end + + def test_record_with_result + @controller.config.configs["result_dir"] = @result_dir + + post :record, :suite => @suite, "testTable.1" => "
", "testTable.2" => "
" + + cur_result_dir = File.join(@result_dir, "default") + assert File.directory?(cur_result_dir) + assert_equal ["blank.html", "index.html", "suite.html", "test1.html", "test2.html"], + Dir.glob("#{cur_result_dir}/*.html").map{|path| File.basename(path)}.sort + + expected = < + + + + + + + +
Foo
Bar
+ +EOS + assert_equal expected, File.read("#{cur_result_dir}/suite.html") + end + + def test_result_hash + post :record, :suite => @suite, "testTable.1" => "
", "testTable.2" => "
", + :result => 'Failed', :numTestFailures => "906", :numTestPasses => "1079", :numCommandFailures => '1027', + :numCommandErrors => '57', :numCommandPasses => '3', :totalTime => "A long time" + + assert_equal 'Failed', assigns['result']['result'] + assert_equal '906', assigns['result']['numTestFailures'] + assert_equal '1079', assigns['result']['numTestPasses'] + assert_equal '1027', assigns['result']['numCommandFailures'] + assert_equal '57', assigns['result']['numCommandErrors'] + assert_equal '3', assigns['result']['numCommandPasses'] + assert_equal 'A long time', assigns['result']['totalTime'] + end +end diff --git a/vendor/plugins/selenium-on-rails/test/selenium_on_rails_config_test.rb b/vendor/plugins/selenium-on-rails/test/selenium_on_rails_config_test.rb new file mode 100644 index 00000000..f7565e4c --- /dev/null +++ b/vendor/plugins/selenium-on-rails/test/selenium_on_rails_config_test.rb @@ -0,0 +1,21 @@ +require File.dirname(__FILE__) + '/test_helper' +require 'mocha' + +class SeleniumOnRailsConfigTest < Test::Unit::TestCase + + def test_config_file_in_config_directory + File.stubs(:expand_path).returns("temporary") + File.expects(:exist?).with("temporary").returns(false) + File.expects(:exist?).with(File.join(RAILS_ROOT, 'config', 'selenium.yml')).returns(true) + YAML.expects(:load_file).with(File.join(RAILS_ROOT, 'config', 'selenium.yml')).returns({:fake => "hash"}) + + assert_equal({:fake => "hash"}, SeleniumOnRailsConfig.new.configs) + end + + def test_setting_config_manually + config = SeleniumOnRailsConfig.new + config.configs["test"] = "result" + + assert_equal("result", config.configs["test"]) + end +end \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test/selenium_support_test.rb b/vendor/plugins/selenium-on-rails/test/selenium_support_test.rb index 6502461a..324c4567 100644 --- a/vendor/plugins/selenium-on-rails/test/selenium_support_test.rb +++ b/vendor/plugins/selenium-on-rails/test/selenium_support_test.rb @@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/test_helper' class SeleniumSupportTest < Test::Unit::TestCase def setup @controller = SeleniumController.new + ActionController::Routing::Routes.draw @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new end diff --git a/vendor/plugins/selenium-on-rails/test/setup_test.rb b/vendor/plugins/selenium-on-rails/test/setup_test.rb index ad2e4c3c..a75fcdba 100644 --- a/vendor/plugins/selenium-on-rails/test/setup_test.rb +++ b/vendor/plugins/selenium-on-rails/test/setup_test.rb @@ -1,29 +1,30 @@ -require File.dirname(__FILE__) + '/test_helper' - -class SetupTest < Test::Unit::TestCase - def setup - @controller = SeleniumController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_session_reset - @request.session['key'] = 'value' - get :setup - assert_nil session['key'] - assert_response :success - assert_tag :content => 'The session is wiped clean.' - end - - def test_session_no_reset - @request.session['key'] = 'value' - get :setup, :keep_session => true - assert_equal 'value', session['key'] - assert_response :success - assert_no_tag :content => 'The session is wiped clean.' - end - - # - # Don't have the nerve to test fixtures since this is a plugin - # -end +require File.dirname(__FILE__) + '/test_helper' +require 'mocha' +RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + "/") + +class SetupTest < Test::Unit::TestCase + def setup + @controller = SeleniumController.new + SeleniumController.any_instance.stubs(:clear_tables).returns([]) + SeleniumController.any_instance.stubs(:layout_path).returns(false) + ActionController::Routing::Routes.draw + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + end + + def test_session_reset + @request.session['key'] = 'value' + get :setup + assert_nil session['key'] + assert_response :success + assert_tag :content => 'The session is wiped clean.' + end + + def test_session_no_reset + @request.session['key'] = 'value' + get :setup, :keep_session => true + assert_equal 'value', session['key'] + assert_response :success + assert_no_tag :content => 'The session is wiped clean.' + end +end diff --git a/vendor/plugins/selenium-on-rails/test/suite_renderer_test.rb b/vendor/plugins/selenium-on-rails/test/suite_renderer_test.rb index 07fe568f..c4bd43f8 100644 --- a/vendor/plugins/selenium-on-rails/test/suite_renderer_test.rb +++ b/vendor/plugins/selenium-on-rails/test/suite_renderer_test.rb @@ -1,173 +1,108 @@ -require File.dirname(__FILE__) + '/test_helper' - -class SuiteRendererTest < Test::Unit::TestCase - def setup - @controller = SeleniumController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller.layout_override =<test layout -@content_for_layout - -END - end - - def test_empty_suite - get :test_file, :testname => 'empty_suite' - assert_response :success - expected =<test layout - - - - - -
Empty suite
- -END - assert_text_equal expected, @response.body - end - - - def test_root_suite - _test_root_suite '' - end - - def test_test_suite_html - #TestSuite.html is the default name the Selenium Runner tries to run - _test_root_suite 'TestSuite.html' - end - - def _test_root_suite testname - get :test_file, :testname => testname - assert_response :success - expected =<test layout - - - - - - - - - - - - - - - -
All test cases
Html
Own layout
Rhtml
Rselenese
Selenese
Partials.All partials
Suite one.Suite one testcase1
Suite one.Suite one testcase2
Suite one.Subsuite.Suite one subsuite testcase
Suite two.Suite two testcase
- -END - assert_text_equal expected, @response.body - end - - def test_suite_one - get :test_file, :testname => 'suite_one' - assert_response :success - expected =<test layout - - - - - - - - -
Suite one
Suite one testcase1
Suite one testcase2
Subsuite.Suite one subsuite testcase
- -END - assert_text_equal expected, @response.body - end - - def test_sub_suite - get :test_file, :testname => 'suite_one/subsuite' - assert_response :success - expected =<test layout - - - - - - -
Subsuite
Suite one subsuite testcase
- -END - assert_text_equal expected, @response.body - end - - def test_missing_tests_directory - def @controller.selenium_tests_path - File.join(File.dirname(__FILE__), 'invalid') - end - get :test_file, :testname => '' - assert_response 404 - assert_equal "Did not find the Selenium tests path (#{File.join(File.dirname(__FILE__), 'invalid')}). Run script/generate selenium", @response.body - end - -end +require File.dirname(__FILE__) + '/test_helper' + +class SuiteRendererTest < Test::Unit::TestCase + def setup + @controller = SeleniumController.new + ActionController::Routing::Routes.draw + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + @controller.layout_override =<test layout +@content_for_layout + +END + end + + def test_empty_suite + get :test_file, :testname => 'empty_suite' + + assert_response :success + assert_tag :tag => "title", :content => "test layout" + assert_tag :tag => "script", :attributes => {:type => "text/javascript"} + assert_tag :tag => "select", :attributes => {:onchange => "openSuite(this)"}, + :descendant => {:tag => "option", :attributes => {:value => "header"}, :content => "Suites:"}, + :descendant => {:tag => "option", :attributes => {:value => ""}, :content => ".."} + + assert_tag :tag => "table", + :descendant => {:tag => "th", :content => "Empty suite"} + end + + def test_root_suite + _test_root_suite '' + end + + def test_test_suite_html + #TestSuite.html is the default name the Selenium Runner tries to run + _test_root_suite 'TestSuite.html' + end + + def _test_root_suite testname + get :test_file, :testname => testname + assert_response :success + + assert_tag :tag => "title", :content => "test layout" + assert_tag :tag => "script", :attributes => {:type => "text/javascript"} + assert_tag :tag => "select", :attributes => {:onchange => "openSuite(this)"}, + :descendant => {:tag => "option", :attributes => {:value => "header"}, :content => "Suites:"}, + :descendant => {:tag => "option", :attributes => {:value => "/partials"}, :content => "Partials"}, + :descendant => {:tag => "option", :attributes => {:value => "/suite_one"}, :content => "Suite one"}, + :descendant => {:tag => "option", :attributes => {:value => "/suite_two"}, :content => "Suite two"}, + :descendant => {:tag => "option", :attributes => {:value => "/suite_one/subsuite"}, :content => "Suite one.Subsuite"} + + assert_tag :tag => "table", + :descendant => {:tag => "th", :content => "All test cases"}, + :descendant => {:tag => "td", :content => "Html"}, + :descendant => {:tag => "td", :content => "Own layout"}, + :descendant => {:tag => "td", :content => "Rhtml"}, + :descendant => {:tag => "td", :content => "Rselenese"}, + :descendant => {:tag => "td", :content => "Selenese"}, + :descendant => {:tag => "td", :content => "Partials.All partials"}, + :descendant => {:tag => "td", :content => "Suite one.Suite one testcase1"}, + :descendant => {:tag => "td", :content => "Suite one.Suite one testcase2"}, + :descendant => {:tag => "td", :content => "Suite one.Subsuite.Suite one subsuite testcase"}, + :descendant => {:tag => "td", :content => "Suite two.Suite two testcase"} + end + + def test_suite_one + get :test_file, :testname => 'suite_one' + + assert_response :success + assert_tag :tag => "title", :content => "test layout" + assert_tag :tag => "script", :attributes => {:type => "text/javascript"} + assert_tag :tag => "select", :attributes => {:onchange => "openSuite(this)"}, + :descendant => {:tag => "option", :attributes => {:value => "header"}, :content => "Suites:"}, + :descendant => {:tag => "option", :attributes => {:value => ""}, :content => ".."}, + :descendant => {:tag => "option", :attributes => {:value => "/suite_one/subsuite"}, :content => "Subsuite"} + + assert_tag :tag => "table", + :descendant => {:tag => "th", :content => "Suite one"}, + :descendant => {:tag => "td", :content => "Suite one testcase1"}, + :descendant => {:tag => "td", :content => "Suite one testcase2"}, + :descendant => {:tag => "td", :content => "Subsuite.Suite one subsuite testcase"} + end + + def test_sub_suite + get :test_file, :testname => 'suite_one/subsuite' + + assert_response :success + assert_tag :tag => "title", :content => "test layout" + assert_tag :tag => "script", :attributes => {:type => "text/javascript"} + assert_tag :tag => "select", :attributes => {:onchange => "openSuite(this)"}, + :descendant => {:tag => "option", :attributes => {:value => "header"}, :content => "Suites:"}, + :descendant => {:tag => "option", :attributes => {:value => "/suite_one"}, :content => ".."} + + assert_tag :tag => "table", + :descendant => {:tag => "th", :content => "Subsuite"}, + :descendant => {:tag => "td", :content => "Suite one subsuite testcase"} + end + + def test_missing_tests_directory + def @controller.selenium_tests_path + File.join(File.dirname(__FILE__), 'invalid') + end + get :test_file, :testname => '' + assert_response 404 + assert_equal "Did not find the Selenium tests path (#{File.join(File.dirname(__FILE__), 'invalid')}). Run script/generate selenium", @response.body + end + +end diff --git a/vendor/plugins/selenium-on-rails/test/switch_environment_controller_test.rb b/vendor/plugins/selenium-on-rails/test/switch_environment_controller_test.rb new file mode 100644 index 00000000..febe59a9 --- /dev/null +++ b/vendor/plugins/selenium-on-rails/test/switch_environment_controller_test.rb @@ -0,0 +1,20 @@ +require File.dirname(__FILE__) + '/test_helper' +require 'mocha' +require 'controllers/switch_environment_controller' + +class SwitchEnvironmentControllerTest < Test::Unit::TestCase + + def setup + @config = mock() + setup_controller_test(SwitchEnvironmentController) + end + + def test_index + SeleniumOnRailsConfig.expects(:new).returns(@config) + @config.expects(:get).with(:environments).returns("hello dolly") + + get :index + + assert @response.body.include?('hello dolly') + end +end \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test/test_helper.rb b/vendor/plugins/selenium-on-rails/test/test_helper.rb index 7c8e4705..397352f3 100644 --- a/vendor/plugins/selenium-on-rails/test/test_helper.rb +++ b/vendor/plugins/selenium-on-rails/test/test_helper.rb @@ -1,70 +1,99 @@ -ENV["RAILS_ENV"] = "test" -require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment") -require 'test_help' -require 'controllers/selenium_controller' - -module SeleniumOnRails::Paths - def selenium_tests_path - File.expand_path(File.dirname(__FILE__) + '/../test_data') - end -end - -class SeleniumController - attr_accessor :layout_override - # Re-raise errors caught by the controller. - def rescue_action e - raise e - end - - def render options = nil, deprecated_status = nil - if override_layout? options - options[:layout] = false - super options, deprecated_status - return response.body = @layout_override.gsub('@content_for_layout', response.body) - end - super options, deprecated_status - end - - private - def override_layout? options - return false unless @layout_override - if options[:action] or options[:template] - options[:layout] != false #for action and template the default layout is used if not explicitly disabled - else - not [nil, false].include? options[:layout] #otherwise a layout has to be specified - end - end - -end - -class Test::Unit::TestCase - def assert_text_equal expected, actual - assert_equal clean_text(expected), clean_text(actual) - end - - def clean_text text - text.gsub("\t", ' ').gsub("\r", '').gsub("\n", '').gsub(/ * @override, :type => @override_type, :locals => local_assigns - extract_commands_from_partial partial - else - render_partial_without_override partial_path, object, local_assigns, status - end - end - - def override_partial partial, type - @override, @override_type = partial, type - result = yield - @override, @override_type = nil, nil - result - end +ENV["RAILS_ENV"] = "test" +RAILS_ROOT = "test" unless defined?(RAILS_ROOT) +$: << File.expand_path(File.dirname(__FILE__) + "/../lib") + +require 'rubygems' +gem 'activesupport' +require 'active_support' + +require 'action_view/template_handler' +require 'action_view/template_handlers/builder' +require 'action_view/template_handlers/erb' +require 'action_view/template_handlers/rjs' +require 'action_view/base' +require 'action_view/partials' +require 'action_view/template_error' +require 'action_controller' + +require 'selenium_on_rails/suite_renderer' +require 'selenium_on_rails/fixture_loader' +require 'selenium_helper' +require 'controllers/selenium_controller' +require File.expand_path(File.dirname(__FILE__) + "/../routes") +require 'action_controller/test_process' + +SeleniumController.append_view_path File.expand_path(File.dirname(__FILE__)) + +def setup_controller_test(controller) + @controller = controller.new + ActionController::Routing::Routes.draw + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new +end + +module SeleniumOnRails::Paths + def selenium_tests_path + File.expand_path(File.dirname(__FILE__) + '/../test_data') + end +end + +class SeleniumController + attr_accessor :layout_override + # Re-raise errors caught by the controller. + def rescue_action e + raise e + end + + def render options = nil + if override_layout? options + options[:layout] = false + super options + return response.body = @layout_override.gsub('@content_for_layout', response.body) + end + super options + end + + private + def override_layout? options + return false unless @layout_override + if options[:action] or options[:template] + options[:layout] != false #for action and template the default layout is used if not explicitly disabled + else + not [nil, false].include? options[:layout] #otherwise a layout has to be specified + end + end + +end + +class Test::Unit::TestCase + def assert_text_equal expected, actual + assert_equal clean_text(expected), clean_text(actual) + end + + def clean_text text + text.gsub("\t", ' ').gsub("\r", '').gsub("\n", '').gsub(/ * @override, :type => @override_type, :locals => local_assigns + # extract_commands_from_partial partial + # else + # render_partial_without_override partial_path, object, local_assigns, status + # end + # end + # + # def override_partial partial, type + # @override, @override_type = partial, type + # result = yield + # @override, @override_type = nil, nil + # result + # end + end \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test_data/.hidden.html b/vendor/plugins/selenium-on-rails/test_data/.hidden.html new file mode 100644 index 00000000..e69de29b diff --git a/vendor/plugins/selenium-on-rails/test_data/backup.html~ b/vendor/plugins/selenium-on-rails/test_data/backup.html~ new file mode 100644 index 00000000..e69de29b diff --git a/vendor/plugins/selenium-on-rails/test_data/html.html b/vendor/plugins/selenium-on-rails/test_data/html.html index 1a0addb8..08e1143d 100644 --- a/vendor/plugins/selenium-on-rails/test_data/html.html +++ b/vendor/plugins/selenium-on-rails/test_data/html.html @@ -1,6 +1,6 @@ -

Testing plain HTML

- - - -
Test HTML
open/selenium/setup 
+

Testing plain HTML

+ + + +
Test HTML
open/selenium/setup 

and it works...

\ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test_data/own_layout.html b/vendor/plugins/selenium-on-rails/test_data/own_layout.html index a45c5498..5f07842e 100644 --- a/vendor/plugins/selenium-on-rails/test_data/own_layout.html +++ b/vendor/plugins/selenium-on-rails/test_data/own_layout.html @@ -1,12 +1,12 @@ - - - Test case with own layout - - - - - - -
Test own layout
open/selenium/setup 
- - + + + Test case with own layout + + + + + + +
Test own layout
open/selenium/setup 
+ + diff --git a/vendor/plugins/selenium-on-rails/test_data/partials/_html.html b/vendor/plugins/selenium-on-rails/test_data/partials/_html.html index 916ca4f7..34e6d718 100644 --- a/vendor/plugins/selenium-on-rails/test_data/partials/_html.html +++ b/vendor/plugins/selenium-on-rails/test_data/partials/_html.html @@ -1,6 +1,6 @@ -

This should never be visible!

- - - -
HTML partial
typepartialHTML partial
+

This should never be visible!

+ + + +
HTML partial
typepartialHTML partial

Neither should this!

\ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test_data/partials/_nesting.rsel b/vendor/plugins/selenium-on-rails/test_data/partials/_nesting.rsel index 28e7bf91..65150cb6 100644 --- a/vendor/plugins/selenium-on-rails/test_data/partials/_nesting.rsel +++ b/vendor/plugins/selenium-on-rails/test_data/partials/_nesting.rsel @@ -1,2 +1,2 @@ -type 'nesting', 'Nesting partial' +type 'nesting', 'Nesting partial' include_partial 'partials/rsel', :hello => hello.reverse \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test_data/partials/_rhtml.rhtml b/vendor/plugins/selenium-on-rails/test_data/partials/_rhtml.rhtml index af6599de..b7045860 100644 --- a/vendor/plugins/selenium-on-rails/test_data/partials/_rhtml.rhtml +++ b/vendor/plugins/selenium-on-rails/test_data/partials/_rhtml.rhtml @@ -1,6 +1,6 @@ -

This should never be visible!

- - - -
RHTML partial
type<%= hello %>RHTML partial
+

This should never be visible!

+ + + +
RHTML partial
type<%= hello %>RHTML partial

Neither should this!

\ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test_data/partials/_rsel.rsel b/vendor/plugins/selenium-on-rails/test_data/partials/_rsel.rsel index 0ce0e9fe..456323e9 100644 --- a/vendor/plugins/selenium-on-rails/test_data/partials/_rsel.rsel +++ b/vendor/plugins/selenium-on-rails/test_data/partials/_rsel.rsel @@ -1 +1 @@ -type hello, 'RSelenese partial' +type hello, 'RSelenese partial' diff --git a/vendor/plugins/selenium-on-rails/test_data/partials/_sel.sel b/vendor/plugins/selenium-on-rails/test_data/partials/_sel.sel index 353f0f26..f0339fa5 100644 --- a/vendor/plugins/selenium-on-rails/test_data/partials/_sel.sel +++ b/vendor/plugins/selenium-on-rails/test_data/partials/_sel.sel @@ -1,5 +1,5 @@ -h1. This should not be visible! - -|type|partial|Selenese partial| - +h1. This should not be visible! + +|type|partial|Selenese partial| + p. Neither should this! \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test_data/partials/all_partials.rsel b/vendor/plugins/selenium-on-rails/test_data/partials/all_partials.rsel index 08c0faf5..b4b7aa41 100644 --- a/vendor/plugins/selenium-on-rails/test_data/partials/all_partials.rsel +++ b/vendor/plugins/selenium-on-rails/test_data/partials/all_partials.rsel @@ -1,5 +1,5 @@ -include_partial 'partial', :source => title -['html', 'rhtml', 'sel', 'rsel'].each do |format| - include_partial "partials/#{format}", :hello => 'world' -end +include_partial 'partial', :source => title +['html', 'rhtml', 'sel', 'rsel'].each do |format| + include_partial "partials/#{format}", :hello => 'world' +end include_partial 'partials/nesting', :hello => 'world' \ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test_data/rhtml.rhtml b/vendor/plugins/selenium-on-rails/test_data/rhtml.rhtml index 2ae4e413..e8e72ebb 100644 --- a/vendor/plugins/selenium-on-rails/test_data/rhtml.rhtml +++ b/vendor/plugins/selenium-on-rails/test_data/rhtml.rhtml @@ -1,7 +1,7 @@ - - -<% for page in ['/fi', '/fo', '/fum'] -%> - -<% end -%> - <%= render :partial => 'partial', :locals => {:source => 'RHTML'} %> +
<%= @page_title %>
open<%= page %> 
+ +<% for page in ['/fi', '/fo', '/fum'] -%> + +<% end -%> + <%= render :partial => 'partial', :locals => {:source => 'RHTML'} %>
<%= @page_title %>
open<%= page %> 
\ No newline at end of file diff --git a/vendor/plugins/selenium-on-rails/test_data/rselenese.rsel b/vendor/plugins/selenium-on-rails/test_data/rselenese.rsel index 0c8e9d59..f73ac4b2 100644 --- a/vendor/plugins/selenium-on-rails/test_data/rselenese.rsel +++ b/vendor/plugins/selenium-on-rails/test_data/rselenese.rsel @@ -1,8 +1,8 @@ -setup -setup :keep_session -test.setup :fixtures => :all -setup :fixtures => [:foo, 'bar'] -setup :clear_tables => [:foo, :bar], :fixtures => :all -assert_absolute_location :controller => 'selenium', :action => 'setup' #urls must be tested with a controller -assert_title view.controller.controller_name #make sure we can access the view easily -include_partial 'partial', :source => 'RSelenese' +setup +setup :keep_session +test.setup :fixtures => :all +setup :fixtures => [:foo, 'bar'] +setup :clear_tables => [:foo, :bar], :fixtures => :all +assert_absolute_location :controller => 'selenium', :action => 'setup' #urls must be tested with a controller +assert_title view.controller.controller_name #make sure we can access the view easily +include_partial 'partial', :source => 'RSelenese' diff --git a/vendor/plugins/selenium-on-rails/test_data/selenese.sel b/vendor/plugins/selenium-on-rails/test_data/selenese.sel index 46b1dce9..9daa0e14 100644 --- a/vendor/plugins/selenium-on-rails/test_data/selenese.sel +++ b/vendor/plugins/selenium-on-rails/test_data/selenese.sel @@ -1,7 +1,7 @@ -Selenese *support* - -|open|/selenium/setup| -|goBack| -|includePartial|partial|source=Selenese| - +Selenese *support* + +|open|/selenium/setup| +|goBack| +|includePartial|partial|source=Selenese| + works. \ No newline at end of file diff --git a/vendor/selenium/scripts/user-extensions.js b/vendor/selenium/scripts/user-extensions.js deleted file mode 100644 index 09a2c9bb..00000000 --- a/vendor/selenium/scripts/user-extensions.js +++ /dev/null @@ -1,9 +0,0 @@ -// All get* methods on the Selenium prototype result in -// store, assert, assertNot, verify, verifyNot, waitFor, and waitForNot commands. -// Will result in support for storeContextCount, assertContextCount, etc. -Selenium.prototype.getContextCount = function() { - return this.browserbot.getCurrentWindow().$$('.context').length; -}; - - -