Skip to content
celerity's specs as a git submodule
Ruby JavaScript
Find file
Pull request Compare This branch is 528 commits behind watir:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
html
lib
LICENSE
README.markdown
area_spec.rb
areas_spec.rb
browser_spec.rb
button_spec.rb
buttons_spec.rb
checkbox_spec.rb
checkboxes_spec.rb
collections_spec.rb
dd_spec.rb
dds_spec.rb
div_spec.rb
divs_spec.rb
dl_spec.rb
dls_spec.rb
dt_spec.rb
dts_spec.rb
element_spec.rb
em_spec.rb
ems_spec.rb
filefield_spec.rb
filefields_spec.rb
form_spec.rb
forms_spec.rb
frame_spec.rb
frames_spec.rb
hidden_spec.rb
hiddens_spec.rb
hn_spec.rb
hns_spec.rb
image_spec.rb
images_spec.rb
label_spec.rb
labels_spec.rb
li_spec.rb
link_spec.rb
links_spec.rb
lis_spec.rb
map_spec.rb
maps_spec.rb
meta_spec.rb
metas_spec.rb
ol_spec.rb
ols_spec.rb
option_spec.rb
p_spec.rb
pre_spec.rb
pres_spec.rb
ps_spec.rb
radio_spec.rb
radios_spec.rb
select_list_spec.rb
select_lists_spec.rb
span_spec.rb
spans_spec.rb
spec_helper.rb
strong_spec.rb
strongs_spec.rb
table_bodies_spec.rb
table_body_spec.rb
table_cell_spec.rb
table_cells_spec.rb
table_footer_spec.rb
table_footers_spec.rb
table_header_spec.rb
table_headers_spec.rb
table_row_spec.rb
table_rows_spec.rb
table_spec.rb
tables_spec.rb
text_field_spec.rb
text_fields_spec.rb
ul_spec.rb
uls_spec.rb
watir_compatibility_spec.rb
watirspec.rake

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.

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

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

include WatirImpl::Exception

# configure this implementation - this also allows you to hook into the guard system
# see http://github.com/jarib/watirspec/blob/master/lib/implementation.rb

WatirSpec.implementation do |imp|
  imp.name          = :watir_impl
  imp.browser_args  = [:some, :arguments] # will be passed to Browser.new
  imp.browser_class = WatirImpl::Browser
end

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 "spec/watirspec/spec_helper" (which in turn will load your spec/spec_helper.rb).

Where

Something went wrong with that request. Please try again.