bauxite 0.6.15 → 0.6.16
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 +1 -1
- data/doc/Bauxite/Selector.html +67 -0
- data/doc/created.rid +3 -2
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +45 -40
- data/lib/bauxite.rb +1 -1
- data/lib/bauxite/actions/failif.rb +1 -1
- data/lib/bauxite/selectors/json.rb +88 -0
- data/test/json.bxt +20 -0
- data/test/json/array.json +4 -0
- data/test/json/object.json +14 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47066a48c6d91a2f266312e543944562d5643afb
|
4
|
+
data.tar.gz: e42af8083729ab30450299392e0a9079689abbbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 955f49ef5a52db41e38b3a000a02b8d76fd0bad99b96b7f639cafb3553e3a4da85bf2776b57397ea409cd2866808b491bfab4d4d6c3d9cdd4a261c01363a7f6b
|
7
|
+
data.tar.gz: 251eeaf915f35f0a332486588404c28862e79dcb084629790cf7224d381d14e5fa09b05247d677fa136dd42f34d46366585055889c91a9034ddbc9282eefc468
|
data/doc/Bauxite/Action.html
CHANGED
@@ -1143,7 +1143,7 @@ href="Action.html#method-i-test">test</a>, etc.) is undefined.</p>
|
|
1143
1143
|
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">with_vars</span>({ <span class="ruby-string">'__TIMEOUT__'</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>}) <span class="ruby-keyword">do</span>
|
1144
1144
|
<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">exec_parsed_action</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-keyword">false</span>)
|
1145
1145
|
<span class="ruby-keyword">end</span>
|
1146
|
-
<span class="ruby-keyword">rescue</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>
|
1146
|
+
<span class="ruby-keyword">rescue</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-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">NoSuchElementError</span>
|
1147
1147
|
<span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
|
1148
1148
|
<span class="ruby-keyword">end</span>
|
1149
1149
|
<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 did not failed as expected:#{action} #{args.join(' ')}"</span>
|
data/doc/Bauxite/Selector.html
CHANGED
@@ -99,6 +99,8 @@
|
|
99
99
|
|
100
100
|
<li ><a href="#method-i-frame">#frame</a>
|
101
101
|
|
102
|
+
<li ><a href="#method-i-json">#json</a>
|
103
|
+
|
102
104
|
<li ><a href="#method-i-sid">#sid</a>
|
103
105
|
|
104
106
|
<li ><a href="#method-i-smart">#smart</a>
|
@@ -368,6 +370,71 @@ selector.</p>
|
|
368
370
|
|
369
371
|
|
370
372
|
|
373
|
+
</div>
|
374
|
+
|
375
|
+
|
376
|
+
<div id="method-i-json" class="method-detail ">
|
377
|
+
|
378
|
+
<div class="method-heading">
|
379
|
+
<span class="method-name">json</span><span
|
380
|
+
class="method-args">(arg) { |element| ... }</span>
|
381
|
+
|
382
|
+
<span class="method-click-advice">click to toggle source</span>
|
383
|
+
|
384
|
+
</div>
|
385
|
+
|
386
|
+
|
387
|
+
<div class="method-description">
|
388
|
+
|
389
|
+
<p>Select a field in a JSON document.</p>
|
390
|
+
|
391
|
+
<p>The JSON selector syntax is:</p>
|
392
|
+
|
393
|
+
<pre class="ruby"><span class="ruby-comment"># For objects:</span>
|
394
|
+
<span class="ruby-identifier">json</span>=<span class="ruby-identifier">key</span> <span class="ruby-comment"># {"key":1} => 1</span>
|
395
|
+
<span class="ruby-identifier">json</span>=<span class="ruby-identifier">key</span>.<span class="ruby-identifier">subkey</span> <span class="ruby-comment"># {"key":{"subkey":2}} => 2</span>
|
396
|
+
<span class="ruby-identifier">json</span>=<span class="ruby-identifier">key</span>[<span class="ruby-value">0</span>] <span class="ruby-comment"># {"key": [3]} => 3</span>
|
397
|
+
<span class="ruby-identifier">json</span>=<span class="ruby-identifier">key</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">subkey</span> <span class="ruby-comment"># {"key": [{"subkey":4}]} => 4</span>
|
398
|
+
<span class="ruby-identifier">json</span>=<span class="ruby-identifier">key</span>.<span class="ruby-identifier">length</span> <span class="ruby-comment"># {"key": [5]} => 1</span>
|
399
|
+
|
400
|
+
<span class="ruby-comment"># For arrays:</span>
|
401
|
+
<span class="ruby-identifier">json</span>=[<span class="ruby-value">0</span>] <span class="ruby-comment"># [1] => 1</span>
|
402
|
+
<span class="ruby-identifier">json</span>=[<span class="ruby-value">1</span>].<span class="ruby-identifier">value</span> <span class="ruby-comment"># [{"value": 2}] => 2</span>
|
403
|
+
<span class="ruby-identifier">json</span>=<span class="ruby-identifier">length</span> <span class="ruby-comment"># [3] => 1</span>
|
404
|
+
</pre>
|
405
|
+
|
406
|
+
<p>For example:</p>
|
407
|
+
|
408
|
+
<pre class="ruby"><span class="ruby-comment"># assuming {"key": [{"subkey":4},{"val":"42"}]}</span>
|
409
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">json</span>=<span class="ruby-identifier">key</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">subkey</span> <span class="ruby-value">4</span>
|
410
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">json</span>=<span class="ruby-identifier">key</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">val</span> <span class="ruby-value">42</span>
|
411
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-identifier">json</span>=<span class="ruby-identifier">key</span>.<span class="ruby-identifier">length</span> <span class="ruby-value">2</span>
|
412
|
+
<span class="ruby-comment"># => these assertions would pass</span>
|
413
|
+
</pre>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
<div class="method-source-code" id="json-source">
|
419
|
+
<pre><span class="ruby-comment"># File lib/bauxite/selectors/json.rb, line 49</span>
|
420
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">json</span>(<span class="ruby-identifier">arg</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
421
|
+
<span class="ruby-identifier">source</span> = <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-identifier">parse</span>(<span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">page_source</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^<html[^>]*>.*<pre>/</span>, <span class="ruby-string">''</span>).<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/<\/pre>.*<\/html>$/</span>, <span class="ruby-string">''</span>))
|
422
|
+
<span class="ruby-identifier">element</span> = <span class="ruby-identifier">_json_find</span>(<span class="ruby-identifier">source</span>, <span class="ruby-identifier">arg</span>)
|
423
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">NoSuchElementError</span>, <span class="ruby-node">"Cannot find JSON element: #{arg}"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">element</span>
|
424
|
+
|
425
|
+
<span class="ruby-identifier">element</span> = <span class="ruby-identifier">element</span>.<span class="ruby-identifier">to_s</span>
|
426
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">text</span>; <span class="ruby-keyword">self</span>; <span class="ruby-keyword">end</span>
|
427
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">element</span>.<span class="ruby-identifier">tag_name</span>; <span class="ruby-string">'json'</span>; <span class="ruby-keyword">end</span>
|
428
|
+
<span class="ruby-keyword">yield</span> <span class="ruby-identifier">element</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
|
429
|
+
<span class="ruby-identifier">element</span>
|
430
|
+
<span class="ruby-keyword">end</span></pre>
|
431
|
+
</div>
|
432
|
+
|
433
|
+
</div>
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
371
438
|
</div>
|
372
439
|
|
373
440
|
|
data/doc/created.rid
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
|
1
|
+
Sun, 28 Dec 2014 11:06:40 -0300
|
2
2
|
README.md Wed, 26 Mar 2014 13:39:30 -0300
|
3
3
|
lib/bauxite/selectors/smart.rb Wed, 26 Mar 2014 13:39:30 -0300
|
4
|
+
lib/bauxite/selectors/json.rb Sun, 28 Dec 2014 10:59:40 -0300
|
4
5
|
lib/bauxite/selectors/attr.rb Wed, 26 Mar 2014 13:39:30 -0300
|
5
6
|
lib/bauxite/selectors/frame.rb Wed, 26 Mar 2014 13:39:30 -0300
|
6
7
|
lib/bauxite/selectors/sid.rb Wed, 26 Mar 2014 13:39:30 -0300
|
@@ -23,7 +24,7 @@ lib/bauxite/actions/alias.rb Wed, 26 Mar 2014 13:39:30 -0300
|
|
23
24
|
lib/bauxite/actions/write.rb Wed, 26 Mar 2014 13:39:30 -0300
|
24
25
|
lib/bauxite/actions/dounless.rb Thu, 05 Jun 2014 16:39:48 -0300
|
25
26
|
lib/bauxite/actions/select.rb Wed, 26 Mar 2014 13:39:30 -0300
|
26
|
-
lib/bauxite/actions/failif.rb
|
27
|
+
lib/bauxite/actions/failif.rb Sun, 28 Dec 2014 10:37:02 -0300
|
27
28
|
lib/bauxite/actions/doif.rb Wed, 26 Mar 2014 13:39:30 -0300
|
28
29
|
lib/bauxite/actions/setif.rb Wed, 26 Mar 2014 13:39:30 -0300
|
29
30
|
lib/bauxite/actions/wait.rb Wed, 26 Mar 2014 13:39:30 -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","reportlogger","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()","assertm()","assertv()","assertw()","attr()","break_action()","capture()","click()","csv()","debug()","debug()","debug_prompt()","debug_prompt()","debug_prompt()","default()","doif()","dounless()","driver()","echo()","exec()","exec_action()","exec_action_object()","exec_file()","exec_parsed_action()","execute()","exit_action()","expand()","failif()","finalize()","finalize()","finalize()","finalize()","finalize()","find()","find()","frame()","get_action()","get_value()","js()","load()","load_logger()","log()","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()","new()","open()","output_path()","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::reportlogger","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#assertm()","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#dounless()","bauxite::context#driver()","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::action#exit_action()","bauxite::context#expand()","bauxite::action#failif()","bauxite::loggers::compositelogger#finalize()","bauxite::loggers::filelogger#finalize()","bauxite::loggers::htmllogger#finalize()","bauxite::loggers::nulllogger#finalize()","bauxite::loggers::reportlogger#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::filelogger#log()","bauxite::loggers::nulllogger#log()","bauxite::loggers::reportlogger#log()","bauxite::loggers::terminallogger#log()","bauxite::loggers::compositelogger#log_cmd()","bauxite::loggers::echologger#log_cmd()","bauxite::loggers::filelogger#log_cmd()","bauxite::loggers::nulllogger#log_cmd()","bauxite::loggers::reportlogger#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::reportlogger::new()","bauxite::loggers::terminallogger::new()","bauxite::parsermodule::new()","bauxite::selectormodule::new()","bauxite::action#open()","bauxite::context#output_path()","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>Composite logger …\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>Html logger.\n<p>This logger creates an HTML report of the test execution, linking to the\ncaptures taken, …\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::ReportLogger","","Bauxite/Loggers/ReportLogger.html","","<p>Report logger.\n<p>This base logger class can be inherited to create reporting loggers.\n<p>Descendent classes …\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<p>XTerm logger …\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"],["assertm","Bauxite::Action","Bauxite/Action.html#method-i-assertm","(text, action = 'accept')","<p>Asserts that a native modal popup is present (e.g. alert, confirm, prompt,\netc.) and that its text matches …\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"],["dounless","Bauxite::Action","Bauxite/Action.html#method-i-dounless","(expected, actual, action, *args)","<p>Executes <code>action</code> only if <code>expected</code> does not match\n<code>actual</code>.\n<p>The conditional check in this action is similar …\n"],["driver","Bauxite::Context","Bauxite/Context.html#method-i-driver","()","<p>Test engine driver instance (Selenium WebDriver).\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"],["exit_action","Bauxite::Action","Bauxite/Action.html#method-i-exit_action","()","<p>Aborts the execution of the current context.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">exit</span>\n<span class=\"ruby-identifier\">assertv</span> <span class=\"ruby-keyword\">true</span> <span class=\"ruby-keyword\">false</span>\n<span class=\"ruby-comment\"># => the assertv will ...</span>\n</pre>\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::FileLogger","Bauxite/Loggers/FileLogger.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"],["finalize","Bauxite::Loggers::ReportLogger","Bauxite/Loggers/ReportLogger.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","(loggers, 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::FileLogger","Bauxite/Loggers/FileLogger.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::ReportLogger","Bauxite/Loggers/ReportLogger.html#method-i-log","(s, type = :info)","<p>Logs the specified string.\n<p><code>type</code>, if specified, should be one of <code>:error</code>,\n<code>:warning</code>, <code>:info</code> (default), <code>:debug</code> …\n"],["log","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log_cmd","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log_cmd","(action, &block)","<p>Pretty prints action information and status.\n<p>This implementation only yileds in the first logger.\n<p>Additional …\n"],["log_cmd","Bauxite::Loggers::EchoLogger","Bauxite/Loggers/EchoLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log_cmd","(action)","<p>Executes the given block in a logging context.\n<p>This default implementation does not provide any logging …\n"],["log_cmd","Bauxite::Loggers::ReportLogger","Bauxite/Loggers/ReportLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\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, loggers = nil)","<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::ReportLogger","Bauxite/Loggers/ReportLogger.html#method-c-new","(options)","<p>Constructs a new report 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"],["output_path","Bauxite::Context","Bauxite/Context.html#method-i-output_path","(path)","<p>Returns the output path for <code>path</code> accounting for the \n<code>__OUTPUT__</code> variable.\n<p>For example:\n\n<pre># assuming --output ...</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, *vars)","<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"]]}}
|
1
|
+
var search_data = {"index":{"searchIndex":["bauxite","action","actionmodule","application","context","errors","assertionerror","filenotfounderror","formaterror","loggers","compositelogger","echologger","filelogger","htmllogger","nulllogger","reportlogger","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()","assertm()","assertv()","assertw()","attr()","break_action()","capture()","click()","csv()","debug()","debug()","debug_prompt()","debug_prompt()","debug_prompt()","default()","doif()","dounless()","driver()","echo()","exec()","exec_action()","exec_action_object()","exec_file()","exec_parsed_action()","execute()","exit_action()","expand()","failif()","finalize()","finalize()","finalize()","finalize()","finalize()","find()","find()","frame()","get_action()","get_value()","js()","json()","load()","load_logger()","log()","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()","new()","open()","output_path()","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::reportlogger","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#assertm()","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#dounless()","bauxite::context#driver()","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::action#exit_action()","bauxite::context#expand()","bauxite::action#failif()","bauxite::loggers::compositelogger#finalize()","bauxite::loggers::filelogger#finalize()","bauxite::loggers::htmllogger#finalize()","bauxite::loggers::nulllogger#finalize()","bauxite::loggers::reportlogger#finalize()","bauxite::context#find()","bauxite::selectormodule#find()","bauxite::selector#frame()","bauxite::context#get_action()","bauxite::context#get_value()","bauxite::action#js()","bauxite::selector#json()","bauxite::action#load()","bauxite::context::load_logger()","bauxite::loggers::compositelogger#log()","bauxite::loggers::filelogger#log()","bauxite::loggers::nulllogger#log()","bauxite::loggers::reportlogger#log()","bauxite::loggers::terminallogger#log()","bauxite::loggers::compositelogger#log_cmd()","bauxite::loggers::echologger#log_cmd()","bauxite::loggers::filelogger#log_cmd()","bauxite::loggers::nulllogger#log_cmd()","bauxite::loggers::reportlogger#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::reportlogger::new()","bauxite::loggers::terminallogger::new()","bauxite::parsermodule::new()","bauxite::selectormodule::new()","bauxite::action#open()","bauxite::context#output_path()","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>Composite logger …\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>Html logger.\n<p>This logger creates an HTML report of the test execution, linking to the\ncaptures taken, …\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::ReportLogger","","Bauxite/Loggers/ReportLogger.html","","<p>Report logger.\n<p>This base logger class can be inherited to create reporting loggers.\n<p>Descendent classes …\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<p>XTerm logger …\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"],["assertm","Bauxite::Action","Bauxite/Action.html#method-i-assertm","(text, action = 'accept')","<p>Asserts that a native modal popup is present (e.g. alert, confirm, prompt,\netc.) and that its text matches …\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"],["dounless","Bauxite::Action","Bauxite/Action.html#method-i-dounless","(expected, actual, action, *args)","<p>Executes <code>action</code> only if <code>expected</code> does not match\n<code>actual</code>.\n<p>The conditional check in this action is similar …\n"],["driver","Bauxite::Context","Bauxite/Context.html#method-i-driver","()","<p>Test engine driver instance (Selenium WebDriver).\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"],["exit_action","Bauxite::Action","Bauxite/Action.html#method-i-exit_action","()","<p>Aborts the execution of the current context.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">exit</span>\n<span class=\"ruby-identifier\">assertv</span> <span class=\"ruby-keyword\">true</span> <span class=\"ruby-keyword\">false</span>\n<span class=\"ruby-comment\"># => the assertv will ...</span>\n</pre>\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::FileLogger","Bauxite/Loggers/FileLogger.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"],["finalize","Bauxite::Loggers::ReportLogger","Bauxite/Loggers/ReportLogger.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"],["json","Bauxite::Selector","Bauxite/Selector.html#method-i-json","(arg, &block)","<p>Select a field in a JSON document.\n<p>The JSON selector syntax is:\n\n<pre># For objects:\njson=key # {"key":1} ...</pre>\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","(loggers, 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::FileLogger","Bauxite/Loggers/FileLogger.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::ReportLogger","Bauxite/Loggers/ReportLogger.html#method-i-log","(s, type = :info)","<p>Logs the specified string.\n<p><code>type</code>, if specified, should be one of <code>:error</code>,\n<code>:warning</code>, <code>:info</code> (default), <code>:debug</code> …\n"],["log","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log_cmd","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log_cmd","(action, &block)","<p>Pretty prints action information and status.\n<p>This implementation only yileds in the first logger.\n<p>Additional …\n"],["log_cmd","Bauxite::Loggers::EchoLogger","Bauxite/Loggers/EchoLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log_cmd","(action)","<p>Executes the given block in a logging context.\n<p>This default implementation does not provide any logging …\n"],["log_cmd","Bauxite::Loggers::ReportLogger","Bauxite/Loggers/ReportLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\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, loggers = nil)","<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::ReportLogger","Bauxite/Loggers/ReportLogger.html#method-c-new","(options)","<p>Constructs a new report 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"],["output_path","Bauxite::Context","Bauxite/Context.html#method-i-output_path","(path)","<p>Returns the output path for <code>path</code> accounting for the \n<code>__OUTPUT__</code> variable.\n<p>For example:\n\n<pre># assuming --output ...</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, *vars)","<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
@@ -175,14 +175,19 @@
|
|
175
175
|
<span class="container">Bauxite::Context</span>
|
176
176
|
|
177
177
|
<li class="method">
|
178
|
-
<a href="Bauxite/Loggers/
|
178
|
+
<a href="Bauxite/Loggers/HtmlLogger.html#method-c-new">::new</a>
|
179
179
|
—
|
180
|
-
<span class="container">Bauxite::Loggers::
|
180
|
+
<span class="container">Bauxite::Loggers::HtmlLogger</span>
|
181
181
|
|
182
182
|
<li class="method">
|
183
|
-
<a href="Bauxite/
|
183
|
+
<a href="Bauxite/Loggers/TerminalLogger.html#method-c-new">::new</a>
|
184
184
|
—
|
185
|
-
<span class="container">Bauxite::
|
185
|
+
<span class="container">Bauxite::Loggers::TerminalLogger</span>
|
186
|
+
|
187
|
+
<li class="method">
|
188
|
+
<a href="Bauxite/ActionModule.html#method-c-new">::new</a>
|
189
|
+
—
|
190
|
+
<span class="container">Bauxite::ActionModule</span>
|
186
191
|
|
187
192
|
<li class="method">
|
188
193
|
<a href="Bauxite/Loggers/FileLogger.html#method-c-new">::new</a>
|
@@ -190,9 +195,9 @@
|
|
190
195
|
<span class="container">Bauxite::Loggers::FileLogger</span>
|
191
196
|
|
192
197
|
<li class="method">
|
193
|
-
<a href="Bauxite/
|
198
|
+
<a href="Bauxite/SelectorModule.html#method-c-new">::new</a>
|
194
199
|
—
|
195
|
-
<span class="container">Bauxite::
|
200
|
+
<span class="container">Bauxite::SelectorModule</span>
|
196
201
|
|
197
202
|
<li class="method">
|
198
203
|
<a href="Bauxite/ParserModule.html#method-c-new">::new</a>
|
@@ -200,14 +205,9 @@
|
|
200
205
|
<span class="container">Bauxite::ParserModule</span>
|
201
206
|
|
202
207
|
<li class="method">
|
203
|
-
<a href="Bauxite/Loggers/
|
204
|
-
—
|
205
|
-
<span class="container">Bauxite::Loggers::HtmlLogger</span>
|
206
|
-
|
207
|
-
<li class="method">
|
208
|
-
<a href="Bauxite/Loggers/TerminalLogger.html#method-c-new">::new</a>
|
208
|
+
<a href="Bauxite/Loggers/NullLogger.html#method-c-new">::new</a>
|
209
209
|
—
|
210
|
-
<span class="container">Bauxite::Loggers::
|
210
|
+
<span class="container">Bauxite::Loggers::NullLogger</span>
|
211
211
|
|
212
212
|
<li class="method">
|
213
213
|
<a href="Bauxite/Loggers/ReportLogger.html#method-c-new">::new</a>
|
@@ -285,14 +285,14 @@
|
|
285
285
|
<span class="container">Bauxite::Loggers::XtermLogger</span>
|
286
286
|
|
287
287
|
<li class="method">
|
288
|
-
<a href="Bauxite/Loggers/
|
288
|
+
<a href="Bauxite/Loggers/XtermLogger.html#method-i-_screen_width">#_screen_width</a>
|
289
289
|
—
|
290
|
-
<span class="container">Bauxite::Loggers::
|
290
|
+
<span class="container">Bauxite::Loggers::XtermLogger</span>
|
291
291
|
|
292
292
|
<li class="method">
|
293
|
-
<a href="Bauxite/Loggers/
|
293
|
+
<a href="Bauxite/Loggers/TerminalLogger.html#method-i-_screen_width">#_screen_width</a>
|
294
294
|
—
|
295
|
-
<span class="container">Bauxite::Loggers::
|
295
|
+
<span class="container">Bauxite::Loggers::TerminalLogger</span>
|
296
296
|
|
297
297
|
<li class="method">
|
298
298
|
<a href="Bauxite/Context.html#method-i-add_alias">#add_alias</a>
|
@@ -359,15 +359,20 @@
|
|
359
359
|
—
|
360
360
|
<span class="container">Bauxite::Parser</span>
|
361
361
|
|
362
|
+
<li class="method">
|
363
|
+
<a href="Bauxite/Context.html#method-i-debug">#debug</a>
|
364
|
+
—
|
365
|
+
<span class="container">Bauxite::Context</span>
|
366
|
+
|
362
367
|
<li class="method">
|
363
368
|
<a href="Bauxite/Action.html#method-i-debug">#debug</a>
|
364
369
|
—
|
365
370
|
<span class="container">Bauxite::Action</span>
|
366
371
|
|
367
372
|
<li class="method">
|
368
|
-
<a href="Bauxite/
|
373
|
+
<a href="Bauxite/Loggers/TerminalLogger.html#method-i-debug_prompt">#debug_prompt</a>
|
369
374
|
—
|
370
|
-
<span class="container">Bauxite::
|
375
|
+
<span class="container">Bauxite::Loggers::TerminalLogger</span>
|
371
376
|
|
372
377
|
<li class="method">
|
373
378
|
<a href="Bauxite/Loggers/CompositeLogger.html#method-i-debug_prompt">#debug_prompt</a>
|
@@ -379,11 +384,6 @@
|
|
379
384
|
—
|
380
385
|
<span class="container">Bauxite::Loggers::NullLogger</span>
|
381
386
|
|
382
|
-
<li class="method">
|
383
|
-
<a href="Bauxite/Loggers/TerminalLogger.html#method-i-debug_prompt">#debug_prompt</a>
|
384
|
-
—
|
385
|
-
<span class="container">Bauxite::Loggers::TerminalLogger</span>
|
386
|
-
|
387
387
|
<li class="method">
|
388
388
|
<a href="Bauxite/Parser.html#method-i-default">#default</a>
|
389
389
|
—
|
@@ -455,9 +455,9 @@
|
|
455
455
|
<span class="container">Bauxite::Action</span>
|
456
456
|
|
457
457
|
<li class="method">
|
458
|
-
<a href="Bauxite/Loggers/
|
458
|
+
<a href="Bauxite/Loggers/HtmlLogger.html#method-i-finalize">#finalize</a>
|
459
459
|
—
|
460
|
-
<span class="container">Bauxite::Loggers::
|
460
|
+
<span class="container">Bauxite::Loggers::HtmlLogger</span>
|
461
461
|
|
462
462
|
<li class="method">
|
463
463
|
<a href="Bauxite/Loggers/FileLogger.html#method-i-finalize">#finalize</a>
|
@@ -465,9 +465,9 @@
|
|
465
465
|
<span class="container">Bauxite::Loggers::FileLogger</span>
|
466
466
|
|
467
467
|
<li class="method">
|
468
|
-
<a href="Bauxite/Loggers/
|
468
|
+
<a href="Bauxite/Loggers/NullLogger.html#method-i-finalize">#finalize</a>
|
469
469
|
—
|
470
|
-
<span class="container">Bauxite::Loggers::
|
470
|
+
<span class="container">Bauxite::Loggers::NullLogger</span>
|
471
471
|
|
472
472
|
<li class="method">
|
473
473
|
<a href="Bauxite/Loggers/CompositeLogger.html#method-i-finalize">#finalize</a>
|
@@ -480,14 +480,14 @@
|
|
480
480
|
<span class="container">Bauxite::Loggers::ReportLogger</span>
|
481
481
|
|
482
482
|
<li class="method">
|
483
|
-
<a href="Bauxite/
|
483
|
+
<a href="Bauxite/Context.html#method-i-find">#find</a>
|
484
484
|
—
|
485
|
-
<span class="container">Bauxite::
|
485
|
+
<span class="container">Bauxite::Context</span>
|
486
486
|
|
487
487
|
<li class="method">
|
488
|
-
<a href="Bauxite/
|
488
|
+
<a href="Bauxite/SelectorModule.html#method-i-find">#find</a>
|
489
489
|
—
|
490
|
-
<span class="container">Bauxite::
|
490
|
+
<span class="container">Bauxite::SelectorModule</span>
|
491
491
|
|
492
492
|
<li class="method">
|
493
493
|
<a href="Bauxite/Selector.html#method-i-frame">#frame</a>
|
@@ -510,24 +510,24 @@
|
|
510
510
|
<span class="container">Bauxite::Action</span>
|
511
511
|
|
512
512
|
<li class="method">
|
513
|
-
<a href="Bauxite/
|
513
|
+
<a href="Bauxite/Selector.html#method-i-json">#json</a>
|
514
514
|
—
|
515
|
-
<span class="container">Bauxite::
|
515
|
+
<span class="container">Bauxite::Selector</span>
|
516
516
|
|
517
517
|
<li class="method">
|
518
|
-
<a href="Bauxite/
|
518
|
+
<a href="Bauxite/Action.html#method-i-load">#load</a>
|
519
519
|
—
|
520
|
-
<span class="container">Bauxite::
|
520
|
+
<span class="container">Bauxite::Action</span>
|
521
521
|
|
522
522
|
<li class="method">
|
523
|
-
<a href="Bauxite/Loggers/
|
523
|
+
<a href="Bauxite/Loggers/CompositeLogger.html#method-i-log">#log</a>
|
524
524
|
—
|
525
|
-
<span class="container">Bauxite::Loggers::
|
525
|
+
<span class="container">Bauxite::Loggers::CompositeLogger</span>
|
526
526
|
|
527
527
|
<li class="method">
|
528
|
-
<a href="Bauxite/Loggers/
|
528
|
+
<a href="Bauxite/Loggers/NullLogger.html#method-i-log">#log</a>
|
529
529
|
—
|
530
|
-
<span class="container">Bauxite::Loggers::
|
530
|
+
<span class="container">Bauxite::Loggers::NullLogger</span>
|
531
531
|
|
532
532
|
<li class="method">
|
533
533
|
<a href="Bauxite/Loggers/ReportLogger.html#method-i-log">#log</a>
|
@@ -539,6 +539,11 @@
|
|
539
539
|
—
|
540
540
|
<span class="container">Bauxite::Loggers::FileLogger</span>
|
541
541
|
|
542
|
+
<li class="method">
|
543
|
+
<a href="Bauxite/Loggers/TerminalLogger.html#method-i-log">#log</a>
|
544
|
+
—
|
545
|
+
<span class="container">Bauxite::Loggers::TerminalLogger</span>
|
546
|
+
|
542
547
|
<li class="method">
|
543
548
|
<a href="Bauxite/Loggers/ReportLogger.html#method-i-log_cmd">#log_cmd</a>
|
544
549
|
—
|
data/lib/bauxite.rb
CHANGED
@@ -43,7 +43,7 @@ class Bauxite::Action
|
|
43
43
|
@ctx.with_vars({ '__TIMEOUT__' => 0}) do
|
44
44
|
@ctx.exec_parsed_action(action, args, false)
|
45
45
|
end
|
46
|
-
rescue Bauxite::Errors::AssertionError
|
46
|
+
rescue Bauxite::Errors::AssertionError, Selenium::WebDriver::Error::NoSuchElementError
|
47
47
|
return true
|
48
48
|
end
|
49
49
|
raise Bauxite::Errors::AssertionError, "Assertion did not failed as expected:#{action} #{args.join(' ')}"
|
@@ -0,0 +1,88 @@
|
|
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
|
+
require 'json'
|
24
|
+
|
25
|
+
class Bauxite::Selector
|
26
|
+
# Select a field in a JSON document.
|
27
|
+
#
|
28
|
+
# The JSON selector syntax is:
|
29
|
+
# # For objects:
|
30
|
+
# json=key # {"key":1} => 1
|
31
|
+
# json=key.subkey # {"key":{"subkey":2}} => 2
|
32
|
+
# json=key[0] # {"key": [3]} => 3
|
33
|
+
# json=key[1].subkey # {"key": [{"subkey":4}]} => 4
|
34
|
+
# json=key.length # {"key": [5]} => 1
|
35
|
+
#
|
36
|
+
# # For arrays:
|
37
|
+
# json=[0] # [1] => 1
|
38
|
+
# json=[1].value # [{"value": 2}] => 2
|
39
|
+
# json=length # [3] => 1
|
40
|
+
#
|
41
|
+
# For example:
|
42
|
+
# # assuming {"key": [{"subkey":4},{"val":"42"}]}
|
43
|
+
# assert json=key[0].subkey 4
|
44
|
+
# assert json=key[1].val 42
|
45
|
+
# assert json=key.length 2
|
46
|
+
# # => these assertions would pass
|
47
|
+
#
|
48
|
+
# :category: Selector Methods
|
49
|
+
def json(arg, &block)
|
50
|
+
source = JSON::parse(@ctx.driver.page_source.sub(/^<html[^>]*>.*<pre>/, '').sub(/<\/pre>.*<\/html>$/, ''))
|
51
|
+
element = _json_find(source, arg)
|
52
|
+
raise Selenium::WebDriver::Error::NoSuchElementError, "Cannot find JSON element: #{arg}" unless element
|
53
|
+
|
54
|
+
element = element.to_s
|
55
|
+
def element.text; self; end
|
56
|
+
def element.tag_name; 'json'; end
|
57
|
+
yield element if block_given?
|
58
|
+
element
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
def _json_find(parent, selector)
|
63
|
+
if selector[0] == '['
|
64
|
+
delim = selector.index(']')
|
65
|
+
raise ArgumentError, "Invalid format for JSON selector (missing closing ']'): #{selector}" unless delim
|
66
|
+
i = selector[1...delim].to_i
|
67
|
+
selector = selector[delim+1..-1]
|
68
|
+
parent = parent[i]
|
69
|
+
return parent if selector == ''
|
70
|
+
end
|
71
|
+
if selector[0] == '.'
|
72
|
+
selector = selector[1..-1]
|
73
|
+
end
|
74
|
+
if selector == 'length' and parent.respond_to? :size
|
75
|
+
return parent.size
|
76
|
+
end
|
77
|
+
|
78
|
+
delim = selector.index(/[\[.]/)
|
79
|
+
if delim
|
80
|
+
target = parent[selector[0...delim]]
|
81
|
+
return unless target
|
82
|
+
rest = selector[delim..-1]
|
83
|
+
_json_find(target, rest)
|
84
|
+
else
|
85
|
+
parent[selector]
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/test/json.bxt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
open "file://${__DIR__}/json/object.json"
|
2
|
+
assert json=top level
|
3
|
+
assert json=parent.first child
|
4
|
+
assert json=parent.second Child
|
5
|
+
assert json=parent.third 3
|
6
|
+
assert json=parent.fourth true
|
7
|
+
assert json=parent.fourth /.*/
|
8
|
+
failif assert json=parent.fifth /.*/
|
9
|
+
assert json=list[0] first
|
10
|
+
assert json=list[1].name second
|
11
|
+
assert json=list.length 3
|
12
|
+
failif assert json=list.length 4
|
13
|
+
|
14
|
+
open "file://${__DIR__}/json/array.json"
|
15
|
+
assert json=[0] 1
|
16
|
+
assert json=[1].value two
|
17
|
+
assert json=length 2
|
18
|
+
|
19
|
+
store json=[1].value is_this_two
|
20
|
+
assertv two "${is_this_two}"
|
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.16
|
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-12-
|
11
|
+
date: 2014-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- lib/bauxite/parsers/html.rb
|
171
171
|
- lib/bauxite/selectors/attr.rb
|
172
172
|
- lib/bauxite/selectors/frame.rb
|
173
|
+
- lib/bauxite/selectors/json.rb
|
173
174
|
- lib/bauxite/selectors/sid.rb
|
174
175
|
- lib/bauxite/selectors/smart.rb
|
175
176
|
- lib/bauxite/selectors/window.rb
|
@@ -212,6 +213,9 @@ files:
|
|
212
213
|
- test/frame/grandchild_frame.html
|
213
214
|
- test/frame/page.html
|
214
215
|
- test/js.bxt
|
216
|
+
- test/json.bxt
|
217
|
+
- test/json/array.json
|
218
|
+
- test/json/object.json
|
215
219
|
- test/load.bxt
|
216
220
|
- test/load/child.bxt
|
217
221
|
- test/parsers.bxt
|