doc/Bauxite/Action.html in bauxite-0.4.1 vs doc/Bauxite/Action.html in bauxite-0.4.2
- old
+ new
@@ -125,16 +125,20 @@
<li ><a href="#method-i-return_action">#return_action</a>
<li ><a href="#method-i-ruby">#ruby</a>
+ <li ><a href="#method-i-select">#select</a>
+
<li ><a href="#method-i-set">#set</a>
<li ><a href="#method-i-source">#source</a>
<li ><a href="#method-i-store">#store</a>
+ <li ><a href="#method-i-submit">#submit</a>
+
<li ><a href="#method-i-test">#test</a>
<li ><a href="#method-i-tryload">#tryload</a>
<li ><a href="#method-i-wait">#wait</a>
@@ -1097,10 +1101,65 @@
</div>
+ <div id="method-i-select" class="method-detail ">
+
+ <div class="method-heading">
+ <span class="method-name">select</span><span
+ class="method-args">(selector, text)</span>
+
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+
+ <div class="method-description">
+
+ <p>Sets the value of the selected <code>HTMLSelect</code> to
+<code>text</code>.</p>
+
+<p><code>text</code> can be the <code>value</code> or the <code>text</code> of
+the target <code>HTMLOption</code>.</p>
+
+<p>For example:</p>
+
+<pre class="ruby"><span class="ruby-comment"># assuming <select id="s"></span>
+<span class="ruby-comment"># <option value="one">First</option></span>
+<span class="ruby-comment"># <option value="two">Second</option></span>
+<span class="ruby-comment"># </select></span>
+<span class="ruby-identifier">select</span> <span class="ruby-identifier">s</span> <span class="ruby-constant">Second</span>
+<span class="ruby-identifier">select</span> <span class="ruby-identifier">s</span> <span class="ruby-identifier">two</span>
+<span class="ruby-comment"># => both actions select the second option.</span>
+</pre>
+
+
+
+
+ <div class="method-source-code" id="select-source">
+ <pre><span class="ruby-comment"># File lib/bauxite/actions/select.rb, line 38</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier">select</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-identifier">text</span>)
+ <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">selector</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">e</span> = <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">Support</span><span class="ruby-operator">::</span><span class="ruby-constant">Select</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">e</span>)
+ <span class="ruby-keyword">begin</span>
+ <span class="ruby-identifier">e</span>.<span class="ruby-identifier">select_by</span>(<span class="ruby-value">:value</span>, <span class="ruby-identifier">text</span>)
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">NoSuchElementError</span>
+ <span class="ruby-identifier">e</span>.<span class="ruby-identifier">select_by</span>(<span class="ruby-value">:text</span>, <span class="ruby-identifier">text</span>)
+ <span class="ruby-keyword">end</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+
+ </div>
+
+
+
+
+ </div>
+
+
<div id="method-i-set" class="method-detail ">
<div class="method-heading">
<span class="method-name">set</span><span
class="method-args">(name, value)</span>
@@ -1238,10 +1297,52 @@
</div>
+ <div id="method-i-submit" class="method-detail ">
+
+ <div class="method-heading">
+ <span class="method-name">submit</span><span
+ class="method-args">(selector)</span>
+
+ <span class="method-click-advice">click to toggle source</span>
+
+ </div>
+
+
+ <div class="method-description">
+
+ <p>Submits the form that contains the selected element.</p>
+
+<p>For example:</p>
+
+<pre class="ruby"><span class="ruby-comment"># assuming <form><input id="i"/></form></span>
+<span class="ruby-identifier">submit</span> <span class="ruby-identifier">i</span>
+<span class="ruby-comment"># => this would submit the form</span>
+</pre>
+
+
+
+
+ <div class="method-source-code" id="submit-source">
+ <pre><span class="ruby-comment"># File lib/bauxite/actions/submit.rb, line 32</span>
+<span class="ruby-keyword">def</span> <span class="ruby-identifier">submit</span>(<span class="ruby-identifier">selector</span>)
+ <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">selector</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">e</span>.<span class="ruby-identifier">submit</span>
+ <span class="ruby-keyword">end</span>
+<span class="ruby-keyword">end</span></pre>
+ </div>
+
+ </div>
+
+
+
+
+ </div>
+
+
<div id="method-i-test" class="method-detail ">
<div class="method-heading">
<span class="method-name">test</span><span
class="method-args">(file, name = nil)</span>
@@ -1459,9 +1560,9 @@
</main>
<footer id="validator-badges" role="contentinfo">
<p><a href="http://validator.w3.org/check/referer">Validate</a>
- <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>