bauxite 0.6.18 → 0.6.19

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.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -21
  3. data/README.md +293 -293
  4. data/Rakefile +128 -128
  5. data/bin/bauxite +27 -27
  6. data/doc/Bauxite.html +6 -9
  7. data/doc/Bauxite/Action.html +298 -315
  8. data/doc/Bauxite/ActionModule.html +23 -26
  9. data/doc/Bauxite/Application.html +36 -38
  10. data/doc/Bauxite/Context.html +303 -303
  11. data/doc/Bauxite/Errors.html +6 -9
  12. data/doc/Bauxite/Errors/AssertionError.html +6 -9
  13. data/doc/Bauxite/Errors/FileNotFoundError.html +6 -9
  14. data/doc/Bauxite/Errors/FormatError.html +6 -9
  15. data/doc/Bauxite/Loggers.html +6 -9
  16. data/doc/Bauxite/Loggers/CompositeLogger.html +29 -32
  17. data/doc/Bauxite/Loggers/EchoLogger.html +10 -13
  18. data/doc/Bauxite/Loggers/FileLogger.html +25 -28
  19. data/doc/Bauxite/Loggers/HtmlLogger.html +99 -102
  20. data/doc/Bauxite/Loggers/NullLogger.html +16 -19
  21. data/doc/Bauxite/Loggers/ReportLogger.html +43 -46
  22. data/doc/Bauxite/Loggers/TerminalLogger.html +76 -79
  23. data/doc/Bauxite/Loggers/XtermLogger.html +28 -31
  24. data/doc/Bauxite/Parser.html +87 -89
  25. data/doc/Bauxite/ParserModule.html +19 -22
  26. data/doc/Bauxite/Selector.html +99 -105
  27. data/doc/Bauxite/SelectorModule.html +27 -30
  28. data/doc/README_md.html +117 -103
  29. data/doc/created.rid +58 -58
  30. data/doc/fonts.css +167 -167
  31. data/doc/fonts/Lato-Light.ttf +0 -0
  32. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  33. data/doc/fonts/Lato-Regular.ttf +0 -0
  34. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  35. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  36. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  37. data/doc/images/add.png +0 -0
  38. data/doc/images/arrow_up.png +0 -0
  39. data/doc/images/brick.png +0 -0
  40. data/doc/images/brick_link.png +0 -0
  41. data/doc/images/bug.png +0 -0
  42. data/doc/images/bullet_black.png +0 -0
  43. data/doc/images/bullet_toggle_minus.png +0 -0
  44. data/doc/images/bullet_toggle_plus.png +0 -0
  45. data/doc/images/date.png +0 -0
  46. data/doc/images/delete.png +0 -0
  47. data/doc/images/find.png +0 -0
  48. data/doc/images/loadingAnimation.gif +0 -0
  49. data/doc/images/macFFBgHack.png +0 -0
  50. data/doc/images/package.png +0 -0
  51. data/doc/images/page_green.png +0 -0
  52. data/doc/images/page_white_text.png +0 -0
  53. data/doc/images/page_white_width.png +0 -0
  54. data/doc/images/plugin.png +0 -0
  55. data/doc/images/ruby.png +0 -0
  56. data/doc/images/tag_blue.png +0 -0
  57. data/doc/images/tag_green.png +0 -0
  58. data/doc/images/transparent.png +0 -0
  59. data/doc/images/wrench.png +0 -0
  60. data/doc/images/wrench_orange.png +0 -0
  61. data/doc/images/zoom.png +0 -0
  62. data/doc/index.html +117 -103
  63. data/doc/js/darkfish.js +32 -11
  64. data/doc/js/jquery.js +0 -0
  65. data/doc/js/navigation.js +0 -0
  66. data/doc/js/search.js +0 -0
  67. data/doc/js/search_index.js +1 -1
  68. data/doc/js/searcher.js +0 -0
  69. data/doc/rdoc.css +580 -580
  70. data/doc/table_of_contents.html +69 -72
  71. data/lib/bauxite.rb +28 -28
  72. data/lib/bauxite/actions/alias.rb +51 -51
  73. data/lib/bauxite/actions/assert.rb +49 -49
  74. data/lib/bauxite/actions/asserth.rb +60 -60
  75. data/lib/bauxite/actions/assertm.rb +49 -49
  76. data/lib/bauxite/actions/assertv.rb +40 -40
  77. data/lib/bauxite/actions/assertw.rb +47 -47
  78. data/lib/bauxite/actions/break.rb +39 -39
  79. data/lib/bauxite/actions/capture.rb +61 -61
  80. data/lib/bauxite/actions/click.rb +36 -36
  81. data/lib/bauxite/actions/debug.rb +103 -103
  82. data/lib/bauxite/actions/doif.rb +43 -43
  83. data/lib/bauxite/actions/dounless.rb +43 -43
  84. data/lib/bauxite/actions/echo.rb +36 -36
  85. data/lib/bauxite/actions/exec.rb +46 -46
  86. data/lib/bauxite/actions/exit.rb +35 -35
  87. data/lib/bauxite/actions/failif.rb +52 -52
  88. data/lib/bauxite/actions/js.rb +41 -41
  89. data/lib/bauxite/actions/load.rb +49 -49
  90. data/lib/bauxite/actions/open.rb +35 -35
  91. data/lib/bauxite/actions/params.rb +40 -40
  92. data/lib/bauxite/actions/replace.rb +37 -37
  93. data/lib/bauxite/actions/reset.rb +38 -38
  94. data/lib/bauxite/actions/return.rb +68 -68
  95. data/lib/bauxite/actions/ruby.rb +58 -58
  96. data/lib/bauxite/actions/select.rb +48 -48
  97. data/lib/bauxite/actions/set.rb +39 -39
  98. data/lib/bauxite/actions/setif.rb +44 -44
  99. data/lib/bauxite/actions/source.rb +44 -44
  100. data/lib/bauxite/actions/store.rb +38 -38
  101. data/lib/bauxite/actions/submit.rb +37 -37
  102. data/lib/bauxite/actions/test.rb +67 -67
  103. data/lib/bauxite/actions/tryload.rb +71 -71
  104. data/lib/bauxite/actions/wait.rb +38 -38
  105. data/lib/bauxite/actions/write.rb +44 -44
  106. data/lib/bauxite/application.rb +349 -349
  107. data/lib/bauxite/core/action.rb +199 -199
  108. data/lib/bauxite/core/context.rb +791 -791
  109. data/lib/bauxite/core/errors.rb +41 -41
  110. data/lib/bauxite/core/logger.rb +169 -169
  111. data/lib/bauxite/core/parser.rb +85 -85
  112. data/lib/bauxite/core/selector.rb +152 -152
  113. data/lib/bauxite/loggers/composite.rb +91 -91
  114. data/lib/bauxite/loggers/echo.rb +36 -36
  115. data/lib/bauxite/loggers/file.rb +68 -68
  116. data/lib/bauxite/loggers/html.rb +154 -154
  117. data/lib/bauxite/loggers/terminal.rb +134 -134
  118. data/lib/bauxite/loggers/xterm.rb +101 -101
  119. data/lib/bauxite/parsers/csv.rb +43 -43
  120. data/lib/bauxite/parsers/default.rb +42 -42
  121. data/lib/bauxite/parsers/html.rb +79 -79
  122. data/lib/bauxite/selectors/attr.rb +39 -39
  123. data/lib/bauxite/selectors/frame.rb +60 -60
  124. data/lib/bauxite/selectors/json.rb +88 -88
  125. data/lib/bauxite/selectors/sid.rb +38 -38
  126. data/lib/bauxite/selectors/smart.rb +80 -80
  127. data/lib/bauxite/selectors/window.rb +77 -77
  128. data/test/alert.bxt +3 -3
  129. data/test/alert/page.html +4 -4
  130. data/test/alias.bxt +9 -9
  131. data/test/asserth.bxt +2 -2
  132. data/test/assertv.bxt +1 -1
  133. data/test/assertw.bxt +7 -7
  134. data/test/broken.bxt.manual +0 -0
  135. data/test/bug_load_path.bxt.manual +0 -0
  136. data/test/bug_load_path/broken.bxt.manual +0 -0
  137. data/test/bug_load_path/test.bxt +0 -0
  138. data/test/capture.bxt.manual +20 -20
  139. data/test/capture/my_test.bxt +1 -1
  140. data/test/capture/page.html +6 -6
  141. data/test/capture_on_error.bxt.manual +3 -3
  142. data/test/capture_on_error/my_test.bxt +1 -1
  143. data/test/capture_on_error/page.html +2 -2
  144. data/test/debug.bxt.manual +0 -0
  145. data/test/default_selector.bxt.manual +7 -7
  146. data/test/default_selector/page.html +10 -10
  147. data/test/default_selector_var.bxt +1 -1
  148. data/test/delay.bxt +2 -2
  149. data/test/delay/page.html +4 -4
  150. data/test/doif.bxt +6 -6
  151. data/test/dounless.bxt +6 -6
  152. data/test/exec.bxt +6 -6
  153. data/test/exit.bxt +3 -3
  154. data/test/exit/test.bxt +3 -3
  155. data/test/extension.bxt.manual +4 -4
  156. data/test/extension/custom.rb +12 -12
  157. data/test/extension/page.html +4 -4
  158. data/test/failif.bxt +7 -7
  159. data/test/failif/page.html +5 -5
  160. data/test/format.bxt +17 -17
  161. data/test/format/page.html +6 -6
  162. data/test/frame.bxt +6 -6
  163. data/test/frame/child_frame.html +6 -6
  164. data/test/frame/grandchild_frame.html +4 -4
  165. data/test/frame/page.html +4 -4
  166. data/test/js.bxt +4 -4
  167. data/test/json.bxt +19 -19
  168. data/test/json/array.json +3 -3
  169. data/test/json/object.json +13 -13
  170. data/test/load.bxt +18 -18
  171. data/test/load/child.bxt +12 -12
  172. data/test/parsers.bxt +1 -1
  173. data/test/parsers.csv +7 -7
  174. data/test/parsers.html +32 -32
  175. data/test/parsers/page.html +6 -6
  176. data/test/return.bxt +1 -1
  177. data/test/return/f1.bxt +1 -1
  178. data/test/return/f2.bxt +1 -1
  179. data/test/return/f3.bxt +1 -1
  180. data/test/return/f4.bxt +2 -2
  181. data/test/ruby.bxt +1 -1
  182. data/test/ruby/custom.rb +5 -5
  183. data/test/select.bxt +9 -9
  184. data/test/select/page.html +8 -8
  185. data/test/selectors.bxt +7 -7
  186. data/test/selectors/page.html +6 -6
  187. data/test/set_builtin.bxt +5 -0
  188. data/test/set_builtin/page.html +5 -0
  189. data/test/setif.bxt +3 -3
  190. data/test/smart_selector.bxt +17 -17
  191. data/test/smart_selector/page.html +17 -17
  192. data/test/stdin.bxt +0 -0
  193. data/test/submit.bxt +4 -4
  194. data/test/submit/page.html +6 -6
  195. data/test/submit/page2.html +4 -4
  196. data/test/test.bxt.manual +6 -6
  197. data/test/test/test1.bxt +2 -2
  198. data/test/test/test2.bxt +3 -3
  199. data/test/test/test3.bxt +2 -2
  200. data/test/test/test4.bxt +1 -1
  201. data/test/test/test5.bxt +1 -1
  202. data/test/window.bxt +14 -14
  203. data/test/window/page.html +5 -5
  204. data/test/window/popup.html +4 -4
  205. metadata +5 -3
