bauxite 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- var search_data = {"index":{"searchIndex":["bauxite","action","actionmodule","application","context","errors","assertionerror","filenotfounderror","formaterror","loggers","compositelogger","echologger","filelogger","nulllogger","terminallogger","xtermlogger","parser","parsermodule","selector","selectormodule","_block()","_cmd_color()","_fmt()","_fmt()","_restore_cursor()","_restore_cursor()","_save_cursor()","_save_cursor()","_screen_width()","_screen_width()","action_args()","actions()","add_alias()","alias_action()","args()","assert()","assertv()","attr()","break_action()","click()","csv()","debug()","debug()","debug_prompt()","debug_prompt()","debug_prompt()","default()","default()","echo()","exec()","exec_action()","exec_file()","execute()","expand()","find()","find()","frame()","get_value()","handle_errors()","js()","load()","load_logger()","log()","log()","log()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","loggers()","max_action_name_size()","new()","new()","new()","new()","new()","new()","new()","new()","open()","params()","parse()","parse_action_default()","parsers()","progress()","progress()","progress()","replace()","reset()","reset_driver()","return_action()","ruby()","selectors()","selenium_find()","selenium_ide_html()","set()","source()","start()","stop()","store()","test()","tryload()","wait()","wait()","with_timeout()","with_vars()","write()","readme"],"longSearchIndex":["bauxite","bauxite::action","bauxite::actionmodule","bauxite::application","bauxite::context","bauxite::errors","bauxite::errors::assertionerror","bauxite::errors::filenotfounderror","bauxite::errors::formaterror","bauxite::loggers","bauxite::loggers::compositelogger","bauxite::loggers::echologger","bauxite::loggers::filelogger","bauxite::loggers::nulllogger","bauxite::loggers::terminallogger","bauxite::loggers::xtermlogger","bauxite::parser","bauxite::parsermodule","bauxite::selector","bauxite::selectormodule","bauxite::loggers::terminallogger#_block()","bauxite::loggers::terminallogger#_cmd_color()","bauxite::loggers::terminallogger#_fmt()","bauxite::loggers::xtermlogger#_fmt()","bauxite::loggers::terminallogger#_restore_cursor()","bauxite::loggers::xtermlogger#_restore_cursor()","bauxite::loggers::terminallogger#_save_cursor()","bauxite::loggers::xtermlogger#_save_cursor()","bauxite::loggers::terminallogger#_screen_width()","bauxite::loggers::xtermlogger#_screen_width()","bauxite::context::action_args()","bauxite::context::actions()","bauxite::context#add_alias()","bauxite::action#alias_action()","bauxite::actionmodule#args()","bauxite::action#assert()","bauxite::action#assertv()","bauxite::selector#attr()","bauxite::action#break_action()","bauxite::action#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::selector#default()","bauxite::action#echo()","bauxite::action#exec()","bauxite::context#exec_action()","bauxite::context#exec_file()","bauxite::actionmodule#execute()","bauxite::context#expand()","bauxite::context#find()","bauxite::selectormodule#find()","bauxite::selector#frame()","bauxite::context#get_value()","bauxite::context#handle_errors()","bauxite::action#js()","bauxite::action#load()","bauxite::context::load_logger()","bauxite::loggers::compositelogger#log()","bauxite::loggers::nulllogger#log()","bauxite::loggers::terminallogger#log()","bauxite::loggers::compositelogger#log_cmd()","bauxite::loggers::echologger#log_cmd()","bauxite::loggers::filelogger#log_cmd()","bauxite::loggers::nulllogger#log_cmd()","bauxite::loggers::terminallogger#log_cmd()","bauxite::context::loggers()","bauxite::context::max_action_name_size()","bauxite::actionmodule::new()","bauxite::context::new()","bauxite::loggers::compositelogger::new()","bauxite::loggers::filelogger::new()","bauxite::loggers::nulllogger::new()","bauxite::loggers::terminallogger::new()","bauxite::parsermodule::new()","bauxite::selectormodule::new()","bauxite::action#open()","bauxite::action#params()","bauxite::parsermodule#parse()","bauxite::context::parse_action_default()","bauxite::context::parsers()","bauxite::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::context::selectors()","bauxite::selectormodule#selenium_find()","bauxite::parser#selenium_ide_html()","bauxite::action#set()","bauxite::action#source()","bauxite::context#start()","bauxite::context#stop()","bauxite::action#store()","bauxite::action#test()","bauxite::action#tryload()","bauxite::action#wait()","bauxite::context::wait()","bauxite::context#with_timeout()","bauxite::context#with_vars()","bauxite::action#write()",""],"info":[["Bauxite","","Bauxite.html","","<p>Bauxite Namespace\n"],["Bauxite::Action","","Bauxite/Action.html","","<p>Test action class.\n<p>Test actions are basic test operations that can be combined to create a\ntest case. …\n"],["Bauxite::ActionModule","","Bauxite/ActionModule.html","","<p>Action common state and behavior.\n"],["Bauxite::Application","","Bauxite/Application.html","","<p><code>bauxite</code> command-line program.\n<p>This program executes Bauxite tests and outputs the execution progress and\n…\n"],["Bauxite::Context","","Bauxite/Context.html","","<p>The Main test context. This class includes state and helper functions used\nby clients execute tests and …\n"],["Bauxite::Errors","","Bauxite/Errors.html","","<p>Errors Module\n"],["Bauxite::Errors::AssertionError","","Bauxite/Errors/AssertionError.html","","<p>Error raised when an assertion fails.\n"],["Bauxite::Errors::FileNotFoundError","","Bauxite/Errors/FileNotFoundError.html","","<p>Error raised when an invalid file tried to be loaded.\n"],["Bauxite::Errors::FormatError","","Bauxite/Errors/FormatError.html","","<p>Error raised when trying to process an invalid file format.\n"],["Bauxite::Loggers","","Bauxite/Loggers.html","","<p>Test loggers module\n<p>The default Logger class and all custom loggers must be included in this\nmodule.\n"],["Bauxite::Loggers::CompositeLogger","","Bauxite/Loggers/CompositeLogger.html","","<p>Composite logger.\n<p>This composite logger forwards logging calls to each of its children.\n<p>Set the <code>:loggers</code> …\n"],["Bauxite::Loggers::EchoLogger","","Bauxite/Loggers/EchoLogger.html","","<p>Echo logger.\n<p>This logger outputs the raw action text for every action executed.\n<p>Note that this logger does …\n"],["Bauxite::Loggers::FileLogger","","Bauxite/Loggers/FileLogger.html","","<p>File logger.\n<p>This logger outputs the raw action text for every action executed to the\nfile specified in …\n"],["Bauxite::Loggers::NullLogger","","Bauxite/Loggers/NullLogger.html","","<p>Test logger class.\n<p>Test loggers handle test output format.\n<p>The default logger does not provide any output …\n"],["Bauxite::Loggers::TerminalLogger","","Bauxite/Loggers/TerminalLogger.html","","<p>Terminal logger.\n<p>This logger outputs text using basic text formatting for a terminal window.\n"],["Bauxite::Loggers::XtermLogger","","Bauxite/Loggers/XtermLogger.html","","<p>XTerm logger.\n<p>This logger outputs colorized lines using xterm (VT100/2) escape sequences.\n"],["Bauxite::Parser","","Bauxite/Parser.html","","<p>Parser class.\n<p>Parser represent different strategies for reading input files into lists of\nBauxite actions. …\n"],["Bauxite::ParserModule","","Bauxite/ParserModule.html","","<p>Parser common state and behavior.\n"],["Bauxite::Selector","","Bauxite/Selector.html","","<p>Selector class.\n<p>Selectors represent different strategies for finding elements. Selenium\nprovides a list …\n"],["Bauxite::SelectorModule","","Bauxite/SelectorModule.html","","<p>Selector common state and behavior.\n"],["_block","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_block","(color, text, size)","<p>Prints <code>text</code> centered inside a square-bracketed block.\n"],["_cmd_color","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_cmd_color","(cmd)","<p>Get the color of <code>cmd</code>.\n"],["_fmt","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_fmt","(color, text, size = 0)","<p>Centers <code>text</code> to a fixed size with.\n"],["_fmt","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_fmt","(color, text, size = 0)",""],["_restore_cursor","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_restore_cursor","()","<p>Restores the cursor to the previously saved cursor position.\n"],["_restore_cursor","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_restore_cursor","()",""],["_save_cursor","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_save_cursor","()","<p>Save the current cursor position,\n"],["_save_cursor","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_save_cursor","()",""],["_screen_width","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_screen_width","()","<p>Returns the terminal screen width.\n"],["_screen_width","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_screen_width","()",""],["action_args","Bauxite::Context","Bauxite/Context.html#method-c-action_args","(action)","<p>Returns an array with the names of the arguments of the specified action.\n<p>For example:\n\n<pre>Context::action_args ...</pre>\n"],["actions","Bauxite::Context","Bauxite/Context.html#method-c-actions","()","<p>Returns an array with the names of every action available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">actions</span>\n<span class=\"ruby-comment\"># =&gt; [ &quot;assert&quot;, ...</span>\n</pre>\n"],["add_alias","Bauxite::Context","Bauxite/Context.html#method-i-add_alias","(name, action, args)","<p>Adds an alias named <code>name</code> to the specified <code>action</code>\nwith the arguments specified in <code>args</code>.\n"],["alias_action","Bauxite::Action","Bauxite/Action.html#method-i-alias_action","(name, action, *args)","<p>Aliases <code>name</code> to <code>action</code> with additional arguments.\n<p>In <code>args</code> the variables <code>${1}</code>..<code>${n}</code>\nwill be expanded to …\n"],["args","Bauxite::ActionModule","Bauxite/ActionModule.html#method-i-args","(quote = false)","<p>Returns the action arguments after applying variable expansion.\n<p>See Context#expand.\n<p>If <code>quote</code> is <code>true</code>, the …\n"],["assert","Bauxite::Action","Bauxite/Action.html#method-i-assert","(selector, text)","<p>Asserts that the value of the selected element matches <code>text</code>.\n<p><code>text</code> is a regular expression. <code>text</code> can be …\n"],["assertv","Bauxite::Action","Bauxite/Action.html#method-i-assertv","(expected, actual)","<p>Asserts that the <code>actual</code> text matches the <code>expected</code>\ntext.\n<p><code>expected</code> can be a regular expression. See #assert …\n"],["attr","Bauxite::Selector","Bauxite/Selector.html#method-i-attr","(arg, &block)","<p>Select an element by attribute value.\n<p>The attribute selector syntax is:\n\n<pre>attr=name:value</pre>\n"],["break_action","Bauxite::Action","Bauxite/Action.html#method-i-break_action","()","<p>Prompts the user to press ENTER before resuming execution.\n<p>Note that this method provides an action named …\n"],["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 &lt;button type=&quot;button&quot; id=&quot;btn&quot;&gt;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\"># =&gt; 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\"># =&gt; 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"],["default","Bauxite::Selector","Bauxite/Selector.html#method-i-default","(arg, &block)","<p>Select an element by id suffix.\n<p>This is the default selector. Any selector strings that do not contain …\n"],["echo","Bauxite::Action","Bauxite/Action.html#method-i-echo","(text)","<p>Prints the value of the specified <code>text</code>.\n<p><code>text</code> is subject to variable expansion (see Context#expand).\n<p>For …\n"],["exec","Bauxite::Action","Bauxite/Action.html#method-i-exec","(*command)","<p>Executes <code>command</code>, optionally storing the results in a\nvariable.\n<p>If the first argument of <code>command</code> is <code>name=...</code> …\n"],["exec_action","Bauxite::Context","Bauxite/Context.html#method-i-exec_action","(text, log = true, file = '<unknown>', line = 0)","<p>Executes the specified action string handling errors, logging and debug\nhistory.\n<p>If <code>log</code> is <code>true</code>, log the …\n"],["exec_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\">&#39;file&#39;</span>)\n<span class=\"ruby-comment\"># =&gt; executes every action defined in &#39;file&#39;</span>\n</pre>\n"],["execute","Bauxite::ActionModule","Bauxite/ActionModule.html#method-i-execute","()","<p>Executes the action evaluating the arguments in the current context.\n<p>Note that #execute calls #args to …\n"],["expand","Bauxite::Context","Bauxite/Context.html#method-i-expand","(s)","<p>Recursively replaces occurencies of variable expansions in <code>s</code>\nwith the corresponding variable value.\n<p>The …\n"],["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_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"],["handle_errors","Bauxite::Context","Bauxite/Context.html#method-i-handle_errors","(break_into_debug = false, exit_on_error = true)","<p>Executes the <code>block</code> inside a rescue block applying standard\ncriteria of error handling.\n<p>The default behavior …\n"],["js","Bauxite::Action","Bauxite/Action.html#method-i-js","(script, name = nil)","<p>Executes the specified Javascript <code>script</code>, optionally storing\nthe results the variable named <code>name</code>.\n<p>Note …\n"],["load","Bauxite::Action","Bauxite/Action.html#method-i-load","(file, *vars)","<p>Load the specified file into an isolated variable context and execute the\nactions specified. If the file …\n"],["load_logger","Bauxite::Context","Bauxite/Context.html#method-c-load_logger","(name, options)","<p>Constructs a Logger instance using <code>name</code> as a hint for the\nlogger type.\n"],["log","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log","(s, type = :info)","<p>Logs the specified string.\n<p><code>type</code>, if specified, should be one of <code>:error</code>,\n<code>:warning</code>, <code>:info</code> (default), <code>:debug</code> …\n"],["log","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log_cmd","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log_cmd","(action, &block)","<p>Pretty prints action information and status.\n<p>This implementation only yileds in the first logger.\n<p>Additional …\n"],["log_cmd","Bauxite::Loggers::EchoLogger","Bauxite/Loggers/EchoLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log_cmd","(action)","<p>Executes the given block in a logging context.\n<p>This default implementation does not provide any logging …\n"],["log_cmd","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log_cmd","(action)","<p>Pretty prints action information and status.\n"],["loggers","Bauxite::Context","Bauxite/Context.html#method-c-loggers","()","<p>Returns an array with the names of every logger available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">loggers</span>\n<span class=\"ruby-comment\"># =&gt; [ &quot;null&quot;, ...</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 &mdash; selenium driver …\n"],["new","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-c-new","(options)","<p>Constructs a new composite logger instance.\n"],["new","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-c-new","(options)","<p>Constructs a new echo logger instance.\n"],["new","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-c-new","(options)","<p>Constructs a new null logger instance.\n"],["new","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-c-new","(options)","<p>Constructs a new Terminal logger instance.\n"],["new","Bauxite::ParserModule","Bauxite/ParserModule.html#method-c-new","(ctx)","<p>Constructs a new test parser instance.\n"],["new","Bauxite::SelectorModule","Bauxite/SelectorModule.html#method-c-new","(ctx)","<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\">&quot;http://www.ruby-lang.org&quot;</span>\n<span class=\"ruby-comment\"># =&gt; this would open ...</span>\n</pre>\n"],["params","Bauxite::Action","Bauxite/Action.html#method-i-params","(*vars)","<p>Asserts that the variables named <code>vars</code> are defined and not\nempty.\n<p>For example:\n\n<pre>params host db_name username ...</pre>\n"],["parse","Bauxite::ParserModule","Bauxite/ParserModule.html#method-i-parse","(file)","<p>Parse <code>file</code> and yield the resulting actions.\n"],["parse_action_default","Bauxite::Context","Bauxite/Context.html#method-c-parse_action_default","(text, file = '<unknown>', line = 0)","<p>Default action parsing strategy.\n"],["parsers","Bauxite::Context","Bauxite/Context.html#method-c-parsers","()","<p>Returns an array with the names of every parser available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">parsers</span>\n<span class=\"ruby-comment\"># =&gt; [ &quot;default&quot;, ...</span>\n</pre>\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\">&gt;</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"],["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"],["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"],["test","Bauxite::Action","Bauxite/Action.html#method-i-test","(file, name = nil)","<p>Load <code>file</code> using the #load action into a new test context.\n<p>If <code>name</code> is specified, it will be used as the …\n"],["tryload","Bauxite::Action","Bauxite/Action.html#method-i-tryload","(file, *vars)","<p>Load the specified file into an isolated variable context and execute the\nactions specified. If the file …\n"],["wait","Bauxite::Action","Bauxite/Action.html#method-i-wait","(seconds)","<p>Wait for the specified number of <code>seconds</code>.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">wait</span> <span class=\"ruby-value\">5</span>\n<span class=\"ruby-comment\"># =&gt; 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\"># =&gt; echoes &quot;Press ...</span>\n</pre>\n"],["with_timeout","Bauxite::Context","Bauxite/Context.html#method-i-with_timeout","(*error_types)","<p>Executes the given block retrying for at most <code>${__TIMEOUT__}</code>\nseconds. Note that this method does not …\n"],["with_vars","Bauxite::Context","Bauxite/Context.html#method-i-with_vars","(vars)","<p>Temporarily alter the value of context variables.\n<p>This method alters the value of the variables specified …\n"],["write","Bauxite::Action","Bauxite/Action.html#method-i-write","(selector, text)","<p>Sets the value of the selected element to <code>text</code>.\n<p><code>text</code> is subject to variable expansion (see Context#expand …\n"],["README","","README_md.html","","<p>bauxite\n<p>Bauxite is a façade over Selenium intended for non-developers\n<p>The idea behind this project was …\n"]]}}
1
+ var search_data = {"index":{"searchIndex":["bauxite","action","actionmodule","application","context","errors","assertionerror","filenotfounderror","formaterror","loggers","compositelogger","echologger","filelogger","nulllogger","terminallogger","xtermlogger","parser","parsermodule","selector","selectormodule","_block()","_cmd_color()","_fmt()","_fmt()","_restore_cursor()","_restore_cursor()","_save_cursor()","_save_cursor()","_screen_width()","_screen_width()","action_args()","actions()","add_alias()","alias_action()","args()","assert()","assertv()","attr()","break_action()","click()","csv()","debug()","debug()","debug_prompt()","debug_prompt()","debug_prompt()","default()","default()","echo()","exec()","exec_action()","exec_file()","execute()","expand()","find()","find()","frame()","get_value()","handle_errors()","js()","load()","load_logger()","log()","log()","log()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","log_cmd()","loggers()","max_action_name_size()","new()","new()","new()","new()","new()","new()","new()","new()","open()","params()","parse()","parse_action_default()","parsers()","progress()","progress()","progress()","replace()","reset()","reset_driver()","return_action()","ruby()","select()","selectors()","selenium_find()","selenium_ide_html()","set()","smart()","source()","start()","stop()","store()","submit()","test()","tryload()","wait()","wait()","with_timeout()","with_vars()","write()","readme"],"longSearchIndex":["bauxite","bauxite::action","bauxite::actionmodule","bauxite::application","bauxite::context","bauxite::errors","bauxite::errors::assertionerror","bauxite::errors::filenotfounderror","bauxite::errors::formaterror","bauxite::loggers","bauxite::loggers::compositelogger","bauxite::loggers::echologger","bauxite::loggers::filelogger","bauxite::loggers::nulllogger","bauxite::loggers::terminallogger","bauxite::loggers::xtermlogger","bauxite::parser","bauxite::parsermodule","bauxite::selector","bauxite::selectormodule","bauxite::loggers::terminallogger#_block()","bauxite::loggers::terminallogger#_cmd_color()","bauxite::loggers::terminallogger#_fmt()","bauxite::loggers::xtermlogger#_fmt()","bauxite::loggers::terminallogger#_restore_cursor()","bauxite::loggers::xtermlogger#_restore_cursor()","bauxite::loggers::terminallogger#_save_cursor()","bauxite::loggers::xtermlogger#_save_cursor()","bauxite::loggers::terminallogger#_screen_width()","bauxite::loggers::xtermlogger#_screen_width()","bauxite::context::action_args()","bauxite::context::actions()","bauxite::context#add_alias()","bauxite::action#alias_action()","bauxite::actionmodule#args()","bauxite::action#assert()","bauxite::action#assertv()","bauxite::selector#attr()","bauxite::action#break_action()","bauxite::action#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::selector#default()","bauxite::action#echo()","bauxite::action#exec()","bauxite::context#exec_action()","bauxite::context#exec_file()","bauxite::actionmodule#execute()","bauxite::context#expand()","bauxite::context#find()","bauxite::selectormodule#find()","bauxite::selector#frame()","bauxite::context#get_value()","bauxite::context#handle_errors()","bauxite::action#js()","bauxite::action#load()","bauxite::context::load_logger()","bauxite::loggers::compositelogger#log()","bauxite::loggers::nulllogger#log()","bauxite::loggers::terminallogger#log()","bauxite::loggers::compositelogger#log_cmd()","bauxite::loggers::echologger#log_cmd()","bauxite::loggers::filelogger#log_cmd()","bauxite::loggers::nulllogger#log_cmd()","bauxite::loggers::terminallogger#log_cmd()","bauxite::context::loggers()","bauxite::context::max_action_name_size()","bauxite::actionmodule::new()","bauxite::context::new()","bauxite::loggers::compositelogger::new()","bauxite::loggers::filelogger::new()","bauxite::loggers::nulllogger::new()","bauxite::loggers::terminallogger::new()","bauxite::parsermodule::new()","bauxite::selectormodule::new()","bauxite::action#open()","bauxite::action#params()","bauxite::parsermodule#parse()","bauxite::context::parse_action_default()","bauxite::context::parsers()","bauxite::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::selector#smart()","bauxite::action#source()","bauxite::context#start()","bauxite::context#stop()","bauxite::action#store()","bauxite::action#submit()","bauxite::action#test()","bauxite::action#tryload()","bauxite::action#wait()","bauxite::context::wait()","bauxite::context#with_timeout()","bauxite::context#with_vars()","bauxite::action#write()",""],"info":[["Bauxite","","Bauxite.html","","<p>Bauxite Namespace\n"],["Bauxite::Action","","Bauxite/Action.html","","<p>Test action class.\n<p>Test actions are basic test operations that can be combined to create a\ntest case. …\n"],["Bauxite::ActionModule","","Bauxite/ActionModule.html","","<p>Action common state and behavior.\n"],["Bauxite::Application","","Bauxite/Application.html","","<p><code>bauxite</code> command-line program.\n<p>This program executes Bauxite tests and outputs the execution progress and\n…\n"],["Bauxite::Context","","Bauxite/Context.html","","<p>The Main test context. This class includes state and helper functions used\nby clients execute tests and …\n"],["Bauxite::Errors","","Bauxite/Errors.html","","<p>Errors Module\n"],["Bauxite::Errors::AssertionError","","Bauxite/Errors/AssertionError.html","","<p>Error raised when an assertion fails.\n"],["Bauxite::Errors::FileNotFoundError","","Bauxite/Errors/FileNotFoundError.html","","<p>Error raised when an invalid file tried to be loaded.\n"],["Bauxite::Errors::FormatError","","Bauxite/Errors/FormatError.html","","<p>Error raised when trying to process an invalid file format.\n"],["Bauxite::Loggers","","Bauxite/Loggers.html","","<p>Test loggers module\n<p>The default Logger class and all custom loggers must be included in this\nmodule.\n"],["Bauxite::Loggers::CompositeLogger","","Bauxite/Loggers/CompositeLogger.html","","<p>Composite logger.\n<p>This composite logger forwards logging calls to each of its children.\n<p>Set the <code>:loggers</code> …\n"],["Bauxite::Loggers::EchoLogger","","Bauxite/Loggers/EchoLogger.html","","<p>Echo logger.\n<p>This logger outputs the raw action text for every action executed.\n<p>Note that this logger does …\n"],["Bauxite::Loggers::FileLogger","","Bauxite/Loggers/FileLogger.html","","<p>File logger.\n<p>This logger outputs the raw action text for every action executed to the\nfile specified in …\n"],["Bauxite::Loggers::NullLogger","","Bauxite/Loggers/NullLogger.html","","<p>Test logger class.\n<p>Test loggers handle test output format.\n<p>The default logger does not provide any output …\n"],["Bauxite::Loggers::TerminalLogger","","Bauxite/Loggers/TerminalLogger.html","","<p>Terminal logger.\n<p>This logger outputs text using basic text formatting for a terminal window.\n"],["Bauxite::Loggers::XtermLogger","","Bauxite/Loggers/XtermLogger.html","","<p>XTerm logger.\n<p>This logger outputs colorized lines using xterm (VT100/2) escape sequences.\n"],["Bauxite::Parser","","Bauxite/Parser.html","","<p>Parser class.\n<p>Parser represent different strategies for reading input files into lists of\nBauxite actions. …\n"],["Bauxite::ParserModule","","Bauxite/ParserModule.html","","<p>Parser common state and behavior.\n"],["Bauxite::Selector","","Bauxite/Selector.html","","<p>Selector class.\n<p>Selectors represent different strategies for finding elements. Selenium\nprovides a list …\n"],["Bauxite::SelectorModule","","Bauxite/SelectorModule.html","","<p>Selector common state and behavior.\n"],["_block","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_block","(color, text, size)","<p>Prints <code>text</code> centered inside a square-bracketed block.\n"],["_cmd_color","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_cmd_color","(cmd)","<p>Get the color of <code>cmd</code>.\n"],["_fmt","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_fmt","(color, text, size = 0)","<p>Centers <code>text</code> to a fixed size with.\n"],["_fmt","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_fmt","(color, text, size = 0)",""],["_restore_cursor","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_restore_cursor","()","<p>Restores the cursor to the previously saved cursor position.\n"],["_restore_cursor","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_restore_cursor","()",""],["_save_cursor","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_save_cursor","()","<p>Save the current cursor position,\n"],["_save_cursor","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_save_cursor","()",""],["_screen_width","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-_screen_width","()","<p>Returns the terminal screen width.\n"],["_screen_width","Bauxite::Loggers::XtermLogger","Bauxite/Loggers/XtermLogger.html#method-i-_screen_width","()",""],["action_args","Bauxite::Context","Bauxite/Context.html#method-c-action_args","(action)","<p>Returns an array with the names of the arguments of the specified action.\n<p>For example:\n\n<pre>Context::action_args ...</pre>\n"],["actions","Bauxite::Context","Bauxite/Context.html#method-c-actions","()","<p>Returns an array with the names of every action available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">actions</span>\n<span class=\"ruby-comment\"># =&gt; [ &quot;assert&quot;, ...</span>\n</pre>\n"],["add_alias","Bauxite::Context","Bauxite/Context.html#method-i-add_alias","(name, action, args)","<p>Adds an alias named <code>name</code> to the specified <code>action</code>\nwith the arguments specified in <code>args</code>.\n"],["alias_action","Bauxite::Action","Bauxite/Action.html#method-i-alias_action","(name, action, *args)","<p>Aliases <code>name</code> to <code>action</code> with additional arguments.\n<p>In <code>args</code> the variables <code>${1}</code>..<code>${n}</code>\nwill be expanded to …\n"],["args","Bauxite::ActionModule","Bauxite/ActionModule.html#method-i-args","(quote = false)","<p>Returns the action arguments after applying variable expansion.\n<p>See Context#expand.\n<p>If <code>quote</code> is <code>true</code>, the …\n"],["assert","Bauxite::Action","Bauxite/Action.html#method-i-assert","(selector, text)","<p>Asserts that the value of the selected element matches <code>text</code>.\n<p><code>text</code> is a regular expression. <code>text</code> can be …\n"],["assertv","Bauxite::Action","Bauxite/Action.html#method-i-assertv","(expected, actual)","<p>Asserts that the <code>actual</code> text matches the <code>expected</code>\ntext.\n<p><code>expected</code> can be a regular expression. See #assert …\n"],["attr","Bauxite::Selector","Bauxite/Selector.html#method-i-attr","(arg, &block)","<p>Select an element by attribute value.\n<p>The attribute selector syntax is:\n\n<pre>attr=name:value</pre>\n"],["break_action","Bauxite::Action","Bauxite/Action.html#method-i-break_action","()","<p>Prompts the user to press ENTER before resuming execution.\n<p>Note that this method provides an action named …\n"],["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 &lt;button type=&quot;button&quot; id=&quot;btn&quot;&gt;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\"># =&gt; 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\"># =&gt; 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"],["default","Bauxite::Selector","Bauxite/Selector.html#method-i-default","(arg, &block)","<p>Select an element by id suffix.\n<p>This is the default selector. Any selector strings that do not contain …\n"],["echo","Bauxite::Action","Bauxite/Action.html#method-i-echo","(text)","<p>Prints the value of the specified <code>text</code>.\n<p><code>text</code> is subject to variable expansion (see Context#expand).\n<p>For …\n"],["exec","Bauxite::Action","Bauxite/Action.html#method-i-exec","(*command)","<p>Executes <code>command</code>, optionally storing the results in a\nvariable.\n<p>If the first argument of <code>command</code> is <code>name=...</code> …\n"],["exec_action","Bauxite::Context","Bauxite/Context.html#method-i-exec_action","(text, log = true, file = '<unknown>', line = 0)","<p>Executes the specified action string handling errors, logging and debug\nhistory.\n<p>If <code>log</code> is <code>true</code>, log the …\n"],["exec_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\">&#39;file&#39;</span>)\n<span class=\"ruby-comment\"># =&gt; executes every action defined in &#39;file&#39;</span>\n</pre>\n"],["execute","Bauxite::ActionModule","Bauxite/ActionModule.html#method-i-execute","()","<p>Executes the action evaluating the arguments in the current context.\n<p>Note that #execute calls #args to …\n"],["expand","Bauxite::Context","Bauxite/Context.html#method-i-expand","(s)","<p>Recursively replaces occurencies of variable expansions in <code>s</code>\nwith the corresponding variable value.\n<p>The …\n"],["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_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"],["handle_errors","Bauxite::Context","Bauxite/Context.html#method-i-handle_errors","(break_into_debug = false, exit_on_error = true)","<p>Executes the <code>block</code> inside a rescue block applying standard\ncriteria of error handling.\n<p>The default behavior …\n"],["js","Bauxite::Action","Bauxite/Action.html#method-i-js","(script, name = nil)","<p>Executes the specified Javascript <code>script</code>, optionally storing\nthe results the variable named <code>name</code>.\n<p>Note …\n"],["load","Bauxite::Action","Bauxite/Action.html#method-i-load","(file, *vars)","<p>Load the specified file into an isolated variable context and execute the\nactions specified. If the file …\n"],["load_logger","Bauxite::Context","Bauxite/Context.html#method-c-load_logger","(name, options)","<p>Constructs a Logger instance using <code>name</code> as a hint for the\nlogger type.\n"],["log","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log","(s, type = :info)","<p>Logs the specified string.\n<p><code>type</code>, if specified, should be one of <code>:error</code>,\n<code>:warning</code>, <code>:info</code> (default), <code>:debug</code> …\n"],["log","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log","(s, type = :info)","<p>Prints the specified string.\n<p>See Bauxite::Loggers::NullLogger#print\n"],["log_cmd","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-i-log_cmd","(action, &block)","<p>Pretty prints action information and status.\n<p>This implementation only yileds in the first logger.\n<p>Additional …\n"],["log_cmd","Bauxite::Loggers::EchoLogger","Bauxite/Loggers/EchoLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-i-log_cmd","(action)","<p>Echoes the raw action text.\n"],["log_cmd","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-i-log_cmd","(action)","<p>Executes the given block in a logging context.\n<p>This default implementation does not provide any logging …\n"],["log_cmd","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-i-log_cmd","(action)","<p>Pretty prints action information and status.\n"],["loggers","Bauxite::Context","Bauxite/Context.html#method-c-loggers","()","<p>Returns an array with the names of every logger available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">loggers</span>\n<span class=\"ruby-comment\"># =&gt; [ &quot;null&quot;, ...</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 &mdash; selenium driver …\n"],["new","Bauxite::Loggers::CompositeLogger","Bauxite/Loggers/CompositeLogger.html#method-c-new","(options)","<p>Constructs a new composite logger instance.\n"],["new","Bauxite::Loggers::FileLogger","Bauxite/Loggers/FileLogger.html#method-c-new","(options)","<p>Constructs a new echo logger instance.\n"],["new","Bauxite::Loggers::NullLogger","Bauxite/Loggers/NullLogger.html#method-c-new","(options)","<p>Constructs a new null logger instance.\n"],["new","Bauxite::Loggers::TerminalLogger","Bauxite/Loggers/TerminalLogger.html#method-c-new","(options)","<p>Constructs a new Terminal logger instance.\n"],["new","Bauxite::ParserModule","Bauxite/ParserModule.html#method-c-new","(ctx)","<p>Constructs a new test parser instance.\n"],["new","Bauxite::SelectorModule","Bauxite/SelectorModule.html#method-c-new","(ctx)","<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\">&quot;http://www.ruby-lang.org&quot;</span>\n<span class=\"ruby-comment\"># =&gt; this would open ...</span>\n</pre>\n"],["params","Bauxite::Action","Bauxite/Action.html#method-i-params","(*vars)","<p>Asserts that the variables named <code>vars</code> are defined and not\nempty.\n<p>For example:\n\n<pre>params host db_name username ...</pre>\n"],["parse","Bauxite::ParserModule","Bauxite/ParserModule.html#method-i-parse","(file)","<p>Parse <code>file</code> and yield the resulting actions.\n"],["parse_action_default","Bauxite::Context","Bauxite/Context.html#method-c-parse_action_default","(text, file = '<unknown>', line = 0)","<p>Default action parsing strategy.\n"],["parsers","Bauxite::Context","Bauxite/Context.html#method-c-parsers","()","<p>Returns an array with the names of every parser available.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-constant\">Context</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">parsers</span>\n<span class=\"ruby-comment\"># =&gt; [ &quot;default&quot;, ...</span>\n</pre>\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\">&gt;</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"],["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 &lt;form&gt;&lt;input id=&quot;i&quot;/&gt;&lt;/form&gt; ...</pre>\n"],["test","Bauxite::Action","Bauxite/Action.html#method-i-test","(file, name = nil)","<p>Load <code>file</code> using the #load action into a new test context.\n<p>If <code>name</code> is specified, it will be used as the …\n"],["tryload","Bauxite::Action","Bauxite/Action.html#method-i-tryload","(file, *vars)","<p>Load the specified file into an isolated variable context and execute the\nactions specified. If the file …\n"],["wait","Bauxite::Action","Bauxite/Action.html#method-i-wait","(seconds)","<p>Wait for the specified number of <code>seconds</code>.\n<p>For example:\n\n<pre class=\"ruby\"><span class=\"ruby-identifier\">wait</span> <span class=\"ruby-value\">5</span>\n<span class=\"ruby-comment\"># =&gt; 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\"># =&gt; echoes &quot;Press ...</span>\n</pre>\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"]]}}
@@ -165,34 +165,34 @@
165
165
  <span class="container">Bauxite::Context</span>
