zena 1.2.7 → 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (407) hide show
  1. data/History.txt +80 -25
  2. data/Rakefile +2 -2
  3. data/app/controllers/columns_controller.rb +2 -2
  4. data/app/controllers/nodes_controller.rb +22 -29
  5. data/app/controllers/user_sessions_controller.rb +35 -10
  6. data/app/controllers/users_controller.rb +2 -2
  7. data/app/controllers/versions_controller.rb +2 -2
  8. data/app/models/group.rb +15 -1
  9. data/app/models/node.rb +109 -8
  10. data/app/models/role.rb +4 -0
  11. data/app/models/site.rb +64 -58
  12. data/app/models/template.rb +1 -1
  13. data/app/models/user.rb +135 -29
  14. data/app/models/user_session.rb +0 -1
  15. data/app/models/virtual_class.rb +11 -6
  16. data/app/views/columns/_form.html.erb +3 -1
  17. data/app/views/columns/_li.html.erb +1 -1
  18. data/app/views/columns/create.rjs +1 -1
  19. data/app/views/groups/_form.rhtml +16 -13
  20. data/app/views/relations/_form.erb +18 -6
  21. data/app/views/sites/_form.erb +12 -6
  22. data/app/views/users/_form.rhtml +23 -8
  23. data/app/views/users/_li.rhtml +14 -3
  24. data/app/views/users/index.rhtml +1 -1
  25. data/app/views/virtual_classes/_form.erb +12 -2
  26. data/app/views/zafu/default/Node-+login.zafu +8 -1
  27. data/app/views/zafu/default/Node-+search.zafu +1 -1
  28. data/bricks/acls/lib/bricks/acls.rb +1 -0
  29. data/bricks/acls/zena/migrate/20130903150356_longer_names_for_acl.rb +9 -0
  30. data/bricks/acls/zena/test/integration/acl_integration_test.rb +2 -2
  31. data/bricks/currency/lib/bricks/currency.rb +120 -0
  32. data/bricks/currency/zena/test/unit/currency_test.rb +43 -0
  33. data/bricks/fs_skin/lib/bricks/fs_skin.rb +1 -1
  34. data/bricks/fs_skin/zena/skins/blog/Node-+search.zafu +1 -1
  35. data/bricks/fs_skin/zena/skins/blog/Node.zafu +1 -1
  36. data/bricks/fs_skin/zena/test/unit/fs_skin_view_test.rb +35 -0
  37. data/bricks/pdf/lib/bricks/pdf.rb +1 -1
  38. data/bricks/sphinx/lib/bricks/sphinx.rb +2 -0
  39. data/bricks/sphinx/zena/init.rb +14 -0
  40. data/bricks/tags/zena/test/zafu/tags.yml +5 -1
  41. data/bricks/worker/lib/bricks/worker.rb +3 -2
  42. data/bricks/zena/zena/migrate/20130829093753_add_versioned_flag_to_column.rb +10 -0
  43. data/bricks/zena/zena/migrate/20130903084909_count_login_attempts.rb +11 -0
  44. data/bricks/zena/zena/migrate/20131104153126_index_fullpath.rb +10 -0
  45. data/bricks/zena/zena/migrate/20131104210011_rebuild_fullpath_after_change.rb +10 -0
  46. data/bricks/zena/zena/migrate/20131105160420_add_skin_id_to_sites.rb +9 -0
  47. data/bricks/zena/zena/migrate/20131105175822_add_profile_to_users.rb +11 -0
  48. data/bricks/zena/zena/migrate/20140213120038_fix_idx_scope.rb +13 -0
  49. data/bricks/zena/zena/migrate/20140628140247_add_site_readonly.rb +9 -0
  50. data/config/bricks.yml +8 -4
  51. data/config/gems.yml +5 -3
  52. data/db/init/base/skins/default/Node-+login.zafu +8 -1
  53. data/db/init/base/skins/default/Node-+search.zafu +1 -1
  54. data/lib/bricks/loader.rb +5 -5
  55. data/lib/gettext_strings.rb +3 -0
  56. data/lib/tasks/zena.rake +25 -22
  57. data/lib/zafu/process/context.rb +4 -0
  58. data/lib/zena/acts/secure_node.rb +3 -3
  59. data/lib/zena/app.rb +1 -0
  60. data/lib/zena/deploy.rb +1 -1
  61. data/lib/zena/deploy/template.rb +1 -1
  62. data/lib/zena/foxy_parser.rb +5 -2
  63. data/lib/zena/info.rb +1 -1
  64. data/lib/zena/site_worker.rb +2 -2
  65. data/lib/zena/test_controller.rb +5 -2
  66. data/lib/zena/use/action.rb +9 -2
  67. data/lib/zena/use/ajax.rb +20 -4
  68. data/lib/zena/use/ancestry.rb +89 -15
  69. data/lib/zena/use/authlogic.rb +8 -2
  70. data/lib/zena/use/context.rb +1 -0
  71. data/lib/zena/use/display.rb +1 -97
  72. data/lib/zena/use/forms.rb +28 -8
  73. data/lib/zena/use/html_tags.rb +16 -7
  74. data/lib/zena/use/i18n.rb +1 -1
  75. data/lib/zena/use/prop_eval.rb +6 -1
  76. data/lib/zena/use/query_node.rb +69 -4
  77. data/lib/zena/use/recursion.rb +1 -1
  78. data/lib/zena/use/refactor.rb +5 -2
  79. data/lib/zena/use/relations.rb +1 -0
  80. data/lib/zena/use/rendering.rb +7 -4
  81. data/lib/zena/use/test_helper.rb +8 -4
  82. data/lib/zena/use/upload.rb +14 -0
  83. data/lib/zena/use/urls.rb +39 -23
  84. data/lib/zena/use/version_hash.rb +5 -2
  85. data/lib/zena/use/workflow.rb +116 -70
  86. data/lib/zena/use/zafu_eval.rb +41 -0
  87. data/lib/zena/use/zafu_safe_definitions.rb +1 -0
  88. data/lib/zena/use/zafu_templates.rb +32 -26
  89. data/lib/zena/use/zazen.rb +8 -7
  90. data/locale/app.pot +5 -1
  91. data/locale/de/LC_MESSAGES/zena.mo +0 -0
  92. data/locale/de/zena.po +385 -281
  93. data/locale/en/LC_MESSAGES/zena.mo +0 -0
  94. data/locale/en/zena.po +378 -271
  95. data/locale/fr/LC_MESSAGES/zena.mo +0 -0
  96. data/locale/fr/zena.po +387 -272
  97. data/locale/it/LC_MESSAGES/zena.mo +0 -0
  98. data/locale/it/zena.po +433 -404
  99. data/locale/zena.pot +362 -268
  100. data/public/javascripts/grid.js +280 -104
  101. data/public/javascripts/zena.js +43 -15
  102. data/public/stylesheets/admin.css +8 -2
  103. data/public/stylesheets/grid.css +5 -2
  104. data/public/stylesheets/popup.css +1 -1
  105. data/test/fixtures/files/TestNode.zafu +51 -0
  106. data/test/functional/nodes_controller_test.rb +20 -5
  107. data/test/functional/user_sessions_controller_test.rb +41 -6
  108. data/test/functional/users_controller_test.rb +1 -2
  109. data/test/integration/navigation_test.rb +22 -4
  110. data/test/integration/query_node/basic.yml +7 -0
  111. data/test/integration/query_node/complex.yml +1 -1
  112. data/test/integration/query_node/errors.yml +1 -1
  113. data/test/integration/query_node/filters.yml +34 -1
  114. data/test/integration/query_node/relations.yml +6 -13
  115. data/test/integration/query_node_test.rb +22 -3
  116. data/test/integration/zafu_compiler/action.yml +1 -1
  117. data/test/integration/zafu_compiler/alias_site.yml +52 -0
  118. data/test/integration/zafu_compiler/complex.yml +1 -1
  119. data/test/integration/zafu_compiler/complex_ok.yml +5 -5
  120. data/test/integration/zafu_compiler/context.yml +1 -1
  121. data/test/integration/zafu_compiler/display.yml +56 -5
  122. data/test/integration/zafu_compiler/forms.yml +35 -2
  123. data/test/integration/zafu_compiler/meta.yml +4 -0
  124. data/test/integration/zafu_compiler/rubyless.yml +1 -1
  125. data/test/integration/zafu_compiler/safe_definitions.yml +4 -0
  126. data/test/integration/zafu_compiler/security.yml +10 -0
  127. data/test/integration/zafu_compiler/site.yml +5 -1
  128. data/test/integration/zafu_compiler/urls.yml +8 -2
  129. data/test/integration/zafu_compiler/zafu_attributes.yml +2 -1
  130. data/test/integration/zafu_compiler/zazen.yml +4 -0
  131. data/test/integration/zafu_compiler_test.rb +47 -4
  132. data/test/selenium/Grid/grid1.rsel +8 -8
  133. data/test/sites/complex/sites.yml +2 -2
  134. data/test/sites/complex/users.yml +1 -0
  135. data/test/sites/zena/columns.yml +4 -0
  136. data/test/sites/zena/sites.yml +1 -0
  137. data/test/sites/zena/users.yml +1 -0
  138. data/test/unit/node_test.rb +53 -5
  139. data/test/unit/note_test.rb +1 -1
  140. data/test/unit/relation_proxy_test.rb +20 -0
  141. data/test/unit/role_test.rb +2 -0
  142. data/test/unit/site_test.rb +28 -6
  143. data/test/unit/user_test.rb +332 -1
  144. data/test/unit/virtual_class_test.rb +55 -0
  145. data/test/unit/workflow_test.rb +175 -0
  146. data/test/unit/zena/use/ancestry_test.rb +52 -10
  147. data/test/unit/zena/use/prop_eval_test.rb +44 -0
  148. data/test/unit/zena/use/rendering_test.rb +48 -2
  149. data/test/unit/zena/use/upload_test.rb +15 -13
  150. data/test/unit/zena/use/urls_test.rb +1 -0
  151. data/vendor/plugins/ar_mysql_full_text/lib/ar_mysql_full_text.rb +39 -25
  152. data/zena.gemspec +69 -307
  153. metadata +143 -368
  154. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run 2.tmCommand +0 -24
  155. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run Context.tmCommand +0 -58
  156. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run Focused Should.tmCommand +0 -88
  157. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run.tmCommand +0 -27
  158. data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/YAML to Shoulda.tmCommand +0 -23
  159. data/vendor/TextMate/Ruby Shoulda.tmbundle/Preferences/Symbol List: Context.tmPreferences +0 -19
  160. data/vendor/TextMate/Ruby Shoulda.tmbundle/Preferences/Symbol List: Should.tmPreferences +0 -19
  161. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory attributes for.tmSnippet +0 -16
  162. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory build.tmSnippet +0 -16
  163. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory.tmSnippet +0 -16
  164. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_define with class.tmSnippet +0 -18
  165. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_define.tmSnippet +0 -18
  166. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_next.tmSnippet +0 -16
  167. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_sequence.tmSnippet +0 -18
  168. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_bad_value.tmSnippet +0 -16
  169. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_contains.tmSnippet +0 -16
  170. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_does_not_contain.tmSnippet +0 -16
  171. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_good_value.tmSnippet +0 -16
  172. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_same_elements.tmSnippet +0 -16
  173. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_save.tmSnippet +0 -16
  174. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_sent_email.tmSnippet +0 -18
  175. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_valid.tmSnippet +0 -16
  176. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/association.tmSnippet +0 -17
  177. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/attribute.tmSnippet +0 -17
  178. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/before_should block.tmSnippet +0 -18
  179. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block get.tmSnippet +0 -22
  180. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block post.tmSnippet +0 -23
  181. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block with setup.tmSnippet +0 -25
  182. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/setup.tmSnippet +0 -18
  183. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should block with before proc.tmSnippet +0 -18
  184. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should block.tmSnippet +0 -18
  185. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_allow_values_for.tmSnippet +0 -16
  186. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_assign_to.tmSnippet +0 -16
  187. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_be_restful denied.tmSnippet +0 -20
  188. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_be_restful.tmSnippet +0 -20
  189. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_belong_to.tmSnippet +0 -16
  190. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_change by.tmSnippet +0 -16
  191. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_change from to.tmSnippet +0 -16
  192. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_at_least.tmSnippet +0 -16
  193. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_in_range.tmSnippet +0 -16
  194. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_is.tmSnippet +0 -16
  195. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_value_in_range.tmSnippet +0 -16
  196. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_eventually.tmSnippet +0 -18
  197. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_filter_params.tmSnippet +0 -16
  198. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_and_belong_to_many.tmSnippet +0 -16
  199. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_class_methods.tmSnippet +0 -16
  200. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_db_column.tmSnippet +0 -16
  201. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_db_columns.tmSnippet +0 -16
  202. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_index.tmSnippet +0 -16
  203. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_indices.tmSnippet +0 -16
  204. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_instance_methods.tmSnippet +0 -16
  205. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_many.tmSnippet +0 -16
  206. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_named_scope.tmSnippet +0 -16
  207. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_one.tmSnippet +0 -16
  208. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_readonly_attributes.tmSnippet +0 -16
  209. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_allow_mass_assignment_of.tmSnippet +0 -16
  210. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_allow_values_for.tmSnippet +0 -16
  211. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_assign_to.tmSnippet +0 -16
  212. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_change.tmSnippet +0 -16
  213. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_set_the_flash.tmSnippet +0 -16
  214. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_redirect_to.tmSnippet +0 -16
  215. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_a_form.tmSnippet +0 -16
  216. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_template.tmSnippet +0 -16
  217. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_with_layout.tmSnippet +0 -16
  218. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_without_layout.tmSnippet +0 -16
  219. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_respond_with.tmSnippet +0 -16
  220. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_respond_with_content_type.tmSnippet +0 -16
  221. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_return_from_session.tmSnippet +0 -16
  222. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_route.tmSnippet +0 -16
  223. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_set_the_flash_to.tmSnippet +0 -16
  224. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_acceptance_of.tmSnippet +0 -16
  225. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_numericality_of.tmSnippet +0 -16
  226. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_presence_of.tmSnippet +0 -16
  227. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_uniqueness_of with scope.tmSnippet +0 -16
  228. data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_uniqueness_of.tmSnippet +0 -16
  229. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb +0 -39
  230. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/run_script.rb +0 -104
  231. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/stdin_dialog.rb +0 -14
  232. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/test.rb +0 -17
  233. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/todo.txt +0 -13
  234. data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/bin/yaml_to_shoulda.rb +0 -25
  235. data/vendor/TextMate/Ruby Shoulda.tmbundle/Syntaxes/Ruby on Rails (Shoulda).tmLanguage +0 -166
  236. data/vendor/TextMate/Ruby Shoulda.tmbundle/info.plist +0 -304
  237. data/vendor/TextMate/Zena.tmbundle/Commands/Run all yaml tests.tmCommand +0 -37
  238. data/vendor/TextMate/Zena.tmbundle/Commands/Run focused yaml test.tmCommand +0 -52
  239. data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb +0 -39
  240. data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/run_script.rb +0 -118
  241. data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/stdin_dialog.rb +0 -14
  242. data/vendor/TextMate/Zena.tmbundle/info.plist +0 -17
  243. data/vendor/plugins/selenium-on-rails/CHANGELOG +0 -125
  244. data/vendor/plugins/selenium-on-rails/LICENSE-2.0.txt +0 -202
  245. data/vendor/plugins/selenium-on-rails/README.md +0 -202
  246. data/vendor/plugins/selenium-on-rails/Rakefile +0 -38
  247. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumController.html +0 -265
  248. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumHelper.html +0 -148
  249. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails.html +0 -126
  250. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/FixtureLoader.html +0 -231
  251. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/PartialsSupport.html +0 -195
  252. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Paths.html +0 -295
  253. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html +0 -219
  254. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Renderer.html +0 -156
  255. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Selenese.html +0 -179
  256. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/SuiteRenderer.html +0 -223
  257. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html +0 -441
  258. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderAccessors.html +0 -3098
  259. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderActions.html +0 -2080
  260. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserAccessors.html +0 -116
  261. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderUserActions.html +0 -116
  262. data/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRailsConfig.html +0 -150
  263. data/vendor/plugins/selenium-on-rails/doc/files/CHANGELOG.html +0 -422
  264. data/vendor/plugins/selenium-on-rails/doc/files/README.html +0 -321
  265. data/vendor/plugins/selenium-on-rails/doc/files/lib/controllers/selenium_controller_rb.html +0 -108
  266. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_helper_rb.html +0 -101
  267. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/acceptance_test_runner_rb.html +0 -222
  268. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/fixture_loader_rb.html +0 -109
  269. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/partials_support_rb.html +0 -111
  270. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/paths_rb.html +0 -101
  271. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/renderer_rb.html +0 -101
  272. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/rselenese_rb.html +0 -118
  273. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/selenese_rb.html +0 -101
  274. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/suite_renderer_rb.html +0 -101
  275. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html +0 -114
  276. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_actions_rb.html +0 -113
  277. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_rb.html +0 -120
  278. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_config_rb.html +0 -108
  279. data/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_rb.html +0 -115
  280. data/vendor/plugins/selenium-on-rails/doc/fr_class_index.html +0 -42
  281. data/vendor/plugins/selenium-on-rails/doc/fr_file_index.html +0 -43
  282. data/vendor/plugins/selenium-on-rails/doc/fr_method_index.html +0 -182
  283. data/vendor/plugins/selenium-on-rails/doc/index.html +0 -24
  284. data/vendor/plugins/selenium-on-rails/doc/rdoc-style.css +0 -208
  285. data/vendor/plugins/selenium-on-rails/generators/selenium/USAGE +0 -19
  286. data/vendor/plugins/selenium-on-rails/generators/selenium/selenium_generator.rb +0 -50
  287. data/vendor/plugins/selenium-on-rails/generators/selenium/templates/rhtml.rhtml +0 -16
  288. data/vendor/plugins/selenium-on-rails/generators/selenium/templates/rselenese.rhtml +0 -14
  289. data/vendor/plugins/selenium-on-rails/generators/selenium/templates/selenese.rhtml +0 -11
  290. data/vendor/plugins/selenium-on-rails/init.rb +0 -15
  291. data/vendor/plugins/selenium-on-rails/lib/controllers/selenium_controller.rb +0 -122
  292. data/vendor/plugins/selenium-on-rails/lib/controllers/switch_environment_controller.rb +0 -16
  293. data/vendor/plugins/selenium-on-rails/lib/selenium_helper.rb +0 -8
  294. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails.rb +0 -11
  295. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/acceptance_test_runner.rb +0 -215
  296. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/fixture_loader.rb +0 -57
  297. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/partials_support.rb +0 -36
  298. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/paths.rb +0 -61
  299. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/renderer.rb +0 -20
  300. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/rselenese.rb +0 -44
  301. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/selenese.rb +0 -87
  302. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/suite_renderer.rb +0 -56
  303. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder.rb +0 -116
  304. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_accessors.rb +0 -1002
  305. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_actions.rb +0 -514
  306. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_accessors.rb.example +0 -91
  307. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_user_actions.rb.example +0 -24
  308. data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb +0 -30
  309. data/vendor/plugins/selenium-on-rails/lib/views/layouts/layout.rhtml +0 -18
  310. data/vendor/plugins/selenium-on-rails/lib/views/record.rhtml +0 -5
  311. data/vendor/plugins/selenium-on-rails/lib/views/selenium_helper.rb +0 -9
  312. data/vendor/plugins/selenium-on-rails/lib/views/setup.rhtml +0 -67
  313. data/vendor/plugins/selenium-on-rails/lib/views/test_suite.rhtml +0 -26
  314. data/vendor/plugins/selenium-on-rails/routes.rb +0 -24
  315. data/vendor/plugins/selenium-on-rails/selenium-core/Blank.html +0 -7
  316. data/vendor/plugins/selenium-on-rails/selenium-core/InjectedRemoteRunner.html +0 -8
  317. data/vendor/plugins/selenium-on-rails/selenium-core/RemoteRunner.html +0 -110
  318. data/vendor/plugins/selenium-on-rails/selenium-core/SeleniumLog.html +0 -109
  319. data/vendor/plugins/selenium-on-rails/selenium-core/TestPrompt.html +0 -145
  320. data/vendor/plugins/selenium-on-rails/selenium-core/TestRunner-splash.html +0 -55
  321. data/vendor/plugins/selenium-on-rails/selenium-core/TestRunner.hta +0 -177
  322. data/vendor/plugins/selenium-on-rails/selenium-core/TestRunner.html +0 -177
  323. data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/butmin.gif +0 -0
  324. data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/butplus.gif +0 -0
  325. data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/domviewer.css +0 -298
  326. data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/domviewer.html +0 -16
  327. data/vendor/plugins/selenium-on-rails/selenium-core/domviewer/selenium-domviewer.js +0 -205
  328. data/vendor/plugins/selenium-on-rails/selenium-core/icons/all.png +0 -0
  329. data/vendor/plugins/selenium-on-rails/selenium-core/icons/continue.png +0 -0
  330. data/vendor/plugins/selenium-on-rails/selenium-core/icons/continue_disabled.png +0 -0
  331. data/vendor/plugins/selenium-on-rails/selenium-core/icons/pause.png +0 -0
  332. data/vendor/plugins/selenium-on-rails/selenium-core/icons/pause_disabled.png +0 -0
  333. data/vendor/plugins/selenium-on-rails/selenium-core/icons/selected.png +0 -0
  334. data/vendor/plugins/selenium-on-rails/selenium-core/icons/step.png +0 -0
  335. data/vendor/plugins/selenium-on-rails/selenium-core/icons/step_disabled.png +0 -0
  336. data/vendor/plugins/selenium-on-rails/selenium-core/iedoc-core.xml +0 -1759
  337. data/vendor/plugins/selenium-on-rails/selenium-core/iedoc.xml +0 -1800
  338. data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/cssQuery-p.js +0 -6
  339. data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level2.js +0 -142
  340. data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-level3.js +0 -150
  341. data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery-standard.js +0 -53
  342. data/vendor/plugins/selenium-on-rails/selenium-core/lib/cssQuery/src/cssQuery.js +0 -356
  343. data/vendor/plugins/selenium-on-rails/selenium-core/lib/prototype.js +0 -2006
  344. data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/builder.js +0 -101
  345. data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/controls.js +0 -815
  346. data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/dragdrop.js +0 -915
  347. data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/effects.js +0 -958
  348. data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/scriptaculous.js +0 -47
  349. data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/slider.js +0 -283
  350. data/vendor/plugins/selenium-on-rails/selenium-core/lib/scriptaculous/unittest.js +0 -383
  351. data/vendor/plugins/selenium-on-rails/selenium-core/lib/snapsie.js +0 -91
  352. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/find_matching_child.js +0 -69
  353. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/htmlutils.js +0 -1616
  354. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/injection.html +0 -72
  355. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-api.js +0 -3184
  356. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-browserbot.js +0 -2300
  357. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-browserdetect.js +0 -153
  358. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-commandhandlers.js +0 -377
  359. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-executionloop.js +0 -175
  360. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-logging.js +0 -148
  361. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-remoterunner.js +0 -695
  362. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-testrunner.js +0 -1362
  363. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/selenium-version.js +0 -5
  364. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/ui-doc.html +0 -803
  365. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/ui-element.js +0 -1537
  366. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/ui-map-sample.js +0 -979
  367. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/user-extensions.js +0 -3
  368. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/user-extensions.js.sample +0 -75
  369. data/vendor/plugins/selenium-on-rails/selenium-core/scripts/xmlextras.js +0 -153
  370. data/vendor/plugins/selenium-on-rails/selenium-core/selenium-logo.png +0 -0
  371. data/vendor/plugins/selenium-on-rails/selenium-core/selenium-test.css +0 -43
  372. data/vendor/plugins/selenium-on-rails/selenium-core/selenium.css +0 -316
  373. data/vendor/plugins/selenium-on-rails/selenium-core/xpath/dom.js +0 -566
  374. data/vendor/plugins/selenium-on-rails/selenium-core/xpath/javascript-xpath-0.1.11.js +0 -2816
  375. data/vendor/plugins/selenium-on-rails/selenium-core/xpath/util.js +0 -549
  376. data/vendor/plugins/selenium-on-rails/selenium-core/xpath/xmltoken.js +0 -149
  377. data/vendor/plugins/selenium-on-rails/selenium-core/xpath/xpath.js +0 -2450
  378. data/vendor/plugins/selenium-on-rails/tasks/test_acceptance.rake +0 -8
  379. data/vendor/plugins/selenium-on-rails/test/fixtures/config.yml +0 -37
  380. data/vendor/plugins/selenium-on-rails/test/fixtures/selenium.yml +0 -27
  381. data/vendor/plugins/selenium-on-rails/test/paths_test.rb +0 -72
  382. data/vendor/plugins/selenium-on-rails/test/renderer_test.rb +0 -157
  383. data/vendor/plugins/selenium-on-rails/test/rselenese_test.rb +0 -708
  384. data/vendor/plugins/selenium-on-rails/test/selenese_test.rb +0 -242
  385. data/vendor/plugins/selenium-on-rails/test/selenium_controller_test.rb +0 -67
  386. data/vendor/plugins/selenium-on-rails/test/selenium_on_rails_config_test.rb +0 -43
  387. data/vendor/plugins/selenium-on-rails/test/selenium_support_test.rb +0 -35
  388. data/vendor/plugins/selenium-on-rails/test/setup_test.rb +0 -31
  389. data/vendor/plugins/selenium-on-rails/test/suite_renderer_test.rb +0 -109
  390. data/vendor/plugins/selenium-on-rails/test/switch_environment_controller_test.rb +0 -17
  391. data/vendor/plugins/selenium-on-rails/test/test_builder_functions_authortest.rb +0 -51
  392. data/vendor/plugins/selenium-on-rails/test/test_helper.rb +0 -101
  393. data/vendor/plugins/selenium-on-rails/test_data/_partial.rsel +0 -1
  394. data/vendor/plugins/selenium-on-rails/test_data/own_layout.html +0 -12
  395. data/vendor/plugins/selenium-on-rails/test_data/partials/_html.html +0 -6
  396. data/vendor/plugins/selenium-on-rails/test_data/partials/_nesting.rsel +0 -2
  397. data/vendor/plugins/selenium-on-rails/test_data/partials/_rhtml.rhtml +0 -6
  398. data/vendor/plugins/selenium-on-rails/test_data/partials/_rsel.rsel +0 -1
  399. data/vendor/plugins/selenium-on-rails/test_data/partials/_sel.sel +0 -5
  400. data/vendor/plugins/selenium-on-rails/test_data/partials/all_partials.rsel +0 -5
  401. data/vendor/plugins/selenium-on-rails/test_data/rhtml.rhtml +0 -7
  402. data/vendor/plugins/selenium-on-rails/test_data/rselenese.rsel +0 -8
  403. data/vendor/plugins/selenium-on-rails/test_data/selenese.sel +0 -7
  404. data/vendor/plugins/selenium-on-rails/test_data/suite_one/subsuite/suite_one_subsuite_testcase.sel +0 -1
  405. data/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase1.sel +0 -1
  406. data/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase2.sel +0 -1
  407. data/vendor/plugins/selenium-on-rails/test_data/suite_two/suite_two_testcase.sel +0 -1