@@ -6,20 +6,17 @@
6
6
 
7
7
  <title>module Bauxite::SelectorModule - RDoc Documentation</title>
8
8
 
9
- <link href="../fonts.css" rel="stylesheet">
10
- <link href="../rdoc.css" rel="stylesheet">
11
-
12
9
  <script type="text/javascript">
13
10
  var rdoc_rel_prefix = "../";
14
11
  </script>
15
12
 
16
13
  <script src="../js/jquery.js"></script>
17
- <script src="../js/navigation.js"></script>
18
- <script src="../js/search_index.js"></script>
19
- <script src="../js/search.js"></script>
20
- <script src="../js/searcher.js"></script>
21
14
  <script src="../js/darkfish.js"></script>
22
15
 
16
+ <link href="../css/fonts.css" rel="stylesheet">
17
+ <link href="../css/rdoc.css" rel="stylesheet">
18
+
19
+
23
20
 
24
21
  <body id="top" role="document" class="module">
25
22
  <nav role="navigation">
@@ -128,9 +125,9 @@
128
125
 
129
126
  <div class="method-source-code" id="new-source">
130
127
  <pre><span class="ruby-comment"># File lib/bauxite/core/selector.rb, line 28</span>
131
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">ctx</span>, <span class="ruby-identifier">default_selector</span>)
132
- <span class="ruby-ivar">@ctx</span> = <span class="ruby-identifier">ctx</span>
133
- <span class="ruby-ivar">@default</span> = <span class="ruby-identifier">default_selector</span>
128
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">ctx</span>, <span class="ruby-identifier">default_selector</span>)
129
+ <span class="ruby-ivar">@ctx</span> = <span class="ruby-identifier">ctx</span>
130
+ <span class="ruby-ivar">@default</span> = <span class="ruby-identifier">default_selector</span>
134
131
  <span class="ruby-keyword">end</span></pre>
