bauxite 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/Bauxite/Action.html +123 -0
- data/doc/Bauxite/Loggers/CompositeLogger.html +11 -5
- data/doc/Bauxite/Parser.html +8 -5
- data/doc/Bauxite/Selector.html +81 -0
- data/doc/created.rid +6 -3
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +43 -28
- data/lib/bauxite/actions/asserth.rb +60 -0
- data/lib/bauxite/actions/assertw.rb +47 -0
- data/lib/bauxite/loggers/composite.rb +6 -0
- data/lib/bauxite/parsers/html.rb +8 -5
- data/lib/bauxite/selectors/window.rb +73 -0
- data/lib/bauxite.rb +1 -1
- data/test/asserth.bxt +2 -0
- data/test/assertw.bxt +7 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92593994aeb4e5c7dbcbd29a735cdcdbfb29db07
|
4
|
+
data.tar.gz: 34f895c5e0a421cac986ddd65fd11c8a30dd77f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 611fe021923dcb88095023c7f7ff551e5182eddcd22c0393b1e35282de29a9deec7a7dcf973ef479e78bf8e5ca0d8b468c2362109ffc235e06c2043d70e9554c
|
7
|
+
data.tar.gz: 588e7efd6f6e9f0df399ec6320fed9aac66dcb03baef4f1738dcec948eb6ba3351d995d5a13d34f5f5c427a8fd89c43ecd8d1fde0f47a24887775f456236afab
|
data/doc/Bauxite/Action.html
CHANGED
@@ -99,8 +99,12 @@
|
|
99
99
|
|
100
100
|
<li ><a href="#method-i-assert">#assert</a>
|
101
101
|
|
102
|
+
<li ><a href="#method-i-asserth">#asserth</a>
|
103
|
+
|
102
104
|
<li ><a href="#method-i-assertv">#assertv</a>
|
103
105
|
|
106
|
+
<li ><a href="#method-i-assertw">#assertw</a>
|
107
|
+
|
104
108
|
<li ><a href="#method-i-break_action">#break_action</a>
|
105
109
|
|
106
110
|
<li ><a href="#method-i-capture">#capture</a>
|
@@ -424,6 +428,72 @@ flags.</p>
|
|
424
428
|
|
425
429
|
|
426
430
|
|
431
|
+
</div>
|
432
|
+
|
433
|
+
|
434
|
+
<div id="method-i-asserth" class="method-detail ">
|
435
|
+
|
436
|
+
<div class="method-heading">
|
437
|
+
<span class="method-name">asserth</span><span
|
438
|
+
class="method-args">(*args)</span>
|
439
|
+
|
440
|
+
<span class="method-click-advice">click to toggle source</span>
|
441
|
+
|
442
|
+
</div>
|
443
|
+
|
444
|
+
|
445
|
+
<div class="method-description">
|
446
|
+
|
447
|
+
<p>Replays the current GET request and asserts that the HTTP headers returned
|
448
|
+
by that request match each of the <code>args</code> specified.</p>
|
449
|
+
|
450
|
+
<p>Note that this action results in an additional HTTP GET request to the
|
451
|
+
current browser url.</p>
|
452
|
+
|
453
|
+
<p>The syntax of <code>args</code> is:</p>
|
454
|
+
|
455
|
+
<pre>"header_name1=expression1" "header_name2=expression2" ...</pre>
|
456
|
+
|
457
|
+
<p>Where <code>expression</code> is a regular expression. Note that multiple
|
458
|
+
headers can be asserted in a single <a
|
459
|
+
href="Action.html#method-i-asserth">asserth</a> call. Also note that if the
|
460
|
+
same header is specified more than once, the value of the header must match
|
461
|
+
every expression specified.</p>
|
462
|
+
|
463
|
+
<p>For example:</p>
|
464
|
+
|
465
|
+
<pre class="ruby"><span class="ruby-comment"># assuming response headers { 'Content-Type' => 'text/plain' }</span>
|
466
|
+
<span class="ruby-identifier">asserth</span> <span class="ruby-string">"content-type=plain"</span>
|
467
|
+
<span class="ruby-identifier">asserth</span> <span class="ruby-string">"content-type=^text"</span> <span class="ruby-string">"content-type=/plain$"</span>
|
468
|
+
<span class="ruby-comment"># => these assertions would pass</span>
|
469
|
+
</pre>
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
<div class="method-source-code" id="asserth-source">
|
475
|
+
<pre><span class="ruby-comment"># File lib/bauxite/actions/asserth.rb, line 46</span>
|
476
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">asserth</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
477
|
+
<span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>(<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">current_url</span>)
|
478
|
+
<span class="ruby-identifier">res</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">get_response</span>(<span class="ruby-identifier">uri</span>)
|
479
|
+
<span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
480
|
+
<span class="ruby-identifier">name</span>,<span class="ruby-identifier">value</span> = <span class="ruby-identifier">a</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'='</span>, <span class="ruby-value">2</span>);
|
481
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
482
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">strip</span>
|
483
|
+
|
484
|
+
<span class="ruby-identifier">actual</span> = <span class="ruby-identifier">res</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||</span> <span class="ruby-string">''</span>
|
485
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">actual</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">_pattern</span>(<span class="ruby-identifier">value</span>)
|
486
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span>, <span class="ruby-node">"Assertion failed for HTTP Header '#{name}': expected '#{value}', got '#{actual}'"</span>
|
487
|
+
<span class="ruby-keyword">end</span>
|
488
|
+
<span class="ruby-keyword">end</span>
|
489
|
+
<span class="ruby-keyword">end</span></pre>
|
490
|
+
</div>
|
491
|
+
|
492
|
+
</div>
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
427
497
|
</div>
|
428
498
|
|
429
499
|
|
@@ -471,6 +541,59 @@ href="Action.html#method-i-assert">assert</a> for more details.</p>
|
|
471
541
|
|
472
542
|
|
473
543
|
|
544
|
+
</div>
|
545
|
+
|
546
|
+
|
547
|
+
<div id="method-i-assertw" class="method-detail ">
|
548
|
+
|
549
|
+
<div class="method-heading">
|
550
|
+
<span class="method-name">assertw</span><span
|
551
|
+
class="method-args">(count = 1)</span>
|
552
|
+
|
553
|
+
<span class="method-click-advice">click to toggle source</span>
|
554
|
+
|
555
|
+
</div>
|
556
|
+
|
557
|
+
|
558
|
+
<div class="method-description">
|
559
|
+
|
560
|
+
<p>Asserts that the number of currently open windows equals
|
561
|
+
<code>count</code>.</p>
|
562
|
+
|
563
|
+
<p>For example:</p>
|
564
|
+
|
565
|
+
<pre class="ruby"><span class="ruby-identifier">assertw</span>
|
566
|
+
<span class="ruby-comment"># => this assertion would pass (only the main window is open)</span>
|
567
|
+
|
568
|
+
<span class="ruby-identifier">js</span> <span class="ruby-string">"window.w = window.open()"</span>
|
569
|
+
<span class="ruby-identifier">assertw</span> <span class="ruby-value">2</span>
|
570
|
+
<span class="ruby-comment"># => this assertion would pass (main window and popup)</span>
|
571
|
+
|
572
|
+
<span class="ruby-identifier">js</span> <span class="ruby-string">"setTimeout(function() { window.w.close(); }, 3000);"</span>
|
573
|
+
<span class="ruby-identifier">assertw</span> <span class="ruby-value">1</span>
|
574
|
+
<span class="ruby-comment"># => this assertion would pass (popup was closed)</span>
|
575
|
+
</pre>
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
<div class="method-source-code" id="assertw-source">
|
581
|
+
<pre><span class="ruby-comment"># File lib/bauxite/actions/assertw.rb, line 39</span>
|
582
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">assertw</span>(<span class="ruby-identifier">count</span> = <span class="ruby-value">1</span>)
|
583
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">with_timeout</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span> <span class="ruby-keyword">do</span>
|
584
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">window_handles</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">count</span>.<span class="ruby-identifier">to_i</span>
|
585
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span>, <span class="ruby-string">"Assertion failed: all popups must be closed."</span>
|
586
|
+
<span class="ruby-keyword">end</span>
|
587
|
+
<span class="ruby-keyword">true</span>
|
588
|
+
<span class="ruby-keyword">end</span>
|
589
|
+
<span class="ruby-keyword">end</span></pre>
|
590
|
+
</div>
|
591
|
+
|
592
|
+
</div>
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
|
474
597
|
</div>
|
475
598
|
|
476
599
|
|
@@ -147,6 +147,12 @@ names</p>
|
|
147
147
|
<div class="method-source-code" id="new-source">
|
148
148
|
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line 32</span>
|
149
149
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span>)
|
150
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:loggers</span>]
|
151
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">"Missing required logger option 'loggers'. "</span><span class="ruby-operator">+</span>
|
152
|
+
<span class="ruby-string">"The value of this option is a comma-separated list of valid loggers. "</span><span class="ruby-operator">+</span>
|
153
|
+
<span class="ruby-string">"For example loggers=xterm,file."</span>
|
154
|
+
<span class="ruby-keyword">end</span>
|
155
|
+
|
150
156
|
<span class="ruby-ivar">@loggers</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:loggers</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">','</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span>
|
151
157
|
<span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Context</span><span class="ruby-operator">::</span><span class="ruby-identifier">load_logger</span>(<span class="ruby-identifier">l</span>, <span class="ruby-identifier">options</span>)
|
152
158
|
<span class="ruby-keyword">end</span>
|
@@ -192,7 +198,7 @@ first logger.</p>
|
|
192
198
|
|
193
199
|
|
194
200
|
<div class="method-source-code" id="debug_prompt-source">
|
195
|
-
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line
|
201
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line 58</span>
|
196
202
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">debug_prompt</span>
|
197
203
|
<span class="ruby-ivar">@loggers</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">debug_prompt</span>
|
198
204
|
<span class="ruby-keyword">end</span></pre>
|
@@ -225,7 +231,7 @@ first logger.</p>
|
|
225
231
|
|
226
232
|
|
227
233
|
<div class="method-source-code" id="finalize-source">
|
228
|
-
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line
|
234
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line 77</span>
|
229
235
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">finalize</span>(<span class="ruby-identifier">ctx</span>)
|
230
236
|
<span class="ruby-ivar">@loggers</span>.<span class="ruby-identifier">each</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">finalize</span>(<span class="ruby-identifier">ctx</span>) }
|
231
237
|
<span class="ruby-keyword">end</span></pre>
|
@@ -260,7 +266,7 @@ first logger.</p>
|
|
260
266
|
|
261
267
|
|
262
268
|
<div class="method-source-code" id="log-source">
|
263
|
-
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line
|
269
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line 71</span>
|
264
270
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">type</span> = <span class="ruby-value">:info</span>)
|
265
271
|
<span class="ruby-ivar">@loggers</span>.<span class="ruby-identifier">each</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">log</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">type</span>) }
|
266
272
|
<span class="ruby-keyword">end</span></pre>
|
@@ -297,7 +303,7 @@ first logger.</p>
|
|
297
303
|
|
298
304
|
|
299
305
|
<div class="method-source-code" id="log_cmd-source">
|
300
|
-
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line
|
306
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line 50</span>
|
301
307
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">log_cmd</span>(<span class="ruby-identifier">action</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
302
308
|
<span class="ruby-identifier">_log_cmd_block</span>(<span class="ruby-ivar">@loggers</span>, <span class="ruby-identifier">action</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
303
309
|
<span class="ruby-keyword">end</span></pre>
|
@@ -330,7 +336,7 @@ first logger.</p>
|
|
330
336
|
|
331
337
|
|
332
338
|
<div class="method-source-code" id="progress-source">
|
333
|
-
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line
|
339
|
+
<pre><span class="ruby-comment"># File lib/bauxite/loggers/composite.rb, line 63</span>
|
334
340
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">progress</span>(<span class="ruby-identifier">value</span>)
|
335
341
|
<span class="ruby-ivar">@loggers</span>.<span class="ruby-identifier">each</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">progress</span>(<span class="ruby-identifier">value</span>) }
|
336
342
|
<span class="ruby-keyword">end</span></pre>
|
data/doc/Bauxite/Parser.html
CHANGED
@@ -328,7 +328,7 @@ parser can't handle the file.</p>
|
|
328
328
|
.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span> }
|
329
329
|
.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span>.<span class="ruby-identifier">captures</span> }
|
330
330
|
.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">action</span><span class="ruby-operator">|</span>
|
331
|
-
<span class="ruby-keyword">case</span> <span class="ruby-identifier">action</span>[<span class="ruby-value">0</span>]
|
331
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">action</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">downcase</span>
|
332
332
|
<span class="ruby-keyword">when</span> <span class="ruby-string">'open'</span>
|
333
333
|
<span class="ruby-identifier">url</span> = <span class="ruby-identifier">action</span>[<span class="ruby-value">1</span>]
|
334
334
|
<span class="ruby-identifier">url</span> = <span class="ruby-identifier">url</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">url</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-string">'/'</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">base_ends_in_slash</span> <span class="ruby-comment"># remove leading '/'</span>
|
@@ -336,21 +336,24 @@ parser can't handle the file.</p>
|
|
336
336
|
<span class="ruby-keyword">when</span> <span class="ruby-string">'type'</span>
|
337
337
|
<span class="ruby-identifier">action</span>[<span class="ruby-value">0</span>] = <span class="ruby-string">'write'</span>
|
338
338
|
<span class="ruby-identifier">action</span>[<span class="ruby-value">1</span>] = <span class="ruby-identifier">_selenium_ide_html_parse_selector</span>(<span class="ruby-identifier">action</span>[<span class="ruby-value">1</span>])
|
339
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">'
|
339
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'verifytextpresent'</span>
|
340
340
|
<span class="ruby-identifier">action</span>[<span class="ruby-value">0</span>] = <span class="ruby-string">'source'</span>
|
341
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">'
|
341
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'clickandwait'</span>, <span class="ruby-string">'click'</span>
|
342
342
|
<span class="ruby-identifier">action</span>[<span class="ruby-value">0</span>] = <span class="ruby-string">'click'</span>
|
343
343
|
<span class="ruby-identifier">action</span>[<span class="ruby-value">1</span>] = <span class="ruby-identifier">_selenium_ide_html_parse_selector</span>(<span class="ruby-identifier">action</span>[<span class="ruby-value">1</span>])
|
344
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">'
|
344
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'waitforpagetoload'</span>
|
345
345
|
<span class="ruby-identifier">action</span>[<span class="ruby-value">0</span>] = <span class="ruby-string">'wait'</span>
|
346
346
|
<span class="ruby-identifier">action</span>[<span class="ruby-value">1</span>] = (<span class="ruby-identifier">action</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">/</span> <span class="ruby-value">1000</span>).<span class="ruby-identifier">to_s</span>
|
347
|
-
<span class="ruby-keyword">when</span> <span class="ruby-string">'
|
347
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'assertvalue'</span>
|
348
348
|
<span class="ruby-identifier">action</span>[<span class="ruby-value">0</span>] = <span class="ruby-string">'assert'</span>
|
349
349
|
<span class="ruby-identifier">action</span>[<span class="ruby-value">1</span>] = <span class="ruby-identifier">_selenium_ide_html_parse_selector</span>(<span class="ruby-identifier">action</span>[<span class="ruby-value">1</span>])
|
350
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'waitforpopup'</span>
|
351
|
+
<span class="ruby-identifier">action</span> = [] <span class="ruby-comment"># remove</span>
|
350
352
|
<span class="ruby-keyword">end</span>
|
351
353
|
<span class="ruby-identifier">action</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">select</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-operator">!=</span> <span class="ruby-string">''</span> }
|
352
354
|
[ <span class="ruby-identifier">action</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">action</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>], <span class="ruby-keyword">nil</span>, <span class="ruby-value">0</span> ]
|
353
355
|
<span class="ruby-keyword">end</span>
|
356
|
+
.<span class="ruby-identifier">select</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-value">0</span>] }
|
354
357
|
<span class="ruby-keyword">end</span>
|
355
358
|
<span class="ruby-keyword">end</span></pre>
|
356
359
|
</div>
|
data/doc/Bauxite/Selector.html
CHANGED
@@ -103,6 +103,8 @@
|
|
103
103
|
|
104
104
|
<li ><a href="#method-i-smart">#smart</a>
|
105
105
|
|
106
|
+
<li ><a href="#method-i-window">#window</a>
|
107
|
+
|
106
108
|
</ul>
|
107
109
|
</div>
|
108
110
|
|
@@ -498,6 +500,85 @@ child control element, including input, select, textarea and button).</p>
|
|
498
500
|
|
499
501
|
|
500
502
|
|
503
|
+
</div>
|
504
|
+
|
505
|
+
|
506
|
+
<div id="method-i-window" class="method-detail ">
|
507
|
+
|
508
|
+
<div class="method-heading">
|
509
|
+
<span class="method-name">window</span><span
|
510
|
+
class="method-args">(arg, &block)</span>
|
511
|
+
|
512
|
+
<span class="method-click-advice">click to toggle source</span>
|
513
|
+
|
514
|
+
</div>
|
515
|
+
|
516
|
+
|
517
|
+
<div class="method-description">
|
518
|
+
|
519
|
+
<p>Change the selector scope to the given window and finds an element in that
|
520
|
+
window.</p>
|
521
|
+
|
522
|
+
<p>This is a composite selector. The window selector syntax is:</p>
|
523
|
+
|
524
|
+
<pre>window=|window_name|child_selector</pre>
|
525
|
+
|
526
|
+
<p>Where <code>window_name</code> is the name or url pattern of the target
|
527
|
+
window, <code>child_selector</code> is any selector available that matches
|
528
|
+
the target element inside the target window.</p>
|
529
|
+
|
530
|
+
<p>Note that the '|' character can be replaced with any
|
531
|
+
single-character delimiter.</p>
|
532
|
+
|
533
|
+
<p>For example:</p>
|
534
|
+
|
535
|
+
<pre class="ruby"><span class="ruby-comment"># assuming <div id='label'>hello!</div> in popup.html</span>
|
536
|
+
<span class="ruby-identifier">js</span> <span class="ruby-string">"window.w = window.open('popup.html', 'mypopup')"</span>
|
537
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-string">"window=|mypopup|label"</span> <span class="ruby-string">"hello!"</span>
|
538
|
+
<span class="ruby-comment"># => this assertion would pass</span>
|
539
|
+
</pre>
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
<div class="method-source-code" id="window-source">
|
545
|
+
<pre><span class="ruby-comment"># File lib/bauxite/selectors/window.rb, line 44</span>
|
546
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">window</span>(<span class="ruby-identifier">arg</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
547
|
+
<span class="ruby-identifier">delimiter</span> = <span class="ruby-identifier">arg</span>[<span class="ruby-value">0</span>]
|
548
|
+
<span class="ruby-identifier">name</span>,<span class="ruby-identifier">child</span> = <span class="ruby-identifier">arg</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">split</span>(<span class="ruby-identifier">delimiter</span>, <span class="ruby-value">2</span>)
|
549
|
+
<span class="ruby-identifier">current</span> = <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">window_handle</span>
|
550
|
+
<span class="ruby-keyword">begin</span>
|
551
|
+
<span class="ruby-identifier">window_name</span> = <span class="ruby-identifier">name</span>
|
552
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">window_handles</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">name</span>
|
553
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^\/.*\/[imxo]*$/</span>
|
554
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">name</span>)
|
555
|
+
<span class="ruby-keyword">else</span>
|
556
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-node">/#{name}/</span>
|
557
|
+
<span class="ruby-keyword">end</span>
|
558
|
+
|
559
|
+
<span class="ruby-identifier">name</span> = <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">window_handles</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span>
|
560
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">switch_to</span>.<span class="ruby-identifier">window</span> <span class="ruby-identifier">h</span>
|
561
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">current_url</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">name</span>
|
562
|
+
<span class="ruby-keyword">end</span>
|
563
|
+
<span class="ruby-keyword">end</span>
|
564
|
+
|
565
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span>
|
566
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span>, <span class="ruby-node">"Cannot find a window matching '#{window_name}' (either by name exact match or by url regex)."</span>
|
567
|
+
<span class="ruby-keyword">end</span>
|
568
|
+
|
569
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">switch_to</span>.<span class="ruby-identifier">window</span> <span class="ruby-identifier">name</span>
|
570
|
+
<span class="ruby-identifier">find</span>(<span class="ruby-identifier">child</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
571
|
+
<span class="ruby-keyword">ensure</span>
|
572
|
+
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">switch_to</span>.<span class="ruby-identifier">window</span> <span class="ruby-identifier">current</span>
|
573
|
+
<span class="ruby-keyword">end</span>
|
574
|
+
<span class="ruby-keyword">end</span></pre>
|
575
|
+
</div>
|
576
|
+
|
577
|
+
</div>
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
501
582
|
</div>
|
502
583
|
|
503
584
|
|
data/doc/created.rid
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
1
|
+
Thu, 06 Feb 2014 16:42:43 -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
|
5
|
+
lib/bauxite/actions/assertw.rb Thu, 06 Feb 2014 15:42:37 -0300
|
6
|
+
lib/bauxite/actions/asserth.rb Thu, 06 Feb 2014 12:30:11 -0300
|
5
7
|
lib/bauxite/actions/wait.rb Mon, 27 Jan 2014 11:02:44 -0300
|
6
8
|
lib/bauxite/actions/assert.rb Mon, 27 Jan 2014 11:02:44 -0300
|
7
9
|
lib/bauxite/actions/ruby.rb Mon, 27 Jan 2014 11:02:44 -0300
|
@@ -36,16 +38,17 @@ lib/bauxite/core/parser.rb Tue, 28 Jan 2014 16:48:43 -0300
|
|
36
38
|
lib/bauxite/core/action.rb Wed, 05 Feb 2014 12:11:16 -0300
|
37
39
|
lib/bauxite/core/logger.rb Wed, 05 Feb 2014 12:11:16 -0300
|
38
40
|
lib/bauxite/parsers/default.rb Mon, 27 Jan 2014 11:02:44 -0300
|
39
|
-
lib/bauxite/parsers/html.rb
|
41
|
+
lib/bauxite/parsers/html.rb Thu, 06 Feb 2014 15:58:08 -0300
|
40
42
|
lib/bauxite/parsers/csv.rb Mon, 27 Jan 2014 11:02:44 -0300
|
41
43
|
lib/bauxite/application.rb Tue, 04 Feb 2014 10:09:38 -0300
|
44
|
+
lib/bauxite/selectors/window.rb Thu, 06 Feb 2014 16:39:12 -0300
|
42
45
|
lib/bauxite/selectors/frame.rb Wed, 29 Jan 2014 09:10:40 -0300
|
43
46
|
lib/bauxite/selectors/attr.rb Mon, 27 Jan 2014 11:02:44 -0300
|
44
47
|
lib/bauxite/selectors/sid.rb Wed, 29 Jan 2014 09:10:40 -0300
|
45
48
|
lib/bauxite/selectors/smart.rb Mon, 03 Feb 2014 10:56:01 -0300
|
46
49
|
lib/bauxite/loggers/terminal.rb Mon, 27 Jan 2014 11:04:47 -0300
|
47
50
|
lib/bauxite/loggers/echo.rb Mon, 27 Jan 2014 11:03:37 -0300
|
48
|
-
lib/bauxite/loggers/composite.rb
|
51
|
+
lib/bauxite/loggers/composite.rb Thu, 06 Feb 2014 15:49:54 -0300
|
49
52
|
lib/bauxite/loggers/xterm.rb Mon, 27 Jan 2014 11:02:44 -0300
|
50
53
|
lib/bauxite/loggers/file.rb Mon, 27 Jan 2014 11:02:44 -0300
|
51
54
|
lib/bauxite/loggers/html.rb Wed, 05 Feb 2014 12:12:28 -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","htmllogger","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()","finalize()","finalize()","finalize()","find()","find()","frame()","get_action()","get_value()","js()","load()","load_logger()","log()","log()","log()","log()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","loggers()","max_action_name_size()","new()","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::htmllogger","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::loggers::compositelogger#finalize()","bauxite::loggers::htmllogger#finalize()","bauxite::loggers::nulllogger#finalize()","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::htmllogger#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::htmllogger#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::htmllogger::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::HtmlLogger","","Bauxite/Loggers/HtmlLogger.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::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"],["finalize","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-finalize","(ctx)","<p>Completes the log execution.\n"],["finalize","Bauxite::Loggers::HtmlLogger","Bauxite/Loggers/HtmlLogger.html#method-i-finalize","(ctx)","<p>Completes the log execution.\n"],["finalize","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-finalize","(ctx)","<p>Completes the log execution.\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::HtmlLogger","Bauxite/Loggers/HtmlLogger.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::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::HtmlLogger","Bauxite/Loggers/HtmlLogger.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::HtmlLogger","Bauxite/Loggers/HtmlLogger.html#method-c-new","(options)","<p>Constructs a new null 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"]]}}
|
1
|
+
var search_data = {"index":{"searchIndex":["bauxite","action","actionmodule","application","context","errors","assertionerror","filenotfounderror","formaterror","loggers","compositelogger","echologger","filelogger","htmllogger","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()","asserth()","assertv()","assertw()","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()","finalize()","finalize()","finalize()","find()","find()","frame()","get_action()","get_value()","js()","load()","load_logger()","log()","log()","log()","log()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","loggers()","max_action_name_size()","new()","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()","window()","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::htmllogger","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#asserth()","bauxite::action#assertv()","bauxite::action#assertw()","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::loggers::compositelogger#finalize()","bauxite::loggers::htmllogger#finalize()","bauxite::loggers::nulllogger#finalize()","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::htmllogger#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::htmllogger#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::htmllogger::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::selector#window()","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::HtmlLogger","","Bauxite/Loggers/HtmlLogger.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::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"],["asserth","Bauxite::Action","Bauxite/Action.html#method-i-asserth","(*args)","<p>Replays the current GET request and asserts that the HTTP headers returned\nby that request match each …\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"],["assertw","Bauxite::Action","Bauxite/Action.html#method-i-assertw","(count = 1)","<p>Asserts that the number of currently open windows equals\n<code>count</code>.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">assertw</span>\n<span class=\"ruby-comment\"># => this assertion ...</span>\n</pre>\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"],["finalize","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-finalize","(ctx)","<p>Completes the log execution.\n"],["finalize","Bauxite::Loggers::HtmlLogger","Bauxite/Loggers/HtmlLogger.html#method-i-finalize","(ctx)","<p>Completes the log execution.\n"],["finalize","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-finalize","(ctx)","<p>Completes the log execution.\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::HtmlLogger","Bauxite/Loggers/HtmlLogger.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::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::HtmlLogger","Bauxite/Loggers/HtmlLogger.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::HtmlLogger","Bauxite/Loggers/HtmlLogger.html#method-c-new","(options)","<p>Constructs a new null 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"],["window","Bauxite::Selector","Bauxite/Selector.html#method-i-window","(arg, &block)","<p>Change the selector scope to the given window and finds an element in that\nwindow.\n<p>This is a composite …\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"]]}}
|
data/doc/table_of_contents.html
CHANGED
@@ -306,11 +306,21 @@
|
|
306
306
|
—
|
307
307
|
<span class="container">Bauxite::Action</span>
|
308
308
|
|
309
|
+
<li class="method">
|
310
|
+
<a href="Bauxite/Action.html#method-i-asserth">#asserth</a>
|
311
|
+
—
|
312
|
+
<span class="container">Bauxite::Action</span>
|
313
|
+
|
309
314
|
<li class="method">
|
310
315
|
<a href="Bauxite/Action.html#method-i-assertv">#assertv</a>
|
311
316
|
—
|
312
317
|
<span class="container">Bauxite::Action</span>
|
313
318
|
|
319
|
+
<li class="method">
|
320
|
+
<a href="Bauxite/Action.html#method-i-assertw">#assertw</a>
|
321
|
+
—
|
322
|
+
<span class="container">Bauxite::Action</span>
|
323
|
+
|
314
324
|
<li class="method">
|
315
325
|
<a href="Bauxite/Selector.html#method-i-attr">#attr</a>
|
316
326
|
—
|
@@ -336,15 +346,20 @@
|
|
336
346
|
—
|
337
347
|
<span class="container">Bauxite::Parser</span>
|
338
348
|
|
349
|
+
<li class="method">
|
350
|
+
<a href="Bauxite/Action.html#method-i-debug">#debug</a>
|
351
|
+
—
|
352
|
+
<span class="container">Bauxite::Action</span>
|
353
|
+
|
339
354
|
<li class="method">
|
340
355
|
<a href="Bauxite/Context.html#method-i-debug">#debug</a>
|
341
356
|
—
|
342
357
|
<span class="container">Bauxite::Context</span>
|
343
358
|
|
344
359
|
<li class="method">
|
345
|
-
<a href="Bauxite/
|
360
|
+
<a href="Bauxite/Loggers/CompositeLogger.html#method-i-debug_prompt">#debug_prompt</a>
|
346
361
|
—
|
347
|
-
<span class="container">Bauxite::
|
362
|
+
<span class="container">Bauxite::Loggers::CompositeLogger</span>
|
348
363
|
|
349
364
|
<li class="method">
|
350
365
|
<a href="Bauxite/Loggers/NullLogger.html#method-i-debug_prompt">#debug_prompt</a>
|
@@ -356,11 +371,6 @@
|
|
356
371
|
—
|
357
372
|
<span class="container">Bauxite::Loggers::TerminalLogger</span>
|
358
373
|
|
359
|
-
<li class="method">
|
360
|
-
<a href="Bauxite/Loggers/CompositeLogger.html#method-i-debug_prompt">#debug_prompt</a>
|
361
|
-
—
|
362
|
-
<span class="container">Bauxite::Loggers::CompositeLogger</span>
|
363
|
-
|
364
374
|
<li class="method">
|
365
375
|
<a href="Bauxite/Parser.html#method-i-default">#default</a>
|
366
376
|
—
|
@@ -417,9 +427,9 @@
|
|
417
427
|
<span class="container">Bauxite::Action</span>
|
418
428
|
|
419
429
|
<li class="method">
|
420
|
-
<a href="Bauxite/Loggers/
|
430
|
+
<a href="Bauxite/Loggers/CompositeLogger.html#method-i-finalize">#finalize</a>
|
421
431
|
—
|
422
|
-
<span class="container">Bauxite::Loggers::
|
432
|
+
<span class="container">Bauxite::Loggers::CompositeLogger</span>
|
423
433
|
|
424
434
|
<li class="method">
|
425
435
|
<a href="Bauxite/Loggers/NullLogger.html#method-i-finalize">#finalize</a>
|
@@ -427,9 +437,9 @@
|
|
427
437
|
<span class="container">Bauxite::Loggers::NullLogger</span>
|
428
438
|
|
429
439
|
<li class="method">
|
430
|
-
<a href="Bauxite/Loggers/
|
440
|
+
<a href="Bauxite/Loggers/HtmlLogger.html#method-i-finalize">#finalize</a>
|
431
441
|
—
|
432
|
-
<span class="container">Bauxite::Loggers::
|
442
|
+
<span class="container">Bauxite::Loggers::HtmlLogger</span>
|
433
443
|
|
434
444
|
<li class="method">
|
435
445
|
<a href="Bauxite/Context.html#method-i-find">#find</a>
|
@@ -467,9 +477,9 @@
|
|
467
477
|
<span class="container">Bauxite::Action</span>
|
468
478
|
|
469
479
|
<li class="method">
|
470
|
-
<a href="Bauxite/Loggers/
|
480
|
+
<a href="Bauxite/Loggers/CompositeLogger.html#method-i-log">#log</a>
|
471
481
|
—
|
472
|
-
<span class="container">Bauxite::Loggers::
|
482
|
+
<span class="container">Bauxite::Loggers::CompositeLogger</span>
|
473
483
|
|
474
484
|
<li class="method">
|
475
485
|
<a href="Bauxite/Loggers/TerminalLogger.html#method-i-log">#log</a>
|
@@ -477,9 +487,9 @@
|
|
477
487
|
<span class="container">Bauxite::Loggers::TerminalLogger</span>
|
478
488
|
|
479
489
|
<li class="method">
|
480
|
-
<a href="Bauxite/Loggers/
|
490
|
+
<a href="Bauxite/Loggers/HtmlLogger.html#method-i-log">#log</a>
|
481
491
|
—
|
482
|
-
<span class="container">Bauxite::Loggers::
|
492
|
+
<span class="container">Bauxite::Loggers::HtmlLogger</span>
|
483
493
|
|
484
494
|
<li class="method">
|
485
495
|
<a href="Bauxite/Loggers/NullLogger.html#method-i-log">#log</a>
|
@@ -487,24 +497,24 @@
|
|
487
497
|
<span class="container">Bauxite::Loggers::NullLogger</span>
|
488
498
|
|
489
499
|
<li class="method">
|
490
|
-
<a href="Bauxite/Loggers/
|
500
|
+
<a href="Bauxite/Loggers/EchoLogger.html#method-i-log_cmd">#log_cmd</a>
|
491
501
|
—
|
492
|
-
<span class="container">Bauxite::Loggers::
|
502
|
+
<span class="container">Bauxite::Loggers::EchoLogger</span>
|
493
503
|
|
494
504
|
<li class="method">
|
495
|
-
<a href="Bauxite/Loggers/
|
505
|
+
<a href="Bauxite/Loggers/TerminalLogger.html#method-i-log_cmd">#log_cmd</a>
|
496
506
|
—
|
497
|
-
<span class="container">Bauxite::Loggers::
|
507
|
+
<span class="container">Bauxite::Loggers::TerminalLogger</span>
|
498
508
|
|
499
509
|
<li class="method">
|
500
|
-
<a href="Bauxite/Loggers/
|
510
|
+
<a href="Bauxite/Loggers/FileLogger.html#method-i-log_cmd">#log_cmd</a>
|
501
511
|
—
|
502
|
-
<span class="container">Bauxite::Loggers::
|
512
|
+
<span class="container">Bauxite::Loggers::FileLogger</span>
|
503
513
|
|
504
514
|
<li class="method">
|
505
|
-
<a href="Bauxite/Loggers/
|
515
|
+
<a href="Bauxite/Loggers/CompositeLogger.html#method-i-log_cmd">#log_cmd</a>
|
506
516
|
—
|
507
|
-
<span class="container">Bauxite::Loggers::
|
517
|
+
<span class="container">Bauxite::Loggers::CompositeLogger</span>
|
508
518
|
|
509
519
|
<li class="method">
|
510
520
|
<a href="Bauxite/Loggers/HtmlLogger.html#method-i-log_cmd">#log_cmd</a>
|
@@ -536,6 +546,11 @@
|
|
536
546
|
—
|
537
547
|
<span class="container">Bauxite::Context</span>
|
538
548
|
|
549
|
+
<li class="method">
|
550
|
+
<a href="Bauxite/Loggers/NullLogger.html#method-i-progress">#progress</a>
|
551
|
+
—
|
552
|
+
<span class="container">Bauxite::Loggers::NullLogger</span>
|
553
|
+
|
539
554
|
<li class="method">
|
540
555
|
<a href="Bauxite/Loggers/CompositeLogger.html#method-i-progress">#progress</a>
|
541
556
|
—
|
@@ -546,11 +561,6 @@
|
|
546
561
|
—
|
547
562
|
<span class="container">Bauxite::Loggers::TerminalLogger</span>
|
548
563
|
|
549
|
-
<li class="method">
|
550
|
-
<a href="Bauxite/Loggers/NullLogger.html#method-i-progress">#progress</a>
|
551
|
-
—
|
552
|
-
<span class="container">Bauxite::Loggers::NullLogger</span>
|
553
|
-
|
554
564
|
<li class="method">
|
555
565
|
<a href="Bauxite/Action.html#method-i-replace">#replace</a>
|
556
566
|
—
|
@@ -651,6 +661,11 @@
|
|
651
661
|
—
|
652
662
|
<span class="container">Bauxite::Action</span>
|
653
663
|
|
664
|
+
<li class="method">
|
665
|
+
<a href="Bauxite/Selector.html#method-i-window">#window</a>
|
666
|
+
—
|
667
|
+
<span class="container">Bauxite::Selector</span>
|
668
|
+
|
654
669
|
<li class="method">
|
655
670
|
<a href="Bauxite/Context.html#method-i-with_driver_timeout">#with_driver_timeout</a>
|
656
671
|
—
|
@@ -0,0 +1,60 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2014 Patricio Zavolinsky
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
#++
|
22
|
+
require 'net/http'
|
23
|
+
|
24
|
+
class Bauxite::Action
|
25
|
+
# Replays the current GET request and asserts that the HTTP headers
|
26
|
+
# returned by that request match each of the +args+ specified.
|
27
|
+
#
|
28
|
+
# Note that this action results in an additional HTTP GET request to
|
29
|
+
# the current browser url.
|
30
|
+
#
|
31
|
+
# The syntax of +args+ is:
|
32
|
+
# "header_name1=expression1" "header_name2=expression2" ...
|
33
|
+
#
|
34
|
+
# Where +expression+ is a regular expression. Note that multiple
|
35
|
+
# headers can be asserted in a single #asserth call. Also note that
|
36
|
+
# if the same header is specified more than once, the value of the
|
37
|
+
# header must match every expression specified.
|
38
|
+
#
|
39
|
+
# For example:
|
40
|
+
# # assuming response headers { 'Content-Type' => 'text/plain' }
|
41
|
+
# asserth "content-type=plain"
|
42
|
+
# asserth "content-type=^text" "content-type=/plain$"
|
43
|
+
# # => these assertions would pass
|
44
|
+
#
|
45
|
+
# :category: Action Methods
|
46
|
+
def asserth(*args)
|
47
|
+
uri = URI(@ctx.driver.current_url)
|
48
|
+
res = Net::HTTP.get_response(uri)
|
49
|
+
args.each do |a|
|
50
|
+
name,value = a.split('=', 2);
|
51
|
+
name = name.strip.downcase
|
52
|
+
value = value.strip
|
53
|
+
|
54
|
+
actual = res[name] || ''
|
55
|
+
unless actual =~ _pattern(value)
|
56
|
+
raise Bauxite::Errors::AssertionError, "Assertion failed for HTTP Header '#{name}': expected '#{value}', got '#{actual}'"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2014 Patricio Zavolinsky
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
#++
|
22
|
+
|
23
|
+
class Bauxite::Action
|
24
|
+
# Asserts that the number of currently open windows equals +count+.
|
25
|
+
#
|
26
|
+
# For example:
|
27
|
+
# assertw
|
28
|
+
# # => this assertion would pass (only the main window is open)
|
29
|
+
#
|
30
|
+
# js "window.w = window.open()"
|
31
|
+
# assertw 2
|
32
|
+
# # => this assertion would pass (main window and popup)
|
33
|
+
#
|
34
|
+
# js "setTimeout(function() { window.w.close(); }, 3000);"
|
35
|
+
# assertw 1
|
36
|
+
# # => this assertion would pass (popup was closed)
|
37
|
+
#
|
38
|
+
# :category: Action Methods
|
39
|
+
def assertw(count = 1)
|
40
|
+
@ctx.with_timeout Bauxite::Errors::AssertionError do
|
41
|
+
unless @ctx.driver.window_handles.size == count.to_i
|
42
|
+
raise Bauxite::Errors::AssertionError, "Assertion failed: all popups must be closed."
|
43
|
+
end
|
44
|
+
true
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -30,6 +30,12 @@ class Bauxite::Loggers::CompositeLogger
|
|
30
30
|
|
31
31
|
# Constructs a new composite logger instance.
|
32
32
|
def initialize(options)
|
33
|
+
unless options[:loggers]
|
34
|
+
raise ArgumentError, "Missing required logger option 'loggers'. "+
|
35
|
+
"The value of this option is a comma-separated list of valid loggers. "+
|
36
|
+
"For example loggers=xterm,file."
|
37
|
+
end
|
38
|
+
|
33
39
|
@loggers = options[:loggers].split(',').map do |l|
|
34
40
|
Bauxite::Context::load_logger(l, options)
|
35
41
|
end
|
data/lib/bauxite/parsers/html.rb
CHANGED
@@ -42,7 +42,7 @@ class Bauxite::Parser
|
|
42
42
|
.select { |match| match }
|
43
43
|
.map { |match| match.captures }
|
44
44
|
.map do |action|
|
45
|
-
case action[0]
|
45
|
+
case action[0].downcase
|
46
46
|
when 'open'
|
47
47
|
url = action[1]
|
48
48
|
url = url[1..-1] if url[0] == '/' and base_ends_in_slash # remove leading '/'
|
@@ -50,21 +50,24 @@ class Bauxite::Parser
|
|
50
50
|
when 'type'
|
51
51
|
action[0] = 'write'
|
52
52
|
action[1] = _selenium_ide_html_parse_selector(action[1])
|
53
|
-
when '
|
53
|
+
when 'verifytextpresent'
|
54
54
|
action[0] = 'source'
|
55
|
-
when '
|
55
|
+
when 'clickandwait', 'click'
|
56
56
|
action[0] = 'click'
|
57
57
|
action[1] = _selenium_ide_html_parse_selector(action[1])
|
58
|
-
when '
|
58
|
+
when 'waitforpagetoload'
|
59
59
|
action[0] = 'wait'
|
60
60
|
action[1] = (action[1].to_i / 1000).to_s
|
61
|
-
when '
|
61
|
+
when 'assertvalue'
|
62
62
|
action[0] = 'assert'
|
63
63
|
action[1] = _selenium_ide_html_parse_selector(action[1])
|
64
|
+
when 'waitforpopup'
|
65
|
+
action = [] # remove
|
64
66
|
end
|
65
67
|
action = action.select { |a| a != '' }
|
66
68
|
[ action[0], action[1..-1], nil, 0 ]
|
67
69
|
end
|
70
|
+
.select { |a| a[0] }
|
68
71
|
end
|
69
72
|
end
|
70
73
|
|
@@ -0,0 +1,73 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2014 Patricio Zavolinsky
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
# SOFTWARE.
|
21
|
+
#++
|
22
|
+
|
23
|
+
class Bauxite::Selector
|
24
|
+
# Change the selector scope to the given window and finds an element in that
|
25
|
+
# window.
|
26
|
+
#
|
27
|
+
# This is a composite selector. The window selector syntax is:
|
28
|
+
# window=|window_name|child_selector
|
29
|
+
#
|
30
|
+
# Where +window_name+ is the name or url pattern of the target window,
|
31
|
+
# +child_selector+ is any selector available that matches the target
|
32
|
+
# element inside the target window.
|
33
|
+
#
|
34
|
+
# Note that the '|' character can be replaced with any single-character
|
35
|
+
# delimiter.
|
36
|
+
#
|
37
|
+
# For example:
|
38
|
+
# # assuming <div id='label'>hello!</div> in popup.html
|
39
|
+
# js "window.w = window.open('popup.html', 'mypopup')"
|
40
|
+
# assert "window=|mypopup|label" "hello!"
|
41
|
+
# # => this assertion would pass
|
42
|
+
#
|
43
|
+
# :category: Selector Methods
|
44
|
+
def window(arg, &block)
|
45
|
+
delimiter = arg[0]
|
46
|
+
name,child = arg[1..-1].split(delimiter, 2)
|
47
|
+
current = @ctx.driver.window_handle
|
48
|
+
begin
|
49
|
+
window_name = name
|
50
|
+
unless @ctx.driver.window_handles.include? name
|
51
|
+
if name =~ /^\/.*\/[imxo]*$/
|
52
|
+
name = eval(name)
|
53
|
+
else
|
54
|
+
name = /#{name}/
|
55
|
+
end
|
56
|
+
|
57
|
+
name = @ctx.driver.window_handles.find do |h|
|
58
|
+
@ctx.driver.switch_to.window h
|
59
|
+
@ctx.driver.current_url =~ name
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
unless name
|
64
|
+
raise Bauxite::Errors::AssertionError, "Cannot find a window matching '#{window_name}' (either by name exact match or by url regex)."
|
65
|
+
end
|
66
|
+
|
67
|
+
@ctx.driver.switch_to.window name
|
68
|
+
find(child, &block)
|
69
|
+
ensure
|
70
|
+
@ctx.driver.switch_to.window current
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
data/lib/bauxite.rb
CHANGED
data/test/asserth.bxt
ADDED
data/test/assertw.bxt
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patricio Zavolinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|
@@ -119,7 +119,9 @@ files:
|
|
119
119
|
- lib/bauxite.rb
|
120
120
|
- lib/bauxite/actions/alias.rb
|
121
121
|
- lib/bauxite/actions/assert.rb
|
122
|
+
- lib/bauxite/actions/asserth.rb
|
122
123
|
- lib/bauxite/actions/assertv.rb
|
124
|
+
- lib/bauxite/actions/assertw.rb
|
123
125
|
- lib/bauxite/actions/break.rb
|
124
126
|
- lib/bauxite/actions/capture.rb
|
125
127
|
- lib/bauxite/actions/click.rb
|
@@ -166,8 +168,11 @@ files:
|
|
166
168
|
- lib/bauxite/selectors/frame.rb
|
167
169
|
- lib/bauxite/selectors/sid.rb
|
168
170
|
- lib/bauxite/selectors/smart.rb
|
171
|
+
- lib/bauxite/selectors/window.rb
|
169
172
|
- test/alias.bxt
|
173
|
+
- test/asserth.bxt
|
170
174
|
- test/assertv.bxt
|
175
|
+
- test/assertw.bxt
|
171
176
|
- test/capture.bxt.manual
|
172
177
|
- test/capture/my_test.bxt
|
173
178
|
- test/capture/page.html
|