@@ -1,153 +0,0 @@
1
- /*
2
- * Copyright 2004 ThoughtWorks, Inc
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- *
16
- */
17
-
18
- // Although it's generally better web development practice not to use
19
- // browser-detection (feature detection is better), the subtle browser
20
- // differences that Selenium has to work around seem to make it
21
- // necessary. Maybe as we learn more about what we need, we can do this in
22
- // a more "feature-centric" rather than "browser-centric" way.
23
-
24
- var BrowserVersion = function() {
25
- this.name = navigator.appName;
26
-
27
- if (navigator.userAgent.indexOf('Mac OS X') != -1) {
28
- this.isOSX = true;
29
- }
30
-
31
- if (navigator.userAgent.indexOf('Windows NT 6') != -1) {
32
- this.isVista = true;
33
- }
34
-
35
- if (window.opera != null) {
36
- this.browser = BrowserVersion.OPERA;
37
- this.isOpera = true;
38
- return;
39
- }
40
-
41
- var _getQueryParameter = function(searchKey) {
42
- var str = location.search.substr(1);
43
- if (str == null) return null;
44
- var clauses = str.split('&');
45
- for (var i = 0; i < clauses.length; i++) {
46
- var keyValuePair = clauses[i].split('=', 2);
47
- var key = unescape(keyValuePair[0]);
48
- if (key == searchKey) {
49
- return unescape(keyValuePair[1]);
50
- }
51
- }
52
- return null;
53
- };
54
-
55
- var self = this;
56
-
57
- var checkChrome = function() {
58
- var loc = window.document.location.href;
59
- try {
60
- loc = window.top.document.location.href;
61
- if (/^chrome:\/\//.test(loc)) {
62
- self.isChrome = true;
63
- } else {
64
- self.isChrome = false;
65
- }
66
- } catch (e) {
67
- // can't see the top (that means we might be chrome, but it's impossible to be sure)
68
- self.isChromeDetectable = "no, top location couldn't be read in this window";
69
- if (_getQueryParameter('thisIsChrome')) {
70
- self.isChrome = true;
71
- } else {
72
- self.isChrome = false;
73
- }
74
- }
75
-
76
-
77
- }
78
-
79
-
80
-
81
- if (this.name == "Microsoft Internet Explorer") {
82
- this.browser = BrowserVersion.IE;
83
- this.isIE = true;
84
- try {
85
- if (window.top.SeleniumHTARunner && window.top.document.location.pathname.match(/.hta$/i)) {
86
- this.isHTA = true;
87
- }
88
- } catch (e) {
89
- this.isHTADetectable = "no, top location couldn't be read in this window";
90
- if (_getQueryParameter('thisIsHTA')) {
91
- self.isHTA = true;
92
- } else {
93
- self.isHTA = false;
94
- }
95
- }
96
- if (navigator.appVersion.match(/MSIE 6.0/)) {
97
- this.isIE6 = true;
98
- }
99
- if ("0" == navigator.appMinorVersion) {
100
- this.preSV1 = true;
101
- if (this.isIE6) {
102
- this.appearsToBeBrokenInitialIE6 = true;
103
- }
104
- }
105
- return;
106
- }
107
-
108
- if (navigator.userAgent.indexOf('Safari') != -1) {
109
- this.browser = BrowserVersion.SAFARI;
110
- this.isSafari = true;
111
- this.khtml = true;
112
- return;
113
- }
114
-
115
- if (navigator.userAgent.indexOf('Konqueror') != -1) {
116
- this.browser = BrowserVersion.KONQUEROR;
117
- this.isKonqueror = true;
118
- this.khtml = true;
119
- return;
120
- }
121
-
122
- if (navigator.userAgent.indexOf('Firefox') != -1) {
123
- this.browser = BrowserVersion.FIREFOX;
124
- this.isFirefox = true;
125
- this.isGecko = true;
126
- var result = /.*Firefox\/([\d\.]+).*/.exec(navigator.userAgent);
127
- if (result) {
128
- this.firefoxVersion = result[1];
129
- }
130
- checkChrome();
131
- return;
132
- }
133
-
134
- if (navigator.userAgent.indexOf('Gecko') != -1) {
135
- this.browser = BrowserVersion.MOZILLA;
136
- this.isMozilla = true;
137
- this.isGecko = true;
138
- checkChrome();
139
- return;
140
- }
141
-
142
- this.browser = BrowserVersion.UNKNOWN;
143
- }
144
-
145
- BrowserVersion.OPERA = "Opera";
146
- BrowserVersion.IE = "IE";
147
- BrowserVersion.KONQUEROR = "Konqueror";
148
- BrowserVersion.SAFARI = "Safari";
149
- BrowserVersion.FIREFOX = "Firefox";
150
- BrowserVersion.MOZILLA = "Mozilla";
151
- BrowserVersion.UNKNOWN = "Unknown";
152
-
153
- var browserVersion = new BrowserVersion();
@@ -1,377 +0,0 @@
1
- /*
2
- * Copyright 2004 ThoughtWorks, Inc
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- // A naming convention used in this file:
18
- //
19
- //
20
- // - a "seleniumApi" is an instance of the Selenium object, defined in selenium-api.js.
21
- //
22
- // - a "Method" is an unbound function whose target must be supplied when it's called, ie.
23
- // it should be invoked using Function.call() or Function.apply()
24
- //
25
- // - a "Block" is a function that has been bound to a target object, so can be called invoked directly
26
- // (or with a null target)
27
- //
28
- // - "CommandHandler" is effectively an abstract base for
29
- // various handlers including ActionHandler, AccessorHandler and AssertHandler.
30
- // Subclasses need to implement an execute(seleniumApi, command) function,
31
- // where seleniumApi is the Selenium object, and command a SeleniumCommand object.
32
- //
33
- // - Handlers will return a "result" object (ActionResult, AccessorResult, AssertResult).
34
- // ActionResults may contain a .terminationCondition function which is run by
35
- // -executionloop.js after the command is run; we'll run it over and over again
36
- // until it returns true or the .terminationCondition throws an exception.
37
- // AccessorResults will contain the results of running getter (e.g. getTitle returns
38
- // the title as a string).
39
-
40
- var CommandHandlerFactory = classCreate();
41
- objectExtend(CommandHandlerFactory.prototype, {
42
-
43
- initialize: function() {
44
- this.handlers = {};
45
- },
46
-
47
- registerAction: function(name, actionBlock, wait, dontCheckAlertsAndConfirms) {
48
- this.handlers[name] = new ActionHandler(actionBlock, wait, dontCheckAlertsAndConfirms);
49
- },
50
-
51
- registerAccessor: function(name, accessBlock) {
52
- this.handlers[name] = new AccessorHandler(accessBlock);
53
- },
54
-
55
- registerAssert: function(name, assertBlock, haltOnFailure) {
56
- this.handlers[name] = new AssertHandler(assertBlock, haltOnFailure);
57
- },
58
-
59
- getCommandHandler: function(name) {
60
- return this.handlers[name];
61
- },
62
-
63
- _registerAllAccessors: function(seleniumApi) {
64
- // Methods of the form getFoo(target) result in commands:
65
- // getFoo, assertFoo, verifyFoo, assertNotFoo, verifyNotFoo
66
- // storeFoo, waitForFoo, and waitForNotFoo.
67
- for (var functionName in seleniumApi) {
68
- var match = /^(get|is)([A-Z].+)$/.exec(functionName);
69
- if (match) {
70
- var accessMethod = seleniumApi[functionName];
71
- var accessBlock = fnBind(accessMethod, seleniumApi);
72
- var baseName = match[2];
73
- var isBoolean = (match[1] == "is");
74
- var requiresTarget = (accessMethod.length == 1);
75
-
76
- this.registerAccessor(functionName, accessBlock);
77
- this._registerStoreCommandForAccessor(baseName, accessBlock, requiresTarget);
78
-
79
- var predicateBlock = this._predicateForAccessor(accessBlock, requiresTarget, isBoolean);
80
- this._registerAssertionsForPredicate(baseName, predicateBlock);
81
- this._registerWaitForCommandsForPredicate(seleniumApi, baseName, predicateBlock);
82
- }
83
- }
84
- },
85
-
86
- _registerAllActions: function(seleniumApi) {
87
- for (var functionName in seleniumApi) {
88
- var match = /^do([A-Z].+)$/.exec(functionName);
89
- if (match) {
90
- var actionName = match[1].lcfirst();
91
- var actionMethod = seleniumApi[functionName];
92
- var dontCheckPopups = actionMethod.dontCheckAlertsAndConfirms;
93
- var actionBlock = fnBind(actionMethod, seleniumApi);
94
- this.registerAction(actionName, actionBlock, false, dontCheckPopups);
95
- this.registerAction(actionName + "AndWait", actionBlock, true, dontCheckPopups);
96
- }
97
- }
98
- },
99
-
100
- _registerAllAsserts: function(seleniumApi) {
101
- for (var functionName in seleniumApi) {
102
- var match = /^assert([A-Z].+)$/.exec(functionName);
103
- if (match) {
104
- var assertBlock = fnBind(seleniumApi[functionName], seleniumApi);
105
-
106
- // Register the assert with the "assert" prefix, and halt on failure.
107
- var assertName = functionName;
108
- this.registerAssert(assertName, assertBlock, true);
109
-
110
- // Register the assert with the "verify" prefix, and do not halt on failure.
111
- var verifyName = "verify" + match[1];
112
- this.registerAssert(verifyName, assertBlock, false);
113
- }
114
- }
115
- },
116
-
117
- registerAll: function(seleniumApi) {
118
- this._registerAllAccessors(seleniumApi);
119
- this._registerAllActions(seleniumApi);
120
- this._registerAllAsserts(seleniumApi);
121
- },
122
-
123
- _predicateForAccessor: function(accessBlock, requiresTarget, isBoolean) {
124
- if (isBoolean) {
125
- return this._predicateForBooleanAccessor(accessBlock);
126
- }
127
- if (requiresTarget) {
128
- return this._predicateForSingleArgAccessor(accessBlock);
129
- }
130
- return this._predicateForNoArgAccessor(accessBlock);
131
- },
132
-
133
- _predicateForSingleArgAccessor: function(accessBlock) {
134
- // Given an accessor function getBlah(target),
135
- // return a "predicate" equivalient to isBlah(target, value) that
136
- // is true when the value returned by the accessor matches the specified value.
137
- return function(target, value) {
138
- var accessorResult = accessBlock(target);
139
- accessorResult = selArrayToString(accessorResult);
140
- if (PatternMatcher.matches(value, accessorResult)) {
141
- return new PredicateResult(true, "Actual value '" + accessorResult + "' did match '" + value + "'");
142
- } else {
143
- return new PredicateResult(false, "Actual value '" + accessorResult + "' did not match '" + value + "'");
144
- }
145
- };
146
- },
147
-
148
- _predicateForNoArgAccessor: function(accessBlock) {
149
- // Given a (no-arg) accessor function getBlah(),
150
- // return a "predicate" equivalient to isBlah(value) that
151
- // is true when the value returned by the accessor matches the specified value.
152
- return function(value) {
153
- var accessorResult = accessBlock();
154
- accessorResult = selArrayToString(accessorResult);
155
- if (PatternMatcher.matches(value, accessorResult)) {
156
- return new PredicateResult(true, "Actual value '" + accessorResult + "' did match '" + value + "'");
157
- } else {
158
- return new PredicateResult(false, "Actual value '" + accessorResult + "' did not match '" + value + "'");
159
- }
160
- };
161
- },
162
-
163
- _predicateForBooleanAccessor: function(accessBlock) {
164
- // Given a boolean accessor function isBlah(),
165
- // return a "predicate" equivalient to isBlah() that
166
- // returns an appropriate PredicateResult value.
167
- return function() {
168
- var accessorResult;
169
- if (arguments.length > 2) throw new SeleniumError("Too many arguments! " + arguments.length);
170
- if (arguments.length == 2) {
171
- accessorResult = accessBlock(arguments[0], arguments[1]);
172
- } else if (arguments.length == 1) {
173
- accessorResult = accessBlock(arguments[0]);
174
- } else {
175
- accessorResult = accessBlock();
176
- }
177
- if (accessorResult) {
178
- return new PredicateResult(true, "true");
179
- } else {
180
- return new PredicateResult(false, "false");
181
- }
182
- };
183
- },
184
-
185
- _invertPredicate: function(predicateBlock) {
186
- // Given a predicate, return the negation of that predicate.
187
- // Leaves the message unchanged.
188
- // Used to create assertNot, verifyNot, and waitForNot commands.
189
- return function(target, value) {
190
- var result = predicateBlock(target, value);
191
- result.isTrue = !result.isTrue;
192
- return result;
193
- };
194
- },
195
-
196
- createAssertionFromPredicate: function(predicateBlock) {
197
- // Convert an isBlahBlah(target, value) function into an assertBlahBlah(target, value) function.
198
- return function(target, value) {
199
- var result = predicateBlock(target, value);
200
- if (!result.isTrue) {
201
- Assert.fail(result.message);
202
- }
203
- };
204
- },
205
-
206
- _invertPredicateName: function(baseName) {
207
- var matchResult = /^(.*)Present$/.exec(baseName);
208
- if (matchResult != null) {
209
- return matchResult[1] + "NotPresent";
210
- }
211
- return "Not" + baseName;
212
- },
213
-
214
- _registerAssertionsForPredicate: function(baseName, predicateBlock) {
215
- // Register an assertion, a verification, a negative assertion,
216
- // and a negative verification based on the specified accessor.
217
- var assertBlock = this.createAssertionFromPredicate(predicateBlock);
218
- this.registerAssert("assert" + baseName, assertBlock, true);
219
- this.registerAssert("verify" + baseName, assertBlock, false);
220
-
221
- var invertedPredicateBlock = this._invertPredicate(predicateBlock);
222
- var negativeassertBlock = this.createAssertionFromPredicate(invertedPredicateBlock);
223
- this.registerAssert("assert" + this._invertPredicateName(baseName), negativeassertBlock, true);
224
- this.registerAssert("verify" + this._invertPredicateName(baseName), negativeassertBlock, false);
225
- },
226
-
227
- _waitForActionForPredicate: function(predicateBlock) {
228
- // Convert an isBlahBlah(target, value) function into a waitForBlahBlah(target, value) function.
229
- return function(target, value) {
230
- var terminationCondition = function () {
231
- try {
232
- return predicateBlock(target, value).isTrue;
233
- } catch (e) {
234
- // Treat exceptions as meaning the condition is not yet met.
235
- // Useful, for example, for waitForValue when the element has
236
- // not even been created yet.
237
- // TODO: possibly should rethrow some types of exception.
238
- return false;
239
- }
240
- };
241
- return Selenium.decorateFunctionWithTimeout(terminationCondition, this.defaultTimeout);
242
- };
243
- },
244
-
245
- _registerWaitForCommandsForPredicate: function(seleniumApi, baseName, predicateBlock) {
246
- // Register a waitForBlahBlah and waitForNotBlahBlah based on the specified accessor.
247
- var waitForActionMethod = this._waitForActionForPredicate(predicateBlock);
248
- var waitForActionBlock = fnBind(waitForActionMethod, seleniumApi);
249
-
250
- var invertedPredicateBlock = this._invertPredicate(predicateBlock);
251
- var waitForNotActionMethod = this._waitForActionForPredicate(invertedPredicateBlock);
252
- var waitForNotActionBlock = fnBind(waitForNotActionMethod, seleniumApi);
253
-
254
- this.registerAction("waitFor" + baseName, waitForActionBlock, false, true);
255
- this.registerAction("waitFor" + this._invertPredicateName(baseName), waitForNotActionBlock, false, true);
256
- //TODO decide remove "waitForNot.*Present" action name or not
257
- //for the back compatiblity issues we still make waitForNot.*Present availble
258
- this.registerAction("waitForNot" + baseName, waitForNotActionBlock, false, true);
259
- },
260
-
261
- _registerStoreCommandForAccessor: function(baseName, accessBlock, requiresTarget) {
262
- var action;
263
- if (requiresTarget) {
264
- action = function(target, varName) {
265
- storedVars[varName] = accessBlock(target);
266
- };
267
- } else {
268
- action = function(varName) {
269
- storedVars[varName] = accessBlock();
270
- };
271
- }
272
- this.registerAction("store" + baseName, action, false, true);
273
- }
274
-
275
- });
276
-
277
- function PredicateResult(isTrue, message) {
278
- this.isTrue = isTrue;
279
- this.message = message;
280
- }
281
-
282
- // NOTE: The CommandHandler is effectively an abstract base for
283
- // various handlers including ActionHandler, AccessorHandler and AssertHandler.
284
- // Subclasses need to implement an execute(seleniumApi, command) function,
285
- // where seleniumApi is the Selenium object, and command a SeleniumCommand object.
286
- function CommandHandler(type, haltOnFailure) {
287
- this.type = type;
288
- this.haltOnFailure = haltOnFailure;
289
- }
290
-
291
- // An ActionHandler is a command handler that executes the sepcified action,
292
- // possibly checking for alerts and confirmations (if checkAlerts is set), and
293
- // possibly waiting for a page load if wait is set.
294
- function ActionHandler(actionBlock, wait, dontCheckAlerts) {
295
- this.actionBlock = actionBlock;
296
- CommandHandler.call(this, "action", true);
297
- if (wait) {
298
- this.wait = true;
299
- }
300
- // note that dontCheckAlerts could be undefined!!!
301
- this.checkAlerts = (dontCheckAlerts) ? false : true;
302
- }
303
- ActionHandler.prototype = new CommandHandler;
304
- ActionHandler.prototype.execute = function(seleniumApi, command) {
305
- if (this.checkAlerts && (null == /(Alert|Confirmation)(Not)?Present/.exec(command.command))) {
306
- // todo: this conditional logic is ugly
307
- seleniumApi.ensureNoUnhandledPopups();
308
- }
309
- var terminationCondition = this.actionBlock(command.target, command.value);
310
- // If the handler didn't return a wait flag, check to see if the
311
- // handler was registered with the wait flag.
312
- if (terminationCondition == undefined && this.wait) {
313
- terminationCondition = seleniumApi.makePageLoadCondition();
314
- }
315
- return new ActionResult(terminationCondition);
316
- };
317
-
318
- function ActionResult(terminationCondition) {
319
- this.terminationCondition = terminationCondition;
320
- }
321
-
322
- function AccessorHandler(accessBlock) {
323
- this.accessBlock = accessBlock;
324
- CommandHandler.call(this, "accessor", true);
325
- }
326
- AccessorHandler.prototype = new CommandHandler;
327
- AccessorHandler.prototype.execute = function(seleniumApi, command) {
328
- var returnValue = this.accessBlock(command.target, command.value);
329
- return new AccessorResult(returnValue);
330
- };
331
-
332
- function AccessorResult(result) {
333
- this.result = result;
334
- }
335
-
336
- /**
337
- * Handler for assertions and verifications.
338
- */
339
- function AssertHandler(assertBlock, haltOnFailure) {
340
- this.assertBlock = assertBlock;
341
- CommandHandler.call(this, "assert", haltOnFailure || false);
342
- }
343
- AssertHandler.prototype = new CommandHandler;
344
- AssertHandler.prototype.execute = function(seleniumApi, command) {
345
- var result = new AssertResult();
346
- try {
347
- this.assertBlock(command.target, command.value);
348
- } catch (e) {
349
- // If this is not a AssertionFailedError, or we should haltOnFailure, rethrow.
350
- if (!e.isAssertionFailedError) {
351
- throw e;
352
- }
353
- if (this.haltOnFailure) {
354
- var error = new SeleniumError(e.failureMessage);
355
- throw error;
356
- }
357
- result.setFailed(e.failureMessage);
358
- }
359
- return result;
360
- };
361
-
362
- function AssertResult() {
363
- this.passed = true;
364
- }
365
- AssertResult.prototype.setFailed = function(message) {
366
- this.passed = null;
367
- this.failed = true;
368
- this.failureMessage = message;
369
- }
370
-
371
- function SeleniumCommand(command, target, value, isBreakpoint) {
372
- this.command = command;
373
- this.target = target;
374
- this.value = value;
375
- this.isBreakpoint = isBreakpoint;
376
- }
377
-