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.
- checksums.yaml +4 -4
- data/LICENSE +21 -21
- data/README.md +293 -293
- data/Rakefile +128 -128
- data/bin/bauxite +27 -27
- data/doc/Bauxite.html +6 -9
- data/doc/Bauxite/Action.html +298 -315
- data/doc/Bauxite/ActionModule.html +23 -26
- data/doc/Bauxite/Application.html +36 -38
- data/doc/Bauxite/Context.html +303 -303
- data/doc/Bauxite/Errors.html +6 -9
- data/doc/Bauxite/Errors/AssertionError.html +6 -9
- data/doc/Bauxite/Errors/FileNotFoundError.html +6 -9
- data/doc/Bauxite/Errors/FormatError.html +6 -9
- data/doc/Bauxite/Loggers.html +6 -9
- data/doc/Bauxite/Loggers/CompositeLogger.html +29 -32
- data/doc/Bauxite/Loggers/EchoLogger.html +10 -13
- data/doc/Bauxite/Loggers/FileLogger.html +25 -28
- data/doc/Bauxite/Loggers/HtmlLogger.html +99 -102
- data/doc/Bauxite/Loggers/NullLogger.html +16 -19
- data/doc/Bauxite/Loggers/ReportLogger.html +43 -46
- data/doc/Bauxite/Loggers/TerminalLogger.html +76 -79
- data/doc/Bauxite/Loggers/XtermLogger.html +28 -31
- data/doc/Bauxite/Parser.html +87 -89
- data/doc/Bauxite/ParserModule.html +19 -22
- data/doc/Bauxite/Selector.html +99 -105
- data/doc/Bauxite/SelectorModule.html +27 -30
- data/doc/README_md.html +117 -103
- data/doc/created.rid +58 -58
- data/doc/fonts.css +167 -167
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +117 -103
- data/doc/js/darkfish.js +32 -11
- data/doc/js/jquery.js +0 -0
- data/doc/js/navigation.js +0 -0
- data/doc/js/search.js +0 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/searcher.js +0 -0
- data/doc/rdoc.css +580 -580
- data/doc/table_of_contents.html +69 -72
- data/lib/bauxite.rb +28 -28
- data/lib/bauxite/actions/alias.rb +51 -51
- data/lib/bauxite/actions/assert.rb +49 -49
- data/lib/bauxite/actions/asserth.rb +60 -60
- data/lib/bauxite/actions/assertm.rb +49 -49
- data/lib/bauxite/actions/assertv.rb +40 -40
- data/lib/bauxite/actions/assertw.rb +47 -47
- data/lib/bauxite/actions/break.rb +39 -39
- data/lib/bauxite/actions/capture.rb +61 -61
- data/lib/bauxite/actions/click.rb +36 -36
- data/lib/bauxite/actions/debug.rb +103 -103
- data/lib/bauxite/actions/doif.rb +43 -43
- data/lib/bauxite/actions/dounless.rb +43 -43
- data/lib/bauxite/actions/echo.rb +36 -36
- data/lib/bauxite/actions/exec.rb +46 -46
- data/lib/bauxite/actions/exit.rb +35 -35
- data/lib/bauxite/actions/failif.rb +52 -52
- data/lib/bauxite/actions/js.rb +41 -41
- data/lib/bauxite/actions/load.rb +49 -49
- data/lib/bauxite/actions/open.rb +35 -35
- data/lib/bauxite/actions/params.rb +40 -40
- data/lib/bauxite/actions/replace.rb +37 -37
- data/lib/bauxite/actions/reset.rb +38 -38
- data/lib/bauxite/actions/return.rb +68 -68
- data/lib/bauxite/actions/ruby.rb +58 -58
- data/lib/bauxite/actions/select.rb +48 -48
- data/lib/bauxite/actions/set.rb +39 -39
- data/lib/bauxite/actions/setif.rb +44 -44
- data/lib/bauxite/actions/source.rb +44 -44
- data/lib/bauxite/actions/store.rb +38 -38
- data/lib/bauxite/actions/submit.rb +37 -37
- data/lib/bauxite/actions/test.rb +67 -67
- data/lib/bauxite/actions/tryload.rb +71 -71
- data/lib/bauxite/actions/wait.rb +38 -38
- data/lib/bauxite/actions/write.rb +44 -44
- data/lib/bauxite/application.rb +349 -349
- data/lib/bauxite/core/action.rb +199 -199
- data/lib/bauxite/core/context.rb +791 -791
- data/lib/bauxite/core/errors.rb +41 -41
- data/lib/bauxite/core/logger.rb +169 -169
- data/lib/bauxite/core/parser.rb +85 -85
- data/lib/bauxite/core/selector.rb +152 -152
- data/lib/bauxite/loggers/composite.rb +91 -91
- data/lib/bauxite/loggers/echo.rb +36 -36
- data/lib/bauxite/loggers/file.rb +68 -68
- data/lib/bauxite/loggers/html.rb +154 -154
- data/lib/bauxite/loggers/terminal.rb +134 -134
- data/lib/bauxite/loggers/xterm.rb +101 -101
- data/lib/bauxite/parsers/csv.rb +43 -43
- data/lib/bauxite/parsers/default.rb +42 -42
- data/lib/bauxite/parsers/html.rb +79 -79
- data/lib/bauxite/selectors/attr.rb +39 -39
- data/lib/bauxite/selectors/frame.rb +60 -60
- data/lib/bauxite/selectors/json.rb +88 -88
- data/lib/bauxite/selectors/sid.rb +38 -38
- data/lib/bauxite/selectors/smart.rb +80 -80
- data/lib/bauxite/selectors/window.rb +77 -77
- data/test/alert.bxt +3 -3
- data/test/alert/page.html +4 -4
- data/test/alias.bxt +9 -9
- data/test/asserth.bxt +2 -2
- data/test/assertv.bxt +1 -1
- data/test/assertw.bxt +7 -7
- data/test/broken.bxt.manual +0 -0
- data/test/bug_load_path.bxt.manual +0 -0
- data/test/bug_load_path/broken.bxt.manual +0 -0
- data/test/bug_load_path/test.bxt +0 -0
- data/test/capture.bxt.manual +20 -20
- data/test/capture/my_test.bxt +1 -1
- data/test/capture/page.html +6 -6
- data/test/capture_on_error.bxt.manual +3 -3
- data/test/capture_on_error/my_test.bxt +1 -1
- data/test/capture_on_error/page.html +2 -2
- data/test/debug.bxt.manual +0 -0
- data/test/default_selector.bxt.manual +7 -7
- data/test/default_selector/page.html +10 -10
- data/test/default_selector_var.bxt +1 -1
- data/test/delay.bxt +2 -2
- data/test/delay/page.html +4 -4
- data/test/doif.bxt +6 -6
- data/test/dounless.bxt +6 -6
- data/test/exec.bxt +6 -6
- data/test/exit.bxt +3 -3
- data/test/exit/test.bxt +3 -3
- data/test/extension.bxt.manual +4 -4
- data/test/extension/custom.rb +12 -12
- data/test/extension/page.html +4 -4
- data/test/failif.bxt +7 -7
- data/test/failif/page.html +5 -5
- data/test/format.bxt +17 -17
- data/test/format/page.html +6 -6
- data/test/frame.bxt +6 -6
- data/test/frame/child_frame.html +6 -6
- data/test/frame/grandchild_frame.html +4 -4
- data/test/frame/page.html +4 -4
- data/test/js.bxt +4 -4
- data/test/json.bxt +19 -19
- data/test/json/array.json +3 -3
- data/test/json/object.json +13 -13
- data/test/load.bxt +18 -18
- data/test/load/child.bxt +12 -12
- data/test/parsers.bxt +1 -1
- data/test/parsers.csv +7 -7
- data/test/parsers.html +32 -32
- data/test/parsers/page.html +6 -6
- data/test/return.bxt +1 -1
- data/test/return/f1.bxt +1 -1
- data/test/return/f2.bxt +1 -1
- data/test/return/f3.bxt +1 -1
- data/test/return/f4.bxt +2 -2
- data/test/ruby.bxt +1 -1
- data/test/ruby/custom.rb +5 -5
- data/test/select.bxt +9 -9
- data/test/select/page.html +8 -8
- data/test/selectors.bxt +7 -7
- data/test/selectors/page.html +6 -6
- data/test/set_builtin.bxt +5 -0
- data/test/set_builtin/page.html +5 -0
- data/test/setif.bxt +3 -3
- data/test/smart_selector.bxt +17 -17
- data/test/smart_selector/page.html +17 -17
- data/test/stdin.bxt +0 -0
- data/test/submit.bxt +4 -4
- data/test/submit/page.html +6 -6
- data/test/submit/page2.html +4 -4
- data/test/test.bxt.manual +6 -6
- data/test/test/test1.bxt +2 -2
- data/test/test/test2.bxt +3 -3
- data/test/test/test3.bxt +2 -2
- data/test/test/test4.bxt +1 -1
- data/test/test/test5.bxt +1 -1
- data/test/window.bxt +14 -14
- data/test/window/page.html +5 -5
- data/test/window/popup.html +4 -4
- 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">&</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">'='</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">"Invalid selector type '#{type}'"</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">&</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">'_selector'</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-operator">&</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">'_selector'</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">&</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">&</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">'='</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">"Invalid selector type '#{type}'"</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">&</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">'_selector'</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-operator">&</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">'_selector'</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">&</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://
|
280
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-
|
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">¶</a> <a href="#
|
90
|
+
<h1 id="label-bauxite">bauxite<span><a href="#label-bauxite">¶</a> <a href="#top">↑</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">"selenium-webdriver"</span>
|
103
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">"selenium-webdriver"</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">"http://google.com"</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">"http://google.com"</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">'q'</span>)
|
112
|
-
<span class="ruby-identifier">element</span>.<span class="ruby-identifier">send_keys</span> <span class="ruby-string">"Hello WebDriver!"</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">'q'</span>)
|
109
|
+
<span class="ruby-identifier">element</span>.<span class="ruby-identifier">send_keys</span> <span class="ruby-string">"Hello WebDriver!"</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
|
127
|
-
write
|
128
|
-
click
|
123
|
+
<pre class="ruby"><span class="ruby-identifier">open</span> <span class="ruby-string">"http://google.com"</span>
|
124
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"name=q"</span> <span class="ruby-string">"Hello WebDriver!"</span>
|
125
|
+
<span class="ruby-identifier">click</span> <span class="ruby-string">"gbqfb"</span>
|
126
|
+
</pre>
|
129
127
|
|
130
|
-
<h2 id="label-Installation">Installation<span><a href="#label-Installation">¶</a> <a href="#
|
128
|
+
<h2 id="label-Installation">Installation<span><a href="#label-Installation">¶</a> <a href="#top">↑</a></span></h2>
|
131
129
|
|
132
130
|
<p>In a nutshell:</p>
|
133
131
|
|
134
|
-
<pre>gem install bauxite</
|
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'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">¶</a> <a href="#
|
149
|
+
<h2 id="label-Hello+World">Hello World<span><a href="#label-Hello+World">¶</a> <a href="#top">↑</a></span></h2>
|
151
150
|
|
152
151
|
<p>Paste the following text into <code>hello.bxt</code>:</p>
|
153
152
|
|
154
|
-
<pre>open
|
153
|
+
<pre class="ruby"><span class="ruby-identifier">open</span> <span class="ruby-string">"http://www.gnu.org/fun/jokes/helloworld.html"</span>
|
154
|
+
</pre>
|
155
155
|
|
156
156
|
<p>Launch a terminal/command prompt and type:</p>
|
157
157
|
|
158
|
-
<pre>bauxite hello
|
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">¶</a> <a href="#
|
161
|
+
<h2 id="label-Command-line+Interface">Command-line Interface<span><a href="#label-Command-line+Interface">¶</a> <a href="#top">↑</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">¶</a> <a href="#
|
170
|
+
<h2 id="label-The+Bauxite+Language">The <a href="Bauxite.html">Bauxite</a> Language<span><a href="#label-The+Bauxite+Language">¶</a> <a href="#top">↑</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
|
182
|
-
write
|
183
|
-
click
|
182
|
+
<pre class="ruby"><span class="ruby-identifier">open</span> <span class="ruby-string">"http://google.com"</span>
|
183
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"name=q"</span> <span class="ruby-string">"Hello WebDriver!"</span>
|
184
|
+
<span class="ruby-identifier">click</span> <span class="ruby-string">"gbqfb"</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
|
214
|
+
<pre class="ruby"><span class="ruby-identifier">click</span> <span class="ruby-string">"gbqfb"</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
|
229
|
+
<pre class="ruby"><span class="ruby-identifier">write</span> <span class="ruby-string">"name=q"</span> <span class="ruby-string">"Hello WebDriver!"</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">¶</a> <a href="#
|
261
|
+
<h2 id="label-Firefox+add-on">Firefox add-on<span><a href="#label-Firefox+add-on">¶</a> <a href="#top">↑</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">¶</a> <a href="#
|
270
|
+
<h2 id="label-Installing+Ruby">Installing Ruby<span><a href="#label-Installing+Ruby">¶</a> <a href="#top">↑</a></span></h2>
|
267
271
|
|
268
272
|
<p>I won'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</
|
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">¶</a> <a href="#
|
292
|
+
<h2 id="label-Implementation">Implementation<span><a href="#label-Implementation">¶</a> <a href="#top">↑</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">¶</a> <a href="#
|
310
|
+
<h2 id="label-Extending+Bauxite">Extending <a href="Bauxite.html">Bauxite</a><span><a href="#label-Extending+Bauxite">¶</a> <a href="#top">↑</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">¶</a> <a href="#
|
315
|
+
<h3 id="label-Functional+extensions">Functional extensions<span><a href="#label-Functional+extensions">¶</a> <a href="#top">↑</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><!-- http://hostname/login.html -->
|
317
|
-
<form>
|
318
|
-
<input id="username" name="username" type="text" />
|
319
|
-
<input id="password" name="password" type="password" />
|
320
|
-
<input id="login" type="submit" value="Login"/>
|
321
|
+
<pre><!-- http://hostname/login.html -->
|
322
|
+
<form>
|
323
|
+
<input id="username" name="username" type="text" />
|
324
|
+
<input id="password" name="password" type="password" />
|
325
|
+
<input id="login" type="submit" value="Login"/>
|
321
326
|
</form></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
|
327
|
-
write
|
328
|
-
write
|
329
|
-
click
|
331
|
+
<pre class="ruby"><span class="ruby-identifier">open</span> <span class="ruby-string">"http://hostname/login.html"</span>
|
332
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"username"</span> <span class="ruby-string">"jdoe"</span>
|
333
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"password"</span> <span class="ruby-string">"hello world!"</span>
|
334
|
+
<span class="ruby-identifier">click</span> <span class="ruby-string">"login"</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'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
|
349
|
-
write
|
350
|
-
write
|
351
|
-
click
|
353
|
+
<pre class="ruby"><span class="ruby-comment"># login.bxt
|
354
|
+
<span class="ruby-identifier">open</span> <span class="ruby-string">"http://hostname/login.html"</span>
|
355
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"username"</span> <span class="ruby-string">"jdoe"</span>
|
356
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"password"</span> <span class="ruby-string">"hello world!"</span>
|
357
|
+
<span class="ruby-identifier">click</span> <span class="ruby-string">"login"</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
|
359
|
-
write
|
360
|
-
write
|
361
|
-
click
|
364
|
+
<pre class="ruby"><span class="ruby-comment"># login.bxt
|
365
|
+
<span class="ruby-identifier">open</span> <span class="ruby-string">"http://hostname/login.html"</span>
|
366
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"username"</span> <span class="ruby-string">"${username}"</span>
|
367
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"password"</span> <span class="ruby-string">"${password}"</span>
|
368
|
+
<span class="ruby-identifier">click</span> <span class="ruby-string">"login"</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
|
370
|
-
write
|
371
|
-
write
|
372
|
-
click
|
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">"http://hostname/login.html"</span>
|
378
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"username"</span> <span class="ruby-string">"${username}"</span>
|
379
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"password"</span> <span class="ruby-string">"${password}"</span>
|
380
|
+
<span class="ruby-identifier">click</span> <span class="ruby-string">"login"</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
|
386
|
+
<pre class="ruby"><span class="ruby-comment"># main_test.bxt
|
387
|
+
<span class="ruby-identifier">load</span> <span class="ruby-string">"login.bxt"</span> <span class="ruby-string">"username=jdoe"</span> <span class="ruby-string">"password=hello world!"</span>
|
379
388
|
|
380
|
-
|
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 "login" "load" "login.bxt" "username=${1}" "password=${2}"</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
|
403
|
+
<pre class="ruby"><span class="ruby-comment"># main_test.bxt
|
404
|
+
<span class="ruby-identifier">load</span> <span class="ruby-string">"alias.bxt"</span>
|
395
405
|
|
396
|
-
login
|
406
|
+
<span class="ruby-identifier">login</span> <span class="ruby-string">"jdoe"</span> <span class="ruby-string">"hello world!"</span>
|
397
407
|
|
398
|
-
|
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">¶</a> <a href="#
|
414
|
+
<h3 id="label-Coded+plugins">Coded plugins<span><a href="#label-Coded+plugins">¶</a> <a href="#top">↑</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><form>
|
415
|
-
<input custom-attr="username" type="text" />
|
416
|
-
<input custom-attr="password" type="password" />
|
417
|
-
<input custom-attr="login" type="submit" value="Login"/>
|
425
|
+
<pre><form>
|
426
|
+
<input custom-attr="username" type="text" />
|
427
|
+
<input custom-attr="password" type="password" />
|
428
|
+
<input custom-attr="login" type="submit" value="Login"/>
|
418
429
|
</form></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
|
425
|
-
write
|
426
|
-
click
|
434
|
+
<pre class="ruby"><span class="ruby-comment"># === my_test.bxt === #
|
435
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"attr=custom-attr:username"</span> <span class="ruby-string">"jdoe"</span>
|
436
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"attr=custom-attr:password"</span> <span class="ruby-string">"hello world!"</span>
|
437
|
+
<span class="ruby-identifier">click</span> <span class="ruby-string">"attr=custom-attr:login"</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 ===
|
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">"custom-attr:#{value}"</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">"custom-attr:#{value}"</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
|
443
|
-
write
|
444
|
-
click
|
453
|
+
<pre class="ruby"><span class="ruby-comment"># === my_test.bxt === #
|
454
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"custom=username"</span> <span class="ruby-string">"jdoe"</span>
|
455
|
+
<span class="ruby-identifier">write</span> <span class="ruby-string">"custom=password"</span> <span class="ruby-string">"hello world!"</span>
|
456
|
+
<span class="ruby-identifier">click</span> <span class="ruby-string">"custom=login"</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">¶</a> <a href="#
|
464
|
+
<h2 id="label-Jenkins+Integration">Jenkins Integration<span><a href="#label-Jenkins+Integration">¶</a> <a href="#top">↑</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 "$WORKSPACE/test-results" \
|
474
|
+
<pre>#!/bin/bash
|
475
|
+
source ~/.rvm/scripts/rvm
|
476
|
+
bauxite -t 60 -o 240 --jenkins "$WORKSPACE/test-results" \
|
464
477
|
"$WORKSPACE/test/suite.bxt"</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 "$WORKSPACE/test-results" \
|
|
469
482
|
|
470
483
|
<p><code>suite.bxt</code> could be something like:</p>
|
471
484
|
|
472
|
-
<pre># === suite.bxt === #
|
473
|
-
test login
|
474
|
-
test register
|
475
|
-
test browse_around
|
476
|
-
test purchase_something
|
477
|
-
|
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://
|
511
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-
|
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
|
|