browsercms 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/controllers/cms/content_block_controller.rb +2 -2
- data/app/controllers/cms/section_nodes_controller.rb +6 -1
- data/app/controllers/cms/sections_controller.rb +1 -1
- data/app/helpers/cms/application_helper.rb +1 -1
- data/app/helpers/cms/content_block_helper.rb +27 -0
- data/app/helpers/cms/section_nodes_helper.rb +43 -5
- data/app/models/abstract_file_block.rb +16 -1
- data/app/models/attachment.rb +17 -35
- data/app/models/file_block.rb +0 -12
- data/app/models/image_block.rb +0 -12
- data/app/models/link.rb +4 -21
- data/app/models/page.rb +31 -34
- data/app/models/section.rb +82 -44
- data/app/models/section_node.rb +39 -24
- data/app/models/user.rb +5 -0
- data/app/views/cms/blocks/index.html.erb +4 -4
- data/app/views/cms/file_blocks/_form.html.erb +1 -1
- data/app/views/cms/image_blocks/_form.html.erb +1 -1
- data/app/views/cms/section_nodes/_link.html.erb +6 -3
- data/app/views/cms/section_nodes/_node.html.erb +11 -1
- data/app/views/cms/section_nodes/_page.html.erb +13 -7
- data/app/views/cms/section_nodes/_section.html.erb +24 -8
- data/app/views/cms/section_nodes/index.html.erb +28 -16
- data/app/views/layouts/templates/default.html.erb +17 -0
- data/browsercms.gemspec +28 -1413
- data/db/migrate/20120117144039_browsercms315.rb +94 -0
- data/db/migrate/{20081114172307_load_seed_data.rb → 20121114172307_load_seeds.rb} +8 -1
- data/lib/acts_as_list.rb +1 -1
- data/lib/browsercms.rb +2 -0
- data/lib/cms/addressable.rb +83 -0
- data/lib/cms/behaviors/attaching.rb +44 -24
- data/lib/cms/behaviors/connecting.rb +2 -1
- data/lib/cms/behaviors/publishing.rb +12 -3
- data/lib/cms/behaviors/versioning.rb +83 -53
- data/lib/cms/content_rendering_support.rb +3 -3
- data/lib/cms/error_pages.rb +8 -0
- data/lib/cms/init.rb +5 -3
- data/lib/cms/version.rb +1 -1
- data/templates/blank.rb +2 -0
- data/templates/demo.rb +2 -0
- data/templates/module.rb +2 -0
- data/test/custom_assertions.rb +7 -1
- data/test/factories.rb +3 -1
- data/test/factories/sitemap_factories.rb +28 -0
- data/test/fixtures/connectors.yml +97 -0
- data/test/fixtures/content_type_groups.yml +13 -0
- data/test/fixtures/content_types.yml +50 -0
- data/test/fixtures/dynamic_view_versions.yml +26 -0
- data/test/fixtures/dynamic_views.yml +26 -0
- data/test/fixtures/group_permissions.yml +16 -0
- data/test/fixtures/group_sections.yml +31 -0
- data/test/fixtures/group_type_permissions.yml +11 -0
- data/test/fixtures/group_types.yml +25 -0
- data/test/fixtures/groups.yml +25 -0
- data/test/fixtures/html_block_versions.yml +67 -0
- data/test/fixtures/html_blocks.yml +63 -0
- data/test/fixtures/page_versions.yml +265 -0
- data/test/fixtures/pages.yml +85 -0
- data/test/fixtures/permissions.yml +28 -0
- data/test/fixtures/section_nodes.yml +46 -0
- data/test/fixtures/sections.yml +19 -0
- data/test/fixtures/sites.yml +9 -0
- data/test/fixtures/user_group_memberships.yml +11 -0
- data/test/fixtures/users.yml +15 -0
- data/test/functional/cms/content_controller_test.rb +6 -1
- data/test/functional/cms/file_blocks_controller_test.rb +1 -0
- data/test/functional/cms/html_blocks_controller_test.rb +1 -0
- data/test/functional/cms/image_blocks_controller_test.rb +39 -32
- data/test/functional/cms/section_nodes_controller_test.rb +48 -20
- data/test/functional/cms/sections_controller_test.rb +3 -1
- data/test/functional/tests/pretend_controller_test.rb +6 -3
- data/test/integration/cms/ckeditor_test.rb +5 -2
- data/test/integration/sitemap_performance_test.rb +26 -0
- data/test/selenium-core/Blank.html +7 -0
- data/test/selenium-core/InjectedRemoteRunner.html +8 -0
- data/test/selenium-core/RemoteRunner.html +110 -0
- data/test/selenium-core/SeleniumLog.html +109 -0
- data/test/selenium-core/TestPrompt.html +145 -0
- data/test/selenium-core/TestRunner-splash.html +55 -0
- data/test/selenium-core/TestRunner.hta +176 -0
- data/test/selenium-core/TestRunner.html +176 -0
- data/test/selenium-core/domviewer/butmin.gif +0 -0
- data/test/selenium-core/domviewer/butplus.gif +0 -0
- data/test/selenium-core/domviewer/domviewer.css +298 -0
- data/test/selenium-core/domviewer/domviewer.html +16 -0
- data/test/selenium-core/domviewer/selenium-domviewer.js +205 -0
- data/test/selenium-core/icons/all.png +0 -0
- data/test/selenium-core/icons/continue.png +0 -0
- data/test/selenium-core/icons/continue_disabled.png +0 -0
- data/test/selenium-core/icons/pause.png +0 -0
- data/test/selenium-core/icons/pause_disabled.png +0 -0
- data/test/selenium-core/icons/selected.png +0 -0
- data/test/selenium-core/icons/step.png +0 -0
- data/test/selenium-core/icons/step_disabled.png +0 -0
- data/test/selenium-core/iedoc-core.xml +1515 -0
- data/test/selenium-core/iedoc.xml +1469 -0
- data/test/selenium-core/lib/cssQuery/cssQuery-p.js +6 -0
- data/test/selenium-core/lib/cssQuery/src/cssQuery-level2.js +142 -0
- data/test/selenium-core/lib/cssQuery/src/cssQuery-level3.js +150 -0
- data/test/selenium-core/lib/cssQuery/src/cssQuery-standard.js +53 -0
- data/test/selenium-core/lib/cssQuery/src/cssQuery.js +356 -0
- data/test/selenium-core/lib/prototype.js +2006 -0
- data/test/selenium-core/lib/scriptaculous/builder.js +101 -0
- data/test/selenium-core/lib/scriptaculous/controls.js +815 -0
- data/test/selenium-core/lib/scriptaculous/dragdrop.js +915 -0
- data/test/selenium-core/lib/scriptaculous/effects.js +958 -0
- data/test/selenium-core/lib/scriptaculous/scriptaculous.js +47 -0
- data/test/selenium-core/lib/scriptaculous/slider.js +283 -0
- data/test/selenium-core/lib/scriptaculous/unittest.js +383 -0
- data/test/selenium-core/scripts/find_matching_child.js +69 -0
- data/test/selenium-core/scripts/htmlutils.js +894 -0
- data/test/selenium-core/scripts/injection.html +72 -0
- data/test/selenium-core/scripts/js2html.js +70 -0
- data/test/selenium-core/scripts/narcissus-defs.js +175 -0
- data/test/selenium-core/scripts/narcissus-exec.js +1054 -0
- data/test/selenium-core/scripts/narcissus-parse.js +1003 -0
- data/test/selenium-core/scripts/se2html.js +63 -0
- data/test/selenium-core/scripts/selenium-api.js +2409 -0
- data/test/selenium-core/scripts/selenium-browserbot.js +2203 -0
- data/test/selenium-core/scripts/selenium-browserdetect.js +150 -0
- data/test/selenium-core/scripts/selenium-commandhandlers.js +377 -0
- data/test/selenium-core/scripts/selenium-executionloop.js +175 -0
- data/test/selenium-core/scripts/selenium-logging.js +147 -0
- data/test/selenium-core/scripts/selenium-remoterunner.js +571 -0
- data/test/selenium-core/scripts/selenium-testrunner.js +1333 -0
- data/test/selenium-core/scripts/selenium-version.js +5 -0
- data/test/selenium-core/scripts/user-extensions.js +3 -0
- data/test/selenium-core/scripts/user-extensions.js.sample +75 -0
- data/test/selenium-core/scripts/xmlextras.js +153 -0
- data/test/selenium-core/selenium-logo.png +0 -0
- data/test/selenium-core/selenium-test.css +43 -0
- data/test/selenium-core/selenium.css +299 -0
- data/test/selenium-core/xpath/dom.js +428 -0
- data/test/selenium-core/xpath/misc.js +252 -0
- data/test/selenium-core/xpath/xpath.js +2223 -0
- data/test/selenium/_login_as_cmsadmin.rsel +4 -0
- data/test/selenium/dashboard.rsel +5 -0
- data/test/selenium/html_blocks.rsel +4 -0
- data/test/selenium/login/failed_login.rsel +8 -0
- data/test/selenium/login/successful_login.rsel +9 -0
- data/test/selenium/page_templates.rsel +12 -0
- data/test/selenium/pages/edit_properties.rsel +5 -0
- data/test/selenium/site/view_home_page.rsel +4 -0
- data/test/selenium/sitemap/move_page.rsel +9 -0
- data/test/selenium/sitemap/open_section.rsel +6 -0
- data/test/selenium/sitemap/select_page.rsel +12 -0
- data/test/selenium/sitemap/select_section.rsel +17 -0
- data/test/test_helper.rb +30 -12
- data/test/unit/behaviors/attaching_test.rb +4 -6
- data/test/unit/behaviors/connectable_test.rb +29 -0
- data/test/unit/behaviors/publishable_test.rb +40 -9
- data/test/unit/behaviors/versioning_test.rb +36 -0
- data/test/unit/helpers/menu_helper_test.rb +5 -2
- data/test/unit/helpers/page_helper_test.rb +2 -0
- data/test/unit/lib/cms/sitemap_test.rb +206 -0
- data/test/unit/models/attachment_test.rb +51 -31
- data/test/unit/models/file_block_test.rb +74 -55
- data/test/unit/models/link_test.rb +44 -0
- data/test/unit/models/page_test.rb +290 -224
- data/test/unit/models/sections_test.rb +144 -44
- data/test/unit/models/user_test.rb +28 -18
- metadata +581 -350
- data/app/views/cms/section_nodes/_section_node.html.erb +0 -10
- data/test/unit/models/section_node_test.rb +0 -92
|
@@ -4,6 +4,7 @@ class Cms::SectionsControllerTest < ActionController::TestCase
|
|
|
4
4
|
include Cms::ControllerTestHelper
|
|
5
5
|
|
|
6
6
|
def setup
|
|
7
|
+
given_a_site_exists
|
|
7
8
|
login_as_cms_admin
|
|
8
9
|
end
|
|
9
10
|
|
|
@@ -38,6 +39,7 @@ class Cms::SectionFileBrowserControllerTest < ActionController::TestCase
|
|
|
38
39
|
include Cms::ControllerTestHelper
|
|
39
40
|
|
|
40
41
|
def setup
|
|
42
|
+
given_a_site_exists
|
|
41
43
|
login_as_cms_admin
|
|
42
44
|
end
|
|
43
45
|
|
|
@@ -207,7 +209,7 @@ class Cms::SectionsControllerPermissionsTest < ActionController::TestCase
|
|
|
207
209
|
@group2 = Factory(:group, :name => "Test", :group_type => Factory(:group_type, :name => "CMS User", :cms_access => true))
|
|
208
210
|
expected_groups = [@group, @group2]
|
|
209
211
|
login_as_cms_admin
|
|
210
|
-
put :update, :id => @editable_subsection, :section => {:name => "new name", :group_ids => [@group, @group2]}
|
|
212
|
+
put :update, :id => @editable_subsection, :section => {:name => "new name", :group_ids => [@group.id, @group2.id]}
|
|
211
213
|
assert_response :redirect
|
|
212
214
|
assert_equal expected_groups, assigns(:section).groups
|
|
213
215
|
end
|
|
@@ -3,6 +3,11 @@ require 'test_helper'
|
|
|
3
3
|
class Tests::PretendControllerTest < ActionController::TestCase
|
|
4
4
|
include Cms::ControllerTestHelper
|
|
5
5
|
|
|
6
|
+
def setup
|
|
7
|
+
remove_all_sitemap_fixtures_to_avoid_bugs
|
|
8
|
+
given_a_site_exists
|
|
9
|
+
end
|
|
10
|
+
|
|
6
11
|
test "open" do
|
|
7
12
|
get :open
|
|
8
13
|
assert_response :success
|
|
@@ -14,7 +19,7 @@ class Tests::PretendControllerTest < ActionController::TestCase
|
|
|
14
19
|
|
|
15
20
|
get :restricted
|
|
16
21
|
assert_response 403
|
|
17
|
-
assert_select '
|
|
22
|
+
assert_select 'title', "Access Denied"
|
|
18
23
|
end
|
|
19
24
|
|
|
20
25
|
test "restricted page should be visible to cmsadmins" do
|
|
@@ -32,7 +37,6 @@ class Tests::PretendControllerTest < ActionController::TestCase
|
|
|
32
37
|
get :not_found
|
|
33
38
|
assert_response :missing
|
|
34
39
|
assert_select "title", "Not Found"
|
|
35
|
-
assert_select "h1", "Page Not Found"
|
|
36
40
|
end
|
|
37
41
|
|
|
38
42
|
# See content_controller_tests for similar behavio
|
|
@@ -49,6 +53,5 @@ class Tests::PretendControllerTest < ActionController::TestCase
|
|
|
49
53
|
get :error
|
|
50
54
|
assert_response :error
|
|
51
55
|
assert_select "title", "Server Error"
|
|
52
|
-
assert_select "p", "The server encountered an unexpected condition that prevented it from fulfilling the request.", "Default CMS server error content"
|
|
53
56
|
end
|
|
54
57
|
end
|
|
@@ -7,7 +7,8 @@ class CkeditorTest < ActionController::IntegrationTest
|
|
|
7
7
|
login_as_cms_admin
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
# These tests are broken as of 3.1.x and are fixed in later updates. So skip running them for now.
|
|
11
|
+
def skip_test_ckeditor_select
|
|
11
12
|
get new_cms_html_block_url
|
|
12
13
|
assert_response :success
|
|
13
14
|
|
|
@@ -16,7 +17,9 @@ class CkeditorTest < ActionController::IntegrationTest
|
|
|
16
17
|
:onchange => "toggleEditor('html_block_content', this)"},
|
|
17
18
|
:child => { :tag => "option", :content => "Rich Text" }
|
|
18
19
|
end
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
# These tests are broken as of 3.1.x and are fixed in later updates. So skip running them for now.
|
|
22
|
+
def skip_test_ckeditor_js_added
|
|
20
23
|
get new_cms_html_block_url
|
|
21
24
|
assert_response :success
|
|
22
25
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
class SitemapPerformanceTest < ActionController::IntegrationTest
|
|
4
|
+
include Cms::IntegrationTestHelper
|
|
5
|
+
|
|
6
|
+
def setup
|
|
7
|
+
given_a_site_exists
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def test_homepage
|
|
11
|
+
r = Benchmark.measure do
|
|
12
|
+
get '/'
|
|
13
|
+
end
|
|
14
|
+
assert r.real < 1, "Should complete in under 1 sec. Was #{r.real}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
test "sitemap" do
|
|
18
|
+
# Make me work someday
|
|
19
|
+
|
|
20
|
+
#login_as_cms_admin
|
|
21
|
+
#
|
|
22
|
+
#puts Benchmark.measure do
|
|
23
|
+
# get '/cms/sitemap'
|
|
24
|
+
#end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<!--
|
|
4
|
+
Copyright 2004 ThoughtWorks, Inc
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the License for the specific language governing permissions and
|
|
16
|
+
limitations under the License.
|
|
17
|
+
-->
|
|
18
|
+
<HTA:APPLICATION ID="SeleniumHTARunner" APPLICATIONNAME="Selenium" >
|
|
19
|
+
<head>
|
|
20
|
+
<meta content="text/html; charset=ISO-8859-1"
|
|
21
|
+
http-equiv="content-type">
|
|
22
|
+
<title>Selenium Remote Control</title>
|
|
23
|
+
<link rel="stylesheet" type="text/css" href="selenium.css" />
|
|
24
|
+
<script type="text/javascript" src="scripts/xmlextras.js"></script>
|
|
25
|
+
<script language="JavaScript" type="text/javascript" src="lib/prototype.js"></script>
|
|
26
|
+
<script language="JavaScript" type="text/javascript" src="lib/cssQuery/cssQuery-p.js"></script>
|
|
27
|
+
<script language="JavaScript" type="text/javascript" src="scripts/htmlutils.js"></script>
|
|
28
|
+
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
|
|
29
|
+
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserbot.js"></script>
|
|
30
|
+
<script language="JavaScript" type="text/javascript" src="scripts/find_matching_child.js"></script>
|
|
31
|
+
<script language="JavaScript" type="text/javascript" src="scripts/selenium-api.js"></script>
|
|
32
|
+
<script language="JavaScript" type="text/javascript" src="scripts/selenium-commandhandlers.js"></script>
|
|
33
|
+
<script language="JavaScript" type="text/javascript" src="scripts/selenium-executionloop.js"></script>
|
|
34
|
+
<script language="JavaScript" type="text/javascript" src="scripts/selenium-remoterunner.js"></script>
|
|
35
|
+
<script language="JavaScript" type="text/javascript" src="scripts/selenium-logging.js"></script>
|
|
36
|
+
<script language="JavaScript" type="text/javascript" src="scripts/selenium-version.js"></script>
|
|
37
|
+
<script language="JavaScript" type="text/javascript" src="xpath/misc.js"></script>
|
|
38
|
+
<script language="JavaScript" type="text/javascript" src="xpath/dom.js"></script>
|
|
39
|
+
<script language="JavaScript" type="text/javascript" src="xpath/xpath.js"></script>
|
|
40
|
+
<script language="JavaScript" type="text/javascript" src="scripts/user-extensions.js"></script>
|
|
41
|
+
<script language="JavaScript" type="text/javascript">
|
|
42
|
+
function openDomViewer() {
|
|
43
|
+
var autFrame = document.getElementById('selenium_myiframe');
|
|
44
|
+
var autFrameDocument = getIframeDocument(autFrame);
|
|
45
|
+
var domViewer = window.open(getDocumentBase(document) + 'domviewer/domviewer.html');
|
|
46
|
+
domViewer.rootDocument = autFrameDocument;
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function cleanUp() {
|
|
51
|
+
if (LOG != null) {
|
|
52
|
+
LOG.close();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
</script>
|
|
57
|
+
</head>
|
|
58
|
+
|
|
59
|
+
<body onLoad="setTimeout(function(){runSeleniumTest();},1000)" onUnload="cleanUp()">
|
|
60
|
+
|
|
61
|
+
<table border="1" style="height: 100%;">
|
|
62
|
+
<tr>
|
|
63
|
+
<td width="50%" height="30%">
|
|
64
|
+
<table>
|
|
65
|
+
<tr>
|
|
66
|
+
<td>
|
|
67
|
+
<img src="selenium-logo.png">
|
|
68
|
+
</td>
|
|
69
|
+
<td>
|
|
70
|
+
<h1><a href="http://selenium.thoughtworks.com" >Selenium</a> Functional Testing for Web Apps</h1>
|
|
71
|
+
Open Source From <a href="http://www.thoughtworks.com">ThoughtWorks, Inc</a> and Friends
|
|
72
|
+
<form action="">
|
|
73
|
+
<br/>Slow Mode:<INPUT TYPE="CHECKBOX" NAME="FASTMODE" VALUE="YES" onmouseup="slowClicked()">
|
|
74
|
+
|
|
75
|
+
<iframe id="seleniumLoggingFrame" name="seleniumLoggingFrame" src="Blank.html" style="border: 0; height: 0; width: 0; "></iframe>
|
|
76
|
+
<fieldset>
|
|
77
|
+
<legend>Tools</legend>
|
|
78
|
+
|
|
79
|
+
<button type="button" id="domViewer1" onclick="openDomViewer();">
|
|
80
|
+
View DOM
|
|
81
|
+
</button>
|
|
82
|
+
<button type="button" onclick="LOG.show();">
|
|
83
|
+
Show Log
|
|
84
|
+
</button>
|
|
85
|
+
</fieldset>
|
|
86
|
+
|
|
87
|
+
</form>
|
|
88
|
+
|
|
89
|
+
</td>
|
|
90
|
+
</tr>
|
|
91
|
+
</table>
|
|
92
|
+
<form action="">
|
|
93
|
+
<label id="context" name="context"></label>
|
|
94
|
+
</form>
|
|
95
|
+
</td>
|
|
96
|
+
<td width="50%" height="30%">
|
|
97
|
+
<b>Last Four Test Commands:</b><br/>
|
|
98
|
+
<div id="commandList"></div>
|
|
99
|
+
</td>
|
|
100
|
+
</tr>
|
|
101
|
+
<tr>
|
|
102
|
+
<td colspan="2" height="70%">
|
|
103
|
+
<iframe name="selenium_myiframe" id="selenium_myiframe" src="Blank.html" height="100%" width="100%"></iframe>
|
|
104
|
+
</td>
|
|
105
|
+
</tr>
|
|
106
|
+
</table>
|
|
107
|
+
|
|
108
|
+
</body>
|
|
109
|
+
</html>
|
|
110
|
+
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<head>
|
|
4
|
+
<title>Selenium Log Console</title>
|
|
5
|
+
<link id="cssLink" rel="stylesheet" href="selenium.css" />
|
|
6
|
+
<script src="scripts/htmlutils.js"></script>
|
|
7
|
+
<script language="JavaScript">
|
|
8
|
+
|
|
9
|
+
var disabled = true;
|
|
10
|
+
|
|
11
|
+
function logOnLoad() {
|
|
12
|
+
var urlConfig = new URLConfiguration();
|
|
13
|
+
urlConfig.queryString = window.location.search.substr(1);
|
|
14
|
+
var startingThreshold = urlConfig._getQueryParameter("startingThreshold");
|
|
15
|
+
setThresholdLevel(startingThreshold);
|
|
16
|
+
var buttons = document.getElementsByTagName("input");
|
|
17
|
+
for (var i = 0; i < buttons.length; i++) {
|
|
18
|
+
addChangeListener(buttons[i]);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function enableButtons() {
|
|
23
|
+
var buttons = document.getElementsByTagName("input");
|
|
24
|
+
for (var i = 0; i < buttons.length; i++) {
|
|
25
|
+
buttons[i].disabled = false;
|
|
26
|
+
disabled = false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function callBack() {}
|
|
31
|
+
|
|
32
|
+
function changeHandler() {
|
|
33
|
+
callBack(getThresholdLevel());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function addChangeListener(element) {
|
|
37
|
+
if (window.addEventListener && !window.opera)
|
|
38
|
+
element.addEventListener("click", changeHandler, true);
|
|
39
|
+
else if (window.attachEvent)
|
|
40
|
+
element.attachEvent("onclick", changeHandler);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var logLevels = {
|
|
44
|
+
debug: 0,
|
|
45
|
+
info: 1,
|
|
46
|
+
warn: 2,
|
|
47
|
+
error: 3
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function getThresholdLevel() {
|
|
51
|
+
var buttons = document.getElementById('logLevelChooser').level;
|
|
52
|
+
for (var i = 0; i < buttons.length; i++) {
|
|
53
|
+
if (buttons[i].checked) {
|
|
54
|
+
return buttons[i].value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function setThresholdLevel(logLevel) {
|
|
60
|
+
var buttons = document.getElementById('logLevelChooser').level;
|
|
61
|
+
for (var i = 0; i < buttons.length; i++) {
|
|
62
|
+
if (buttons[i].value==logLevel) {
|
|
63
|
+
buttons[i].checked = true;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
buttons[i].checked = false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function append(message, logLevel) {
|
|
72
|
+
var logLevelThreshold = getThresholdLevel();
|
|
73
|
+
if (logLevels[logLevel] < logLevels[logLevelThreshold]) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
var log = document.getElementById('log');
|
|
77
|
+
var newEntry = document.createElement('li');
|
|
78
|
+
newEntry.className = logLevel;
|
|
79
|
+
newEntry.appendChild(document.createTextNode(message));
|
|
80
|
+
log.appendChild(newEntry);
|
|
81
|
+
if (newEntry.scrollIntoView) {
|
|
82
|
+
newEntry.scrollIntoView();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
</script>
|
|
87
|
+
</head>
|
|
88
|
+
<body id="logging-console" onload="logOnLoad();">
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
<div id="banner">
|
|
93
|
+
<form id="logLevelChooser">
|
|
94
|
+
<input id="level-error" type="radio" name="level" disabled='true'
|
|
95
|
+
value="error" /><label for="level-error">Error</label>
|
|
96
|
+
<input id="level-warn" type="radio" name="level" disabled='true'
|
|
97
|
+
value="warn" /><label for="level-warn">Warn</label>
|
|
98
|
+
<input id="level-info" type="radio" name="level" disabled='true'
|
|
99
|
+
value="info" /><label for="level-info">Info</label>
|
|
100
|
+
<input id="level-debug" type="radio" name="level" checked="yes" disabled='true'
|
|
101
|
+
value="debug" /><label for="level-debug">Debug</label>
|
|
102
|
+
</form>
|
|
103
|
+
<h1>Selenium Log Console</h1>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<ul id="log"></ul>
|
|
107
|
+
|
|
108
|
+
</body>
|
|
109
|
+
</html>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<!--
|
|
3
|
+
Copyright 2004 ThoughtWorks, Inc
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
-->
|
|
17
|
+
|
|
18
|
+
<head>
|
|
19
|
+
<meta content="text/html; charset=ISO-8859-1"
|
|
20
|
+
http-equiv="content-type">
|
|
21
|
+
<title>Select a Test Suite</title>
|
|
22
|
+
<script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
|
|
23
|
+
<script language="JavaScript" type="text/javascript" src="scripts/xmlextras.js"></script>
|
|
24
|
+
<script>
|
|
25
|
+
|
|
26
|
+
function load() {
|
|
27
|
+
if (browserVersion.isHTA) {
|
|
28
|
+
document.getElementById("save-div").style.display = "inline";
|
|
29
|
+
}
|
|
30
|
+
if (/thisIsSeleniumServer/.test(window.location.search)) {
|
|
31
|
+
document.getElementById("slowResources-div").style.display = "inline";
|
|
32
|
+
if (browserVersion.isHTA || browserVersion.isChrome) {
|
|
33
|
+
document.getElementById("test").value = "http://localhost:4444/selenium-server/tests/TestSuite.html";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function autoCheck() {
|
|
39
|
+
var auto = document.getElementById("auto");
|
|
40
|
+
var autoDiv = document.getElementById("auto-div");
|
|
41
|
+
if (auto.checked) {
|
|
42
|
+
autoDiv.style.display = "inline";
|
|
43
|
+
} else {
|
|
44
|
+
autoDiv.style.display = "none";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function slowCheck() {
|
|
49
|
+
var slowResourcesCheckbox = document.getElementById("slowResources");
|
|
50
|
+
var slowResources = slowResourcesCheckbox.checked ? true : false;
|
|
51
|
+
var xhr = XmlHttp.create();
|
|
52
|
+
var driverUrl = "http://localhost:4444/selenium-server/driver/?cmd=slowResources&1=" + slowResources;
|
|
53
|
+
xhr.open("GET", driverUrl, true);
|
|
54
|
+
xhr.send(null);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function saveCheck() {
|
|
58
|
+
var results = document.getElementById("results");
|
|
59
|
+
var check = document.getElementById("save").checked;
|
|
60
|
+
if (check) {
|
|
61
|
+
results.firstChild.nodeValue = "Results file ";
|
|
62
|
+
document.getElementById("resultsUrl").value = "results.html";
|
|
63
|
+
} else {
|
|
64
|
+
results.firstChild.nodeValue = "Results URL ";
|
|
65
|
+
document.getElementById("resultsUrl").value = "../postResults";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function go() {
|
|
70
|
+
if (!browserVersion.isHTA) return true;
|
|
71
|
+
var inputs = document.getElementsByTagName("input");
|
|
72
|
+
var queryString = "";
|
|
73
|
+
for (var i = 0; i < inputs.length; i++) {
|
|
74
|
+
var elem = inputs[i];
|
|
75
|
+
var name = elem.name;
|
|
76
|
+
var value = elem.value;
|
|
77
|
+
if (elem.type == "checkbox") {
|
|
78
|
+
value = elem.checked;
|
|
79
|
+
}
|
|
80
|
+
queryString += escape(name) + "=" + escape(value);
|
|
81
|
+
if (i < (inputs.length - 1)) {
|
|
82
|
+
queryString += "&";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
window.parent.selenium = null;
|
|
87
|
+
window.parent.htmlTestRunner.controlPanel.queryString = queryString;
|
|
88
|
+
window.parent.htmlTestRunner.loadSuiteFrame();
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
</script>
|
|
92
|
+
</head>
|
|
93
|
+
|
|
94
|
+
<body onload="load()" style="font-size: x-small">
|
|
95
|
+
<form id="prompt" target="_top" method="GET" onsubmit="return go();" action="TestRunner.html">
|
|
96
|
+
|
|
97
|
+
<p>
|
|
98
|
+
Test Suite:
|
|
99
|
+
<input id="test" name="test" size="30" value="../tests/TestSuite.html"/>
|
|
100
|
+
</p>
|
|
101
|
+
|
|
102
|
+
<p align="center"><input type="submit" value="Go"/></p>
|
|
103
|
+
|
|
104
|
+
<fieldset>
|
|
105
|
+
<legend>Options</legend>
|
|
106
|
+
|
|
107
|
+
<p>
|
|
108
|
+
<input id="multiWindow" type="checkbox" name="multiWindow" onclick="autoCheck();"/> <label
|
|
109
|
+
for="multiWindow">AUT in separate window</label>
|
|
110
|
+
|
|
111
|
+
<p>
|
|
112
|
+
|
|
113
|
+
<div id="slowResources-div" style="display: none">
|
|
114
|
+
<p>
|
|
115
|
+
<input id="slowResources" type="checkbox" name="slowResources" onclick="slowCheck();" /> <label for="slowResources">Slow down web server</label>
|
|
116
|
+
</p>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<p>
|
|
120
|
+
<input id="auto" type="checkbox" name="auto" onclick="autoCheck();"/> <label for="auto">Run
|
|
121
|
+
automatically</label>
|
|
122
|
+
</p>
|
|
123
|
+
|
|
124
|
+
<div id="auto-div" style="display: none">
|
|
125
|
+
<p>
|
|
126
|
+
<input id="close" type="checkbox" name="close"/> <label for="close">Close afterwards </label>
|
|
127
|
+
</p>
|
|
128
|
+
|
|
129
|
+
<div id="save-div" style="display: none">
|
|
130
|
+
<br/><label for="save">Save to file </label><input id="save" type="checkbox" name="save"
|
|
131
|
+
onclick="saveCheck();"/>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<p id="results">
|
|
135
|
+
Results URL:
|
|
136
|
+
<input id="resultsUrl" name="resultsUrl" value="../postResults"/>
|
|
137
|
+
</p>
|
|
138
|
+
|
|
139
|
+
</div>
|
|
140
|
+
</fieldset>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
</form>
|
|
144
|
+
</body>
|
|
145
|
+
</html>
|