166
166
 
167
167
  <li class="method">
168
- <a href="Bauxite/Context.html#method-c-new">::new</a>
168
+ <a href="Bauxite/Loggers/CompositeLogger.html#method-c-new">::new</a>
169
169
  &mdash;
170
- <span class="container">Bauxite::Context</span>
170
+ <span class="container">Bauxite::Loggers::CompositeLogger</span>
171
171
 
172
172
  <li class="method">
173
- <a href="Bauxite/Loggers/NullLogger.html#method-c-new">::new</a>
173
+ <a href="Bauxite/Loggers/TerminalLogger.html#method-c-new">::new</a>
174
174
  &mdash;
175
- <span class="container">Bauxite::Loggers::NullLogger</span>
175
+ <span class="container">Bauxite::Loggers::TerminalLogger</span>
176
176
 
177
177
  <li class="method">
178
- <a href="Bauxite/Loggers/FileLogger.html#method-c-new">::new</a>
178
+ <a href="Bauxite/ParserModule.html#method-c-new">::new</a>
179
179
  &mdash;
180
- <span class="container">Bauxite::Loggers::FileLogger</span>
180
+ <span class="container">Bauxite::ParserModule</span>
181
181
 
182
182
  <li class="method">
183
- <a href="Bauxite/ParserModule.html#method-c-new">::new</a>
183
+ <a href="Bauxite/Loggers/FileLogger.html#method-c-new">::new</a>
184
184
  &mdash;
