public
Description: celerity's specs as a git submodule
Homepage:
Clone URL: git://github.com/jarib/watirspec.git
name age message
file LICENSE Fri Aug 07 10:41:10 -0700 2009 Add BSD license [jarib]
file README.markdown Loading commit data...
file area_spec.rb
file areas_spec.rb
file browser_spec.rb Mon Oct 12 17:41:02 -0700 2009 More guards [jarib]
file button_spec.rb
file buttons_spec.rb
file checkbox_spec.rb Sun Oct 11 08:17:18 -0700 2009 Remove specs for {Radio,CheckBox}#get_state [jarib]
file checkboxes_spec.rb Sun Aug 09 11:28:52 -0700 2009 Some whitespace cleanup [jarib]
file dd_spec.rb
file dds_spec.rb
file div_spec.rb
file divs_spec.rb
file dl_spec.rb
file dls_spec.rb
file dt_spec.rb Mon Oct 12 17:41:02 -0700 2009 More guards [jarib]
file dts_spec.rb Sun Aug 09 11:28:52 -0700 2009 Some whitespace cleanup [jarib]
file element_spec.rb
file em_spec.rb
file ems_spec.rb
file filefield_spec.rb
file filefields_spec.rb Fri Aug 07 11:09:44 -0700 2009 Remove some celerity specs + whitespace cleanup [jarib]
file form_spec.rb
file forms_spec.rb
file frame_spec.rb
file frames_spec.rb
file hidden_spec.rb Sun Aug 09 11:28:52 -0700 2009 Some whitespace cleanup [jarib]
file hiddens_spec.rb
file hn_spec.rb Fri Aug 07 11:09:44 -0700 2009 Remove some celerity specs + whitespace cleanup [jarib]
file hns_spec.rb
directory html/
file image_spec.rb
file images_spec.rb
file label_spec.rb
file labels_spec.rb
file li_spec.rb
directory lib/ Tue Nov 17 12:13:34 -0800 2009 Add ability to set impl name manually using Wat... [jarib]
file link_spec.rb
file links_spec.rb
file lis_spec.rb
file map_spec.rb
file maps_spec.rb
file meta_spec.rb Sun Oct 11 14:56:59 -0700 2009 Add more watir bug guards [jarib]
file metas_spec.rb Fri Aug 07 11:09:44 -0700 2009 Remove some celerity specs + whitespace cleanup [jarib]
file ol_spec.rb
file ols_spec.rb Fri Aug 07 11:09:44 -0700 2009 Remove some celerity specs + whitespace cleanup [jarib]
file option_spec.rb Tue Oct 27 05:16:22 -0700 2009 Fix clear_selection => clear [jarib]
file p_spec.rb
file pre_spec.rb
file pres_spec.rb Fri Aug 07 11:09:44 -0700 2009 Remove some celerity specs + whitespace cleanup [jarib]
file ps_spec.rb
file radio_spec.rb
file radios_spec.rb
file select_list_spec.rb
file select_lists_spec.rb
file span_spec.rb
file spans_spec.rb
file spec_helper.rb
file strong_spec.rb
file strongs_spec.rb
file table_bodies_spec.rb
file table_body_spec.rb
file table_cell_spec.rb
file table_cells_spec.rb Fri Aug 07 11:09:44 -0700 2009 Remove some celerity specs + whitespace cleanup [jarib]
file table_footer_spec.rb
file table_footers_spec.rb
file table_header_spec.rb
file table_headers_spec.rb
file table_row_spec.rb Mon Oct 12 17:41:02 -0700 2009 More guards [jarib]
file table_rows_spec.rb
file table_spec.rb
file tables_spec.rb Fri Aug 07 11:09:44 -0700 2009 Remove some celerity specs + whitespace cleanup [jarib]
file text_field_spec.rb
file text_fields_spec.rb
file ul_spec.rb
file uls_spec.rb
file watir_compatibility_spec.rb
file watirspec.rake Sun Aug 09 13:39:51 -0700 2009 Fix the watirspec:run task description [jarib]
README.markdown

What

This repository is intended to be used as a git submodule for projects that want to implement Watir's API. Since the specs were taken from Celerity, making it usable on other implementations (including Watir itself) is a work in progress. Please contribute!

The specs run a small Sinatra webapp (WatirSpec::Server) to simulate interacting with a web server. However, most specs use the file:// scheme to avoid hitting the server.

How to use

First add the submodule to spec/watirspec:

$ git submodule add git://github.com/jarib/watirspec.git spec/watirspec

The specs will look for a spec_helper.rb in its parent directory (i.e. spec/). In this file you can load your library and set various options. The spec suite expects a Browser constant to exist at the top level after this file has been loaded.

Here's an example of what spec/spec_helper.rb could look like:

$LOAD_PATH.unshift(«lib folder»)
require "watir_impl"

Browser = WatirImpl::Browser
include WatirImpl::Exception

WatirSpec.browser_args       = [:some, :arguments] # will be passed to Browser.new
WatirSpec.persistent_browser = false               # defaults to true, but can be disabled if needed
WatirSpec::Server.autorun    = false               # defaults to true, but can be disabled if needed

WatirSpec::Server.get("/my_route") { "content" }   # add routes to the server for implementation-specific specs

Implementation-specific specs should be placed at the root of the spec/ folder. To use the setup code from watirspec, simply require "watirspec/spec_helper" (which in turn will load your spec/spec_helper.rb).

Where