bauxite 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +8 -2
- data/doc/Bauxite/Action.html +1 -1
- data/doc/Bauxite/ActionModule.html +3 -32
- data/doc/Bauxite/Context.html +65 -47
- data/doc/created.rid +6 -6
- data/doc/js/search_index.js +1 -1
- data/lib/bauxite/actions/debug.rb +2 -4
- data/lib/bauxite/actions/test.rb +1 -1
- data/lib/bauxite/core/action.rb +0 -8
- data/lib/bauxite/core/context.rb +35 -17
- data/lib/bauxite.rb +1 -1
- data/test/capture_on_error/my_test.bxt +2 -0
- data/test/capture_on_error/page.html +3 -0
- data/test/capture_on_error.bxt.manual +4 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2e679b02fa2d87d2025f68ffa25c036bba29179
|
4
|
+
data.tar.gz: bac892397b03334d2cf9345feaec1dcc231a9777
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a43c7c2eba872794903b59a8d283650e6c58db77e07c7f8f470b726be0c5506524761049a0d4ef54327f5b9940b3ffd9f13831d8e0064bc14ac1b8467fe6ceaa
|
7
|
+
data.tar.gz: df529681b7cc9938c377f00665966198722a8d0b201f550582eeedaaad5b27fbd35a46ae21dd97ac985d2fefee692420d07b2452af28e1e6edd9828d3bc7df7b
|
data/Rakefile
CHANGED
@@ -56,9 +56,10 @@ task :test do
|
|
56
56
|
fail "The -d argument failed to open the debug console"
|
57
57
|
end
|
58
58
|
|
59
|
-
system('rm -rf /tmp/bauxite-test')
|
60
|
-
ruby "-Ilib bin/bauxite test/capture.bxt.manual --output /tmp/bauxite-test"
|
61
59
|
check = lambda { |f| fail "Captured file not found #{f}" unless File.exists? f }
|
60
|
+
|
61
|
+
system('rm -rf /tmp/bauxite-test')
|
62
|
+
ruby "-Ilib bin/bauxite --output /tmp/bauxite-test test/capture.bxt.manual"
|
62
63
|
check.call '/tmp/bauxite-test/test_capture_bxt_manual_0.png'
|
63
64
|
check.call '/tmp/bauxite-test/test_capture_bxt_manual_1.png'
|
64
65
|
check.call '/tmp/bauxite-test/test_capture_bxt_manual_2.png'
|
@@ -66,6 +67,11 @@ task :test do
|
|
66
67
|
check.call '/tmp/bauxite-test/capture_my_test_bxt_test_capture_my_test_bxt_3.png'
|
67
68
|
check.call '/tmp/bauxite-test/named_test_test_capture_my_test_bxt_3.png'
|
68
69
|
|
70
|
+
system('rm -rf /tmp/bauxite-test')
|
71
|
+
system("ruby -Ilib bin/bauxite --output /tmp/bauxite-test -c test/capture_on_error.bxt.manual")
|
72
|
+
fail "The 'capture_on_error' test failed to return the expected exit status: the exit status was #{$?.exitstatus}" unless $?.exitstatus == 1
|
73
|
+
check.call '/tmp/bauxite-test/capture_on_error_my_test_bxt_test_capture_on_error_bxt_manual_0.png'
|
74
|
+
check.call '/tmp/bauxite-test/test_capture_on_error_bxt_manual_0.png'
|
69
75
|
end
|
70
76
|
|
71
77
|
# === Documentation ========================================================= #
|
data/doc/Bauxite/Action.html
CHANGED
@@ -1625,7 +1625,7 @@ the execution continues with the next test context (if any).</p>
|
|
1625
1625
|
<span class="ruby-identifier">t</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>
|
1626
1626
|
<span class="ruby-identifier">status</span> = <span class="ruby-string">'ERROR'</span>
|
1627
1627
|
<span class="ruby-identifier">error</span> = <span class="ruby-keyword">nil</span>
|
1628
|
-
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">with_vars</span>({ <span class="ruby-string">'
|
1628
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">with_vars</span>({ <span class="ruby-string">'__TEST__'</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span> }) <span class="ruby-keyword">do</span>
|
1629
1629
|
<span class="ruby-identifier">delayed</span>.<span class="ruby-identifier">call</span>
|
1630
1630
|
<span class="ruby-identifier">status</span> = <span class="ruby-string">'OK'</span>
|
1631
1631
|
<span class="ruby-keyword">end</span>
|
@@ -119,33 +119,6 @@
|
|
119
119
|
</div>
|
120
120
|
</div>
|
121
121
|
|
122
|
-
<div id="attribute-i-file" class="method-detail">
|
123
|
-
<div class="method-heading attribute-method-heading">
|
124
|
-
<span class="method-name">file</span><span
|
125
|
-
class="attribute-access-type">[R]</span>
|
126
|
-
</div>
|
127
|
-
|
128
|
-
<div class="method-description">
|
129
|
-
|
130
|
-
<p>File where the action was defined.</p>
|
131
|
-
|
132
|
-
</div>
|
133
|
-
</div>
|
134
|
-
|
135
|
-
<div id="attribute-i-line" class="method-detail">
|
136
|
-
<div class="method-heading attribute-method-heading">
|
137
|
-
<span class="method-name">line</span><span
|
138
|
-
class="attribute-access-type">[R]</span>
|
139
|
-
</div>
|
140
|
-
|
141
|
-
<div class="method-description">
|
142
|
-
|
143
|
-
<p>Line in the <a href="ActionModule.html#attribute-i-file">file</a> where the
|
144
|
-
action was defined.</p>
|
145
|
-
|
146
|
-
</div>
|
147
|
-
</div>
|
148
|
-
|
149
122
|
<div id="attribute-i-text" class="method-detail">
|
150
123
|
<div class="method-heading attribute-method-heading">
|
151
124
|
<span class="method-name">text</span><span
|
@@ -188,14 +161,12 @@ action was defined.</p>
|
|
188
161
|
|
189
162
|
|
190
163
|
<div class="method-source-code" id="new-source">
|
191
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/action.rb, line
|
164
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/action.rb, line 33</span>
|
192
165
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">ctx</span>, <span class="ruby-identifier">cmd</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>)
|
193
166
|
<span class="ruby-ivar">@ctx</span> = <span class="ruby-identifier">ctx</span>
|
194
167
|
<span class="ruby-ivar">@cmd</span> = <span class="ruby-identifier">cmd</span>
|
195
168
|
<span class="ruby-ivar">@args</span> = <span class="ruby-identifier">args</span>
|
196
169
|
<span class="ruby-ivar">@text</span> = <span class="ruby-identifier">text</span>
|
197
|
-
<span class="ruby-ivar">@file</span> = <span class="ruby-identifier">file</span>
|
198
|
-
<span class="ruby-ivar">@line</span> = <span class="ruby-identifier">line</span>
|
199
170
|
|
200
171
|
<span class="ruby-ivar">@cmd_real</span> = (<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">cmd</span><span class="ruby-operator">+</span><span class="ruby-string">'_action'</span>) <span class="ruby-operator">?</span> (<span class="ruby-identifier">cmd</span><span class="ruby-operator">+</span><span class="ruby-string">'_action'</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">cmd</span>
|
201
172
|
|
@@ -260,7 +231,7 @@ quote characters (“) and every quote inside an argument is doubled.</p>
|
|
260
231
|
|
261
232
|
|
262
233
|
<div class="method-source-code" id="args-source">
|
263
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/action.rb, line
|
234
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/action.rb, line 66</span>
|
264
235
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">args</span>(<span class="ruby-identifier">quote</span> = <span class="ruby-keyword">false</span>)
|
265
236
|
<span class="ruby-identifier">ret</span> = <span class="ruby-ivar">@args</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">expand</span>(<span class="ruby-identifier">a</span>) }
|
266
237
|
<span class="ruby-identifier">ret</span> = <span class="ruby-identifier">ret</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-string">'"'</span><span class="ruby-operator">+</span><span class="ruby-identifier">a</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'"'</span>, <span class="ruby-string">'""'</span>)<span class="ruby-operator">+</span><span class="ruby-string">'"'</span> } <span class="ruby-keyword">if</span> <span class="ruby-identifier">quote</span>
|
@@ -314,7 +285,7 @@ might yield different results.</p>
|
|
314
285
|
|
315
286
|
|
316
287
|
<div class="method-source-code" id="execute-source">
|
317
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/action.rb, line
|
288
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/action.rb, line 88</span>
|
318
289
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">execute</span>()
|
319
290
|
<span class="ruby-identifier">send</span>(<span class="ruby-ivar">@cmd_real</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
320
291
|
<span class="ruby-keyword">end</span></pre>
|
data/doc/Bauxite/Context.html
CHANGED
@@ -420,7 +420,8 @@ href="Context.html#method-i-stop">stop</a> (defaults to <code>false</code>)</p>
|
|
420
420
|
<span class="ruby-string">'__TIMEOUT__'</span> =<span class="ruby-operator">></span> (<span class="ruby-identifier">options</span>[<span class="ruby-value">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">10</span>).<span class="ruby-identifier">to_i</span>,
|
421
421
|
<span class="ruby-string">'__DEBUG__'</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">false</span>,
|
422
422
|
<span class="ruby-string">'__SELECTOR__'</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:selector</span>] <span class="ruby-operator">||</span> <span class="ruby-string">'sid'</span>,
|
423
|
-
<span class="ruby-string">'__OUTPUT__'</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:output</span>]
|
423
|
+
<span class="ruby-string">'__OUTPUT__'</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:output</span>],
|
424
|
+
<span class="ruby-string">'__DIR__'</span> =<span class="ruby-operator">></span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">absolute_path</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>)
|
424
425
|
}
|
425
426
|
<span class="ruby-ivar">@aliases</span> = {}
|
426
427
|
<span class="ruby-ivar">@tests</span> = []
|
@@ -479,9 +480,9 @@ href="Context.html#method-i-stop">stop</a> (defaults to <code>false</code>)</p>
|
|
479
480
|
|
480
481
|
|
481
482
|
<div class="method-source-code" id="debug-source">
|
482
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
483
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 259</span>
|
483
484
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">debug</span>
|
484
|
-
<span class="ruby-identifier">
|
485
|
+
<span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-string">'debug'</span>, [], <span class="ruby-keyword">false</span>)
|
485
486
|
<span class="ruby-keyword">end</span></pre>
|
486
487
|
</div>
|
487
488
|
|
@@ -536,7 +537,7 @@ applies if no <code>block</code> was given).</p>
|
|
536
537
|
|
537
538
|
|
538
539
|
<div class="method-source-code" id="find-source">
|
539
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
540
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 248</span>
|
540
541
|
<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>) <span class="ruby-comment"># yields: element</span>
|
541
542
|
<span class="ruby-identifier">with_timeout</span> <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">NoSuchElementError</span> <span class="ruby-keyword">do</span>
|
542
543
|
<span class="ruby-constant">Selector</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>, <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__SELECTOR__'</span>]).<span class="ruby-identifier">find</span>(<span class="ruby-identifier">selector</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -586,7 +587,7 @@ the inner text or the value of the <code>value</code> attribute.</p>
|
|
586
587
|
|
587
588
|
|
588
589
|
<div class="method-source-code" id="get_value-source">
|
589
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
590
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 278</span>
|
590
591
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">element</span>)
|
591
592
|
<span class="ruby-keyword">if</span> [<span class="ruby-string">'input'</span>,<span class="ruby-string">'select'</span>,<span class="ruby-string">'textarea'</span>].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">tag_name</span>.<span class="ruby-identifier">downcase</span>
|
592
593
|
<span class="ruby-identifier">element</span>.<span class="ruby-identifier">attribute</span>(<span class="ruby-string">'value'</span>)
|
@@ -629,7 +630,7 @@ the inner text or the value of the <code>value</code> attribute.</p>
|
|
629
630
|
|
630
631
|
|
631
632
|
<div class="method-source-code" id="reset_driver-source">
|
632
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
633
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 203</span>
|
633
634
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">reset_driver</span>
|
634
635
|
<span class="ruby-ivar">@driver</span>.<span class="ruby-identifier">quit</span>
|
635
636
|
<span class="ruby-identifier">_load_driver</span>
|
@@ -678,7 +679,7 @@ href="Context.html#method-i-stop">stop</a>).</p>
|
|
678
679
|
|
679
680
|
|
680
681
|
<div class="method-source-code" id="start-source">
|
681
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
682
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 179</span>
|
682
683
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">start</span>(<span class="ruby-identifier">actions</span> = [])
|
683
684
|
<span class="ruby-identifier">_load_driver</span>
|
684
685
|
<span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">actions</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
@@ -743,7 +744,7 @@ href="Context.html#method-i-stop">stop</a> pattern.</p>
|
|
743
744
|
|
744
745
|
|
745
746
|
<div class="method-source-code" id="stop-source">
|
746
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
747
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 223</span>
|
747
748
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">stop</span>
|
748
749
|
<span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">wait</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:wait</span>]
|
749
750
|
<span class="ruby-ivar">@driver</span>.<span class="ruby-identifier">quit</span>
|
@@ -809,7 +810,7 @@ logger type.</p>
|
|
809
810
|
|
810
811
|
|
811
812
|
<div class="method-source-code" id="load_logger-source">
|
812
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
813
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 416</span>
|
813
814
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">load_logger</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>)
|
814
815
|
<span class="ruby-identifier">log_name</span> = (<span class="ruby-identifier">name</span> <span class="ruby-operator">||</span> <span class="ruby-string">'null'</span>).<span class="ruby-identifier">downcase</span>
|
815
816
|
|
@@ -851,7 +852,7 @@ logger type.</p>
|
|
851
852
|
|
852
853
|
|
853
854
|
<div class="method-source-code" id="parse_action_default-source">
|
854
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
855
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 438</span>
|
855
856
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parse_action_default</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span> = <span class="ruby-string">'<unknown>'</span>, <span class="ruby-identifier">line</span> = <span class="ruby-value">0</span>)
|
856
857
|
<span class="ruby-identifier">data</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">' '</span>, <span class="ruby-value">2</span>)
|
857
858
|
<span class="ruby-keyword">begin</span>
|
@@ -919,7 +920,7 @@ logger type.</p>
|
|
919
920
|
|
920
921
|
|
921
922
|
<div class="method-source-code" id="wait-source">
|
922
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
923
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 409</span>
|
923
924
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">wait</span>
|
924
925
|
<span class="ruby-constant">Readline</span>.<span class="ruby-identifier">readline</span>(<span class="ruby-string">"Press ENTER to continue\n"</span>)
|
925
926
|
<span class="ruby-keyword">end</span></pre>
|
@@ -961,7 +962,7 @@ with the arguments specified in <code>args</code>.</p>
|
|
961
962
|
|
962
963
|
|
963
964
|
<div class="method-source-code" id="add_alias-source">
|
964
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
965
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 432</span>
|
965
966
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_alias</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
|
966
967
|
<span class="ruby-ivar">@aliases</span>[<span class="ruby-identifier">name</span>] = { <span class="ruby-value">:action</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">action</span>, <span class="ruby-value">:args</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">args</span> }
|
967
968
|
<span class="ruby-keyword">end</span></pre>
|
@@ -979,7 +980,7 @@ with the arguments specified in <code>args</code>.</p>
|
|
979
980
|
|
980
981
|
<div class="method-heading">
|
981
982
|
<span class="method-name">exec_action</span><span
|
982
|
-
class="method-args">(text
|
983
|
+
class="method-args">(text)</span>
|
983
984
|
|
984
985
|
<span class="method-click-advice">click to toggle source</span>
|
985
986
|
|
@@ -1004,10 +1005,10 @@ behavior).</p>
|
|
1004
1005
|
|
1005
1006
|
|
1006
1007
|
<div class="method-source-code" id="exec_action-source">
|
1007
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1008
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_action</span>(<span class="ruby-identifier">text</span
|
1009
|
-
<span class="ruby-identifier">data</span> = <span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">parse_action_default</span>(<span class="ruby-identifier">text</span>, <span class="ruby-
|
1010
|
-
<span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-identifier">data</span>[<span class="ruby-value">:action</span>], <span class="ruby-identifier">data</span>[<span class="ruby-value">:args</span>], <span class="ruby-
|
1008
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 299</span>
|
1009
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_action</span>(<span class="ruby-identifier">text</span>)
|
1010
|
+
<span class="ruby-identifier">data</span> = <span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">parse_action_default</span>(<span class="ruby-identifier">text</span>, <span class="ruby-string">'<unknown>'</span>, <span class="ruby-value">0</span>)
|
1011
|
+
<span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-identifier">data</span>[<span class="ruby-value">:action</span>], <span class="ruby-identifier">data</span>[<span class="ruby-value">:args</span>], <span class="ruby-keyword">true</span>, <span class="ruby-identifier">text</span>)
|
1011
1012
|
<span class="ruby-keyword">end</span></pre>
|
1012
1013
|
</div>
|
1013
1014
|
|
@@ -1052,13 +1053,8 @@ ret.call if ret.respond_to? :call</pre>
|
|
1052
1053
|
|
1053
1054
|
|
1054
1055
|
<div class="method-source-code" id="exec_action_object-source">
|
1055
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1056
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 518</span>
|
1056
1057
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_action_object</span>(<span class="ruby-identifier">action</span>)
|
1057
|
-
<span class="ruby-comment"># Inject built-in variables</span>
|
1058
|
-
<span class="ruby-identifier">file</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">file</span>
|
1059
|
-
<span class="ruby-identifier">dir</span> = (<span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-identifier">file</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">file</span>) <span class="ruby-operator">:</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">pwd</span>
|
1060
|
-
<span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__FILE__'</span>] = <span class="ruby-identifier">file</span>
|
1061
|
-
<span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__DIR__'</span>] = <span class="ruby-constant">File</span>.<span class="ruby-identifier">absolute_path</span>(<span class="ruby-identifier">dir</span>)
|
1062
1058
|
<span class="ruby-identifier">action</span>.<span class="ruby-identifier">execute</span>
|
1063
1059
|
<span class="ruby-keyword">end</span></pre>
|
1064
1060
|
</div>
|
@@ -1096,11 +1092,22 @@ ret.call if ret.respond_to? :call</pre>
|
|
1096
1092
|
|
1097
1093
|
|
1098
1094
|
<div class="method-source-code" id="exec_file-source">
|
1099
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1095
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 310</span>
|
1100
1096
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_file</span>(<span class="ruby-identifier">file</span>)
|
1097
|
+
<span class="ruby-identifier">current_dir</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__DIR__'</span> ]
|
1098
|
+
<span class="ruby-identifier">current_file</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__FILE__'</span>]
|
1099
|
+
<span class="ruby-identifier">current_line</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__LINE__'</span>]
|
1100
|
+
|
1101
1101
|
<span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">file</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
|
1102
|
-
<span class="ruby-
|
1102
|
+
<span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__DIR__'</span>] = <span class="ruby-constant">File</span>.<span class="ruby-identifier">absolute_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">file</span>))
|
1103
|
+
<span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__FILE__'</span>] = <span class="ruby-identifier">file</span>
|
1104
|
+
<span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__LINE__'</span>] = <span class="ruby-identifier">line</span>
|
1105
|
+
<span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-keyword">true</span>, <span class="ruby-identifier">text</span>)
|
1103
1106
|
<span class="ruby-keyword">end</span>
|
1107
|
+
|
1108
|
+
<span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__DIR__'</span> ] = <span class="ruby-identifier">current_dir</span>
|
1109
|
+
<span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__FILE__'</span>] = <span class="ruby-identifier">current_file</span>
|
1110
|
+
<span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__LINE__'</span>] = <span class="ruby-identifier">current_line</span>
|
1104
1111
|
<span class="ruby-keyword">end</span></pre>
|
1105
1112
|
</div>
|
1106
1113
|
|
@@ -1116,7 +1123,7 @@ ret.call if ret.respond_to? :call</pre>
|
|
1116
1123
|
|
1117
1124
|
<div class="method-heading">
|
1118
1125
|
<span class="method-name">exec_parsed_action</span><span
|
1119
|
-
class="method-args">(action, args, log = true, text = nil
|
1126
|
+
class="method-args">(action, args, log = true, text = nil)</span>
|
1120
1127
|
|
1121
1128
|
<span class="method-click-advice">click to toggle source</span>
|
1122
1129
|
|
@@ -1146,9 +1153,9 @@ preferred.</p>
|
|
1146
1153
|
|
1147
1154
|
|
1148
1155
|
<div class="method-source-code" id="exec_parsed_action-source">
|
1149
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1150
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">log</span> = <span class="ruby-keyword">true</span>, <span class="ruby-identifier">text</span> = <span class="ruby-keyword">nil</span
|
1151
|
-
<span class="ruby-identifier">action</span> =
|
1156
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 340</span>
|
1157
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">log</span> = <span class="ruby-keyword">true</span>, <span class="ruby-identifier">text</span> = <span class="ruby-keyword">nil</span>)
|
1158
|
+
<span class="ruby-identifier">action</span> = <span class="ruby-identifier">get_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span>)
|
1152
1159
|
<span class="ruby-identifier">ret</span> = <span class="ruby-keyword">nil</span>
|
1153
1160
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">log</span>
|
1154
1161
|
<span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">log_cmd</span>(<span class="ruby-identifier">action</span>) <span class="ruby-keyword">do</span>
|
@@ -1175,7 +1182,7 @@ preferred.</p>
|
|
1175
1182
|
|
1176
1183
|
<div class="method-heading">
|
1177
1184
|
<span class="method-name">get_action</span><span
|
1178
|
-
class="method-args">(action, args, text = nil
|
1185
|
+
class="method-args">(action, args, text = nil)</span>
|
1179
1186
|
|
1180
1187
|
<span class="method-click-advice">click to toggle source</span>
|
1181
1188
|
|
@@ -1197,8 +1204,8 @@ preferred.</p>
|
|
1197
1204
|
|
1198
1205
|
|
1199
1206
|
<div class="method-source-code" id="get_action-source">
|
1200
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1201
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span> = <span class="ruby-keyword">nil</span
|
1207
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 478</span>
|
1208
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span> = <span class="ruby-keyword">nil</span>)
|
1202
1209
|
<span class="ruby-keyword">while</span> (<span class="ruby-identifier">alias_action</span> = <span class="ruby-ivar">@aliases</span>[<span class="ruby-identifier">action</span>])
|
1203
1210
|
<span class="ruby-identifier">action</span> = <span class="ruby-identifier">alias_action</span>[<span class="ruby-value">:action</span>]
|
1204
1211
|
<span class="ruby-identifier">args</span> = <span class="ruby-identifier">alias_action</span>[<span class="ruby-value">:args</span>].<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
@@ -1219,8 +1226,8 @@ preferred.</p>
|
|
1219
1226
|
<span class="ruby-keyword">end</span>
|
1220
1227
|
|
1221
1228
|
<span class="ruby-identifier">text</span> = ([<span class="ruby-identifier">action</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-string">'"'</span><span class="ruby-operator">+</span><span class="ruby-identifier">a</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'"'</span>, <span class="ruby-string">'""'</span>)<span class="ruby-operator">+</span><span class="ruby-string">'"'</span> }).<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">text</span>
|
1222
|
-
<span class="ruby-identifier">file</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__FILE__'</span>]
|
1223
|
-
<span class="ruby-identifier">line</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__LINE__'</span>]
|
1229
|
+
<span class="ruby-identifier">file</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__FILE__'</span>]
|
1230
|
+
<span class="ruby-identifier">line</span> = <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__LINE__'</span>]
|
1224
1231
|
|
1225
1232
|
<span class="ruby-constant">Action</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">text</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>)
|
1226
1233
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1238,7 +1245,7 @@ preferred.</p>
|
|
1238
1245
|
|
1239
1246
|
<div class="method-heading">
|
1240
1247
|
<span class="method-name">print_error</span><span
|
1241
|
-
class="method-args">(e)</span>
|
1248
|
+
class="method-args">(e, capture = true)</span>
|
1242
1249
|
|
1243
1250
|
<span class="method-click-advice">click to toggle source</span>
|
1244
1251
|
|
@@ -1264,8 +1271,8 @@ handling the verbose option.</p>
|
|
1264
1271
|
|
1265
1272
|
|
1266
1273
|
<div class="method-source-code" id="print_error-source">
|
1267
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1268
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_error</span>(<span class="ruby-identifier">e</span>)
|
1274
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 533</span>
|
1275
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">print_error</span>(<span class="ruby-identifier">e</span>, <span class="ruby-identifier">capture</span> = <span class="ruby-keyword">true</span>)
|
1269
1276
|
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@logger</span>
|
1270
1277
|
<span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">log</span> <span class="ruby-node">"#{e.message}\n"</span>, <span class="ruby-value">:error</span>
|
1271
1278
|
<span class="ruby-keyword">else</span>
|
@@ -1275,6 +1282,11 @@ handling the verbose option.</p>
|
|
1275
1282
|
<span class="ruby-identifier">p</span> <span class="ruby-identifier">e</span>
|
1276
1283
|
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>
|
1277
1284
|
<span class="ruby-keyword">end</span>
|
1285
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">capture</span> <span class="ruby-keyword">and</span> <span class="ruby-ivar">@options</span>[<span class="ruby-value">:capture</span>]
|
1286
|
+
<span class="ruby-identifier">with_vars</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">variables</span>) <span class="ruby-keyword">do</span>
|
1287
|
+
<span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-string">'capture'</span>, [] , <span class="ruby-keyword">false</span>)
|
1288
|
+
<span class="ruby-keyword">end</span>
|
1289
|
+
<span class="ruby-keyword">end</span>
|
1278
1290
|
<span class="ruby-keyword">end</span></pre>
|
1279
1291
|
</div>
|
1280
1292
|
|
@@ -1318,7 +1330,7 @@ available <a href="Selector.html">Selector</a> strategies).</p>
|
|
1318
1330
|
|
1319
1331
|
|
1320
1332
|
<div class="method-source-code" id="with_driver_timeout-source">
|
1321
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1333
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 394</span>
|
1322
1334
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">with_driver_timeout</span>(<span class="ruby-identifier">timeout</span>)
|
1323
1335
|
<span class="ruby-identifier">current</span> = <span class="ruby-ivar">@driver_timeout</span>
|
1324
1336
|
<span class="ruby-ivar">@driver</span>.<span class="ruby-identifier">manage</span>.<span class="ruby-identifier">timeouts</span>.<span class="ruby-identifier">implicit_wait</span> = <span class="ruby-identifier">timeout</span>
|
@@ -1367,7 +1379,7 @@ to execute the block itself.</p>
|
|
1367
1379
|
|
1368
1380
|
|
1369
1381
|
<div class="method-source-code" id="with_timeout-source">
|
1370
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1382
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 366</span>
|
1371
1383
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">with_timeout</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">error_types</span>)
|
1372
1384
|
<span class="ruby-identifier">stime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>
|
1373
1385
|
<span class="ruby-identifier">timeout</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">stime</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@variables</span>[<span class="ruby-string">'__TIMEOUT__'</span>]
|
@@ -1448,7 +1460,7 @@ to execute the block itself.</p>
|
|
1448
1460
|
|
1449
1461
|
|
1450
1462
|
<div class="method-source-code" id="action_args-source">
|
1451
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1463
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 570</span>
|
1452
1464
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">action_args</span>(<span class="ruby-identifier">action</span>)
|
1453
1465
|
<span class="ruby-identifier">action</span> <span class="ruby-operator">+=</span> <span class="ruby-string">'_action'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">_action_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">action</span>
|
1454
1466
|
<span class="ruby-constant">Action</span>.<span class="ruby-identifier">public_instance_method</span>(<span class="ruby-identifier">action</span>).<span class="ruby-identifier">parameters</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">att</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span> }
|
@@ -1488,7 +1500,7 @@ to execute the block itself.</p>
|
|
1488
1500
|
|
1489
1501
|
|
1490
1502
|
<div class="method-source-code" id="actions-source">
|
1491
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1503
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 560</span>
|
1492
1504
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">actions</span>
|
1493
1505
|
<span class="ruby-identifier">_action_methods</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/_action$/</span>, <span class="ruby-string">''</span>) }
|
1494
1506
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1527,7 +1539,7 @@ to execute the block itself.</p>
|
|
1527
1539
|
|
1528
1540
|
|
1529
1541
|
<div class="method-source-code" id="loggers-source">
|
1530
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1542
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 599</span>
|
1531
1543
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">loggers</span>
|
1532
1544
|
<span class="ruby-constant">Loggers</span>.<span class="ruby-identifier">constants</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/logger$/</span>, <span class="ruby-string">''</span>) }
|
1533
1545
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1569,7 +1581,7 @@ to execute the block itself.</p>
|
|
1569
1581
|
|
1570
1582
|
|
1571
1583
|
<div class="method-source-code" id="max_action_name_size-source">
|
1572
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1584
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 623</span>
|
1573
1585
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">max_action_name_size</span>
|
1574
1586
|
<span class="ruby-identifier">actions</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span>,<span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-identifier">s</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">s</span> }
|
1575
1587
|
<span class="ruby-keyword">end</span></pre>
|
@@ -1608,7 +1620,7 @@ to execute the block itself.</p>
|
|
1608
1620
|
|
1609
1621
|
|
1610
1622
|
<div class="method-source-code" id="parsers-source">
|
1611
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1623
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 609</span>
|
1612
1624
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parsers</span>
|
1613
1625
|
(<span class="ruby-constant">Parser</span>.<span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">false</span>) <span class="ruby-operator">-</span> <span class="ruby-constant">ParserModule</span>.<span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">false</span>))
|
1614
1626
|
.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">to_s</span> }
|
@@ -1652,7 +1664,7 @@ custom selectors are returned.</p>
|
|
1652
1664
|
|
1653
1665
|
|
1654
1666
|
<div class="method-source-code" id="selectors-source">
|
1655
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1667
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 585</span>
|
1656
1668
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">selectors</span>(<span class="ruby-identifier">include_standard_selectors</span> = <span class="ruby-keyword">true</span>)
|
1657
1669
|
<span class="ruby-identifier">ret</span> = <span class="ruby-constant">Selector</span>.<span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">false</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/_selector$/</span>, <span class="ruby-string">''</span>) }
|
1658
1670
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">include_standard_selectors</span>
|
@@ -1734,7 +1746,7 @@ with the corresponding variable value.</p>
|
|
1734
1746
|
|
1735
1747
|
|
1736
1748
|
<div class="method-source-code" id="expand-source">
|
1737
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1749
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 644</span>
|
1738
1750
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">expand</span>(<span class="ruby-identifier">s</span>)
|
1739
1751
|
<span class="ruby-identifier">result</span> = <span class="ruby-ivar">@variables</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-identifier">s</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span>,<span class="ruby-identifier">kv</span><span class="ruby-operator">|</span>
|
1740
1752
|
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\$\{#{kv[0]}\}/</span>, <span class="ruby-identifier">kv</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_s</span>)
|
@@ -1787,11 +1799,17 @@ variables is restored.</p>
|
|
1787
1799
|
|
1788
1800
|
|
1789
1801
|
<div class="method-source-code" id="with_vars-source">
|
1790
|
-
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line
|
1802
|
+
<pre><span class="ruby-comment"># File lib/bauxite/core/context.rb, line 667</span>
|
1791
1803
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">with_vars</span>(<span class="ruby-identifier">vars</span>)
|
1792
1804
|
<span class="ruby-identifier">current</span> = <span class="ruby-ivar">@variables</span>
|
1793
1805
|
<span class="ruby-ivar">@variables</span> = <span class="ruby-ivar">@variables</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">vars</span>)
|
1794
1806
|
<span class="ruby-keyword">yield</span>
|
1807
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
1808
|
+
<span class="ruby-identifier">e</span>.<span class="ruby-identifier">instance_variable_set</span> <span class="ruby-string">"@variables"</span>, <span class="ruby-ivar">@variables</span>
|
1809
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">variables</span>
|
1810
|
+
<span class="ruby-ivar">@variables</span>
|
1811
|
+
<span class="ruby-keyword">end</span>
|
1812
|
+
<span class="ruby-identifier">raise</span>
|
1795
1813
|
<span class="ruby-keyword">ensure</span>
|
1796
1814
|
<span class="ruby-ivar">@variables</span> = <span class="ruby-identifier">current</span>
|
1797
1815
|
<span class="ruby-keyword">end</span></pre>
|
data/doc/created.rid
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Tue, 04 Feb 2014
|
1
|
+
Tue, 04 Feb 2014 14:34:25 -0300
|
2
2
|
README.md Fri, 31 Jan 2014 09:09:21 -0300
|
3
3
|
lib/bauxite/actions/js.rb Mon, 27 Jan 2014 11:02:44 -0300
|
4
4
|
lib/bauxite/actions/exec.rb Mon, 27 Jan 2014 11:02:44 -0300
|
@@ -9,12 +9,12 @@ lib/bauxite/actions/store.rb Mon, 27 Jan 2014 11:02:44 -0300
|
|
9
9
|
lib/bauxite/actions/assertv.rb Mon, 27 Jan 2014 11:02:44 -0300
|
10
10
|
lib/bauxite/actions/alias.rb Mon, 27 Jan 2014 11:02:44 -0300
|
11
11
|
lib/bauxite/actions/tryload.rb Mon, 27 Jan 2014 11:02:44 -0300
|
12
|
-
lib/bauxite/actions/test.rb Tue, 04 Feb 2014
|
12
|
+
lib/bauxite/actions/test.rb Tue, 04 Feb 2014 13:02:27 -0300
|
13
13
|
lib/bauxite/actions/load.rb Mon, 27 Jan 2014 11:02:44 -0300
|
14
14
|
lib/bauxite/actions/submit.rb Tue, 28 Jan 2014 16:05:51 -0300
|
15
15
|
lib/bauxite/actions/open.rb Wed, 29 Jan 2014 09:10:40 -0300
|
16
16
|
lib/bauxite/actions/reset.rb Mon, 27 Jan 2014 11:02:44 -0300
|
17
|
-
lib/bauxite/actions/capture.rb Tue, 04 Feb 2014
|
17
|
+
lib/bauxite/actions/capture.rb Tue, 04 Feb 2014 14:25:00 -0300
|
18
18
|
lib/bauxite/actions/write.rb Mon, 27 Jan 2014 11:02:44 -0300
|
19
19
|
lib/bauxite/actions/failif.rb Tue, 04 Feb 2014 11:03:59 -0300
|
20
20
|
lib/bauxite/actions/setif.rb Tue, 04 Feb 2014 11:05:42 -0300
|
@@ -23,7 +23,7 @@ lib/bauxite/actions/select.rb Tue, 28 Jan 2014 16:04:12 -0300
|
|
23
23
|
lib/bauxite/actions/echo.rb Mon, 27 Jan 2014 11:02:44 -0300
|
24
24
|
lib/bauxite/actions/set.rb Mon, 27 Jan 2014 11:02:44 -0300
|
25
25
|
lib/bauxite/actions/params.rb Mon, 27 Jan 2014 11:02:44 -0300
|
26
|
-
lib/bauxite/actions/debug.rb Tue, 04 Feb 2014
|
26
|
+
lib/bauxite/actions/debug.rb Tue, 04 Feb 2014 14:06:05 -0300
|
27
27
|
lib/bauxite/actions/return.rb Mon, 27 Jan 2014 11:02:44 -0300
|
28
28
|
lib/bauxite/actions/click.rb Mon, 27 Jan 2014 11:02:44 -0300
|
29
29
|
lib/bauxite/actions/doif.rb Mon, 03 Feb 2014 11:48:07 -0300
|
@@ -31,9 +31,9 @@ lib/bauxite/actions/source.rb Mon, 27 Jan 2014 11:02:44 -0300
|
|
31
31
|
lib/bauxite/actions/break.rb Mon, 27 Jan 2014 11:02:44 -0300
|
32
32
|
lib/bauxite/core/selector.rb Wed, 29 Jan 2014 09:10:40 -0300
|
33
33
|
lib/bauxite/core/errors.rb Mon, 27 Jan 2014 11:02:44 -0300
|
34
|
-
lib/bauxite/core/context.rb Tue, 04 Feb 2014
|
34
|
+
lib/bauxite/core/context.rb Tue, 04 Feb 2014 14:05:47 -0300
|
35
35
|
lib/bauxite/core/parser.rb Tue, 28 Jan 2014 16:48:43 -0300
|
36
|
-
lib/bauxite/core/action.rb Tue,
|
36
|
+
lib/bauxite/core/action.rb Tue, 04 Feb 2014 13:17:22 -0300
|
37
37
|
lib/bauxite/core/logger.rb Wed, 29 Jan 2014 15:46:07 -0300
|
38
38
|
lib/bauxite/parsers/default.rb Mon, 27 Jan 2014 11:02:44 -0300
|
39
39
|
lib/bauxite/parsers/html.rb Mon, 27 Jan 2014 11:02:44 -0300
|
data/doc/js/search_index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var search_data = {"index":{"searchIndex":["bauxite","action","actionmodule","application","context","errors","assertionerror","filenotfounderror","formaterror","loggers","compositelogger","echologger","filelogger","nulllogger","terminallogger","xtermlogger","parser","parsermodule","selector","selectormodule","_block()","_cmd_color()","_fmt()","_fmt()","_restore_cursor()","_restore_cursor()","_save_cursor()","_save_cursor()","_screen_width()","_screen_width()","action_args()","actions()","add_alias()","alias_action()","args()","assert()","assertv()","attr()","break_action()","capture()","click()","csv()","debug()","debug()","debug_prompt()","debug_prompt()","debug_prompt()","default()","doif()","echo()","exec()","exec_action()","exec_action_object()","exec_file()","exec_parsed_action()","execute()","expand()","failif()","find()","find()","frame()","get_action()","get_value()","js()","load()","load_logger()","log()","log()","log()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","loggers()","max_action_name_size()","new()","new()","new()","new()","new()","new()","new()","new()","open()","params()","parse()","parse_action_default()","parsers()","print_error()","progress()","progress()","progress()","replace()","reset()","reset_driver()","return_action()","ruby()","select()","selectors()","selenium_find()","selenium_ide_html()","set()","setif()","sid()","smart()","source()","start()","stop()","store()","submit()","test()","tryload()","wait()","wait()","with_driver_timeout()","with_timeout()","with_vars()","write()","readme"],"longSearchIndex":["bauxite","bauxite::action","bauxite::actionmodule","bauxite::application","bauxite::context","bauxite::errors","bauxite::errors::assertionerror","bauxite::errors::filenotfounderror","bauxite::errors::formaterror","bauxite::loggers","bauxite::loggers::compositelogger","bauxite::loggers::echologger","bauxite::loggers::filelogger","bauxite::loggers::nulllogger","bauxite::loggers::terminallogger","bauxite::loggers::xtermlogger","bauxite::parser","bauxite::parsermodule","bauxite::selector","bauxite::selectormodule","bauxite::loggers::terminallogger#_block()","bauxite::loggers::terminallogger#_cmd_color()","bauxite::loggers::terminallogger#_fmt()","bauxite::loggers::xtermlogger#_fmt()","bauxite::loggers::terminallogger#_restore_cursor()","bauxite::loggers::xtermlogger#_restore_cursor()","bauxite::loggers::terminallogger#_save_cursor()","bauxite::loggers::xtermlogger#_save_cursor()","bauxite::loggers::terminallogger#_screen_width()","bauxite::loggers::xtermlogger#_screen_width()","bauxite::context::action_args()","bauxite::context::actions()","bauxite::context#add_alias()","bauxite::action#alias_action()","bauxite::actionmodule#args()","bauxite::action#assert()","bauxite::action#assertv()","bauxite::selector#attr()","bauxite::action#break_action()","bauxite::action#capture()","bauxite::action#click()","bauxite::parser#csv()","bauxite::action#debug()","bauxite::context#debug()","bauxite::loggers::compositelogger#debug_prompt()","bauxite::loggers::nulllogger#debug_prompt()","bauxite::loggers::terminallogger#debug_prompt()","bauxite::parser#default()","bauxite::action#doif()","bauxite::action#echo()","bauxite::action#exec()","bauxite::context#exec_action()","bauxite::context#exec_action_object()","bauxite::context#exec_file()","bauxite::context#exec_parsed_action()","bauxite::actionmodule#execute()","bauxite::context#expand()","bauxite::action#failif()","bauxite::context#find()","bauxite::selectormodule#find()","bauxite::selector#frame()","bauxite::context#get_action()","bauxite::context#get_value()","bauxite::action#js()","bauxite::action#load()","bauxite::context::load_logger()","bauxite::loggers::compositelogger#log()","bauxite::loggers::nulllogger#log()","bauxite::loggers::terminallogger#log()","bauxite::loggers::compositelogger#log_cmd()","bauxite::loggers::echologger#log_cmd()","bauxite::loggers::filelogger#log_cmd()","bauxite::loggers::nulllogger#log_cmd()","bauxite::loggers::terminallogger#log_cmd()","bauxite::context::loggers()","bauxite::context::max_action_name_size()","bauxite::actionmodule::new()","bauxite::context::new()","bauxite::loggers::compositelogger::new()","bauxite::loggers::filelogger::new()","bauxite::loggers::nulllogger::new()","bauxite::loggers::terminallogger::new()","bauxite::parsermodule::new()","bauxite::selectormodule::new()","bauxite::action#open()","bauxite::action#params()","bauxite::parsermodule#parse()","bauxite::context::parse_action_default()","bauxite::context::parsers()","bauxite::context#print_error()","bauxite::loggers::compositelogger#progress()","bauxite::loggers::nulllogger#progress()","bauxite::loggers::terminallogger#progress()","bauxite::action#replace()","bauxite::action#reset()","bauxite::context#reset_driver()","bauxite::action#return_action()","bauxite::action#ruby()","bauxite::action#select()","bauxite::context::selectors()","bauxite::selectormodule#selenium_find()","bauxite::parser#selenium_ide_html()","bauxite::action#set()","bauxite::action#setif()","bauxite::selector#sid()","bauxite::selector#smart()","bauxite::action#source()","bauxite::context#start()","bauxite::context#stop()","bauxite::action#store()","bauxite::action#submit()","bauxite::action#test()","bauxite::action#tryload()","bauxite::action#wait()","bauxite::context::wait()","bauxite::context#with_driver_timeout()","bauxite::context#with_timeout()","bauxite::context#with_vars()","bauxite::action#write()",""],"info":[["Bauxite","","Bauxite.html","","<p>Bauxite Namespace\n"],["Bauxite::Action","","Bauxite/Action.html","","<p>Test action class.\n<p>Test actions are basic test operations that can be combined to create a\ntest case. …\n"],["Bauxite::ActionModule","","Bauxite/ActionModule.html","","<p>Action common state and behavior.\n"],["Bauxite::Application","","Bauxite/Application.html","","<p><code>bauxite</code> command-line program.\n<p>This program executes Bauxite tests and outputs the execution progress and\n…\n"],["Bauxite::Context","","Bauxite/Context.html","","<p>The Main test context. This class includes state and helper functions used\nby clients execute tests and …\n"],["Bauxite::Errors","","Bauxite/Errors.html","","<p>Errors Module\n"],["Bauxite::Errors::AssertionError","","Bauxite/Errors/AssertionError.html","","<p>Error raised when an assertion fails.\n"],["Bauxite::Errors::FileNotFoundError","","Bauxite/Errors/FileNotFoundError.html","","<p>Error raised when an invalid file tried to be loaded.\n"],["Bauxite::Errors::FormatError","","Bauxite/Errors/FormatError.html","","<p>Error raised when trying to process an invalid file format.\n"],["Bauxite::Loggers","","Bauxite/Loggers.html","","<p>Test loggers module\n<p>The default Logger class and all custom loggers must be included in this\nmodule.\n"],["Bauxite::Loggers::CompositeLogger","","Bauxite/Loggers/CompositeLogger.html","","<p>Composite logger.\n<p>This composite logger forwards logging calls to each of its children.\n<p>Set the <code>:loggers</code> …\n"],["Bauxite::Loggers::EchoLogger","","Bauxite/Loggers/EchoLogger.html","","<p>Echo logger.\n<p>This logger outputs the raw action text for every action executed.\n<p>Note that this logger does …\n"],["Bauxite::Loggers::FileLogger","","Bauxite/Loggers/FileLogger.html","","<p>File logger.\n<p>This logger outputs the raw action text for every action executed to the\nfile specified in …\n"],["Bauxite::Loggers::NullLogger","","Bauxite/Loggers/NullLogger.html","","<p>Test logger class.\n<p>Test loggers handle test output format.\n<p>The default logger does not provide any output …\n"],["Bauxite::Loggers::TerminalLogger","","Bauxite/Loggers/TerminalLogger.html","","<p>Terminal logger.\n<p>This logger outputs text using basic text formatting for a terminal window.\n"],["Bauxite::Loggers::XtermLogger","","Bauxite/Loggers/XtermLogger.html","","<p>XTerm logger.\n<p>This logger outputs colorized lines using xterm (VT100/2) escape sequences.\n"],["Bauxite::Parser","","Bauxite/Parser.html","","<p>Parser class.\n<p>Parser represent different strategies for reading input files into lists of\nBauxite actions. …\n"],["Bauxite::ParserModule","","Bauxite/ParserModule.html","","<p>Parser common state and behavior.\n"],["Bauxite::Selector","","Bauxite/Selector.html","","<p>Selector class.\n<p>Selectors represent different strategies for finding elements. Selenium\nprovides a list …\n"],["Bauxite::SelectorModule","","Bauxite/SelectorModule.html","","<p>Selector common state and behavior.\n"],["_block","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_block","(color, text, size)","<p>Prints <code>text</code> centered inside a square-bracketed block.\n"],["_cmd_color","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_cmd_color","(cmd)","<p>Get the color of <code>cmd</code>.\n"],["_fmt","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_fmt","(color, text, size = 0)","<p>Centers <code>text</code> to a fixed size with.\n"],["_fmt","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_fmt","(color, text, size = 0)",""],["_restore_cursor","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_restore_cursor","()","<p>Restores the cursor to the previously saved cursor position.\n"],["_restore_cursor","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_restore_cursor","()",""],["_save_cursor","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_save_cursor","()","<p>Save the current cursor position,\n"],["_save_cursor","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_save_cursor","()",""],["_screen_width","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_screen_width","()","<p>Returns the terminal screen width.\n"],["_screen_width","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_screen_width","()",""],["action_args","Bauxite::Context","Bauxite/Context.html#method-c-action_args","(action)","<p>Returns an array with the names of the arguments of the specified action.\n<p>For example:\n\n<pre>Context::action_args ...</pre>\n"],["actions","Bauxite::Context","Bauxite/Context.html#method-c-actions","()","<p>Returns an array with the names of every action available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">actions</span>\n<span class=\"ruby-comment\"># => [ "assert", ...</span>\n</pre>\n"],["add_alias","Bauxite::Context","Bauxite/Context.html#method-i-add_alias","(name, action, args)","<p>Adds an alias named <code>name</code> to the specified <code>action</code>\nwith the arguments specified in <code>args</code>.\n"],["alias_action","Bauxite::Action","Bauxite/Action.html#method-i-alias_action","(name, action, *args)","<p>Aliases <code>name</code> to <code>action</code> with additional arguments.\n<p>In <code>args</code> the variables <code>${1}</code>..<code>${n}</code>\nwill be expanded to …\n"],["args","Bauxite::ActionModule","Bauxite/ActionModule.html#method-i-args","(quote = false)","<p>Returns the action arguments after applying variable expansion.\n<p>See Context#expand.\n<p>If <code>quote</code> is <code>true</code>, the …\n"],["assert","Bauxite::Action","Bauxite/Action.html#method-i-assert","(selector, text)","<p>Asserts that the value of the selected element matches <code>text</code>.\n<p><code>text</code> is a regular expression. <code>text</code> can be …\n"],["assertv","Bauxite::Action","Bauxite/Action.html#method-i-assertv","(expected, actual)","<p>Asserts that the <code>actual</code> text matches the <code>expected</code>\ntext.\n<p><code>expected</code> can be a regular expression. See #assert …\n"],["attr","Bauxite::Selector","Bauxite/Selector.html#method-i-attr","(arg, &block)","<p>Select an element by attribute value.\n<p>The attribute selector syntax is:\n\n<pre>attr=name:value</pre>\n"],["break_action","Bauxite::Action","Bauxite/Action.html#method-i-break_action","()","<p>Prompts the user to press ENTER before resuming execution.\n<p>Note that this method provides an action named …\n"],["capture","Bauxite::Action","Bauxite/Action.html#method-i-capture","(file = nil)","<p>Captures a screenshot of the current browser window and saves it with\nspecified <code>file</code> name. If <code>file</code> is …\n"],["click","Bauxite::Action","Bauxite/Action.html#method-i-click","(selector)","<p>Triggers the <code>click</code> event on the selected element.\n<p>For example:\n\n<pre># assuming <button type="button" id="btn">click ...</pre>\n"],["csv","Bauxite::Parser","Bauxite/Parser.html#method-i-csv","(file)","<p>Load CSV files.\n"],["debug","Bauxite::Action","Bauxite/Action.html#method-i-debug","()","<p>Breaks into the debug console.\n<p>In the debug console you can type action strings and test their result. …\n"],["debug","Bauxite::Context","Bauxite/Context.html#method-i-debug","()","<p>Breaks into the debug console.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">ctx</span>.<span class=\"ruby-identifier\">debug</span>\n<span class=\"ruby-comment\"># => this breaks into the debug console</span>\n</pre>\n"],["debug_prompt","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-debug_prompt","()","<p>Returns a colorized debug prompt.\n<p>This implementation returns the debug_prompt of the first logger.\n"],["debug_prompt","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-debug_prompt","()","<p>Returns the prompt shown by the debug console (see Context#debug).\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug_prompt</span>\n<span class=\"ruby-comment\"># => returns ...</span>\n</pre>\n"],["debug_prompt","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-debug_prompt","()","<p>Returns a colorized debug prompt.\n"],["default","Bauxite::Parser","Bauxite/Parser.html#method-i-default","(file, io = nil)","<p>Load default Bauxite files.\n"],["doif","Bauxite::Action","Bauxite/Action.html#method-i-doif","(expected, actual, action, *args)","<p>Executes <code>action</code> only if <code>expected</code> matches\n<code>actual</code>.\n<p>The conditional check in this action is similar to #assertv …\n"],["echo","Bauxite::Action","Bauxite/Action.html#method-i-echo","(text)","<p>Prints the value of the specified <code>text</code>.\n<p><code>text</code> is subject to variable expansion (see Context#expand).\n<p>For …\n"],["exec","Bauxite::Action","Bauxite/Action.html#method-i-exec","(*command)","<p>Executes <code>command</code>, optionally storing the results in a\nvariable.\n<p>If the first argument of <code>command</code> is <code>name=...</code> …\n"],["exec_action","Bauxite::Context","Bauxite/Context.html#method-i-exec_action","(text, log = true, file = '<unknown>', line = 0)","<p>Executes the specified action string handling errors, logging and debug\nhistory.\n<p>If <code>log</code> is <code>true</code>, log the …\n"],["exec_action_object","Bauxite::Context","Bauxite/Context.html#method-i-exec_action_object","(action)","<p>Executes the specified action object injecting built-in variables. Note\nthat the result returned by this …\n"],["exec_file","Bauxite::Context","Bauxite/Context.html#method-i-exec_file","(file)","<p>Executes the specified <code>file</code>.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">ctx</span>.<span class=\"ruby-identifier\">exec_file</span>(<span class=\"ruby-string\">'file'</span>)\n<span class=\"ruby-comment\"># => executes every action defined in 'file'</span>\n</pre>\n"],["exec_parsed_action","Bauxite::Context","Bauxite/Context.html#method-i-exec_parsed_action","(action, args, log = true, text = nil, file = nil, line = nil)","<p>Executes the specified action handling errors, logging and debug history.\n<p>If <code>log</code> is <code>true</code>, log the action …\n"],["execute","Bauxite::ActionModule","Bauxite/ActionModule.html#method-i-execute","()","<p>Executes the action evaluating the arguments in the current context.\n<p>Note that #execute calls #args to …\n"],["expand","Bauxite::Context","Bauxite/Context.html#method-i-expand","(s)","<p>Recursively replaces occurencies of variable expansions in <code>s</code>\nwith the corresponding variable value.\n<p>The …\n"],["failif","Bauxite::Action","Bauxite/Action.html#method-i-failif","(action, *args)","<p>Executes the specified <code>action</code> expected to fail. If\n<code>action</code> succeeds the #failif action fails. If\n<code>action</code> …\n"],["find","Bauxite::Context","Bauxite/Context.html#method-i-find","(selector)","<p>Finds an element by <code>selector</code>.\n<p>The element found is yielded to the given <code>block</code> (if any) and\nreturned.\n<p>Note …\n"],["find","Bauxite::SelectorModule","Bauxite/SelectorModule.html#method-i-find","(selector, &block)","<p>Searches for elements using the specified selector string.\n<p>For more information see Context#find.\n<p>Selectors …\n"],["frame","Bauxite::Selector","Bauxite/Selector.html#method-i-frame","(arg, &block)","<p>Change the selector scope to the given frame and finds an element in that\nframe.\n<p>This is a composite selector. …\n"],["get_action","Bauxite::Context","Bauxite/Context.html#method-i-get_action","(action, args, text = nil, file = nil, line = nil)","<p>Returns an executable Action object constructed from the specified\narguments resolving action aliases. …\n"],["get_value","Bauxite::Context","Bauxite/Context.html#method-i-get_value","(element)","<p>Returns the value of the specified <code>element</code>.\n<p>This method takes into account the type of element and selectively …\n"],["js","Bauxite::Action","Bauxite/Action.html#method-i-js","(script, name = nil)","<p>Executes the specified Javascript <code>script</code>, optionally storing\nthe results the variable named <code>name</code>.\n<p>Note …\n"],["load","Bauxite::Action","Bauxite/Action.html#method-i-load","(file, *vars)","<p>Load the specified file into an isolated variable context and execute the\nactions specified. If the file …\n"],["load_logger","Bauxite::Context","Bauxite/Context.html#method-c-load_logger","(name, options)","<p>Constructs a Logger instance using <code>name</code> as a hint for the\nlogger type.\n"],["log","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log","(s, type = :info)","<p>Logs the specified string.\n<p><code>type</code>, if specified, should be one of <code>:error</code>,\n<code>:warning</code>, <code>:info</code> (default), <code>:debug</code> …\n"],["log","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log_cmd","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log_cmd","(action, &block)","<p>Pretty prints action information and status.\n<p>This implementation only yileds in the first logger.\n<p>Additional …\n"],["log_cmd","Bauxite::Loggers::EchoLogger","Bauxite/Loggers/EchoLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log_cmd","(action)","<p>Executes the given block in a logging context.\n<p>This default implementation does not provide any logging …\n"],["log_cmd","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log_cmd","(action)","<p>Pretty prints action information and status.\n"],["loggers","Bauxite::Context","Bauxite/Context.html#method-c-loggers","()","<p>Returns an array with the names of every logger available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">loggers</span>\n<span class=\"ruby-comment\"># => [ "null", ...</span>\n</pre>\n"],["max_action_name_size","Bauxite::Context","Bauxite/Context.html#method-c-max_action_name_size","()","<p>Returns the maximum size in characters of an action name.\n<p>This method is useful to pretty print lists …\n"],["new","Bauxite::ActionModule","Bauxite/ActionModule.html#method-c-new","(ctx, cmd, args, text, file, line)","<p>Constructs a new test action instance.\n"],["new","Bauxite::Context","Bauxite/Context.html#method-c-new","(options)","<p>Constructs a new test context instance.\n<p><code>options</code> is a hash with the following values:\n<p>:driver — selenium driver …\n"],["new","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-c-new","(options)","<p>Constructs a new composite logger instance.\n"],["new","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-c-new","(options)","<p>Constructs a new echo logger instance.\n"],["new","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-c-new","(options)","<p>Constructs a new null logger instance.\n"],["new","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-c-new","(options)","<p>Constructs a new Terminal logger instance.\n"],["new","Bauxite::ParserModule","Bauxite/ParserModule.html#method-c-new","(ctx)","<p>Constructs a new test parser instance.\n"],["new","Bauxite::SelectorModule","Bauxite/SelectorModule.html#method-c-new","(ctx, default_selector)","<p>Constructs a new test selector instance.\n"],["open","Bauxite::Action","Bauxite/Action.html#method-i-open","(url)","<p>Opens the specified <code>url</code> in the browser.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">open</span> <span class=\"ruby-string\">"http://www.ruby-lang.org"</span>\n<span class=\"ruby-comment\"># => this would open ...</span>\n</pre>\n"],["params","Bauxite::Action","Bauxite/Action.html#method-i-params","(*vars)","<p>Asserts that the variables named <code>vars</code> are defined and not\nempty.\n<p>For example:\n\n<pre>params host db_name username ...</pre>\n"],["parse","Bauxite::ParserModule","Bauxite/ParserModule.html#method-i-parse","(file)","<p>Parse <code>file</code> and yield the resulting actions.\n"],["parse_action_default","Bauxite::Context","Bauxite/Context.html#method-c-parse_action_default","(text, file = '<unknown>', line = 0)","<p>Default action parsing strategy.\n"],["parsers","Bauxite::Context","Bauxite/Context.html#method-c-parsers","()","<p>Returns an array with the names of every parser available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">parsers</span>\n<span class=\"ruby-comment\"># => [ "default", ...</span>\n</pre>\n"],["print_error","Bauxite::Context","Bauxite/Context.html#method-i-print_error","(e)","<p>Prints the specified <code>error</code> using the Logger configured and \nhandling the verbose option.\n<p>For example: …\n"],["progress","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-progress","(value)","<p>Updates action progress.\n"],["progress","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-progress","(value)","<p>Updates the progress of the current action.\n"],["progress","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-progress","(value)","<p>Updates action progress.\n"],["replace","Bauxite::Action","Bauxite/Action.html#method-i-replace","(text, pattern, replacement, name)","<p>Replaces the occurrences of <code>pattern</code> in <code>text</code> with\n<code>replacement</code> and assigns the result to the variable named …\n"],["reset","Bauxite::Action","Bauxite/Action.html#method-i-reset","()","<p>Resets the test engine by closing and reopening the browser. As a side\neffect of resetting the test engine, …\n"],["reset_driver","Bauxite::Context","Bauxite/Context.html#method-i-reset_driver","()","<p>Stops the test engine and starts a new engine with the same provider.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">ctx</span>.<span class=\"ruby-identifier\">reset_driver</span>\n=<span class=\"ruby-operator\">></span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["return_action","Bauxite::Action","Bauxite/Action.html#method-i-return_action","(*vars)","<p>Returns the specified variables to the parent scope (if any).\n<p>If <code>vars</code> is <code>*</code> every variable defined in the …\n"],["ruby","Bauxite::Action","Bauxite/Action.html#method-i-ruby","(file, *vars)","<p>Load the specified ruby file into an isolated variable context and execute\nthe ruby code.\n<p><code>file</code> can be …\n"],["select","Bauxite::Action","Bauxite/Action.html#method-i-select","(selector, text)","<p>Sets the value of the selected <code>HTMLSelect</code> to\n<code>text</code>.\n<p><code>text</code> can be the <code>value</code> or the <code>text</code> of\nthe target <code>HTMLOption</code> …\n"],["selectors","Bauxite::Context","Bauxite/Context.html#method-c-selectors","(include_standard_selectors = true)","<p>Returns an array with the names of every selector available.\n<p>If <code>include_standard_selectors</code> is <code>true</code> (default …\n"],["selenium_find","Bauxite::SelectorModule","Bauxite/SelectorModule.html#method-i-selenium_find","(type, selector)","<p>Searches for elements using standard Selenium selectors.\n<p>Selectors calling this method should forward …\n"],["selenium_ide_html","Bauxite::Parser","Bauxite/Parser.html#method-i-selenium_ide_html","(file)","<p>Load Selenium IDE HTML files.\n"],["set","Bauxite::Action","Bauxite/Action.html#method-i-set","(name, value)","<p>Sets the variable named <code>name</code> to the <code>value</code>\nspecified.\n<p>Both <code>name</code> and <code>value</code> are subject to variable\nexpansion …\n"],["setif","Bauxite::Action","Bauxite/Action.html#method-i-setif","(name, value, action, *args)","<p>Sets the variable named <code>name</code> to the <code>value</code>\nspecified only if the. <code>action</code> execution succeeds. If the\nexecution …\n"],["sid","Bauxite::Selector","Bauxite/Selector.html#method-i-sid","(arg, &block)","<p>Select an element by id suffix.\n<p>This is the default selector. Any selector strings that do not contain …\n"],["smart","Bauxite::Selector","Bauxite/Selector.html#method-i-smart","(arg, &block)","<p>Select an element by applying different Selector strategies.\n<p>This selector tries to find elements by using …\n"],["source","Bauxite::Action","Bauxite/Action.html#method-i-source","(text)","<p>Asserts that the page source matches <code>text</code>.\n<p><code>text</code> can be a regular expression. See #assert for more\ndetails. …\n"],["start","Bauxite::Context","Bauxite/Context.html#method-i-start","(actions = [])","<p>Starts the test engine and executes the actions specified. If no action was\nspecified, returns without …\n"],["stop","Bauxite::Context","Bauxite/Context.html#method-i-stop","()","<p>Stops the test engine.\n<p>Calling this method at the end of the test is mandatory if #start was\ncalled without …\n"],["store","Bauxite::Action","Bauxite/Action.html#method-i-store","(selector, name)","<p>Sets the variable named <code>name</code> to the value of the selected\nelement.\n<p><code>name</code> is subject to variable expansion …\n"],["submit","Bauxite::Action","Bauxite/Action.html#method-i-submit","(selector)","<p>Submits the form that contains the selected element.\n<p>For example:\n\n<pre># assuming <form><input id="i"/></form> ...</pre>\n"],["test","Bauxite::Action","Bauxite/Action.html#method-i-test","(file, name = nil)","<p>Load <code>file</code> using the #load action into a new test context.\n<p>If <code>name</code> is specified, it will be used as the …\n"],["tryload","Bauxite::Action","Bauxite/Action.html#method-i-tryload","(file, *vars)","<p>Load the specified file into an isolated variable context and execute the\nactions specified. If the file …\n"],["wait","Bauxite::Action","Bauxite/Action.html#method-i-wait","(seconds)","<p>Wait for the specified number of <code>seconds</code>.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">wait</span> <span class=\"ruby-value\">5</span>\n<span class=\"ruby-comment\"># => this would wait for 5 seconds and then ...</span>\n</pre>\n"],["wait","Bauxite::Context","Bauxite/Context.html#method-c-wait","()","<p>Prompts the user to press ENTER before resuming execution.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">wait</span>\n<span class=\"ruby-comment\"># => echoes "Press ...</span>\n</pre>\n"],["with_driver_timeout","Bauxite::Context","Bauxite/Context.html#method-i-with_driver_timeout","(timeout)","<p>Executes the given block using the specified driver <code>timeout</code>.\n<p>Note that the driver <code>timeout</code> is the time …\n"],["with_timeout","Bauxite::Context","Bauxite/Context.html#method-i-with_timeout","(*error_types)","<p>Executes the given block retrying for at most <code>${__TIMEOUT__}</code>\nseconds. Note that this method does not …\n"],["with_vars","Bauxite::Context","Bauxite/Context.html#method-i-with_vars","(vars)","<p>Temporarily alter the value of context variables.\n<p>This method alters the value of the variables specified …\n"],["write","Bauxite::Action","Bauxite/Action.html#method-i-write","(selector, text)","<p>Sets the value of the selected element to <code>text</code>.\n<p><code>text</code> is subject to variable expansion (see Context#expand …\n"],["README","","README_md.html","","<p>bauxite\n<p>Bauxite is a façade over Selenium intended for non-developers\n<p>The idea behind this project was …\n"]]}}
|
1
|
+
var search_data = {"index":{"searchIndex":["bauxite","action","actionmodule","application","context","errors","assertionerror","filenotfounderror","formaterror","loggers","compositelogger","echologger","filelogger","nulllogger","terminallogger","xtermlogger","parser","parsermodule","selector","selectormodule","_block()","_cmd_color()","_fmt()","_fmt()","_restore_cursor()","_restore_cursor()","_save_cursor()","_save_cursor()","_screen_width()","_screen_width()","action_args()","actions()","add_alias()","alias_action()","args()","assert()","assertv()","attr()","break_action()","capture()","click()","csv()","debug()","debug()","debug_prompt()","debug_prompt()","debug_prompt()","default()","doif()","echo()","exec()","exec_action()","exec_action_object()","exec_file()","exec_parsed_action()","execute()","expand()","failif()","find()","find()","frame()","get_action()","get_value()","js()","load()","load_logger()","log()","log()","log()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","loggers()","max_action_name_size()","new()","new()","new()","new()","new()","new()","new()","new()","open()","params()","parse()","parse_action_default()","parsers()","print_error()","progress()","progress()","progress()","replace()","reset()","reset_driver()","return_action()","ruby()","select()","selectors()","selenium_find()","selenium_ide_html()","set()","setif()","sid()","smart()","source()","start()","stop()","store()","submit()","test()","tryload()","wait()","wait()","with_driver_timeout()","with_timeout()","with_vars()","write()","readme"],"longSearchIndex":["bauxite","bauxite::action","bauxite::actionmodule","bauxite::application","bauxite::context","bauxite::errors","bauxite::errors::assertionerror","bauxite::errors::filenotfounderror","bauxite::errors::formaterror","bauxite::loggers","bauxite::loggers::compositelogger","bauxite::loggers::echologger","bauxite::loggers::filelogger","bauxite::loggers::nulllogger","bauxite::loggers::terminallogger","bauxite::loggers::xtermlogger","bauxite::parser","bauxite::parsermodule","bauxite::selector","bauxite::selectormodule","bauxite::loggers::terminallogger#_block()","bauxite::loggers::terminallogger#_cmd_color()","bauxite::loggers::terminallogger#_fmt()","bauxite::loggers::xtermlogger#_fmt()","bauxite::loggers::terminallogger#_restore_cursor()","bauxite::loggers::xtermlogger#_restore_cursor()","bauxite::loggers::terminallogger#_save_cursor()","bauxite::loggers::xtermlogger#_save_cursor()","bauxite::loggers::terminallogger#_screen_width()","bauxite::loggers::xtermlogger#_screen_width()","bauxite::context::action_args()","bauxite::context::actions()","bauxite::context#add_alias()","bauxite::action#alias_action()","bauxite::actionmodule#args()","bauxite::action#assert()","bauxite::action#assertv()","bauxite::selector#attr()","bauxite::action#break_action()","bauxite::action#capture()","bauxite::action#click()","bauxite::parser#csv()","bauxite::action#debug()","bauxite::context#debug()","bauxite::loggers::compositelogger#debug_prompt()","bauxite::loggers::nulllogger#debug_prompt()","bauxite::loggers::terminallogger#debug_prompt()","bauxite::parser#default()","bauxite::action#doif()","bauxite::action#echo()","bauxite::action#exec()","bauxite::context#exec_action()","bauxite::context#exec_action_object()","bauxite::context#exec_file()","bauxite::context#exec_parsed_action()","bauxite::actionmodule#execute()","bauxite::context#expand()","bauxite::action#failif()","bauxite::context#find()","bauxite::selectormodule#find()","bauxite::selector#frame()","bauxite::context#get_action()","bauxite::context#get_value()","bauxite::action#js()","bauxite::action#load()","bauxite::context::load_logger()","bauxite::loggers::compositelogger#log()","bauxite::loggers::nulllogger#log()","bauxite::loggers::terminallogger#log()","bauxite::loggers::compositelogger#log_cmd()","bauxite::loggers::echologger#log_cmd()","bauxite::loggers::filelogger#log_cmd()","bauxite::loggers::nulllogger#log_cmd()","bauxite::loggers::terminallogger#log_cmd()","bauxite::context::loggers()","bauxite::context::max_action_name_size()","bauxite::actionmodule::new()","bauxite::context::new()","bauxite::loggers::compositelogger::new()","bauxite::loggers::filelogger::new()","bauxite::loggers::nulllogger::new()","bauxite::loggers::terminallogger::new()","bauxite::parsermodule::new()","bauxite::selectormodule::new()","bauxite::action#open()","bauxite::action#params()","bauxite::parsermodule#parse()","bauxite::context::parse_action_default()","bauxite::context::parsers()","bauxite::context#print_error()","bauxite::loggers::compositelogger#progress()","bauxite::loggers::nulllogger#progress()","bauxite::loggers::terminallogger#progress()","bauxite::action#replace()","bauxite::action#reset()","bauxite::context#reset_driver()","bauxite::action#return_action()","bauxite::action#ruby()","bauxite::action#select()","bauxite::context::selectors()","bauxite::selectormodule#selenium_find()","bauxite::parser#selenium_ide_html()","bauxite::action#set()","bauxite::action#setif()","bauxite::selector#sid()","bauxite::selector#smart()","bauxite::action#source()","bauxite::context#start()","bauxite::context#stop()","bauxite::action#store()","bauxite::action#submit()","bauxite::action#test()","bauxite::action#tryload()","bauxite::action#wait()","bauxite::context::wait()","bauxite::context#with_driver_timeout()","bauxite::context#with_timeout()","bauxite::context#with_vars()","bauxite::action#write()",""],"info":[["Bauxite","","Bauxite.html","","<p>Bauxite Namespace\n"],["Bauxite::Action","","Bauxite/Action.html","","<p>Test action class.\n<p>Test actions are basic test operations that can be combined to create a\ntest case. …\n"],["Bauxite::ActionModule","","Bauxite/ActionModule.html","","<p>Action common state and behavior.\n"],["Bauxite::Application","","Bauxite/Application.html","","<p><code>bauxite</code> command-line program.\n<p>This program executes Bauxite tests and outputs the execution progress and\n…\n"],["Bauxite::Context","","Bauxite/Context.html","","<p>The Main test context. This class includes state and helper functions used\nby clients execute tests and …\n"],["Bauxite::Errors","","Bauxite/Errors.html","","<p>Errors Module\n"],["Bauxite::Errors::AssertionError","","Bauxite/Errors/AssertionError.html","","<p>Error raised when an assertion fails.\n"],["Bauxite::Errors::FileNotFoundError","","Bauxite/Errors/FileNotFoundError.html","","<p>Error raised when an invalid file tried to be loaded.\n"],["Bauxite::Errors::FormatError","","Bauxite/Errors/FormatError.html","","<p>Error raised when trying to process an invalid file format.\n"],["Bauxite::Loggers","","Bauxite/Loggers.html","","<p>Test loggers module\n<p>The default Logger class and all custom loggers must be included in this\nmodule.\n"],["Bauxite::Loggers::CompositeLogger","","Bauxite/Loggers/CompositeLogger.html","","<p>Composite logger.\n<p>This composite logger forwards logging calls to each of its children.\n<p>Set the <code>:loggers</code> …\n"],["Bauxite::Loggers::EchoLogger","","Bauxite/Loggers/EchoLogger.html","","<p>Echo logger.\n<p>This logger outputs the raw action text for every action executed.\n<p>Note that this logger does …\n"],["Bauxite::Loggers::FileLogger","","Bauxite/Loggers/FileLogger.html","","<p>File logger.\n<p>This logger outputs the raw action text for every action executed to the\nfile specified in …\n"],["Bauxite::Loggers::NullLogger","","Bauxite/Loggers/NullLogger.html","","<p>Test logger class.\n<p>Test loggers handle test output format.\n<p>The default logger does not provide any output …\n"],["Bauxite::Loggers::TerminalLogger","","Bauxite/Loggers/TerminalLogger.html","","<p>Terminal logger.\n<p>This logger outputs text using basic text formatting for a terminal window.\n"],["Bauxite::Loggers::XtermLogger","","Bauxite/Loggers/XtermLogger.html","","<p>XTerm logger.\n<p>This logger outputs colorized lines using xterm (VT100/2) escape sequences.\n"],["Bauxite::Parser","","Bauxite/Parser.html","","<p>Parser class.\n<p>Parser represent different strategies for reading input files into lists of\nBauxite actions. …\n"],["Bauxite::ParserModule","","Bauxite/ParserModule.html","","<p>Parser common state and behavior.\n"],["Bauxite::Selector","","Bauxite/Selector.html","","<p>Selector class.\n<p>Selectors represent different strategies for finding elements. Selenium\nprovides a list …\n"],["Bauxite::SelectorModule","","Bauxite/SelectorModule.html","","<p>Selector common state and behavior.\n"],["_block","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_block","(color, text, size)","<p>Prints <code>text</code> centered inside a square-bracketed block.\n"],["_cmd_color","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_cmd_color","(cmd)","<p>Get the color of <code>cmd</code>.\n"],["_fmt","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_fmt","(color, text, size = 0)","<p>Centers <code>text</code> to a fixed size with.\n"],["_fmt","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_fmt","(color, text, size = 0)",""],["_restore_cursor","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_restore_cursor","()","<p>Restores the cursor to the previously saved cursor position.\n"],["_restore_cursor","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_restore_cursor","()",""],["_save_cursor","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_save_cursor","()","<p>Save the current cursor position,\n"],["_save_cursor","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_save_cursor","()",""],["_screen_width","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_screen_width","()","<p>Returns the terminal screen width.\n"],["_screen_width","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_screen_width","()",""],["action_args","Bauxite::Context","Bauxite/Context.html#method-c-action_args","(action)","<p>Returns an array with the names of the arguments of the specified action.\n<p>For example:\n\n<pre>Context::action_args ...</pre>\n"],["actions","Bauxite::Context","Bauxite/Context.html#method-c-actions","()","<p>Returns an array with the names of every action available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">actions</span>\n<span class=\"ruby-comment\"># => [ "assert", ...</span>\n</pre>\n"],["add_alias","Bauxite::Context","Bauxite/Context.html#method-i-add_alias","(name, action, args)","<p>Adds an alias named <code>name</code> to the specified <code>action</code>\nwith the arguments specified in <code>args</code>.\n"],["alias_action","Bauxite::Action","Bauxite/Action.html#method-i-alias_action","(name, action, *args)","<p>Aliases <code>name</code> to <code>action</code> with additional arguments.\n<p>In <code>args</code> the variables <code>${1}</code>..<code>${n}</code>\nwill be expanded to …\n"],["args","Bauxite::ActionModule","Bauxite/ActionModule.html#method-i-args","(quote = false)","<p>Returns the action arguments after applying variable expansion.\n<p>See Context#expand.\n<p>If <code>quote</code> is <code>true</code>, the …\n"],["assert","Bauxite::Action","Bauxite/Action.html#method-i-assert","(selector, text)","<p>Asserts that the value of the selected element matches <code>text</code>.\n<p><code>text</code> is a regular expression. <code>text</code> can be …\n"],["assertv","Bauxite::Action","Bauxite/Action.html#method-i-assertv","(expected, actual)","<p>Asserts that the <code>actual</code> text matches the <code>expected</code>\ntext.\n<p><code>expected</code> can be a regular expression. See #assert …\n"],["attr","Bauxite::Selector","Bauxite/Selector.html#method-i-attr","(arg, &block)","<p>Select an element by attribute value.\n<p>The attribute selector syntax is:\n\n<pre>attr=name:value</pre>\n"],["break_action","Bauxite::Action","Bauxite/Action.html#method-i-break_action","()","<p>Prompts the user to press ENTER before resuming execution.\n<p>Note that this method provides an action named …\n"],["capture","Bauxite::Action","Bauxite/Action.html#method-i-capture","(file = nil)","<p>Captures a screenshot of the current browser window and saves it with\nspecified <code>file</code> name. If <code>file</code> is …\n"],["click","Bauxite::Action","Bauxite/Action.html#method-i-click","(selector)","<p>Triggers the <code>click</code> event on the selected element.\n<p>For example:\n\n<pre># assuming <button type="button" id="btn">click ...</pre>\n"],["csv","Bauxite::Parser","Bauxite/Parser.html#method-i-csv","(file)","<p>Load CSV files.\n"],["debug","Bauxite::Action","Bauxite/Action.html#method-i-debug","()","<p>Breaks into the debug console.\n<p>In the debug console you can type action strings and test their result. …\n"],["debug","Bauxite::Context","Bauxite/Context.html#method-i-debug","()","<p>Breaks into the debug console.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">ctx</span>.<span class=\"ruby-identifier\">debug</span>\n<span class=\"ruby-comment\"># => this breaks into the debug console</span>\n</pre>\n"],["debug_prompt","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-debug_prompt","()","<p>Returns a colorized debug prompt.\n<p>This implementation returns the debug_prompt of the first logger.\n"],["debug_prompt","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-debug_prompt","()","<p>Returns the prompt shown by the debug console (see Context#debug).\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug_prompt</span>\n<span class=\"ruby-comment\"># => returns ...</span>\n</pre>\n"],["debug_prompt","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-debug_prompt","()","<p>Returns a colorized debug prompt.\n"],["default","Bauxite::Parser","Bauxite/Parser.html#method-i-default","(file, io = nil)","<p>Load default Bauxite files.\n"],["doif","Bauxite::Action","Bauxite/Action.html#method-i-doif","(expected, actual, action, *args)","<p>Executes <code>action</code> only if <code>expected</code> matches\n<code>actual</code>.\n<p>The conditional check in this action is similar to #assertv …\n"],["echo","Bauxite::Action","Bauxite/Action.html#method-i-echo","(text)","<p>Prints the value of the specified <code>text</code>.\n<p><code>text</code> is subject to variable expansion (see Context#expand).\n<p>For …\n"],["exec","Bauxite::Action","Bauxite/Action.html#method-i-exec","(*command)","<p>Executes <code>command</code>, optionally storing the results in a\nvariable.\n<p>If the first argument of <code>command</code> is <code>name=...</code> …\n"],["exec_action","Bauxite::Context","Bauxite/Context.html#method-i-exec_action","(text)","<p>Executes the specified action string handling errors, logging and debug\nhistory.\n<p>If <code>log</code> is <code>true</code>, log the …\n"],["exec_action_object","Bauxite::Context","Bauxite/Context.html#method-i-exec_action_object","(action)","<p>Executes the specified action object injecting built-in variables. Note\nthat the result returned by this …\n"],["exec_file","Bauxite::Context","Bauxite/Context.html#method-i-exec_file","(file)","<p>Executes the specified <code>file</code>.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">ctx</span>.<span class=\"ruby-identifier\">exec_file</span>(<span class=\"ruby-string\">'file'</span>)\n<span class=\"ruby-comment\"># => executes every action defined in 'file'</span>\n</pre>\n"],["exec_parsed_action","Bauxite::Context","Bauxite/Context.html#method-i-exec_parsed_action","(action, args, log = true, text = nil)","<p>Executes the specified action handling errors, logging and debug history.\n<p>If <code>log</code> is <code>true</code>, log the action …\n"],["execute","Bauxite::ActionModule","Bauxite/ActionModule.html#method-i-execute","()","<p>Executes the action evaluating the arguments in the current context.\n<p>Note that #execute calls #args to …\n"],["expand","Bauxite::Context","Bauxite/Context.html#method-i-expand","(s)","<p>Recursively replaces occurencies of variable expansions in <code>s</code>\nwith the corresponding variable value.\n<p>The …\n"],["failif","Bauxite::Action","Bauxite/Action.html#method-i-failif","(action, *args)","<p>Executes the specified <code>action</code> expected to fail. If\n<code>action</code> succeeds the #failif action fails. If\n<code>action</code> …\n"],["find","Bauxite::Context","Bauxite/Context.html#method-i-find","(selector)","<p>Finds an element by <code>selector</code>.\n<p>The element found is yielded to the given <code>block</code> (if any) and\nreturned.\n<p>Note …\n"],["find","Bauxite::SelectorModule","Bauxite/SelectorModule.html#method-i-find","(selector, &block)","<p>Searches for elements using the specified selector string.\n<p>For more information see Context#find.\n<p>Selectors …\n"],["frame","Bauxite::Selector","Bauxite/Selector.html#method-i-frame","(arg, &block)","<p>Change the selector scope to the given frame and finds an element in that\nframe.\n<p>This is a composite selector. …\n"],["get_action","Bauxite::Context","Bauxite/Context.html#method-i-get_action","(action, args, text = nil)","<p>Returns an executable Action object constructed from the specified\narguments resolving action aliases. …\n"],["get_value","Bauxite::Context","Bauxite/Context.html#method-i-get_value","(element)","<p>Returns the value of the specified <code>element</code>.\n<p>This method takes into account the type of element and selectively …\n"],["js","Bauxite::Action","Bauxite/Action.html#method-i-js","(script, name = nil)","<p>Executes the specified Javascript <code>script</code>, optionally storing\nthe results the variable named <code>name</code>.\n<p>Note …\n"],["load","Bauxite::Action","Bauxite/Action.html#method-i-load","(file, *vars)","<p>Load the specified file into an isolated variable context and execute the\nactions specified. If the file …\n"],["load_logger","Bauxite::Context","Bauxite/Context.html#method-c-load_logger","(name, options)","<p>Constructs a Logger instance using <code>name</code> as a hint for the\nlogger type.\n"],["log","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log","(s, type = :info)","<p>Logs the specified string.\n<p><code>type</code>, if specified, should be one of <code>:error</code>,\n<code>:warning</code>, <code>:info</code> (default), <code>:debug</code> …\n"],["log","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log_cmd","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log_cmd","(action, &block)","<p>Pretty prints action information and status.\n<p>This implementation only yileds in the first logger.\n<p>Additional …\n"],["log_cmd","Bauxite::Loggers::EchoLogger","Bauxite/Loggers/EchoLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log_cmd","(action)","<p>Executes the given block in a logging context.\n<p>This default implementation does not provide any logging …\n"],["log_cmd","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log_cmd","(action)","<p>Pretty prints action information and status.\n"],["loggers","Bauxite::Context","Bauxite/Context.html#method-c-loggers","()","<p>Returns an array with the names of every logger available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">loggers</span>\n<span class=\"ruby-comment\"># => [ "null", ...</span>\n</pre>\n"],["max_action_name_size","Bauxite::Context","Bauxite/Context.html#method-c-max_action_name_size","()","<p>Returns the maximum size in characters of an action name.\n<p>This method is useful to pretty print lists …\n"],["new","Bauxite::ActionModule","Bauxite/ActionModule.html#method-c-new","(ctx, cmd, args, text, file, line)","<p>Constructs a new test action instance.\n"],["new","Bauxite::Context","Bauxite/Context.html#method-c-new","(options)","<p>Constructs a new test context instance.\n<p><code>options</code> is a hash with the following values:\n<p>:driver — selenium driver …\n"],["new","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-c-new","(options)","<p>Constructs a new composite logger instance.\n"],["new","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-c-new","(options)","<p>Constructs a new echo logger instance.\n"],["new","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-c-new","(options)","<p>Constructs a new null logger instance.\n"],["new","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-c-new","(options)","<p>Constructs a new Terminal logger instance.\n"],["new","Bauxite::ParserModule","Bauxite/ParserModule.html#method-c-new","(ctx)","<p>Constructs a new test parser instance.\n"],["new","Bauxite::SelectorModule","Bauxite/SelectorModule.html#method-c-new","(ctx, default_selector)","<p>Constructs a new test selector instance.\n"],["open","Bauxite::Action","Bauxite/Action.html#method-i-open","(url)","<p>Opens the specified <code>url</code> in the browser.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">open</span> <span class=\"ruby-string\">"http://www.ruby-lang.org"</span>\n<span class=\"ruby-comment\"># => this would open ...</span>\n</pre>\n"],["params","Bauxite::Action","Bauxite/Action.html#method-i-params","(*vars)","<p>Asserts that the variables named <code>vars</code> are defined and not\nempty.\n<p>For example:\n\n<pre>params host db_name username ...</pre>\n"],["parse","Bauxite::ParserModule","Bauxite/ParserModule.html#method-i-parse","(file)","<p>Parse <code>file</code> and yield the resulting actions.\n"],["parse_action_default","Bauxite::Context","Bauxite/Context.html#method-c-parse_action_default","(text, file = '<unknown>', line = 0)","<p>Default action parsing strategy.\n"],["parsers","Bauxite::Context","Bauxite/Context.html#method-c-parsers","()","<p>Returns an array with the names of every parser available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">parsers</span>\n<span class=\"ruby-comment\"># => [ "default", ...</span>\n</pre>\n"],["print_error","Bauxite::Context","Bauxite/Context.html#method-i-print_error","(e, capture = true)","<p>Prints the specified <code>error</code> using the Logger configured and \nhandling the verbose option.\n<p>For example: …\n"],["progress","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-progress","(value)","<p>Updates action progress.\n"],["progress","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-progress","(value)","<p>Updates the progress of the current action.\n"],["progress","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-progress","(value)","<p>Updates action progress.\n"],["replace","Bauxite::Action","Bauxite/Action.html#method-i-replace","(text, pattern, replacement, name)","<p>Replaces the occurrences of <code>pattern</code> in <code>text</code> with\n<code>replacement</code> and assigns the result to the variable named …\n"],["reset","Bauxite::Action","Bauxite/Action.html#method-i-reset","()","<p>Resets the test engine by closing and reopening the browser. As a side\neffect of resetting the test engine, …\n"],["reset_driver","Bauxite::Context","Bauxite/Context.html#method-i-reset_driver","()","<p>Stops the test engine and starts a new engine with the same provider.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">ctx</span>.<span class=\"ruby-identifier\">reset_driver</span>\n=<span class=\"ruby-operator\">></span> <span class=\"ruby-operator\">...</span>\n</pre>\n"],["return_action","Bauxite::Action","Bauxite/Action.html#method-i-return_action","(*vars)","<p>Returns the specified variables to the parent scope (if any).\n<p>If <code>vars</code> is <code>*</code> every variable defined in the …\n"],["ruby","Bauxite::Action","Bauxite/Action.html#method-i-ruby","(file, *vars)","<p>Load the specified ruby file into an isolated variable context and execute\nthe ruby code.\n<p><code>file</code> can be …\n"],["select","Bauxite::Action","Bauxite/Action.html#method-i-select","(selector, text)","<p>Sets the value of the selected <code>HTMLSelect</code> to\n<code>text</code>.\n<p><code>text</code> can be the <code>value</code> or the <code>text</code> of\nthe target <code>HTMLOption</code> …\n"],["selectors","Bauxite::Context","Bauxite/Context.html#method-c-selectors","(include_standard_selectors = true)","<p>Returns an array with the names of every selector available.\n<p>If <code>include_standard_selectors</code> is <code>true</code> (default …\n"],["selenium_find","Bauxite::SelectorModule","Bauxite/SelectorModule.html#method-i-selenium_find","(type, selector)","<p>Searches for elements using standard Selenium selectors.\n<p>Selectors calling this method should forward …\n"],["selenium_ide_html","Bauxite::Parser","Bauxite/Parser.html#method-i-selenium_ide_html","(file)","<p>Load Selenium IDE HTML files.\n"],["set","Bauxite::Action","Bauxite/Action.html#method-i-set","(name, value)","<p>Sets the variable named <code>name</code> to the <code>value</code>\nspecified.\n<p>Both <code>name</code> and <code>value</code> are subject to variable\nexpansion …\n"],["setif","Bauxite::Action","Bauxite/Action.html#method-i-setif","(name, value, action, *args)","<p>Sets the variable named <code>name</code> to the <code>value</code>\nspecified only if the. <code>action</code> execution succeeds. If the\nexecution …\n"],["sid","Bauxite::Selector","Bauxite/Selector.html#method-i-sid","(arg, &block)","<p>Select an element by id suffix.\n<p>This is the default selector. Any selector strings that do not contain …\n"],["smart","Bauxite::Selector","Bauxite/Selector.html#method-i-smart","(arg, &block)","<p>Select an element by applying different Selector strategies.\n<p>This selector tries to find elements by using …\n"],["source","Bauxite::Action","Bauxite/Action.html#method-i-source","(text)","<p>Asserts that the page source matches <code>text</code>.\n<p><code>text</code> can be a regular expression. See #assert for more\ndetails. …\n"],["start","Bauxite::Context","Bauxite/Context.html#method-i-start","(actions = [])","<p>Starts the test engine and executes the actions specified. If no action was\nspecified, returns without …\n"],["stop","Bauxite::Context","Bauxite/Context.html#method-i-stop","()","<p>Stops the test engine.\n<p>Calling this method at the end of the test is mandatory if #start was\ncalled without …\n"],["store","Bauxite::Action","Bauxite/Action.html#method-i-store","(selector, name)","<p>Sets the variable named <code>name</code> to the value of the selected\nelement.\n<p><code>name</code> is subject to variable expansion …\n"],["submit","Bauxite::Action","Bauxite/Action.html#method-i-submit","(selector)","<p>Submits the form that contains the selected element.\n<p>For example:\n\n<pre># assuming <form><input id="i"/></form> ...</pre>\n"],["test","Bauxite::Action","Bauxite/Action.html#method-i-test","(file, name = nil)","<p>Load <code>file</code> using the #load action into a new test context.\n<p>If <code>name</code> is specified, it will be used as the …\n"],["tryload","Bauxite::Action","Bauxite/Action.html#method-i-tryload","(file, *vars)","<p>Load the specified file into an isolated variable context and execute the\nactions specified. If the file …\n"],["wait","Bauxite::Action","Bauxite/Action.html#method-i-wait","(seconds)","<p>Wait for the specified number of <code>seconds</code>.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">wait</span> <span class=\"ruby-value\">5</span>\n<span class=\"ruby-comment\"># => this would wait for 5 seconds and then ...</span>\n</pre>\n"],["wait","Bauxite::Context","Bauxite/Context.html#method-c-wait","()","<p>Prompts the user to press ENTER before resuming execution.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">wait</span>\n<span class=\"ruby-comment\"># => echoes "Press ...</span>\n</pre>\n"],["with_driver_timeout","Bauxite::Context","Bauxite/Context.html#method-i-with_driver_timeout","(timeout)","<p>Executes the given block using the specified driver <code>timeout</code>.\n<p>Note that the driver <code>timeout</code> is the time …\n"],["with_timeout","Bauxite::Context","Bauxite/Context.html#method-i-with_timeout","(*error_types)","<p>Executes the given block retrying for at most <code>${__TIMEOUT__}</code>\nseconds. Note that this method does not …\n"],["with_vars","Bauxite::Context","Bauxite/Context.html#method-i-with_vars","(vars)","<p>Temporarily alter the value of context variables.\n<p>This method alters the value of the variables specified …\n"],["write","Bauxite::Action","Bauxite/Action.html#method-i-write","(selector, text)","<p>Sets the value of the selected element to <code>text</code>.\n<p><code>text</code> is subject to variable expansion (see Context#expand …\n"],["README","","README_md.html","","<p>bauxite\n<p>Bauxite is a façade over Selenium intended for non-developers\n<p>The idea behind this project was …\n"]]}}
|
@@ -41,7 +41,6 @@ class Bauxite::Action
|
|
41
41
|
end
|
42
42
|
|
43
43
|
private
|
44
|
-
@@debug_line = 0
|
45
44
|
def _debug_process
|
46
45
|
Readline.completion_append_character = " "
|
47
46
|
Readline.completer_word_break_characters = ""
|
@@ -51,11 +50,10 @@ private
|
|
51
50
|
next if not line or line == ''
|
52
51
|
break if line == 'exit'
|
53
52
|
begin
|
54
|
-
@ctx.exec_action(line
|
53
|
+
@ctx.exec_action(line)
|
55
54
|
rescue StandardError => e
|
56
|
-
@ctx.print_error(e)
|
55
|
+
@ctx.print_error(e, false)
|
57
56
|
end
|
58
|
-
@@debug_line += 1
|
59
57
|
end
|
60
58
|
end
|
61
59
|
|
data/lib/bauxite/actions/test.rb
CHANGED
data/lib/bauxite/core/action.rb
CHANGED
@@ -29,20 +29,12 @@ module Bauxite
|
|
29
29
|
# Raw action text.
|
30
30
|
attr_reader :text
|
31
31
|
|
32
|
-
# File where the action was defined.
|
33
|
-
attr_reader :file
|
34
|
-
|
35
|
-
# Line in the #file where the action was defined.
|
36
|
-
attr_reader :line
|
37
|
-
|
38
32
|
# Constructs a new test action instance.
|
39
33
|
def initialize(ctx, cmd, args, text, file, line)
|
40
34
|
@ctx = ctx
|
41
35
|
@cmd = cmd
|
42
36
|
@args = args
|
43
37
|
@text = text
|
44
|
-
@file = file
|
45
|
-
@line = line
|
46
38
|
|
47
39
|
@cmd_real = (respond_to? cmd+'_action') ? (cmd+'_action') : cmd
|
48
40
|
|
data/lib/bauxite/core/context.rb
CHANGED
@@ -144,7 +144,8 @@ module Bauxite
|
|
144
144
|
'__TIMEOUT__' => (options[:timeout] || 10).to_i,
|
145
145
|
'__DEBUG__' => false,
|
146
146
|
'__SELECTOR__' => options[:selector] || 'sid',
|
147
|
-
'__OUTPUT__' => options[:output]
|
147
|
+
'__OUTPUT__' => options[:output],
|
148
|
+
'__DIR__' => File.absolute_path(Dir.pwd)
|
148
149
|
}
|
149
150
|
@aliases = {}
|
150
151
|
@tests = []
|
@@ -256,7 +257,7 @@ module Bauxite
|
|
256
257
|
# ctx.debug
|
257
258
|
# # => this breaks into the debug console
|
258
259
|
def debug
|
259
|
-
|
260
|
+
exec_parsed_action('debug', [], false)
|
260
261
|
end
|
261
262
|
|
262
263
|
# Returns the value of the specified +element+.
|
@@ -295,9 +296,9 @@ module Bauxite
|
|
295
296
|
# ctx.exec_action 'open "http://www.ruby-lang.org"'
|
296
297
|
# # => navigates to www.ruby-lang.org
|
297
298
|
#
|
298
|
-
def exec_action(text
|
299
|
-
data = Context::parse_action_default(text,
|
300
|
-
exec_parsed_action(data[:action], data[:args],
|
299
|
+
def exec_action(text)
|
300
|
+
data = Context::parse_action_default(text, '<unknown>', 0)
|
301
|
+
exec_parsed_action(data[:action], data[:args], true, text)
|
301
302
|
end
|
302
303
|
|
303
304
|
# Executes the specified +file+.
|
@@ -307,9 +308,20 @@ module Bauxite
|
|
307
308
|
# # => executes every action defined in 'file'
|
308
309
|
#
|
309
310
|
def exec_file(file)
|
311
|
+
current_dir = @variables['__DIR__' ]
|
312
|
+
current_file = @variables['__FILE__']
|
313
|
+
current_line = @variables['__LINE__']
|
314
|
+
|
310
315
|
@parser.parse(file) do |action, args, text, file, line|
|
311
|
-
|
316
|
+
@variables['__DIR__'] = File.absolute_path(File.dirname(file))
|
317
|
+
@variables['__FILE__'] = file
|
318
|
+
@variables['__LINE__'] = line
|
319
|
+
exec_parsed_action(action, args, true, text)
|
312
320
|
end
|
321
|
+
|
322
|
+
@variables['__DIR__' ] = current_dir
|
323
|
+
@variables['__FILE__'] = current_file
|
324
|
+
@variables['__LINE__'] = current_line
|
313
325
|
end
|
314
326
|
|
315
327
|
# Executes the specified action handling errors, logging and debug
|
@@ -325,8 +337,8 @@ module Bauxite
|
|
325
337
|
# ctx.exec_action 'open "http://www.ruby-lang.org"'
|
326
338
|
# # => navigates to www.ruby-lang.org
|
327
339
|
#
|
328
|
-
def exec_parsed_action(action, args, log = true, text = nil
|
329
|
-
action =
|
340
|
+
def exec_parsed_action(action, args, log = true, text = nil)
|
341
|
+
action = get_action(action, args, text)
|
330
342
|
ret = nil
|
331
343
|
if log
|
332
344
|
@logger.log_cmd(action) do
|
@@ -463,7 +475,7 @@ module Bauxite
|
|
463
475
|
# for advanced use (e.g. in complex actions). To execute an Action
|
464
476
|
# directly, the #exec_action method is preferred.
|
465
477
|
#
|
466
|
-
def get_action(action, args, text = nil
|
478
|
+
def get_action(action, args, text = nil)
|
467
479
|
while (alias_action = @aliases[action])
|
468
480
|
action = alias_action[:action]
|
469
481
|
args = alias_action[:args].map do |a|
|
@@ -484,8 +496,8 @@ module Bauxite
|
|
484
496
|
end
|
485
497
|
|
486
498
|
text = ([action] + args.map { |a| '"'+a.gsub('"', '""')+'"' }).join(' ') unless text
|
487
|
-
file = @variables['__FILE__']
|
488
|
-
line = @variables['__LINE__']
|
499
|
+
file = @variables['__FILE__']
|
500
|
+
line = @variables['__LINE__']
|
489
501
|
|
490
502
|
Action.new(self, action, args, text, file, line)
|
491
503
|
end
|
@@ -504,11 +516,6 @@ module Bauxite
|
|
504
516
|
# ret.call if ret.respond_to? :call
|
505
517
|
#
|
506
518
|
def exec_action_object(action)
|
507
|
-
# Inject built-in variables
|
508
|
-
file = action.file
|
509
|
-
dir = (File.exists? file) ? File.dirname(file) : Dir.pwd
|
510
|
-
@variables['__FILE__'] = file
|
511
|
-
@variables['__DIR__'] = File.absolute_path(dir)
|
512
519
|
action.execute
|
513
520
|
end
|
514
521
|
|
@@ -523,7 +530,7 @@ module Bauxite
|
|
523
530
|
# # => additional error handling code here
|
524
531
|
# end
|
525
532
|
#
|
526
|
-
def print_error(e)
|
533
|
+
def print_error(e, capture = true)
|
527
534
|
if @logger
|
528
535
|
@logger.log "#{e.message}\n", :error
|
529
536
|
else
|
@@ -533,6 +540,11 @@ module Bauxite
|
|
533
540
|
p e
|
534
541
|
puts e.backtrace
|
535
542
|
end
|
543
|
+
if capture and @options[:capture]
|
544
|
+
with_vars(e.variables) do
|
545
|
+
exec_parsed_action('capture', [] , false)
|
546
|
+
end
|
547
|
+
end
|
536
548
|
end
|
537
549
|
|
538
550
|
# ======================================================================= #
|
@@ -656,6 +668,12 @@ module Bauxite
|
|
656
668
|
current = @variables
|
657
669
|
@variables = @variables.merge(vars)
|
658
670
|
yield
|
671
|
+
rescue StandardError => e
|
672
|
+
e.instance_variable_set "@variables", @variables
|
673
|
+
def e.variables
|
674
|
+
@variables
|
675
|
+
end
|
676
|
+
raise
|
659
677
|
ensure
|
660
678
|
@variables = current
|
661
679
|
end
|
data/lib/bauxite.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bauxite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patricio Zavolinsky
|
@@ -169,6 +169,9 @@ files:
|
|
169
169
|
- test/capture.bxt.manual
|
170
170
|
- test/capture/my_test.bxt
|
171
171
|
- test/capture/page.html
|
172
|
+
- test/capture_on_error.bxt.manual
|
173
|
+
- test/capture_on_error/my_test.bxt
|
174
|
+
- test/capture_on_error/page.html
|
172
175
|
- test/debug.bxt.manual
|
173
176
|
- test/default_selector.bxt.manual
|
174
177
|
- test/default_selector/page.html
|