185
- <span class="container">Bauxite::ParserModule</span>
185
+ <span class="container">Bauxite::Loggers::FileLogger</span>
186
186
 
187
187
  <li class="method">
188
- <a href="Bauxite/Loggers/TerminalLogger.html#method-c-new">::new</a>
188
+ <a href="Bauxite/ActionModule.html#method-c-new">::new</a>
189
189
  &mdash;
190
- <span class="container">Bauxite::Loggers::TerminalLogger</span>
190
+ <span class="container">Bauxite::ActionModule</span>
191
191
 
192
192
  <li class="method">
193
- <a href="Bauxite/Loggers/CompositeLogger.html#method-c-new">::new</a>
193
+ <a href="Bauxite/Context.html#method-c-new">::new</a>
194
194
  &mdash;
195
- <span class="container">Bauxite::Loggers::CompositeLogger</span>
195
+ <span class="container">Bauxite::Context</span>
196
196
 
197
197
  <li class="method">
198
198
  <a href="Bauxite/SelectorModule.html#method-c-new">::new</a>
@@ -200,9 +200,9 @@
200
200
  <span class="container">Bauxite::SelectorModule</span>
201
201
 
202
202
  <li class="method">
203
- <a href="Bauxite/ActionModule.html#method-c-new">::new</a>
203
+ <a href="Bauxite/Loggers/NullLogger.html#method-c-new">::new</a>
204
204
  &mdash;
