tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html
Reinier Balt 9b504b3e47 Update selenium on rails using 'official' git repo
git://github.com/paytonrules/selenium-on-rails.git
2008-12-02 10:05:41 +01:00

219 lines
No EOL
7.1 KiB
HTML

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