Permalink
Browse files

r828@D600 (orig r13): dev | 2006-06-06 12:03:24 +0100

 Added support for Selenium Core 0.7
 Added rcov task


git-svn-id: https://svn.openqa.org/svn/selenium-on-rails/trunk@14 9274398c-e119-0410-8437-aa71ef7847aa
  • Loading branch information...
Jonas Jonas
Jonas authored and Jonas committed Jul 31, 2006
1 parent c5b37d2 commit 980d2ba343e32fc943cacfed40ec4d5f5dd10853
Showing with 4,093 additions and 2,046 deletions.
  1. +5 −5 README
  2. +8 −0 Rakefile
  3. +1 −1 doc/classes/SeleniumController.html
  4. +1 −1 doc/classes/SeleniumOnRails.html
  5. +14 −14 doc/classes/SeleniumOnRails/FixtureLoader.html
  6. +36 −36 doc/classes/SeleniumOnRails/Paths.html
  7. +2 −2 doc/classes/SeleniumOnRails/RSelenese.html
  8. +6 −6 doc/classes/SeleniumOnRails/Renderer.html
  9. +24 −24 doc/classes/SeleniumOnRails/SuiteRenderer.html
  10. +149 −47 doc/classes/SeleniumOnRails/TestBuilder.html
  11. +1,672 −0 doc/classes/SeleniumOnRails/TestBuilderAccessors.html
  12. +630 −237 doc/classes/SeleniumOnRails/TestBuilderActions.html
  13. +0 −1,172 doc/classes/SeleniumOnRails/TestBuilderChecks.html
  14. +7 −7 doc/files/README.html
  15. +114 −0 doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html
  16. +113 −0 doc/files/lib/selenium_on_rails/test_builder_actions_rb.html
  17. +16 −4 doc/files/lib/selenium_on_rails/test_builder_rb.html
  18. +2 −1 doc/files/lib/selenium_on_rails_rb.html
  19. +1 −1 doc/fr_class_index.html
  20. +2 −0 doc/fr_file_index.html
  21. +77 −73 doc/fr_method_index.html
  22. +2 −2 generators/selenium/templates/rhtml.rhtml
  23. +1 −1 generators/selenium/templates/rselenese.rhtml
  24. +2 −2 generators/selenium/templates/selenese.rhtml
  25. +7 −5 lib/selenium_on_rails/paths.rb
  26. +36 −336 lib/selenium_on_rails/test_builder.rb
  27. +575 −0 lib/selenium_on_rails/test_builder_accessors.rb
  28. +283 −0 lib/selenium_on_rails/test_builder_actions.rb
  29. +1 −0 test/renderer_test.rb
  30. +304 −68 test/rselenese_test.rb
  31. +2 −1 test_data/rselenese.rsel