205
- <span class="container">Bauxite::ActionModule</span>
205
+ <span class="container">Bauxite::Loggers::NullLogger</span>
206
206
 
207
207
  <li class="method">
208
208
  <a href="Bauxite/Context.html#method-c-parse_action_default">::parse_action_default</a>
@@ -265,14 +265,14 @@
265
265
  <span class="container">Bauxite::Loggers::TerminalLogger</span>
266
266
 
267
267
  <li class="method">
268
- <a href="Bauxite/Loggers/TerminalLogger.html#method-i-_screen_width">#_screen_width</a>
268
+ <a href="Bauxite/Loggers/XtermLogger.html#method-i-_screen_width">#_screen_width</a>
269
269
  &mdash;
270
- <span class="container">Bauxite::Loggers::TerminalLogger</span>
270
+ <span class="container">Bauxite::Loggers::XtermLogger</span>
271
271
 
272
272
  <li class="method">
273
- <a href="Bauxite/Loggers/XtermLogger.html#method-i-_screen_width">#_screen_width</a>
273
+ <a href="Bauxite/Loggers/TerminalLogger.html#method-i-_screen_width">#_screen_width</a>
274
274
  &mdash;
275
- <span class="container">Bauxite::Loggers::XtermLogger</span>
275
+ <span class="container">Bauxite::Loggers::TerminalLogger</span>
276
276
 
