mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 08:10:13 +01:00
Upgrade Selenium on Rails to r140
This commit is contained in:
parent
156862200b
commit
40074c71ad
117 changed files with 16789 additions and 8867 deletions
|
|
@ -1,18 +1,18 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Selenium on Rails<%= defined?(@page_title) ? ": #{@page_title}" : '' %></title>
|
||||
</head>
|
||||
<style type="text/css">
|
||||
body, html { font-family: Verdana, Arial, sans-serif; }
|
||||
table { border-collapse: collapse; margin: 10px 0px; }
|
||||
td, th { border: 2px solid black; }
|
||||
#notice { text-align: center; color: darkgreen; background-color: lightgreen; padding: 5px 15px; width: 400px; margin-left: auto; margin-right: auto; }
|
||||
#notice * { text-align: left; }
|
||||
#usagedescription { margin: 15px 30px; }
|
||||
</style>
|
||||
<body>
|
||||
<%= @content_for_layout %>
|
||||
</body>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Selenium on Rails<%= defined?(@page_title) ? ": #{@page_title}" : '' %></title>
|
||||
</head>
|
||||
<style type="text/css">
|
||||
body, html { font-family: Verdana, Arial, sans-serif; }
|
||||
table { border-collapse: collapse; margin: 10px 0px; }
|
||||
td, th { border: 2px solid black; }
|
||||
#notice { text-align: center; color: darkgreen; background-color: lightgreen; padding: 5px 15px; width: 400px; margin-left: auto; margin-right: auto; }
|
||||
#notice * { text-align: left; }
|
||||
#usagedescription { margin: 15px 30px; }
|
||||
</style>
|
||||
<body>
|
||||
<%= @content_for_layout %>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<table>
|
||||
<% @result.each_pair do |key, value| -%>
|
||||
<tr><td><%= key %></td><td><%= value %></td></tr>
|
||||
<% end -%>
|
||||
</table>
|
||||
<table>
|
||||
<% @result.each_pair do |key, value| -%>
|
||||
<tr><td><%= key %></td><td><%= value %></td></tr>
|
||||
<% end -%>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
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
|
||||
|
|
|
|||
|
|
@ -1,67 +1,67 @@
|
|||
<% @page_title = 'Setup' -%>
|
||||
<% if defined?(@session_wiped) or @cleared_tables.any? or @loaded_fixtures.any? -%>
|
||||
<div id="notice">
|
||||
<% if defined?(@session_wiped) -%>
|
||||
<p>The session is wiped clean.</p>
|
||||
<% end-%>
|
||||
<% if @cleared_tables.any? -%>
|
||||
<p>The following database tables are cleared:</p>
|
||||
<ul>
|
||||
<% for table in @cleared_tables -%>
|
||||
<li><%= table %></li>
|
||||
<% end-%>
|
||||
</ul>
|
||||
<% end -%>
|
||||
<% if @loaded_fixtures.any? -%>
|
||||
<p>The following fixtures are loaded:</p>
|
||||
<ul>
|
||||
<% for fixture in @loaded_fixtures -%>
|
||||
<li><%= fixture %></li>
|
||||
<% end-%>
|
||||
</ul>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<div id="usagedescription">
|
||||
<p>This page can be used to setup your Selenium tests. The following options can be used:</p>
|
||||
<dl>
|
||||
<dt><tt>keep_session</tt></dt>
|
||||
<dd>
|
||||
Per default the session is reset, so add <tt>keep_session</tt> in order to keep the current session.
|
||||
<table>
|
||||
<tr><td>open</td><td><%= url_for %>?keep_session</td><td> </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
<dt><tt>fixtures</tt></dt>
|
||||
<dd>
|
||||
Loads one or many fixtures into the database. <strong>This will destroy the current data you have in your database!</strong> Use <tt>all</tt> as name in order to load all fixtures, or specify which fixtures that should be loaded (delimited by commas).<br />
|
||||
If a test needs different data than you have in your fixtures, you can add another <em>fixture set</em>. A fixture set is just a sub directory in <tt>/test/fixtures/</tt> where you can add alternate fixtures (e.g. <tt>/test/fixtures/blank/users.yml</tt>).
|
||||
<table>
|
||||
<tr><td>open</td><td><%= url_for :fixtures => 'all' %></td><td> </td></tr>
|
||||
<tr><td>open</td><td><%= url_for :fixtures => 'fixture' %></td><td> </td></tr>
|
||||
<tr><td>open</td><td><%= url_for :fixtures => 'fixture_one' %>,fixture_two</td><td> </td></tr>
|
||||
</table>
|
||||
<b>Available fixtures</b><br />
|
||||
<% fixtures = available_fixtures -%>
|
||||
<% for fixture_set in fixtures.keys.sort -%>
|
||||
In the <%= fixture_set.blank? ? 'default' : "<tt>#{fixture_set}</tt>" %> fixture set:
|
||||
<ul>
|
||||
<% fixtures[fixture_set].unshift fixture_set.blank? ? 'all' : "#{fixture_set}/all" -%>
|
||||
<% for fixture in fixtures[fixture_set] -%>
|
||||
<li><tt><%= fixture %></tt></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
<% end -%>
|
||||
</dd>
|
||||
<dt><tt>clear_tables</tt></dt>
|
||||
<dd>
|
||||
Clears one or many database tables. Another way to do the same thing is to create an empty fixture in a new fixture set (see <tt>fixtures</tt> above).
|
||||
<table>
|
||||
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %></td><td> </td></tr>
|
||||
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %>,outgoing_messages</td><td> </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
<% @page_title = 'Setup' -%>
|
||||
<% if defined?(@session_wiped) or @cleared_tables.any? or @loaded_fixtures.any? -%>
|
||||
<div id="notice">
|
||||
<% if defined?(@session_wiped) -%>
|
||||
<p>The session is wiped clean.</p>
|
||||
<% end-%>
|
||||
<% if @cleared_tables.any? -%>
|
||||
<p>The following database tables are cleared:</p>
|
||||
<ul>
|
||||
<% for table in @cleared_tables -%>
|
||||
<li><%= table %></li>
|
||||
<% end-%>
|
||||
</ul>
|
||||
<% end -%>
|
||||
<% if @loaded_fixtures.any? -%>
|
||||
<p>The following fixtures are loaded:</p>
|
||||
<ul>
|
||||
<% for fixture in @loaded_fixtures -%>
|
||||
<li><%= fixture %></li>
|
||||
<% end-%>
|
||||
</ul>
|
||||
<% end -%>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
||||
<div id="usagedescription">
|
||||
<p>This page can be used to setup your Selenium tests. The following options can be used:</p>
|
||||
<dl>
|
||||
<dt><tt>keep_session</tt></dt>
|
||||
<dd>
|
||||
Per default the session is reset, so add <tt>keep_session</tt> in order to keep the current session.
|
||||
<table>
|
||||
<tr><td>open</td><td><%= url_for %>?keep_session</td><td> </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
<dt><tt>fixtures</tt></dt>
|
||||
<dd>
|
||||
Loads one or many fixtures into the database. <strong>This will destroy the current data you have in your database!</strong> Use <tt>all</tt> as name in order to load all fixtures, or specify which fixtures that should be loaded (delimited by commas).<br />
|
||||
If a test needs different data than you have in your fixtures, you can add another <em>fixture set</em>. A fixture set is just a sub directory in <tt>/test/fixtures/</tt> where you can add alternate fixtures (e.g. <tt>/test/fixtures/blank/users.yml</tt>).
|
||||
<table>
|
||||
<tr><td>open</td><td><%= url_for :fixtures => 'all' %></td><td> </td></tr>
|
||||
<tr><td>open</td><td><%= url_for :fixtures => 'fixture' %></td><td> </td></tr>
|
||||
<tr><td>open</td><td><%= url_for :fixtures => 'fixture_one' %>,fixture_two</td><td> </td></tr>
|
||||
</table>
|
||||
<b>Available fixtures</b><br />
|
||||
<% fixtures = available_fixtures -%>
|
||||
<% for fixture_set in fixtures.keys.sort -%>
|
||||
In the <%= fixture_set.blank? ? 'default' : "<tt>#{fixture_set}</tt>" %> fixture set:
|
||||
<ul>
|
||||
<% fixtures[fixture_set].unshift fixture_set.blank? ? 'all' : "#{fixture_set}/all" -%>
|
||||
<% for fixture in fixtures[fixture_set] -%>
|
||||
<li><tt><%= fixture %></tt></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
<% end -%>
|
||||
</dd>
|
||||
<dt><tt>clear_tables</tt></dt>
|
||||
<dd>
|
||||
Clears one or many database tables. Another way to do the same thing is to create an empty fixture in a new fixture set (see <tt>fixtures</tt> above).
|
||||
<table>
|
||||
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %></td><td> </td></tr>
|
||||
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %>,outgoing_messages</td><td> </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
<% @page_title = test_suite_name @suite_path -%>
|
||||
<% @page_title = test_suite_name @suite_path -%>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function openSuite(selector) {
|
||||
var suite = selector.options[selector.selectedIndex].value;
|
||||
if(suite == "header") return;
|
||||
if(top.location.href != location.href) //inside a frame
|
||||
top.location = "<%= url_for :action => :support_file %>/TestRunner.html?test=tests" + suite
|
||||
else
|
||||
window.location = "<%= url_for :action => :test_file, :testname => '' %>" + suite
|
||||
function openSuite(selector) {
|
||||
var suite = selector.options[selector.selectedIndex].value;
|
||||
if(suite == "header") return;
|
||||
if(top.location.href != location.href) //inside a frame
|
||||
top.location = "<%= url_for :action => :support_file %>/TestRunner.html?test=tests" + suite
|
||||
else
|
||||
window.location = "<%= url_for :action => :test_file, :testname => '' %>" + suite
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<select onchange="openSuite(this)">
|
||||
<option value="header">Suites:</option>
|
||||
<% for name, path in test_suites @suite_path -%>
|
||||
<option value="<%= path %>"><%= name%></option>
|
||||
<% end -%>
|
||||
</select>
|
||||
|
||||
<table>
|
||||
<tr><th><%= @page_title %></th></tr>
|
||||
<% for name, path in test_cases @suite_path -%>
|
||||
<tr><td><%= link_to_test_case name, path %></td></tr>
|
||||
<% end -%>
|
||||
</script>
|
||||
<select onchange="openSuite(this)">
|
||||
<option value="header">Suites:</option>
|
||||
<% for name, path in test_suites @suite_path -%>
|
||||
<option value="<%= path %>"><%= name%></option>
|
||||
<% end -%>
|
||||
</select>
|
||||
|
||||
<table>
|
||||
<tr><th><%= @page_title %></th></tr>
|
||||
<% for name, path in test_cases @suite_path -%>
|
||||
<tr><td><%= link_to_test_case name, path %></td></tr>
|
||||
<% end -%>
|
||||
</table>
|
||||
Loading…
Add table
Add a link
Reference in a new issue