135
132
  </div>
136
133
 
@@ -187,20 +184,20 @@ href="Context.html#method-i-find">Bauxite::Context#find</a>.</p>
187
184
 
188
185
  <div class="method-source-code" id="find-source">
189
186
  <pre><span class="ruby-comment"># File lib/bauxite/core/selector.rb, line 49</span>
190
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
191
- <span class="ruby-identifier">data</span> = <span class="ruby-identifier">selector</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;=&#39;</span>, <span class="ruby-value">2</span>)
192
- <span class="ruby-identifier">type</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value">0</span>]
193
- <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value">-1</span>]
194
- <span class="ruby-keyword">unless</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^[a-z_]+$/i</span>
195
- <span class="ruby-identifier">type</span> = <span class="ruby-ivar">@default</span>
196
- <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">selector</span>
197
- <span class="ruby-keyword">end</span>
198
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Invalid selector type &#39;#{type}&#39;&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">selectors</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">type</span>
199
-
200
- <span class="ruby-identifier">custom_selectors</span> = <span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">selectors</span>(<span class="ruby-keyword">false</span>)
201
- <span class="ruby-keyword">return</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">type</span> , <span class="ruby-identifier">arg</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">custom_selectors</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">type</span>
202
- <span class="ruby-keyword">return</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">type</span><span class="ruby-operator">+</span><span class="ruby-string">&#39;_selector&#39;</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">custom_selectors</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">type</span><span class="ruby-operator">+</span><span class="ruby-string">&#39;_selector&#39;</span>
203
- <span class="ruby-identifier">selenium_find</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
187
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">find</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
188
+ <span class="ruby-identifier">data</span> = <span class="ruby-identifier">selector</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;=&#39;</span>, <span class="ruby-value">2</span>)
189
+ <span class="ruby-identifier">type</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value">0</span>]
190
+ <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">data</span>[<span class="ruby-value">-1</span>]
191
+ <span class="ruby-keyword">unless</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^[a-z_]+$/i</span>
192
+ <span class="ruby-identifier">type</span> = <span class="ruby-ivar">@default</span>
193
+ <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">selector</span>
194
+ <span class="ruby-keyword">end</span>
195
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Invalid selector type &#39;#{type}&#39;&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">selectors</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">type</span>
196
+
197
+ <span class="ruby-identifier">custom_selectors</span> = <span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">selectors</span>(<span class="ruby-keyword">false</span>)
198
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">type</span> , <span class="ruby-identifier">arg</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">custom_selectors</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">type</span>
199
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">type</span><span class="ruby-operator">+</span><span class="ruby-string">&#39;_selector&#39;</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">custom_selectors</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">type</span><span class="ruby-operator">+</span><span class="ruby-string">&#39;_selector&#39;</span>
200
+ <span class="ruby-identifier">selenium_find</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
204
201
  <span class="ruby-keyword">end</span></pre>
205
202
  </div>
206
203
 
@@ -253,10 +250,10 @@ href="Context.html#method-i-find">Bauxite::Context#find</a>.</p>
253
250
 
254
251
  <div class="method-source-code" id="selenium_find-source">
255
252
  <pre><span class="ruby-comment"># File lib/bauxite/core/selector.rb, line 80</span>
256
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">selenium_find</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">selector</span>)
257
- <span class="ruby-identifier">element</span> = <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">find_element</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">selector</span>)
258
- <span class="ruby-keyword">yield</span> <span class="ruby-identifier">element</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
259
- <span class="ruby-identifier">element</span>
253
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">selenium_find</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">selector</span>)
254
+ <span class="ruby-identifier">element</span> = <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">find_element</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">selector</span>)
255
+ <span class="ruby-keyword">yield</span> <span class="ruby-identifier">element</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
256
+ <span class="ruby-identifier">element</span>
260
257
  <span class="ruby-keyword">end</span></pre>
261
258
  </div>
262
259
 
@@ -276,7 +273,7 @@ href="Context.html#method-i-find">Bauxite::Context#find</a>.</p>
276
273
 
277
274
  <footer id="validator-badges" role="contentinfo">
278
275
  <p><a href="http://validator.w3.org/check/referer">Validate</a>
279
- <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
280
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
276
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
277
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
281
278
  </footer>
282
279
 
data/doc/README_md.html CHANGED
@@ -6,20 +6,17 @@
6
6
 
7
7
  <title>README - RDoc Documentation</title>
8
8
 