277
277
  <li class="method">
278
278
  <a href="Bauxite/Context.html#method-i-add_alias">#add_alias</a>
@@ -329,6 +329,11 @@
329
329
  &mdash;
330
330
  <span class="container">Bauxite::Action</span>
331
331
 
332
+ <li class="method">
333
+ <a href="Bauxite/Loggers/TerminalLogger.html#method-i-debug_prompt">#debug_prompt</a>
334
+ &mdash;
335
+ <span class="container">Bauxite::Loggers::TerminalLogger</span>
336
+
332
337
  <li class="method">
333
338
  <a href="Bauxite/Loggers/NullLogger.html#method-i-debug_prompt">#debug_prompt</a>
334
339
  &mdash;
@@ -340,20 +345,15 @@
340
345
  <span class="container">Bauxite::Loggers::CompositeLogger</span>
341
346
 
342
347
  <li class="method">
343
- <a href="Bauxite/Loggers/TerminalLogger.html#method-i-debug_prompt">#debug_prompt</a>
348
+ <a href="Bauxite/Selector.html#method-i-default">#default</a>
344
349
  &mdash;
345
- <span class="container">Bauxite::Loggers::TerminalLogger</span>
350
+ <span class="container">Bauxite::Selector</span>
346
351
 
347
352
  <li class="method">