View
10 README
@@ -3,17 +3,17 @@
== Overview
Selenium on Rails provides an easy way to test Rails application with
-Selenium[http://www.openqa.org/selenium/].
+SeleniumCore[http://www.openqa.org/selenium-core/].
This plugin does four things:
-1. The Selenium files don't have to pollute <tt>/public</tt>, they can stay in the Selenium gem or in <tt>/vendor/selenium</tt>.
+1. The Selenium Core files don't have to pollute <tt>/public</tt>, they can stay in the Selenium gem or in <tt>/vendor/selenium</tt>.
2. No need to create suite files, they are generated on the fly -- one suite per directory in <tt>/test/selenium</tt> (suites can be nested).
3. Instead of writing the test cases in HTML you can use a number of better formats (see <tt>Formats</tt>).
4. Loading of fixtures and wiping of session (<tt>/selenium/setup</tt>).
== Installation
-1. Selenium needs to be available. It could either be installed as a gem (<tt>gem install selenium</tt>) or in <tt>/vendor/selenium/</tt>.
+1. Selenium Core needs to be available. It could either be installed as a gem (<tt>gem install selenium</tt>) or in <tt>/vendor/selenium/</tt>.
2. Install Selenium on Rails: <tt>script/plugin install http://andthennothing.net/svn/public/selenium_on_rails/</tt>
3. <i>If RedCloth is available the Selenese test cases can use it for better markup.</i>
4. Run the Rakefile in the plugin's directory to run the tests in order to see that everything works. (If RedCloth isn't installed a few tests will fail since they assume RedCloth is installed.)
@@ -149,8 +149,8 @@ the server when needed.
=== user_extension.js
Selenium has support for <tt>user_extension.js</tt> which is a way to extend the
-functionality of Selenium. However there is currently no easy way to add such a
-file in Selenium on Rails.
+functionality of Selenium Core. However there is currently no easy way to add
+such a file in Selenium on Rails.
=== More setup/teardown support?
View
@@ -17,3 +17,11 @@ task :rdoc do
rm_rf 'doc'
RDoc::RDoc.new.document(%w(--line-numbers --inline-source --title SeleniumOnRails README lib))
end
+
+begin
+ require 'rcov/rcovtask'
+ Rcov::RcovTask.new do |t|
+ t.test_files = FileList['test/*_test.rb']
+ end
+rescue LoadError #if rcov isn't available, ignore
+end
@@ -193,7 +193,7 @@ <h3 class="section-bar">Public Instance methods</h3>
<span class="ruby-comment cmt"># File lib/controllers/selenium_controller.rb, line 31</span>
31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">support_file</span>
32: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-identifier">:filename</span>].<span class="ruby-identifier">empty?</span>
-33: <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:filename</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'TestRunner.html'</span>
+33: <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:filename</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'TestRunner.html'</span>, <span class="ruby-identifier">:test</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'tests'</span>
34: <span class="ruby-keyword kw">return</span>
35: <span class="ruby-keyword kw">end</span>
36:
@@ -96,8 +96,8 @@ <h3 class="section-bar">Classes and Modules</h3>
Module <a href="SeleniumOnRails/Paths.html" class="link">SeleniumOnRails::Paths</a><br />
Module <a href="SeleniumOnRails/Renderer.html" class="link">SeleniumOnRails::Renderer</a><br />
Module <a href="SeleniumOnRails/SuiteRenderer.html" class="link">SeleniumOnRails::SuiteRenderer</a><br />
+Module <a href="SeleniumOnRails/TestBuilderAccessors.html" class="link">SeleniumOnRails::TestBuilderAccessors</a><br />
Module <a href="SeleniumOnRails/TestBuilderActions.html" class="link">SeleniumOnRails::TestBuilderActions</a><br />
-Module <a href="SeleniumOnRails/TestBuilderChecks.html" class="link">SeleniumOnRails::TestBuilderChecks</a><br />
Class <a href="SeleniumOnRails/RSelenese.html" class="link">SeleniumOnRails::RSelenese</a><br />
Class <a href="SeleniumOnRails/Selenese.html" class="link">SeleniumOnRails::Selenese</a><br />
Class <a href="SeleniumOnRails/TestBuilder.html" class="link">SeleniumOnRails::TestBuilder</a><br />
@@ -80,8 +80,8 @@
<h3 class="section-bar">Methods</h3>
<div class="name-list">
- <a href="#M000076">available_fixtures</a>&nbsp;&nbsp;
- <a href="#M000077">load_fixtures</a>&nbsp;&nbsp;
+ <a href="#M000048">available_fixtures</a>&nbsp;&nbsp;
+ <a href="#M000049">load_fixtures</a>&nbsp;&nbsp;
</div>
</div>
@@ -110,43 +110,43 @@ <h3 class="section-bar">Included Modules</h3>
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
- <div id="method-M000076" class="method-detail">
- <a name="M000076"></a>
+ <div id="method-M000048" class="method-detail">
+ <a name="M000048"></a>
<div class="method-heading">
- <a href="#M000076" class="method-signature">
+ <a href="#M000048" class="method-signature">
<span class="method-name">available_fixtures</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000076-source">
+ onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000048-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/fixture_loader.rb, line 6</span>
6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">available_fixtures</span>
-7: <span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">fixtures_path</span>).<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">not</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">fixtures_path</span>, <span class="ruby-identifier">f</span>))}
-8: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\.[^.]*$/</span>, <span class="ruby-value str">''</span>)}
+7: <span class="ruby-identifier">files</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-node">&quot;#{fixtures_path}/*.{yml,csv}&quot;</span>]
+8: <span class="ruby-identifier">files</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">f</span>).<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\.[^.]*$/</span>, <span class="ruby-value str">''</span>)}
9: <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
- <div id="method-M000077" class="method-detail">
- <a name="M000077"></a>
+ <div id="method-M000049" class="method-detail">
+ <a name="M000049"></a>
<div class="method-heading">
- <a href="#M000077" class="method-signature">
+ <a href="#M000049" class="method-signature">
<span class="method-name">load_fixtures</span><span class="method-args">(fixtures)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000077-source">
+ onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000049-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/fixture_loader.rb, line 11</span>
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_fixtures</span> <span class="ruby-identifier">fixtures</span>
@@ -80,12 +80,12 @@
<h3 class="section-bar">Methods</h3>
<div class="name-list">
- <a href="#M000070">fixtures_path</a>&nbsp;&nbsp;
- <a href="#M000069">layout_path</a>&nbsp;&nbsp;
- <a href="#M000071">log_path</a>&nbsp;&nbsp;
- <a href="#M000066">selenium_path</a>&nbsp;&nbsp;
- <a href="#M000067">selenium_tests_path</a>&nbsp;&nbsp;
- <a href="#M000068">view_path</a>&nbsp;&nbsp;
+ <a href="#M000042">fixtures_path</a>&nbsp;&nbsp;
+ <a href="#M000041">layout_path</a>&nbsp;&nbsp;
+ <a href="#M000043">log_path</a>&nbsp;&nbsp;
+ <a href="#M000038">selenium_path</a>&nbsp;&nbsp;
+ <a href="#M000039">selenium_tests_path</a>&nbsp;&nbsp;
+ <a href="#M000040">view_path</a>&nbsp;&nbsp;
</div>
</div>
@@ -107,19 +107,19 @@ <h3 class="section-bar">Methods</h3>
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
- <div id="method-M000070" class="method-detail">
- <a name="M000070"></a>
+ <div id="method-M000042" class="method-detail">
+ <a name="M000042"></a>
<div class="method-heading">
- <a href="#M000070" class="method-signature">
+ <a href="#M000042" class="method-signature">
<span class="method-name">fixtures_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000070-source">
+ onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000042-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 25</span>
25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fixtures_path</span>
@@ -130,11 +130,11 @@ <h3 class="section-bar">Public Instance methods</h3>
</div>
</div>
- <div id="method-M000069" class="method-detail">
- <a name="M000069"></a>
+ <div id="method-M000041" class="method-detail">
+ <a name="M000041"></a>
<div class="method-heading">
- <a href="#M000069" class="method-signature">
+ <a href="#M000041" class="method-signature">
<span class="method-name">layout_path</span><span class="method-args">()</span>
</a>
</div>
@@ -146,8 +146,8 @@ <h3 class="section-bar">Public Instance methods</h3>
paths to layout templates.
</p>
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000069-source">
+ onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000041-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 19</span>
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">layout_path</span>
@@ -160,19 +160,19 @@ <h3 class="section-bar">Public Instance methods</h3>
</div>
</div>
- <div id="method-M000071" class="method-detail">
- <a name="M000071"></a>
+ <div id="method-M000043" class="method-detail">
+ <a name="M000043"></a>
<div class="method-heading">
- <a href="#M000071" class="method-signature">
+ <a href="#M000043" class="method-signature">
<span class="method-name">log_path</span><span class="method-args">(log_file)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000071-source">
+ onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000043-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 29</span>
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_path</span> <span class="ruby-identifier">log_file</span>
@@ -183,19 +183,19 @@ <h3 class="section-bar">Public Instance methods</h3>
</div>
</div>
- <div id="method-M000066" class="method-detail">
- <a name="M000066"></a>
+ <div id="method-M000038" class="method-detail">
+ <a name="M000038"></a>
<div class="method-heading">
- <a href="#M000066" class="method-signature">
+ <a href="#M000038" class="method-signature">
<span class="method-name">selenium_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000066-source">
+ onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000038-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 3</span>
3: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">selenium_path</span>
@@ -207,19 +207,19 @@ <h3 class="section-bar">Public Instance methods</h3>
</div>
</div>
- <div id="method-M000067" class="method-detail">
- <a name="M000067"></a>
+ <div id="method-M000039" class="method-detail">
+ <a name="M000039"></a>
<div class="method-heading">
- <a href="#M000067" class="method-signature">
+ <a href="#M000039" class="method-signature">
<span class="method-name">selenium_tests_path</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000067-source">
+ onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000039-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 8</span>
8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">selenium_tests_path</span>
@@ -230,19 +230,19 @@ <h3 class="section-bar">Public Instance methods</h3>
</div>
</div>
- <div id="method-M000068" class="method-detail">
- <a name="M000068"></a>
+ <div id="method-M000040" class="method-detail">
+ <a name="M000040"></a>
<div class="method-heading">
- <a href="#M000068" class="method-signature">
+ <a href="#M000040" class="method-signature">
<span class="method-name">view_path</span><span class="method-args">(view)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000068-source">
+ onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000040-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/paths.rb, line 12</span>
12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">view_path</span> <span class="ruby-identifier">view</span>
@@ -192,10 +192,10 @@ <h3 class="section-bar">Public Instance methods</h3>
24: <span class="ruby-identifier">title</span> = (<span class="ruby-ivar">@view</span>.<span class="ruby-identifier">assigns</span>[<span class="ruby-value str">'page_title'</span>] <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">local_assigns</span>[<span class="ruby-value str">'page_title'</span>])
25: <span class="ruby-identifier">table</span>(<span class="ruby-identifier">title</span>) <span class="ruby-keyword kw">do</span>
26: <span class="ruby-identifier">test</span> = <span class="ruby-keyword kw">self</span> <span class="ruby-comment cmt">#to enable test.command</span>
-27:
+27:
28: <span class="ruby-identifier">assign_locals_code</span> = <span class="ruby-value str">''</span>
29: <span class="ruby-identifier">local_assigns</span>.<span class="ruby-identifier">each_key</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-identifier">assign_locals_code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{key} = local_assigns[#{key.inspect}];&quot;</span>}
-30:
+30:
31: <span class="ruby-identifier">eval</span> <span class="ruby-identifier">assign_locals_code</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">template</span>
32: <span class="ruby-keyword kw">end</span>
33: <span class="ruby-keyword kw">end</span>
@@ -80,7 +80,7 @@
<h3 class="section-bar">Methods</h3>
<div class="name-list">
- <a href="#M000065">render_test_case</a>&nbsp;&nbsp;
+ <a href="#M000037">render_test_case</a>&nbsp;&nbsp;
</div>
</div>
@@ -110,19 +110,19 @@ <h3 class="section-bar">Included Modules</h3>
<div id="methods">
<h3 class="section-bar">Public Instance methods</h3>
- <div id="method-M000065" class="method-detail">
- <a name="M000065"></a>
+ <div id="method-M000037" class="method-detail">
+ <a name="M000037"></a>
<div class="method-heading">
- <a href="#M000065" class="method-signature">
+ <a href="#M000037" class="method-signature">
<span class="method-name">render_test_case</span><span class="method-args">(filename)</span>
</a>
</div>
<div class="method-description">
<p><a class="source-toggle" href="#"
- onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
- <div class="method-source-code" id="M000065-source">
+ onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000037-source">
<pre>
<span class="ruby-comment cmt"># File lib/selenium_on_rails/renderer.rb, line 5</span>
5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_test_case</span> <span class="ruby-identifier">filename</span>
Oops, something went wrong.

0 comments on commit 980d2ba

Please sign in to comment.