9
- <link href="./fonts.css" rel="stylesheet">
10
- <link href="./rdoc.css" rel="stylesheet">
11
-
12
9
  <script type="text/javascript">
13
10
  var rdoc_rel_prefix = "./";
14
11
  </script>
15
12
 
16
13
  <script src="./js/jquery.js"></script>
17
- <script src="./js/navigation.js"></script>
18
- <script src="./js/search_index.js"></script>
19
- <script src="./js/search.js"></script>
20
- <script src="./js/searcher.js"></script>
21
14
  <script src="./js/darkfish.js"></script>
22
15
 
16
+ <link href="./css/fonts.css" rel="stylesheet">
17
+ <link href="./css/rdoc.css" rel="stylesheet">
18
+
19
+
23
20
 
24
21
  <body id="top" role="document" class="file">
25
22
  <nav role="navigation">
@@ -90,7 +87,7 @@
90
87
 
91
88
  <main role="main" aria-label="Page README.md">
92
89
 
93
- <h1 id="label-bauxite">bauxite<span><a href="#label-bauxite">&para;</a> <a href="#documentation">&uarr;</a></span></h1>
90
+ <h1 id="label-bauxite">bauxite<span><a href="#label-bauxite">&para;</a> <a href="#top">&uarr;</a></span></h1>
94
91
 
95
92
  <p><a href="Bauxite.html">Bauxite</a> is a façade over Selenium intended for
96
93
  non-developers</p>
@@ -103,16 +100,16 @@ create functional abstractions over technical details.</p>
103
100
  <p>Take a look at the following Ruby excerpt from <a
104
101
  href="http://code.google.com/p/selenium/wiki/RubyBindings">code.google.com/p/selenium/wiki/RubyBindings</a>:</p>
105
102
 
106
- <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&quot;selenium-webdriver&quot;</span>
103
+ <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&quot;selenium-webdriver&quot;</span>
107
104
 
108
- <span class="ruby-identifier">driver</span> = <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span>.<span class="ruby-identifier">for</span> :<span class="ruby-identifier">firefox</span>
109
- <span class="ruby-identifier">driver</span>.<span class="ruby-identifier">navigate</span>.<span class="ruby-identifier">to</span> <span class="ruby-string">&quot;http://google.com&quot;</span>
105
+ <span class="ruby-identifier">driver</span> = <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span>.<span class="ruby-identifier">for</span> :<span class="ruby-identifier">firefox</span>
106
+ <span class="ruby-identifier">driver</span>.<span class="ruby-identifier">navigate</span>.<span class="ruby-identifier">to</span> <span class="ruby-string">&quot;http://google.com&quot;</span>
110
107
 