348
353
  <a href="Bauxite/Parser.html#method-i-default">#default</a>
349
354
  &mdash;
350
355
  <span class="container">Bauxite::Parser</span>
351
356
 
352
- <li class="method">
353
- <a href="Bauxite/Selector.html#method-i-default">#default</a>
354
- &mdash;
355
- <span class="container">Bauxite::Selector</span>
356
-
357
357
  <li class="method">
358
358
  <a href="Bauxite/Action.html#method-i-echo">#echo</a>
359
359
  &mdash;
@@ -385,14 +385,14 @@
385
385
  <span class="container">Bauxite::Context</span>
386
386
 
387
387
  <li class="method">
388
- <a href="Bauxite/SelectorModule.html#method-i-find">#find</a>
388
+ <a href="Bauxite/Context.html#method-i-find">#find</a>
389
389
  &mdash;
390
- <span class="container">Bauxite::SelectorModule</span>
390
+ <span class="container">Bauxite::Context</span>
391
391
 
392
392
  <li class="method">
393
- <a href="Bauxite/Context.html#method-i-find">#find</a>
393
+ <a href="Bauxite/SelectorModule.html#method-i-find">#find</a>
394
394
  &mdash;
395
- <span class="container">Bauxite::Context</span>
395
+ <span class="container">Bauxite::SelectorModule</span>
396
396
 