111
- <span class="ruby-identifier">element</span> = <span class="ruby-identifier">driver</span>.<span class="ruby-identifier">find_element</span>(:<span class="ruby-identifier">name</span>, <span class="ruby-string">&#39;q&#39;</span>)
112
- <span class="ruby-identifier">element</span>.<span class="ruby-identifier">send_keys</span> <span class="ruby-string">&quot;Hello WebDriver!&quot;</span>
113
- <span class="ruby-identifier">element</span>.<span class="ruby-identifier">submit</span>
108
+ <span class="ruby-identifier">element</span> = <span class="ruby-identifier">driver</span>.<span class="ruby-identifier">find_element</span>(:<span class="ruby-identifier">name</span>, <span class="ruby-string">&#39;q&#39;</span>)
109
+ <span class="ruby-identifier">element</span>.<span class="ruby-identifier">send_keys</span> <span class="ruby-string">&quot;Hello WebDriver!&quot;</span>
110
+ <span class="ruby-identifier">element</span>.<span class="ruby-identifier">submit</span>
114
111
 
115
- <span class="ruby-identifier">puts</span> <span class="ruby-identifier">driver</span>.<span class="ruby-identifier">title</span>
112
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">driver</span>.<span class="ruby-identifier">title</span>
116
113
 
117
114
  <span class="ruby-identifier">driver</span>.<span class="ruby-identifier">quit</span>
118
115
  </pre>
@@ -123,15 +120,17 @@ might be a bit shocked.</p>
123
120
  <p>The equivalent <a href="Bauxite.html">Bauxite</a> test is easier on the
124
121
  eyes:</p>
125
122
 
126
- <pre>open &quot;http://google.com&quot;
127
- write &quot;name=q&quot; &quot;Hello WebDriver!&quot;
128
- click &quot;gbqfb&quot;</pre>
123
+ <pre class="ruby"><span class="ruby-identifier">open</span> <span class="ruby-string">&quot;http://google.com&quot;</span>
124
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;name=q&quot;</span> <span class="ruby-string">&quot;Hello WebDriver!&quot;</span>
125
+ <span class="ruby-identifier">click</span> <span class="ruby-string">&quot;gbqfb&quot;</span>
126
+ </pre>
129
127
 
130
- <h2 id="label-Installation">Installation<span><a href="#label-Installation">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
128
+ <h2 id="label-Installation">Installation<span><a href="#label-Installation">&para;</a> <a href="#top">&uarr;</a></span></h2>
131
129
 
132
130
  <p>In a nutshell:</p>
133
131
 
134
- <pre>gem install bauxite</pre>
132
+ <pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-identifier">install</span> <span class="ruby-identifier">bauxite</span>
133
+ </pre>
135
134
 
136
135
  <p>If you don&#39;t have Ruby 2.x yet, check the <a
137
136
  href="#installing-ruby">Installing Ruby</a> section below.</p>
@@ -147,17 +146,19 @@ Firefox add-on to record <a href="Bauxite.html">Bauxite</a> tests directly
147
146
  from the browser (please note that this extension is still <em>very</em>
148
147
  experimental so its not yet hosted in the Mozilla add-ons page).</p>
149
148
 
150
- <h2 id="label-Hello+World">Hello World<span><a href="#label-Hello+World">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
149
+ <h2 id="label-Hello+World">Hello World<span><a href="#label-Hello+World">&para;</a> <a href="#top">&uarr;</a></span></h2>
151
150
 
152
151
  <p>Paste the following text into <code>hello.bxt</code>:</p>
153
152
 
154
- <pre>open &quot;http://www.gnu.org/fun/jokes/helloworld.html&quot;</pre>
153
+ <pre class="ruby"><span class="ruby-identifier">open</span> <span class="ruby-string">&quot;http://www.gnu.org/fun/jokes/helloworld.html&quot;</span>
154
+ </pre>
155
155
 
156
156
  <p>Launch a terminal/command prompt and type:</p>
157
157
 
158
- <pre>bauxite hello.bxt</pre>
158
+ <pre class="ruby"><span class="ruby-identifier">bauxite</span> <span class="ruby-identifier">hello</span>.<span class="ruby-identifier">bxt</span>
159
+ </pre>
159
160
 
160
- <h2 id="label-Command-line+Interface">Command-line Interface<span><a href="#label-Command-line+Interface">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
161
+ <h2 id="label-Command-line+Interface">Command-line Interface<span><a href="#label-Command-line+Interface">&para;</a> <a href="#top">&uarr;</a></span></h2>
161
162
 
162
163
  <p>The <code>bauxite</code> command-line program supports several
163
164
  configuration options.</p>
@@ -166,7 +167,7 @@ configuration options.</p>
166
167
  href="http://pzavolinsky.github.io/bauxite/Bauxite/Application.html">RDoc
167
168
  documentation</a> for more details.</p>
168
169
 
169
- <h2 id="label-The+Bauxite+Language">The <a href="Bauxite.html">Bauxite</a> Language<span><a href="#label-The+Bauxite+Language">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
170
+ <h2 id="label-The+Bauxite+Language">The <a href="Bauxite.html">Bauxite</a> Language<span><a href="#label-The+Bauxite+Language">&para;</a> <a href="#top">&uarr;</a></span></h2>
170
171
 
171
172
  <p>The <a href="Bauxite.html">Bauxite</a> language is composed of two elements
172
173
  <code>Actions</code> and <code>Selectors</code>: Actions are testing
@@ -178,9 +179,10 @@ elements of a page such as a button, a textbox, a label, etc.</p>
178
179
  contains a series of Actions (one per line). Depending on the Action, a few
179
180
  action arguments might need to be specified as well. For example in:</p>
180
181
 
181
- <pre>open &quot;http://google.com&quot;
182
- write &quot;name=q&quot; &quot;Hello WebDriver!&quot;
183
- click &quot;gbqfb&quot;</pre>
182
+ <pre class="ruby"><span class="ruby-identifier">open</span> <span class="ruby-string">&quot;http://google.com&quot;</span>
183
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;name=q&quot;</span> <span class="ruby-string">&quot;Hello WebDriver!&quot;</span>
184
+ <span class="ruby-identifier">click</span> <span class="ruby-string">&quot;gbqfb&quot;</span>
185
+ </pre>
184
186
 
185
187
  <p><code>open</code>, <code>write</code> and <code>click</code> are Actions: -
186
188
  <code>open</code> takes a single URL argument
@@ -209,7 +211,8 @@ href="Bauxite.html">Bauxite</a> uses Selectors.</p>
209
211
 
210
212
  <p>If we want to click the “Search” button we can do the following:</p>
211
213
 
212
- <pre>click &quot;gbqfb&quot;</pre>
214
+ <pre class="ruby"><span class="ruby-identifier">click</span> <span class="ruby-string">&quot;gbqfb&quot;</span>
215
+ </pre>
213
216
 
214
217
  <p><a href="Bauxite.html">Bauxite</a> supports several other Selectors such as
215
218
  <code>name=</code> in the example above. The <code>name</code> Selector
@@ -223,7 +226,8 @@ the <code>=</code> sign.</p>
223
226
  <p>If we want to type the text “Hello WebDriver!” in the textbox we can do the
224
227
  following:</p>
225
228
 
226
- <pre>write &quot;name=q&quot; &quot;Hello WebDriver!&quot;</pre>
229
+ <pre class="ruby"><span class="ruby-identifier">write</span> <span class="ruby-string">&quot;name=q&quot;</span> <span class="ruby-string">&quot;Hello WebDriver!&quot;</span>
230
+ </pre>
227
231
 
228
232
  <p>This section presented a brief introduction into the basic <a
229
233
  href="Bauxite.html">Bauxite</a> concepts. For more details and a list of
@@ -254,7 +258,7 @@ href="http://pzavolinsky.github.io/bauxite/Bauxite/Selector.html">Creating
254
258
  new Selectors</a></p>
255
259
  </li></ul>
256
260
 
257
- <h2 id="label-Firefox+add-on">Firefox add-on<span><a href="#label-Firefox+add-on">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
261
+ <h2 id="label-Firefox+add-on">Firefox add-on<span><a href="#label-Firefox+add-on">&para;</a> <a href="#top">&uarr;</a></span></h2>
258
262
 
259
263
  <p>As an alternative method of writing <a href="Bauxite.html">Bauxite</a>
260
264
  tests, you might try the <a
@@ -263,15 +267,15 @@ Firefox add-on to record <a href="Bauxite.html">Bauxite</a> tests directly
263
267
  from the browser (please note that this extension is still <em>very</em>
264
268
  experimental so its not yet hosted in the Mozilla add-ons page).</p>
265
269
 
266
- <h2 id="label-Installing+Ruby">Installing Ruby<span><a href="#label-Installing+Ruby">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
270
+ <h2 id="label-Installing+Ruby">Installing Ruby<span><a href="#label-Installing+Ruby">&para;</a> <a href="#top">&uarr;</a></span></h2>
267
271
 
268
272
  <p>I won&#39;t cover all the details of installing Ruby on your system (Google
269
273
  knows best), but the following should probably work.</p>
270
274
 
271
275
  <p>In GNU/Linux, you can install <a href="http://rvm.io/">RVM</a>, then Ruby:</p>
272
276
 
273
- <pre>curl -sSL https://get.rvm.io | bash -s stable
274
- source ~/.rvm/scripts/rvm
277
+ <pre>curl -sSL https://get.rvm.io | bash -s stable
278
+ source ~/.rvm/scripts/rvm
275
279
  rvm install ruby-2.1.0</pre>
276
280
 
277
281
  <p>In Windows, you can install Ruby 2.x with <a
@@ -282,9 +286,10 @@ Ruby</code> option in your start menu.</p>
282
286
  <p>Regadless of your OS, you should be able to install <a
283
287
  href="Bauxite.html">Bauxite</a> with:</p>
284
288
 
285
- <pre>gem install bauxite</pre>
289
+ <pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-identifier">install</span> <span class="ruby-identifier">bauxite</span>
290
+ </pre>
286
291
 
287
- <h2 id="label-Implementation">Implementation<span><a href="#label-Implementation">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
292
+ <h2 id="label-Implementation">Implementation<span><a href="#label-Implementation">&para;</a> <a href="#top">&uarr;</a></span></h2>
288
293
 
289
294
  <p><a href="Bauxite.html">Bauxite</a> is both a command-line program and a
290
295
  library. You can use the program to run <a href="Bauxite.html">Bauxite</a>
@@ -302,31 +307,32 @@ application take a look a the code in
302
307
  example of how to create a <a href="Bauxite.html">Bauxite</a> Context and
303
308
  execute some actions.</p>
304
309
 
305
- <h2 id="label-Extending+Bauxite">Extending <a href="Bauxite.html">Bauxite</a><span><a href="#label-Extending+Bauxite">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
310
+ <h2 id="label-Extending+Bauxite">Extending <a href="Bauxite.html">Bauxite</a><span><a href="#label-Extending+Bauxite">&para;</a> <a href="#top">&uarr;</a></span></h2>
306
311
 
307
312
  <p><a href="Bauxite.html">Bauxite</a> supports two types of extensions:
308
313
  functional extensions and coded plugins.</p>
309
314
 
310
- <h3 id="label-Functional+extensions">Functional extensions<span><a href="#label-Functional+extensions">&para;</a> <a href="#documentation">&uarr;</a></span></h3>
315
+ <h3 id="label-Functional+extensions">Functional extensions<span><a href="#label-Functional+extensions">&para;</a> <a href="#top">&uarr;</a></span></h3>
311
316
 
312
317
  <p>Functional extensions are composite constructs created using existing <a
313
318
  href="Bauxite.html">Bauxite</a> actions to convey functional meaning. For
314
319
  example, imagine a login form:</p>
315
320
 
316
- <pre>&lt;!-- http://hostname/login.html --&gt;
317
- &lt;form&gt;
318
- &lt;input id=&quot;username&quot; name=&quot;username&quot; type=&quot;text&quot; /&gt;
319
- &lt;input id=&quot;password&quot; name=&quot;password&quot; type=&quot;password&quot; /&gt;
320
- &lt;input id=&quot;login&quot; type=&quot;submit&quot; value=&quot;Login&quot;/&gt;
321
+ <pre>&lt;!-- http://hostname/login.html --&gt;
322
+ &lt;form&gt;
323
+ &lt;input id=&quot;username&quot; name=&quot;username&quot; type=&quot;text&quot; /&gt;
324
+ &lt;input id=&quot;password&quot; name=&quot;password&quot; type=&quot;password&quot; /&gt;
325
+ &lt;input id=&quot;login&quot; type=&quot;submit&quot; value=&quot;Login&quot;/&gt;
321
326
  &lt;/form&gt;</pre>
322
327
 
323
328
  <p>The <a href="Bauxite.html">Bauxite</a> code to login into this site would
324
329
  be:</p>
325
330
 
326
- <pre>open &quot;http://hostname/login.html&quot;
327
- write &quot;username&quot; &quot;jdoe&quot;
328
- write &quot;password&quot; &quot;hello world!&quot;
329
- click &quot;login&quot;</pre>
331
+ <pre class="ruby"><span class="ruby-identifier">open</span> <span class="ruby-string">&quot;http://hostname/login.html&quot;</span>
332
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;username&quot;</span> <span class="ruby-string">&quot;jdoe&quot;</span>
333
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;password&quot;</span> <span class="ruby-string">&quot;hello world!&quot;</span>
334
+ <span class="ruby-identifier">click</span> <span class="ruby-string">&quot;login&quot;</span>
335
+ </pre>
330
336
 
331
337
  <p>If we were creating a suite of automated web tests for our
332
338
  <em>hostname</em> site, we&#39;ll probably need to login into the site
@@ -337,70 +343,75 @@ test in our suite.</p>
337
343
  tests into many files and include one test into another with the
338
344
  <code>load</code> action.</p>
339
345
 
340
- <pre># my_test.bxt (by the way, this is a comment)
341
- load other_test_fragment.bxt
346
+ <pre># my_test.bxt (by the way, this is a comment)
347
+ load other_test_fragment.bxt
342
348
  ...</pre>
343
349
 
344
350
  <p>Back to our login example, first we can package the login part of our tests
345
351
  into a separate <a href="Bauxite.html">Bauxite</a> file:</p>
346
352
 
347
- <pre># login.bxt
348
- open &quot;http://hostname/login.html&quot;
349
- write &quot;username&quot; &quot;jdoe&quot;
350
- write &quot;password&quot; &quot;hello world!&quot;
351
- click &quot;login&quot;</pre>
353
+ <pre class="ruby"><span class="ruby-comment"># login.bxt
354
+ <span class="ruby-identifier">open</span> <span class="ruby-string">&quot;http://hostname/login.html&quot;</span>
355
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;username&quot;</span> <span class="ruby-string">&quot;jdoe&quot;</span>
356
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;password&quot;</span> <span class="ruby-string">&quot;hello world!&quot;</span>
357
+ <span class="ruby-identifier">click</span> <span class="ruby-string">&quot;login&quot;</span>
358
+ </pre>
352
359
 
353
360
  <p>Of course we would like to be able to login with different
354
361
  username/password combinations, so we can replace the literals in
355
362
  <code>login.bxt</code> with variables:</p>
356
363
 
357
- <pre># login.bxt
358
- open &quot;http://hostname/login.html&quot;
359
- write &quot;username&quot; &quot;${username}&quot;
360
- write &quot;password&quot; &quot;${password}&quot;
361
- click &quot;login&quot;</pre>
364
+ <pre class="ruby"><span class="ruby-comment"># login.bxt
365
+ <span class="ruby-identifier">open</span> <span class="ruby-string">&quot;http://hostname/login.html&quot;</span>
366
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;username&quot;</span> <span class="ruby-string">&quot;${username}&quot;</span>
367
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;password&quot;</span> <span class="ruby-string">&quot;${password}&quot;</span>
368
+ <span class="ruby-identifier">click</span> <span class="ruby-string">&quot;login&quot;</span>
369
+ </pre>
362
370
 
363
371
  <p>Now, we would like to assert that both <code>username</code> and
364
372
  <code>password</code> variables are set before calling our test (just in
365
373
  case someone forgets). We can do this with <code>params</code></p>
366
374
 
367
- <pre># login.bxt
368
- params username password
369
- open &quot;http://hostname/login.html&quot;
370
- write &quot;username&quot; &quot;${username}&quot;
371
- write &quot;password&quot; &quot;${password}&quot;
372
- click &quot;login&quot;</pre>
375
+ <pre class="ruby"><span class="ruby-comment"># login.bxt
376
+ <span class="ruby-identifier">params</span> <span class="ruby-identifier">username</span> <span class="ruby-identifier">password</span>
377
+ <span class="ruby-identifier">open</span> <span class="ruby-string">&quot;http://hostname/login.html&quot;</span>
378
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;username&quot;</span> <span class="ruby-string">&quot;${username}&quot;</span>
379
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;password&quot;</span> <span class="ruby-string">&quot;${password}&quot;</span>
380
+ <span class="ruby-identifier">click</span> <span class="ruby-string">&quot;login&quot;</span>
381
+ </pre>
373
382
 
374
383
  <p>In our main test we can load <code>login.bxt</code> and specify the
375
384
  variables required using this code:</p>
376
385
 
377
- <pre># main_test.bxt
378
- load &quot;login.bxt&quot; &quot;username=jdoe&quot; &quot;password=hello world!&quot;
386
+ <pre class="ruby"><span class="ruby-comment"># main_test.bxt
387
+ <span class="ruby-identifier">load</span> <span class="ruby-string">&quot;login.bxt&quot;</span> <span class="ruby-string">&quot;username=jdoe&quot;</span> <span class="ruby-string">&quot;password=hello world!&quot;</span>
379
388
 
380
- # additional actions go here</pre>
389
+ <span class="ruby-comment"># additional actions go here</span>
390
+ </pre>
381
391
 
382
392
  <p>We could improve this even further by creating an <code>alias</code> to
383
393
  simplify the login process. To do this, lets create an new file called
384
394
  <code>alias.bxt</code>:</p>
385
395
 
386
- <pre># alias.bxt
396
+ <pre># alias.bxt
387
397
  alias &quot;login&quot; &quot;load&quot; &quot;login.bxt&quot; &quot;username=${1}&quot; &quot;password=${2}&quot;</pre>
388
398
 
389
399
  <p>Note that the <code>alias</code> action supports positional arguments.</p>
390
400
 
391
401
  <p>Now we can change our main test to use our alias:</p>
392
402
 
393
- <pre># main_test.bxt
394
- load &quot;alias.bxt&quot;
403
+ <pre class="ruby"><span class="ruby-comment"># main_test.bxt
404
+ <span class="ruby-identifier">load</span> <span class="ruby-string">&quot;alias.bxt&quot;</span>
395
405
 
396
- login &quot;jdoe&quot; &quot;hello world!&quot;
406
+ <span class="ruby-identifier">login</span> <span class="ruby-string">&quot;jdoe&quot;</span> <span class="ruby-string">&quot;hello world!&quot;</span>
397
407
 
398
- # additional actions go here</pre>
408
+ <span class="ruby-comment"># additional actions go here</span>
409
+ </pre>
399
410
 
400
411
  <p>That was a bit of work but the resulting test is purely functional (minus
401
412
  the load alias part, of course).</p>
402
413
 
403
- <h3 id="label-Coded+plugins">Coded plugins<span><a href="#label-Coded+plugins">&para;</a> <a href="#documentation">&uarr;</a></span></h3>
414
+ <h3 id="label-Coded+plugins">Coded plugins<span><a href="#label-Coded+plugins">&para;</a> <a href="#top">&uarr;</a></span></h3>
404
415
 
405
416
  <p>Coded plugins are Ruby files that extend the <a
406
417
  href="Bauxite.html">Bauxite</a> language by providing additional language
@@ -411,44 +422,46 @@ href="Bauxite.html">Bauxite</a> actions, selectors and loggers.</p>
411
422
  were identified using a custom HTML attribute instead of <code>id</code>.
412
423
  For example:</p>
413
424
 
414
- <pre>&lt;form&gt;
415
- &lt;input custom-attr=&quot;username&quot; type=&quot;text&quot; /&gt;
416
- &lt;input custom-attr=&quot;password&quot; type=&quot;password&quot; /&gt;
417
- &lt;input custom-attr=&quot;login&quot; type=&quot;submit&quot; value=&quot;Login&quot;/&gt;
425
+ <pre>&lt;form&gt;
426
+ &lt;input custom-attr=&quot;username&quot; type=&quot;text&quot; /&gt;
427
+ &lt;input custom-attr=&quot;password&quot; type=&quot;password&quot; /&gt;
428
+ &lt;input custom-attr=&quot;login&quot; type=&quot;submit&quot; value=&quot;Login&quot;/&gt;
418
429
  &lt;/form&gt;</pre>
419
430
 
420
431
  <p>Using standard <a href="Bauxite.html">Bauxite</a> language we could select
421
432
  these elements using:</p>
422
433
 
423
- <pre># === my_test.bxt === #
424
- write &quot;attr=custom-attr:username&quot; &quot;jdoe&quot;
425
- write &quot;attr=custom-attr:password&quot; &quot;hello world!&quot;
426
- click &quot;attr=custom-attr:login&quot;</pre>
434
+ <pre class="ruby"><span class="ruby-comment"># === my_test.bxt === #
435
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;attr=custom-attr:username&quot;</span> <span class="ruby-string">&quot;jdoe&quot;</span>
436
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;attr=custom-attr:password&quot;</span> <span class="ruby-string">&quot;hello world!&quot;</span>
437
+ <span class="ruby-identifier">click</span> <span class="ruby-string">&quot;attr=custom-attr:login&quot;</span>
438
+ </pre>
427
439
 
428
440
  <p>But we can improve the overall readability of our test by using a coded
429
441
  plugin:</p>
430
442
 
431
- <pre class="ruby"><span class="ruby-comment"># === plugins/custom_selector.rb === #</span>
432
- <span class="ruby-keyword">class</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Selector</span>
433
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">custom</span>(<span class="ruby-identifier">value</span>)
434
- <span class="ruby-identifier">attr</span> <span class="ruby-node">&quot;custom-attr:#{value}&quot;</span>
435
- <span class="ruby-keyword">end</span>
443
+ <pre class="ruby"><span class="ruby-comment"># === plugins/custom_selector.rb === #
444
+ <span class="ruby-keyword">class</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Selector</span>
445
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">custom</span>(<span class="ruby-identifier">value</span>)
446
+ <span class="ruby-identifier">attr</span> <span class="ruby-node">&quot;custom-attr:#{value}&quot;</span>
447
+ <span class="ruby-keyword">end</span>
436
448
  <span class="ruby-keyword">end</span>
437
449
  </pre>
438
450
 
439
451
  <p>Now we can change our test to look like this:</p>
440
452
 
441
- <pre># === my_test.bxt === #
442
- write &quot;custom=username&quot; &quot;jdoe&quot;
443
- write &quot;custom=password&quot; &quot;hello world!&quot;
444
- click &quot;custom=login&quot;</pre>
453
+ <pre class="ruby"><span class="ruby-comment"># === my_test.bxt === #
454
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;custom=username&quot;</span> <span class="ruby-string">&quot;jdoe&quot;</span>
455
+ <span class="ruby-identifier">write</span> <span class="ruby-string">&quot;custom=password&quot;</span> <span class="ruby-string">&quot;hello world!&quot;</span>
456
+ <span class="ruby-identifier">click</span> <span class="ruby-string">&quot;custom=login&quot;</span>
457
+ </pre>
445
458
 
446
459
  <p>Finally, to execute <a href="Bauxite.html">Bauxite</a> loading our plugin
447
460
  we can type:</p>
448
461
 
449
462
  <pre>bauxite -e plugins my_test.bxt</pre>
450
463
 
451
- <h2 id="label-Jenkins+Integration">Jenkins Integration<span><a href="#label-Jenkins+Integration">&para;</a> <a href="#documentation">&uarr;</a></span></h2>
464
+ <h2 id="label-Jenkins+Integration">Jenkins Integration<span><a href="#label-Jenkins+Integration">&para;</a> <a href="#top">&uarr;</a></span></h2>
452
465
 
453
466
  <p>If you want to run <a href="Bauxite.html">Bauxite</a> tests in your <a
454
467
  href="http://jenkins-ci.org/">Jenkins CI</a> server you must install
@@ -458,9 +471,9 @@ start. Assuming you installed Ruby and <a href="Bauxite.html">Bauxite</a>
458
471
  for the <code>jenkins</code> user (see the instructions above), you can
459
472
  create an execute shell build task with the following text:</p>
460
473
 
461
- <pre>#!/bin/bash
462
- source ~/.rvm/scripts/rvm
463
- bauxite -t 60 -o 240 --jenkins &quot;$WORKSPACE/test-results&quot; \
474
+ <pre>#!/bin/bash
475
+ source ~/.rvm/scripts/rvm
476
+ bauxite -t 60 -o 240 --jenkins &quot;$WORKSPACE/test-results&quot; \
464
477
  &quot;$WORKSPACE/test/suite.bxt&quot;</pre>
465
478
 
466
479
  <p>Assuming you have Selenium Server running on localhost and your workspace
@@ -469,12 +482,13 @@ bauxite -t 60 -o 240 --jenkins &quot;$WORKSPACE/test-results&quot; \
469
482
 
470
483
  <p><code>suite.bxt</code> could be something like:</p>
471
484
 
472
- <pre># === suite.bxt === #
473
- test login.bxt
474
- test register.bxt
475
- test browse_around.bxt
476
- test purchase_something.bxt
477
- # more tests here...</pre>
485
+ <pre class="ruby"><span class="ruby-comment"># === suite.bxt === #
486
+ <span class="ruby-identifier">test</span> <span class="ruby-identifier">login</span>.<span class="ruby-identifier">bxt</span>
487
+ <span class="ruby-identifier">test</span> <span class="ruby-identifier">register</span>.<span class="ruby-identifier">bxt</span>
488
+ <span class="ruby-identifier">test</span> <span class="ruby-identifier">browse_around</span>.<span class="ruby-identifier">bxt</span>
489
+ <span class="ruby-identifier">test</span> <span class="ruby-identifier">purchase_something</span>.<span class="ruby-identifier">bxt</span>
490
+ <span class="ruby-comment"># more tests here...</span>
491
+ </pre>
478
492
 
479
493
  <p>Note the <code>--jenkins</code> option in the configuration above. That
480
494
  option sets the default configuration arguments for Jenkins integration.
@@ -507,7 +521,7 @@ href="https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin">Plot<
507
521
 
508
522
  <footer id="validator-badges" role="contentinfo">
509
523
  <p><a href="http://validator.w3.org/check/referer">Validate</a>
510
- <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.2.
511
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
524
+ <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0.
525
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
512
526
  </footer>
513
527