397
397
  <li class="method">
398
398
  <a href="Bauxite/Selector.html#method-i-frame">#frame</a>
@@ -419,30 +419,25 @@
419
419
  &mdash;
420
420
  <span class="container">Bauxite::Action</span>
421
421
 
422
- <li class="method">
423
- <a href="Bauxite/Loggers/CompositeLogger.html#method-i-log">#log</a>
424
- &mdash;
425
- <span class="container">Bauxite::Loggers::CompositeLogger</span>
426
-
427
422
  <li class="method">
428
423
  <a href="Bauxite/Loggers/TerminalLogger.html#method-i-log">#log</a>
429
424
  &mdash;
430
425
  <span class="container">Bauxite::Loggers::TerminalLogger</span>
431
426
 
432
427
  <li class="method">
433
- <a href="Bauxite/Loggers/NullLogger.html#method-i-log">#log</a>
428
+ <a href="Bauxite/Loggers/CompositeLogger.html#method-i-log">#log</a>
434
429
  &mdash;
435
- <span class="container">Bauxite::Loggers::NullLogger</span>
430
+ <span class="container">Bauxite::Loggers::CompositeLogger</span>
436
431
 
437
432
  <li class="method">
438
- <a href="Bauxite/Loggers/CompositeLogger.html#method-i-log_cmd">#log_cmd</a>
433
+ <a href="Bauxite/Loggers/NullLogger.html#method-i-log">#log</a>
439
434
  &mdash;
440
- <span class="container">Bauxite::Loggers::CompositeLogger</span>
435
+ <span class="container">Bauxite::Loggers::NullLogger</span>
441
436
 
442
437
  <li class="method">
443
- <a href="Bauxite/Loggers/FileLogger.html#method-i-log_cmd">#log_cmd</a>
438
+ <a href="Bauxite/Loggers/EchoLogger.html#method-i-log_cmd">#log_cmd</a>
444
439
  &mdash;
445
- <span class="container">Bauxite::Loggers::FileLogger</span>
440
+ <span class="container">Bauxite::Loggers::EchoLogger</span>
446
441
 
447
442
  <li class="method">
448
443
  <a href="Bauxite/Loggers/NullLogger.html#method-i-log_cmd">#log_cmd</a>
@@ -450,15 +445,20 @@
450
445
  <span class="container">Bauxite::Loggers::NullLogger</span>
451
446
 
452
447
  <li class="method">
453
- <a href="Bauxite/Loggers/EchoLogger.html#method-i-log_cmd">#log_cmd</a>
448
+ <a href="Bauxite/Loggers/CompositeLogger.html#method-i-log_cmd">#log_cmd</a>
454
449
  &mdash;
455
- <span class="container">Bauxite::Loggers::EchoLogger</span>
450
+ <span class="container">Bauxite::Loggers::CompositeLogger</span>
456
451
 
457
452
  <li class="method">
458
453
  <a href="Bauxite/Loggers/TerminalLogger.html#method-i-log_cmd">#log_cmd</a>
459
454
  &mdash;
460
455
  <span class="container">Bauxite::Loggers::TerminalLogger</span>
461
456
 
457
+ <li class="method">
458
+ <a href="Bauxite/Loggers/FileLogger.html#method-i-log_cmd">#log_cmd</a>
459
+ &mdash;
460
+ <span class="container">Bauxite::Loggers::FileLogger</span>
461
+
462
462
  <li class="method">
463
463
  <a href="Bauxite/Action.html#method-i-open">#open</a>
464
464
  &mdash;
@@ -474,6 +474,11 @@
474
474
  &mdash;
475
475
  <span class="container">Bauxite::ParserModule</span>
476
476
 
477
+ <li class="method">
478
+ <a href="Bauxite/Loggers/NullLogger.html#method-i-progress">#progress</a>
479
+ &mdash;
480
+ <span class="container">Bauxite::Loggers::NullLogger</span>
481
+
477
482
  <li class="method">
478
483
  <a href="Bauxite/Loggers/CompositeLogger.html#method-i-progress">#progress</a>
479
484
  &mdash;
@@ -484,11 +489,6 @@
484
489
  &mdash;
485
490
  <span class="container">Bauxite::Loggers::TerminalLogger</span>
486
491
 
487
- <li class="method">
488
- <a href="Bauxite/Loggers/NullLogger.html#method-i-progress">#progress</a>
489
- &mdash;
490
- <span class="container">Bauxite::Loggers::NullLogger</span>
491
-
492
492
  <li class="method">
493
493
  <a href="Bauxite/Action.html#method-i-replace">#replace</a>
494
494
  &mdash;
@@ -514,6 +514,11 @@
514
514
  &mdash;
515
515
  <span class="container">Bauxite::Action</span>
516
516
 
517
+ <li class="method">
518
+ <a href="Bauxite/Action.html#method-i-select">#select</a>
519
+ &mdash;
520
+ <span class="container">Bauxite::Action</span>
521
+
517
522
  <li class="method">
518
523
  <a href="Bauxite/SelectorModule.html#method-i-selenium_find">#selenium_find</a>
519
524
  &mdash;
@@ -529,6 +534,11 @@
529
534
  &mdash;
530
535
  <span class="container">Bauxite::Action</span>
531
536
 
537
+ <li class="method">
538
+ <a href="Bauxite/Selector.html#method-i-smart">#smart</a>
539
+ &mdash;
540
+ <span class="container">Bauxite::Selector</span>
541
+
532
542
  <li class="method">
533
543
  <a href="Bauxite/Action.html#method-i-source">#source</a>
534
544
  &mdash;
@@ -549,6 +559,11 @@
549
559
  &mdash;
550
560
  <span class="container">Bauxite::Action</span>
551
561
 
562
+ <li class="method">
563
+ <a href="Bauxite/Action.html#method-i-submit">#submit</a>
564
+ &mdash;
565
+ <span class="container">Bauxite::Action</span>
566
+
552
567
  <li class="method">
553
568
  <a href="Bauxite/Action.html#method-i-test">#test</a>
554
569
  &mdash;
@@ -584,7 +599,7 @@
584
599
 
585
600
  <footer id="validator-badges" role="contentinfo">
586
601
  <p><a href="http://validator.w3.org/check/referer">Validate</a>
587
- <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
602
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.
588
603
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
589
604
  </footer>
590
605
 
@@ -0,0 +1,48 @@
1
+ #--
2
+ # Copyright (c) 2014 Patricio Zavolinsky
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in
12
+ # all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ # SOFTWARE.
21
+ #++
22
+
23
+ class Bauxite::Action
24
+ # Sets the value of the selected +HTMLSelect+ to +text+.
25
+ #
26
+ # +text+ can be the +value+ or the +text+ of the target +HTMLOption+.
27
+ #
28
+ # For example:
29
+ # # assuming <select id="s">
30
+ # # <option value="one">First</option>
31
+ # # <option value="two">Second</option>
32
+ # # </select>
33
+ # select s Second
34
+ # select s two
35
+ # # => both actions select the second option.
36
+ #
37
+ # :category: Action Methods
38
+ def select(selector, text)
39
+ @ctx.find(selector) do |e|
40
+ e = Selenium::WebDriver::Support::Select.new(e)
41
+ begin
42
+ e.select_by(:value, text)
43
+ rescue Selenium::WebDriver::Error::NoSuchElementError
44
+ e.select_by(:text, text)
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,37 @@
1
+ #--
2
+ # Copyright (c) 2014 Patricio Zavolinsky
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in
12
+ # all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ # SOFTWARE.
21
+ #++
22
+
23
+ class Bauxite::Action
24
+ # Submits the form that contains the selected element.
25
+ #
26
+ # For example:
27
+ # # assuming <form><input id="i"/></form>
28
+ # submit i
29
+ # # => this would submit the form
30
+ #
31
+ # :category: Action Methods
32
+ def submit(selector)
33
+ @ctx.find(selector) do |e|
34
+ e.submit
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,74 @@
1
+ #--
2
+ # Copyright (c) 2014 Patricio Zavolinsky
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in
12
+ # all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ # SOFTWARE.
21
+ #++
22
+
23
+ class Bauxite::Selector
24
+ # Select an element by applying different Selector strategies.
25
+ #
26
+ # This selector tries to find elements by using the following strategies:
27
+ # 1. default (id suffix)
28
+ # 2. by +name+
29
+ # 3. by +class_name+
30
+ # 4. by +id+ fragment (the +id+ contains the text specified)
31
+ # 5. by +placeholder+ attribute
32
+ # 6. by text content (unless the element is a label)
33
+ # 7. by radio/checkbox button value
34
+ # 8. by referenced element (find a label by its text, then find the element
35
+ # pointed by the label's +for+ attribute)
36
+ # 9. by child element (find a label by its text, then find the first
37
+ # element child control element, including input, select, textarea and
38
+ # button).
39
+ #
40
+ # For example:
41
+ # # assuming <label>By label parent<input type="text" value="By label parent"/></label>
42
+ # assert "smart=By label parent" "By label parent"
43
+ # # => the assertion succeeds.
44
+ #
45
+ # :category: Selector Methods
46
+ def smart(arg, &block)
47
+ b = lambda { |e| e }
48
+ target = _smart_try_find { default(arg, &b) }
49
+ target ||= _smart_try_find { selenium_find(:name, arg) }
50
+ target ||= _smart_try_find { selenium_find(:class_name, arg) }
51
+ target ||= _smart_try_find { attr("id*:"+arg, &b) }
52
+ target ||= _smart_try_find { attr("placeholder:"+arg, &b) }
53
+ quoted_arg = "'"+arg.gsub("'", "\\'")+"'"
54
+ target ||= _smart_try_find { selenium_find(:css, "input[type='checkbox'][value=#{quoted_arg}],input[type='radio'][value=#{quoted_arg}]") }
55
+ return yield target if target
56
+
57
+ target = selenium_find(:xpath, "//*[contains(text(), '#{arg.gsub("'", "\\'")}')]")
58
+ return yield target unless target.tag_name.downcase == 'label'
59
+ label = target
60
+ id = label['for']
61
+ return yield selenium_find(:id, id) if id
62
+
63
+ target = _smart_try_find { label.find_element(:css, "input, select, textarea, button") }
64
+ return yield target if target
65
+ end
66
+
67
+ private
68
+ def _smart_try_find()
69
+ wait = Selenium::WebDriver::Wait.new(:timeout => 0.01)
70
+ wait.until { yield }
71
+ rescue StandardError => e
72
+ nil
73
+ end
74
+ end
data/lib/bauxite.rb CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  #--
24
24
  module Bauxite
25
- VERSION = "0.4.1"
25
+ VERSION = "0.4.2"
26
26
  end
27
27
  #++
28
28
 
@@ -0,0 +1,9 @@
1
+ <html>
2
+ <body>
3
+ <select id="type">
4
+ <option value="def" selected="selected">None</option>
5
+ <option value="car">Auto</option>
6
+ <option value="bike">Bicycle</option>
7
+ </select>
8
+ </body>
9
+ </html>
data/test/select.bxt ADDED
@@ -0,0 +1,9 @@
1
+ open "file://${__DIR__}/select/page.html"
2
+
3
+ assert type def
4
+
5
+ select type Auto
6
+ assert type car
7
+
8
+ select type Bicycle
9
+ assert type bike